/* Wildpics modern presentation. Classic is self-contained in classic.php. */
:root {
    color-scheme: light;
    --paper: #f4f3ed;
    --surface: #fdfcf8;
    --ink: #193e35;
    --muted: #67736a;
    --line: #dce1d7;
    --accent: #b3c591;
    --serif: Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(.2,.75,.25,1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
button:focus-visible, a:focus-visible, label:has(input:focus-visible), .filter-tree-row:has(input:focus-visible) { outline: 3px solid #568575; outline-offset: 4px; }
button { transition: background .18s, border-color .18s, box-shadow .18s, transform .22s var(--ease); }
svg { width: 22px; height: 22px; stroke-width: 1.6; flex-shrink: 0; }
.header { padding: 21px max(28px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; gap: 32px; background: var(--ink); color: #f4f3e7; }
.wordmark { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 43px; height: 43px; color: #b9ca9e; }
.brand-name { display: block; font: 34px/.95 var(--serif); letter-spacing: -1.5px; }
.brand-dot { color: var(--accent); }
.brand-by { display: block; margin-top: 7px; font-size: 8px; letter-spacing: 2.8px; font-weight: 650; }
.header-tagline { font: italic 15px var(--serif); color: #bccbbf; margin-left: auto; }
.header-actions { display: flex; gap: 8px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #527066; border-radius: 50%; background: transparent; color: #eeeede; }
.help-button { font: 21px var(--serif); }
.sound-slash, [aria-pressed="true"] .sound-waves { display: none; }
[aria-pressed="true"] .sound-slash { display: block; }
.play-shell { width: min(1120px, calc(100% - 64px)); margin: 0 auto; }
.session-bar { display: flex; justify-content: space-between; gap: 24px; padding: 29px 0 26px; align-items: center; border-bottom: 1px solid var(--line); }
.eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: 2px; line-height: 1.5; }
.filter-summary { min-width: 0; }
.filter-summary > .eyebrow { color: var(--muted); font-size: 9px; letter-spacing: 1.7px; }
.filter-summary-pill { display: flex; text-align: left; gap: 16px; align-items: center; min-height: 33px; margin: 3px 0; padding: 0; background: none; border: none; color: var(--ink); font-size: 16px; font-weight: 650; }
.filter-divider { color: #9ba795; padding: 0 6px; font-weight: 400; }
.filter-count { color: var(--muted); font-size: 11px; }
.session-tools { display: flex; align-items: center; gap: 28px; flex-shrink: 0; }
.scoreboard { display: flex; gap: 25px; }
.stat { display: flex; flex-direction: column; gap: 5px; min-width: 76px; }
.stat + .stat { padding-left: 25px; border-left: 1px solid var(--line); }
.stat-label { font-size: 9px; letter-spacing: 1.7px; color: var(--muted); font-weight: 700; }
.stat-value { display: flex; align-items: center; gap: 4px; font-size: 25px; line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-denominator { font-size: 15px; color: var(--muted); white-space: nowrap; }
.stat-value svg { width: 17px; color: #7e896d; }
.has-streak .stat-value svg { color: #9a7833; fill: #ead7a5; }
.settings-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; background: transparent; color: var(--ink); border: 1px solid #bac6b8; border-radius: 8px; font-size: 12px; font-weight: 650; }
.game { padding: 32px 0 26px; }
.identify-mode { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 52px; }
.round-heading { min-width: 0; animation: settle-in .48s var(--ease) both; }
.round-heading .eyebrow { color: #6c7e5b; }
.prompt { font: 46px/1.06 var(--serif); letter-spacing: -1.7px; margin: 14px 0 13px; overflow-wrap: break-word; }
.prompt:focus { outline: none; }
.round-heading p { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0; }
.identify-mode .round-heading { grid-column: 2; grid-row: 1; padding: 9px 0 25px; }
.hero-photo { position: relative; grid-column: 1; grid-row: 1 / 3; min-width: 0; height: 100%; min-height: 450px; max-height: 590px; background: #18251f; border-radius: 14px; overflow: hidden; box-shadow: 0 12px 28px -20px #193e3566; animation: settle-in .55s var(--ease) both; }
.hero-photo img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; display: block; }
.photo-tag { position: absolute; top: 18px; left: 18px; padding: 7px 9px; border-radius: 4px; color: white; background: #13231e99; font-size: 8px; letter-spacing: 1.7px; }
.answer-panel { grid-column: 2; grid-row: 2; min-width: 0; align-self: end; }
.choice-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; letter-spacing: 1.4px; margin-bottom: 12px; }
.keyboard-hint { font-size: 10px; letter-spacing: 0; font-weight: 400; }
.name-grid { display: grid; gap: 10px; }
.name-choice { display: flex; align-items: center; gap: 14px; position: relative; width: 100%; min-height: 63px; padding: 13px 18px 13px 13px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font-size: 15px; line-height: 1.3; font-weight: 550; animation: settle-in .4s var(--ease) both; }
.choice-number { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 29px; height: 29px; border-radius: 7px; background: #edf0e7; color: #637258; font-size: 11px; font-weight: 500; transition: color .2s, background .2s; }
.name-choice:nth-child(2), .photo-choice:nth-child(2) { animation-delay: 45ms; }
.name-choice:nth-child(3), .photo-choice:nth-child(3) { animation-delay: 90ms; }
.name-choice:nth-child(4), .photo-choice:nth-child(4) { animation-delay: 135ms; }
.find-mode .round-heading { text-align: center; max-width: 900px; margin: 0 auto 24px; }
.find-mode .prompt { font-size: 35px; line-height: 1.18; margin: 10px 0; }
.prompt-prefix { font-weight: 400; }
.prompt-bird { font-weight: 400; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: min(850px, 100%); margin: 0 auto; }
.photo-choice { position: relative; aspect-ratio: 1.58; padding: 0; border: none; border-radius: 12px; overflow: hidden; background: #18251f; isolation: isolate; animation: settle-in .5s var(--ease) both; }
/* Identification needs the entire photograph, including on narrow or wide tiles. */
.photo-choice img { width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity .35s; }
.game img { opacity: 0; transition: opacity .4s; }
.game img.is-loaded { opacity: 1; }
.photo-choice .choice-number { position: absolute; top: 12px; left: 12px; z-index: 2; color: white; background: #142f27b3; backdrop-filter: blur(8px); border: 1px solid #ffffff4d; }
.photo-credit { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; background: linear-gradient(transparent, #000b); color: #fff; font-size: 10px; line-height: 1.3; pointer-events: none; overflow-wrap: anywhere; text-align: left; }
.hero-photo .photo-credit { padding: 35px 18px 15px; }
.photo-choice .choice-bird-name { position: absolute; left: 10px; right: 10px; top: 50%; transform: translateY(-50%); z-index: 3; padding: 9px 12px; border-radius: 6px; color: white; background: #502c23e6; font-size: 13px; line-height: 1.3; }
.disabled { cursor: default; }
.name-choice.correct { background: #e5eddf; border-color: #547854; box-shadow: inset 0 0 0 1px #547854; }
.name-choice.wrong { background: #f3e6df; border-color: #a36750; }
.name-choice.correct .choice-number { color: white; background: #3b684e; font-size: 0; }
.name-choice.correct .choice-number::after { content: '✓'; font-size: 16px; }
.name-choice.wrong .choice-number { color: white; background: #a36750; font-size: 0; }
.name-choice.wrong .choice-number::after { content: '×'; font-size: 19px; }
.photo-choice.correct::after, .photo-choice.wrong::after { content: ''; position: absolute; inset: 0; border: 4px solid #9fca88; border-radius: inherit; pointer-events: none; z-index: 4; animation: feedback-in .22s var(--ease); }
.photo-choice.wrong::after { border-color: #d69c81; }
.photo-choice.correct .choice-number { background: #315f40; font-size: 0; }
.photo-choice.correct .choice-number::after { content: '✓'; font-size: 18px; }
.photo-choice.wrong .choice-number { background: #8b513b; font-size: 0; }
.photo-choice.wrong .choice-number::after { content: '×'; font-size: 20px; }
.image-unavailable::before { content: 'Photo unavailable · try another region'; position: absolute; inset: 40% 15px auto; color: white; font-size: 12px; text-align: center; z-index: 1; }
.round-status { display: flex; align-items: center; gap: 9px; position: relative; min-height: 54px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 4px; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #9bab84; flex-shrink: 0; }
.message { font-size: 12px; line-height: 1.5; }
.next-round { margin-left: auto; white-space: nowrap; font-size: 10px; opacity: 0; }
.next-round span { margin-left: 12px; font-size: 16px; }
.answered .next-round { opacity: 1; }
.answered::after { content: ''; position: absolute; bottom: -1px; left: 0; height: 2px; width: 100%; background: currentColor; transform-origin: left; animation: round-progress var(--round-delay) linear both; }
.is-correct { color: #37613e; }
.is-wrong { color: #99573e; }
.is-wrong .status-dot { background: #b07857; }
.game-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 max(25px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 10px; }
.game-footer > span { font: italic 13px var(--serif); }
.game-footer > div { display: flex; gap: 16px; align-items: center; }
.game-footer a, .reset-button { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0; font-size: 10px; text-decoration: none; border: none; background: none; color: inherit; }
.footer-divider { color: #acb5a6; }
.modal-open { overflow: hidden; }
.settings-panel, .welcome-panel { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; padding: 24px; background: #13281fc2; backdrop-filter: blur(7px); }
.settings-panel.open, .welcome-panel.open { display: flex; animation: feedback-in .2s both; }
.settings-card, .welcome-card { width: min(620px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 32px; border: 1px solid #ffffff66; border-radius: 20px; background: var(--surface); box-shadow: 0 24px 100px #071e1c40; animation: settle-in .3s var(--ease) both; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.settings-head h2 { margin: 5px 0 0; font: 32px var(--serif); letter-spacing: -1px; }
.settings-head .eyebrow, .welcome-card > .eyebrow { color: #6c7e5b; }
.settings-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; font-size: 25px; }
.settings-section { margin: 22px 0; }
.settings-section h3 { margin: 0 0 12px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.filter-tree, .filter-tree-node { display: grid; gap: 6px; }
.filter-tree-node.level-1, .filter-tree-node.level-2 { margin-left: 16px; }
.filter-tree-row { display: grid; grid-template-columns: 44px 1fr; background: #f2f3ec; border: 1px solid var(--line); border-radius: 8px; }
.filter-tree-toggle { width: 44px; min-height: 44px; border: none; background: transparent; color: var(--ink); font-size: 16px; }
.filter-tree-toggle:disabled { color: #9da594; cursor: default; }
.filter-tree-row label { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px 8px 0; cursor: pointer; font-size: 13px; }
.filter-tree-row input, .filter-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filter-tree-row:has(input:checked) { border-color: #507556; background: #e3ebdb; }
.filter-tree-row:has(input:checked) label::after { content: '✓'; margin-left: auto; color: #42633d; }
.filter-tree-children { display: none; gap: 6px; }
.filter-tree-node.is-open > .filter-tree-children { display: grid; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; cursor: pointer; }
.filter-chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: white; }
.option-list { display: grid; gap: 8px; }
.option-list label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; }
input { accent-color: var(--ink); }
.settings-note { margin: 10px 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.settings-apply, .welcome-start { display: flex; align-items: center; justify-content: center; gap: 30px; min-height: 49px; border: none; border-radius: 8px; padding: 14px 22px; background: var(--ink); color: white; font-size: 13px; font-weight: 600; }
.settings-apply { width: 100%; }
.welcome-card h2 { font: 48px/1.03 var(--serif); letter-spacing: -2px; margin: 14px 0 16px; }
.welcome-card p, .welcome-card li { font-size: 13px; line-height: 1.65; color: var(--muted); }
.welcome-card .welcome-lead { font-size: 15px; }
.welcome-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.welcome-modes span { font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.welcome-modes p { margin: 9px 0 0; }
.welcome-card ul { padding-left: 18px; }
.welcome-card .welcome-credit-note { font-size: 11px; }
.welcome-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }
.welcome-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 11px; color: var(--muted); }
.welcome-check input { width: 17px; height: 17px; }
.empty-game { max-width: 580px; margin: 45px auto; text-align: center; }
.empty-game .settings-apply { width: auto; margin: 24px auto; }
@keyframes settle-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes feedback-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes round-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (hover: hover) {
    .name-choice:not(.disabled):hover { border-color: #849b79; background: #f0f3e9; transform: translateX(3px); box-shadow: 0 3px 12px #193e3509; }
    .photo-choice:not(.disabled):hover { box-shadow: 0 0 0 3px #a2b28f; }
    .icon-button:hover { background: #ffffff12; border-color: #a7b7a3; }
    .settings-button:hover, .settings-close:hover { background: #e8eddf; }
    .game-footer a:hover, .reset-button:hover, .filter-summary-pill:hover { color: #385d26; text-decoration: underline; text-underline-offset: 4px; }
    .settings-apply:hover, .welcome-start:hover { background: #2b5748; }
}
@media (max-width: 1000px) {
    .identify-mode { column-gap: 28px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .prompt { font-size: 40px; }
    .hero-photo { min-height: 440px; }
    .session-tools { gap: 18px; }
    .scoreboard { gap: 16px; }
    .stat + .stat { padding-left: 16px; }
}
@media (max-width: 700px) {
    .header { padding: 16px 20px; gap: 12px; }
    .brand-name { font-size: 30px; }
    .brand-mark { width: 35px; height: 35px; }
    .brand-by { font-size: 7px; letter-spacing: 2.5px; }
    .header-tagline { display: none; }
    .header-actions { margin-left: auto; gap: 6px; }
    .play-shell { width: calc(100% - 32px); }
    .session-bar { padding: 17px 0; gap: 12px; align-items: flex-start; }
    .filter-summary > .eyebrow { font-size: 8px; letter-spacing: 1px; }
    .filter-summary-pill { font-size: 12px; line-height: 1.4; gap: 8px; min-height: 35px; margin: 0; }
    .filter-divider { padding: 0 2px; }
    .filter-count { font-size: 9px; line-height: 1.4; display: block; }
    .session-tools { gap: 0; }
    .scoreboard { gap: 12px; padding-top: 2px; }
    .stat { min-width: 47px; gap: 8px; }
    .stat + .stat { padding-left: 12px; }
    .stat-label { font-size: 8px; letter-spacing: 1px; }
    .stat-value { font-size: 21px; gap: 2px; }
    .stat-denominator { font-size: 11px; }
    .stat-value svg { width: 13px; }
    .settings-button { display: none; }
    .game { padding: 22px 0 19px; }
    .identify-mode { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 0; }
    .identify-mode .round-heading { grid-column: 1; grid-row: 1; padding: 0 0 17px; text-align: center; }
    .round-heading .eyebrow { font-size: 9px; letter-spacing: 1.6px; }
    .prompt { font-size: 33px; letter-spacing: -1.2px; margin: 8px 0; }
    .prompt br { display: none; }
    .prompt br::after { content: ' '; }
    .round-heading p { font-size: 11px; }
    .hero-photo { grid-column: 1; grid-row: 2; min-height: 0; height: auto; aspect-ratio: 1.3; max-height: 42svh; border-radius: 11px; }
    .photo-tag { top: 12px; left: 12px; font-size: 6px; letter-spacing: 1px; }
    .hero-photo .photo-credit { padding: 22px 12px 10px; font-size: 9px; }
    .answer-panel { grid-column: 1; grid-row: 3; margin-top: 15px; }
    .choice-heading { font-size: 8px; margin-bottom: 9px; }
    .keyboard-hint { display: none; }
    .name-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .name-choice { min-height: 64px; padding: 10px; gap: 8px; font-size: 12px; border-radius: 8px; }
    .choice-number { width: 23px; height: 25px; font-size: 10px; border-radius: 5px; }
    .find-mode .round-heading { margin-bottom: 18px; }
    .find-mode .prompt { font-size: 29px; }
    .photo-grid { gap: 10px; max-width: 480px; }
    .photo-choice { aspect-ratio: 1; border-radius: 9px; }
    .photo-choice .choice-number { top: 9px; left: 9px; }
    .photo-credit { font-size: 8px; padding: 22px 9px 8px; }
    .photo-choice .choice-bird-name { font-size: 11px; padding: 8px; }
    .round-status { min-height: 51px; padding: 12px 0; gap: 7px; }
    .message { font-size: 10px; }
    .next-round { font-size: 9px; }
    .next-round span { margin-left: 3px; }
    .game-footer { padding-top: 19px; gap: 10px; }
    .game-footer > span { font-size: 11px; }
    .game-footer > div { gap: 10px; }
    .game-footer a, .reset-button { font-size: 9px; }
    .settings-panel, .welcome-panel { align-items: flex-end; padding: 0; }
    .settings-card, .welcome-card { max-height: calc(100dvh - 32px); width: 100%; border-radius: 20px 20px 0 0; padding: 25px 22px calc(25px + env(safe-area-inset-bottom)); }
    .welcome-card h2 { font-size: 42px; }
    .welcome-modes { gap: 12px; }
    .welcome-actions { flex-wrap: wrap; }
    .welcome-start { flex: 1; }
    .filter-tree-node.level-1, .filter-tree-node.level-2 { margin-left: 10px; }
}
@media (max-width: 370px) {
    .header { padding-inline: 16px; }
    .play-shell { width: calc(100% - 24px); }
    .scoreboard { gap: 7px; }
    .stat + .stat { padding-left: 7px; }
    .filter-summary-pill { font-size: 11px; }
    .name-choice { padding: 9px 7px; font-size: 11px; gap: 6px; }
    .game-footer > span { max-width: 100px; }
}
@media (min-width: 701px) and (max-height: 650px) and (orientation: landscape) {
    .header { padding-block: 10px; }
    .session-bar { padding-block: 14px; }
    .game { padding-block: 20px; }
    .hero-photo { min-height: 360px; }
    .identify-mode .round-heading { padding-top: 0; padding-bottom: 14px; }
    .prompt { font-size: 32px; }
    .name-choice { min-height: 48px; }
    .photo-grid { max-width: 630px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .game img { opacity: 1; }
    .answered::after { transform: none; }
}
