:root { color-scheme: light; --surface-hover: #eeeae2; --status-success: var(--success); --status-error: var(--error); --status-muted: var(--muted); --bg: #f7f5ef; --ink: #263b35; --muted: #65726a; --card: #fffefb; --border: #dce1d5; --shadow: #e5e7dc; --current: #eff4e9; --accent: #496d43; --heart: #cc584c; --empty: #d8dcd4; --error: #a73731; --success: #386e37; font-family: 'Inter', sans-serif; color: var(--ink); background: var(--bg); font-synthesis: none; }
:root[data-theme="dark"] { color-scheme: dark; --surface-hover: #303933; --bg: #17211d; --ink: #edf3e9; --muted: #b3bfb4; --card: #24322b; --border: #455648; --shadow: #0f1813; --current: #30402c; --accent: #a5c18f; --heart: #ff8a7d; --empty: #47524a; --error: #ff928a; --success: #9bd18c; }
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.game-shell { width: 100%; padding: 20px 18px; }
.header { display: flex; align-items: center; gap: 32px; min-height: 46px; }
h1, h2, h3, .brand { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; }
.brand { color: inherit; text-decoration: none; font-size: 27px; font-weight: 800; letter-spacing: -1px; white-space: nowrap; }
.brand span { font-size: 11px; font-weight: 500; letter-spacing: 0; margin-left: 8px; color: var(--muted); }
.header > .mode-nav { margin-left: auto; display: none; }
.settings-toggle { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--card); color: var(--ink); }
.menu-toggle, .close-menu { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink); }
.menu-toggle { display: grid; }
.material-symbols-outlined { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: 'liga'; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.settings-toggle .material-symbols-outlined { font-size: 24px; }
.settings-panel { width: 320px; max-width: calc(100vw - 24px); padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--ink); overflow: visible; }

.settings-panel h2 { margin: 0; font-size: 22px; }
.theme-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0; cursor: pointer; }
.theme-setting > span { display: flex; align-items: center; gap: 8px; }
.settings-switch { appearance: none; width: 44px; height: 26px; margin: 0; border: 1px solid var(--muted); border-radius: 20px; background: var(--empty); cursor: pointer; flex-shrink: 0; }
.settings-switch::before { content: ''; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--ink); transition: transform 180ms ease; }
.settings-switch:checked { background: var(--accent); border-color: var(--accent); }
.settings-switch:checked::before { transform: translateX(18px); background: var(--bg); }
.nerd-setting { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 24px 0; cursor: pointer; }
.preference-copy { display: flex; flex-direction: column; gap: 6px; }
.preference-title { display: flex; align-items: center; gap: 8px; }
.nerd-icon { width: 24px; flex-shrink: 0; font-size: 22px; line-height: 1; text-align: center; }
.preference-description { font-size: 13px; line-height: 1.5; color: var(--muted); }
.language-label { display: block; margin-bottom: 10px; }
.language-select { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); }
.language-select summary, .language-options a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; cursor: pointer; }
.language-select summary { list-style: none; }
.language-select summary::-webkit-details-marker { display: none; }
.language-select summary .material-symbols-outlined { margin-left: auto; }
.language-options { position: absolute; top: calc(100% + 6px); left: -1px; right: -1px; z-index: 2; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 8px 24px #0003; }
.language-select[open] summary .material-symbols-outlined { transform: rotate(180deg); }
.language-options a { color: inherit; text-decoration: none; }
.language-options a:hover, .language-options a[aria-current] { background: var(--current); }
.language-select img { border-radius: 2px; flex-shrink: 0; }
.intro { text-align: center; margin: 24px 0; }
.info-page { max-width: 720px; margin: 48px auto; padding: 0 16px; line-height: 1.75; }
.info-page h1 { margin-bottom: 24px; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 18px; color: var(--muted); font-size: 13px; }
.footer-support { flex-shrink: 0; margin: 0; }
.support-button { display: inline-flex; align-items: center; justify-content: center; width: 150px; max-width: 100%; min-height: 42px; padding: 8px 10px; gap: 9px; background: #ffdd00; color: #181818; border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 700; }
.support-button img { display: block; width: 100%; max-width: 150px; height: auto; }
.support-button:has(img:not([hidden])) { padding: 0; background: transparent; }
.result-support { margin: 18px 0 0; text-align: center; }
.support-button:hover { filter: brightness(.95); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.site-footer a { color: inherit; min-height: 36px; display: inline-flex; align-items: center; }
.lives-hud { padding: 4px 0; margin: 14px 0 18px; }
.state-block { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.intro { margin-top: 40px; }
.lives { display: flex; justify-content: center; gap: 10px; color: var(--heart); line-height: 1; margin: 0; }
.lives .heart { font-size: 36px; font-variation-settings: 'FILL' 1; }
.lives .empty { color: var(--empty); font-variation-settings: 'FILL' 1; }
.lives .life-lost { animation: life-shake 650ms ease-in-out; }
@keyframes life-shake { 0%, 100% { transform: translateX(0); } 15%, 45%, 75% { transform: translateX(-5px) rotate(-8deg); color: var(--heart); } 30%, 60%, 90% { transform: translateX(5px) rotate(8deg); color: var(--heart); } }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -1px; margin: 10px 0; }
.intro p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.intro p { max-width: 520px; margin: 12px auto; }
.intro .daily-date { font-size: 12px; margin-top: 8px; }
#current-card { display: flex; justify-content: center; }
.animal-card.current .card-verdict { left: 8px; right: auto; }
.animal-card { position: relative; flex: 0 0 136px; width: 136px; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 15px; border: 1px solid var(--border); background: #34443a; text-align: center; box-shadow: 0 4px 0 var(--shadow), 0 7px 16px #00000010; }
.media-block, .card-media { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.card-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; user-select: none; }
.photo-placeholder { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; padding-bottom: 62px; color: #dce5db; font-size: 12px; background: linear-gradient(145deg, #53634c, #25372d); }
.photo-placeholder .material-symbols-outlined { font-size: 32px; opacity: .7; }
.card-overlay { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 36px 10px 12px; color: #fff; background: linear-gradient(transparent, #07130fe6 42%, #07130ff5); text-shadow: 0 1px 3px #0008; }
.animal-card h3 { font-size: 15px; line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
.scientific-name { margin: 0; font-size: 12px; line-height: 1.4; font-style: italic; color: #dae3d9; overflow-wrap: anywhere; }
.animal-card:not(.current) .scientific-name { display: none; font-size: 12px; margin-bottom: 6px; }
:root[data-show-scientific-names-in-compact-cards="true"] .animal-card:not(.current) .scientific-name { display: block; }
.weight { margin: 0; padding-top: 7px; border-top: 1px solid #ffffff40; font-size: 13px; font-weight: 400; display: flex; align-items: center; justify-content: center; gap: 5px; }
.animal-card.current { width: 200px; flex-basis: 200px; border: 2px solid var(--accent); touch-action: none; user-select: none; cursor: grab; box-shadow: 0 0 0 3px var(--current), 0 8px 22px #0002; }
.current h3 { font-size: 19px; }
.current .card-overlay { padding: 44px 12px 16px; }
.weight .material-symbols-outlined { font-size: 14px; }
.current.dealing { animation: deal-in 1100ms cubic-bezier(.22, .7, .25, 1); transform-origin: 50% 65%; }
@keyframes deal-in {
  0% { transform: perspective(1100px) translateY(50px) rotateY(-84deg) rotateZ(-17deg) scale(.85); }
  55% { transform: perspective(1100px) translateY(-8px) rotateY(26deg) rotateZ(4deg) scale(1.035); }
  80% { transform: perspective(1100px) rotateY(-8deg) rotateZ(-1deg); }
  100% { transform: none; }
}
.animal-card.correct::after { content: ''; position: absolute; inset: 0; z-index: 4; border: 4px solid var(--success); border-radius: inherit; pointer-events: none; animation: success-fade 2s linear both; animation-delay: var(--verdict-delay, 0ms); }
.correct .card-verdict { width: 34px; height: 34px; font-size: 24px; animation: success-fade 2s linear both; animation-delay: var(--verdict-delay, 0ms); }
@keyframes success-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.animal-card.incorrect { border-color: var(--error); }
.card-verdict { z-index: 5; position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: var(--bg); font-size: 20px; font-weight: 900; }
.incorrect .card-verdict { background: var(--error); }
.drag-source { opacity: .35; }
.drag-ghost { position: fixed; z-index: 20; pointer-events: none; opacity: .92; transform: rotate(-3deg); box-shadow: 0 14px 36px #0004; cursor: grabbing; }
.timeline-section { position: relative; margin-top: 34px; padding-top: 20px; }
.timeline-section::before { content: ''; position: absolute; left: 0; right: 0; top: calc(50% + 10px); height: 1px; background: color-mix(in srgb, var(--muted) 22%, transparent); pointer-events: none; }
.line-heading { position: absolute; top: calc(50% - 14px); left: 0; right: 0; display: flex; justify-content: space-between; font-size: 12px; font-weight: 400; color: color-mix(in srgb, var(--muted) 75%, var(--bg)); pointer-events: none; }
.line-heading > span { white-space: nowrap; }
.line-heading span[aria-hidden] { color: var(--accent); font-size: 20px; vertical-align: -4px; }
.timeline { position: relative; display: flex; align-items: center; gap: 22px; overflow-x: auto; padding: 12px 18px 20px; min-height: 190px; scrollbar-color: var(--accent) var(--border); scrollbar-width: thin; }
.timeline.is-swiping, .timeline.final-line.is-swiping { cursor: grabbing; user-select: none; scroll-behavior: auto; }
.timeline.is-swiping .animal-card { cursor: grabbing; }
/* Auto margins center short lines and collapse to zero when they overflow. */
.timeline:not(.is-previewing):not(.final-line) > .animal-card:first-of-type { margin-left: auto; }
.timeline:not(.is-previewing):not(.final-line) > .animal-card:last-of-type { margin-right: auto; }
.timeline.is-previewing > :first-child { margin-left: auto; }
.timeline.is-previewing > :last-child { margin-right: auto; }
.drop-slot { flex: 0 0 96px; align-self: stretch; pointer-events: none; }
.finished .timeline-section { margin-top: 36px; }
.finished .line-heading { display: none; }
.finished .timeline-section::before { display: none; }
.timeline.final-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; overflow: visible; padding: 12px 8px 20px; min-height: 0; max-width: 600px; margin: 0 auto; }
.final-line .animal-card { width: 100%; min-width: 0; margin: 0; }
.final-line .card-overlay { padding: 30px 6px 9px; }
.final-line h3 { font-size: 14px; }
.final-line .weight { font-size: 12px; }
.final-line .animal-card .scientific-name { font-size: 11px; }
#result-title:focus { outline: none; }
#result-lives .lives { margin: 8px 0 0; gap: 6px; }
#result-lives .heart { font-size: 24px; }
#result-placed .attempt-history { margin: 0; }
:focus-visible { outline: 3px solid #bd8b3b; outline-offset: 4px; }
.primary { display: block; width: 100%; min-height: 50px; padding: 12px 24px; border: 0; border-radius: 12px; background: var(--accent); color: var(--bg); font-weight: 750; }
.primary:hover { filter: brightness(.92); }
.result { --result-border: var(--accent); --result-surface: var(--current); max-width: 440px; text-align: center; }
dialog.result { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.result-panel { position: relative; padding: 28px 22px; border: 3px solid var(--result-border); border-radius: 18px; background: var(--result-surface); max-height: calc(100dvh - 80px); overflow: auto; }
.result .result-countdown-tab { width: fit-content; max-width: calc(100% - 40px); margin: -3px auto 0; padding: 8px 16px; border-radius: 0 0 12px 12px; background: var(--result-border); color: var(--bg); font-size: 13px; line-height: 1.4; font-weight: 600; }

.dialog-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.view-result { display: block; margin: 20px auto; }
body:has(dialog[open]) { overflow: hidden; }
.mode-nav { display: flex; align-items: center; gap: 24px; }
.mode-nav a { display: flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.mode-nav a:hover { color: var(--ink); }
.mode-nav [aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.navigation-drawer { width: min(300px, calc(100% - 48px)); height: 100dvh; max-height: none; margin: 0; padding: 24px; border: 0; border-right: 1px solid var(--border); background: var(--bg); color: var(--ink); }
.navigation-drawer[open] { animation: drawer-in 240ms cubic-bezier(.22, 1, .36, 1); }

.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.drawer-header h2 { margin: 0; font-size: 24px; }
.navigation-drawer .mode-nav { flex-direction: column; align-items: stretch; gap: 12px; }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.archive-view { max-width: 600px; margin: 40px auto; padding: 0 8px; }
.archive-view > p { color: var(--muted); line-height: 1.5; }
#archive-title:focus { outline: none; }
.archive-month { margin: 28px 0; }
.archive-month h2 { font-size: 19px; margin: 0 0 12px; }
.archive-month h2::first-letter { text-transform: uppercase; }
.archive-row { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; min-height: 64px; margin: 6px 0; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 10px; transition: background 160ms ease; }
.archive-row.has-replay { position: relative; }
.archive-row.has-replay .archive-row-open { padding-right: 64px; }
.archive-row-open { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 22px; min-width: 0; min-height: 68px; padding: 14px 18px; text-align: left; background: transparent; color: inherit; border: 0; border-radius: inherit; }
.archive-row-scores { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.archive-best { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.archive-score-lives { display: inline-flex; align-items: center; gap: 2px; }
.archive-replay { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; padding: 0; background: var(--card); color: var(--ink); border: 1px solid var(--border); border-radius: 50%; transition: background 160ms ease, border-color 160ms ease; }
.archive-replay::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; }
.archive-row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.archive-row-date { font-weight: 650; white-space: nowrap; }
.archive-row-date small { display: block; font-size: 10px; color: var(--status-muted); margin-top: 4px; }
.archive-row-mode, .archive-row-status { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.archive-row-mode { color: var(--muted); font-size: 13px; }
.archive-row .material-symbols-outlined { font-size: 19px; }
.archive-row .archive-best .material-symbols-outlined, .archive-row .archive-score-lives .material-symbols-outlined { font-size: 14px; width: 14px; height: 14px; line-height: 14px; }
.archive-row .archive-score-lives .material-symbols-outlined { font-size: 11px; width: 11px; height: 11px; line-height: 11px; }
.archive-row .archive-best .material-symbols-outlined { color: var(--border); }
.archive-row-status { font-size: 13px; font-weight: 600; }
.archive-row.completed .archive-row-status { color: var(--status-success); }
.archive-row.failed .archive-row-status { color: var(--status-error); }
.archive-row.locked { color: var(--status-muted); background: var(--bg); }
.archive-row.locked .archive-row-mode { opacity: .8; }
.archive-row.today { border: 2px solid var(--accent); }
.archive-affordance { color: var(--status-muted); font-size: 24px; margin-left: 4px; }
@media (hover: hover) {
  .archive-row-open:hover { background: var(--bg); }
  .archive-replay:hover { background: var(--surface-hover); border-color: var(--muted); }
}
@media (max-width: 480px) { .archive-row-open { gap: 16px; padding: 12px; } .archive-row-mode { font-size: 12px; gap: 4px; } .archive-row-status { font-size: 12px; gap: 3px; } .archive-affordance { margin-left: 0; } }
@media (max-width: 380px) {
  .archive-row-open { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; }
  .archive-row-date { grid-column: 1; grid-row: 1; }
  .archive-row-mode { grid-column: 1; grid-row: 2; }
  .archive-row-scores { grid-column: 2; grid-row: 1 / span 2; }
}
.access-dialog { width: min(360px, calc(100% - 24px)); border: 1px solid var(--border); border-radius: 18px; padding: 24px; background: var(--card); color: var(--ink); }
.access-dialog h2 { font-size: 22px; margin-top: 0; }
.access-dialog p { color: var(--muted); line-height: 1.5; }
.result-attempt-label { color: var(--accent); font-weight: 650; }
.archive-cta { display: block; width: 100%; margin-top: 12px; }
.result-icon { font-size: 34px; margin: 0 0 8px; color: var(--accent); }
.result[data-outcome="lost"] { --result-border: var(--error); --result-surface: color-mix(in srgb, var(--error) 12%, var(--card)); }
.result[data-outcome="lost"] h2, .result[data-outcome="lost"] .result-icon { color: var(--error); }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.result h2 { font-size: 26px; margin: 0; }
.result-panel > p:not(.result-icon) { font-size: 14px; line-height: 1.5; }
.muted, .tomorrow { color: var(--muted); }
.daily-countdown { margin: 12px 0; text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
#share-result { display: flex; align-items: center; justify-content: center; gap: 8px; }
#share-result:disabled { opacity: .6; cursor: wait; }
.share-options { position: fixed; inset: auto; margin: 0; width: min(290px, calc(100vw - 24px)); padding: 42px 8px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 10px 32px #0004; }
.share-options > button:not(.close-share-options) { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; text-align: left; border: 0; border-radius: 8px; background: transparent; color: inherit; }
.share-options > button > .material-symbols-outlined { font-size: 21px; flex-shrink: 0; }
.share-options > button:not(.close-share-options):hover { background: var(--current); }
.share-options .close-share-options { position: absolute; top: 4px; right: 6px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.share-options button:disabled { opacity: .6; cursor: wait; }
#share-feedback:empty { display: none; }
#share-text { display: block; width: 100%; min-height: 180px; padding: 12px; font: inherit; font-size: 13px; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 10px; resize: vertical; }
.attempt-history { display: flex; justify-content: center; flex-wrap: nowrap; gap: 6px; height: 10px; margin: 0; }
.attempt-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--success); }
.attempt-dot.incorrect { background: var(--error); }
.attempt-dot.pending { background: var(--empty); }
.notice { border: 1px solid var(--error); border-radius: 10px; padding: 10px; }
.debug-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 28px 12px 0; font-size: 12px; color: var(--muted); }
.debug-controls button { border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); padding: 8px; }
.secondary { border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink); min-height: 44px; padding: 8px 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 649px) {
  .site-footer { gap: 12px; padding: 24px 12px; font-size: 11px; }
  .site-footer .support-button { width: 100px; min-height: 32px; }
  .site-footer nav { column-gap: 10px; row-gap: 0; }
  .game-shell { padding: 20px 0; }
  .archive-view { padding: 0 6px; }
  .header, .intro { margin-left: 12px; margin-right: 12px; }
  .header { gap: 8px; }
  .settings-toggle { margin-left: auto; }
  .brand { font-size: 25px; }
  .brand span { margin-left: 5px; }
  .menu-toggle { display: grid; }
  .animal-card { width: 122.4px; flex-basis: 122.4px; }
  .animal-card.current { width: 180px; flex-basis: 180px; }
  .timeline { gap: 18px; padding-left: 8px; padding-right: 8px; }
  .result { margin-left: 12px; margin-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .current.dealing { animation: none; }
  .navigation-drawer[open] { animation: none; }
  .lives .life-lost { animation: none; outline: 2px solid var(--heart); outline-offset: 3px; border-radius: 50%; }
  .confetti { display: none; }
}
@media (min-width: 650px) {
  .header > .mode-nav { display: flex; }
  .menu-toggle { display: none; }
  .timeline.final-line { max-width: 1100px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .final-line .animal-card { width: 100%; }
  .drop-slot { flex-basis: 130px; }
  .game-shell { padding: 24px 36px; }
  .intro { margin-top: 48px; }
  .timeline-section { margin-top: 40px; }
  .animal-card { width: 168px; flex-basis: 168px; }
}
@media (min-width: 1024px) {
  .animal-card.current { width: 230px; flex-basis: 230px; }
  .current h3 { font-size: 22px; }
}
@media (min-width: 1200px) {
  .timeline.final-line { cursor: grab; }
  .finished #game-content { min-height: calc(100dvh - 94px); min-width: 0; }
  .finished .timeline-section { margin-top: 0; min-width: 0; padding-top: max(0px, calc(50dvh - 118px - clamp(165px, 15.75vw, 240px))); }
  .timeline.final-line { display: flex; max-width: none; gap: 22px; overflow-x: auto; padding: 16px 12px 28px; }
  .final-line .animal-card { width: clamp(220px, 21vw, 320px); flex: 0 0 clamp(220px, 21vw, 320px); }
  .final-line .card-overlay { padding: 48px 14px 18px; }
  .final-line h3 { font-size: 21px; }
  .final-line .weight { font-size: 16px; }
  .final-line .animal-card .scientific-name { display: block; font-size: 12px; }
  .final-line .weight .material-symbols-outlined { font-size: 17px; }
}

dialog::backdrop { background: rgb(7 19 15 / 50%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* Compact results; sharing stays available after the dialog closes. */
.post-game { max-width: 380px; margin: 20px auto; padding: 0 12px; text-align: center; }
.post-game-summary, #post-game-summary { font-weight: 650; }
#post-game-summary { display: flex; align-items: center; justify-content: center; gap: 5px; }
#post-game-summary .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }
#post-game-summary[data-outcome="won"] { color: var(--success); }
#post-game-summary[data-outcome="lost"] { color: var(--error); }
.post-game .view-result { min-height: 44px; padding: 8px; margin: 4px auto; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.result-score { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 18px 0 12px; }
.result-score strong { font-size: 24px; }
.result-score #result-lives .lives { margin: 0; }
.result-streak { display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 600; }
.result[data-outcome="lost"]:has(#result-streak[hidden]) .result-state { margin-bottom: 16px; }
.result-streak .material-symbols-outlined, #post-game-summary .streak-flame-icon { font-size: 26px; flex-shrink: 0; color: #e87924; animation: streak-flame 2.4s ease-in-out infinite; }
.result-panel #result-description { font-size: 16px; }
@keyframes streak-flame { 0%, 100% { color: #e87924; } 50% { color: #df4937; } }
@media (prefers-reduced-motion: reduce) { .result-streak .material-symbols-outlined, #post-game-summary .streak-flame-icon { animation: none; } }
#share-post-game { display: flex; align-items: center; justify-content: center; gap: 8px; }
#share-post-game:disabled { opacity: .6; cursor: wait; }
.result-support a { color: var(--muted); font-size: 12px; display: inline-block; padding: 8px; text-underline-offset: 3px; }
body:has(#result[open]) .footer-support { visibility: hidden; }
/* Internal QA is activated only by ?qa=weight. Public game layout is untouched. */
.qa-mode .mode-nav, .qa-mode .menu-toggle, .qa-mode .site-footer { display: none !important; }
.qa-mode .game-shell.finished { min-height: auto; }
.qa-bar, .qa-tools { border: 1px solid var(--border, #a8ada6); border-radius: 12px; padding: 16px; margin: 24px auto; max-width: 960px; }
.qa-bar { background: var(--surface-hover, #eceae5); }
.qa-bar > details > summary { cursor: pointer; }
.qa-bar small { display: block; margin: 8px 0; }
.qa-actions, #qa-seed-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.qa-bar button, .qa-tools button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border, #a8ada6); border-radius: 8px; color: inherit; background: var(--surface, transparent); font: inherit; cursor: pointer; }
.qa-tools button.primary { background: var(--accent); color: var(--bg); }
.qa-mode .qa-evaluate { margin-top: 16px; }
.qa-bar button:focus-visible, .qa-tools button:focus-visible, .qa-mode input:focus-visible, .qa-mode textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.qa-tools { width: calc(100% - 24px); box-sizing: border-box; }
.qa-tools pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.qa-tools fieldset { display: grid; gap: 12px; padding: 16px; margin: 16px 0; }
.qa-tools fieldset label { min-height: 32px; display: flex; align-items: center; gap: 8px; }
.qa-tools textarea { width: 100%; box-sizing: border-box; }
.qa-bar input, .qa-tools textarea { color: inherit; background: var(--card-bg, transparent); border: 1px solid var(--border, #a8ada6); border-radius: 6px; padding: 8px; font: inherit; }
.qa-mode input[type="radio"] { accent-color: var(--accent, #739564); }
.qa-tools > section, .qa-tools details { margin-bottom: 24px; }
.qa-reset { opacity: .8; }
.feedback-survey { width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 32px); margin: auto; padding: 20px; overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--ink); }
.feedback-survey h2 { margin: 0 0 8px; font-size: 21px; }
.feedback-survey > p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.feedback-survey form { display: grid; gap: 16px; }
.feedback-survey label { display: grid; gap: 6px; font-size: 14px; }
.feedback-survey select { width: 100%; min-width: 0; min-height: 44px; padding: 8px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.feedback-close { display: block; margin: 12px auto 0; min-height: 44px; padding: 8px; font: inherit; color: var(--muted); background: transparent; border: 0; text-decoration: underline; cursor: pointer; }
.result-feedback { display: block; margin: 6px auto 0; padding: 8px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* Boot markup and image placeholders share the final card dimensions. */
.boot-card { pointer-events: none; }
.boot-state { display: flex; gap: 6px; }
.boot-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--empty); }
.boot-hearts { font-size: 36px; line-height: 1; color: var(--empty); }
.image-skeleton { background: linear-gradient(110deg, #34443a 25%, #53634c 45%, #34443a 65%); background-size: 240% 100%; animation: skeleton-shimmer 1.8s ease-in-out infinite; }
.image-skeleton > .material-symbols-outlined, .image-skeleton > span:not(.image-loader) { visibility: hidden; }
.image-loader { position: absolute; inset: 0; display: grid; place-items: center; }
.loading-snake { width: 44px; height: 44px; color: #dce5db; opacity: 0; animation: loader-appear 1ms 200ms forwards; }
.loading-snake g { transform-origin: 24px 24px; animation: snake-chase 1.6s linear infinite; }
.animal-card:not(.current) .image-loader { display: none; }
.skeleton-caption { position: absolute; bottom: 18px; left: 15%; width: 70%; height: 28px; border-radius: 6px; background: #dce5db25; z-index: 2; }
@keyframes skeleton-shimmer { to { background-position: -240% 0; } }
@keyframes snake-chase { to { transform: rotate(360deg); } }
@keyframes loader-appear { to { opacity: .8; } }
@media (prefers-reduced-motion: reduce) {
  .image-skeleton, .loading-snake g { animation: none; }
}
.feedback-survey :is(button, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.feedback-survey fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.feedback-survey legend { margin-bottom: 8px; font-size: 14px; }
.feedback-options { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-options label { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.feedback-options input { margin: 0; accent-color: var(--accent); }
.feedback-options label:has(input:checked) { border-color: var(--accent); }
.feedback-options label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#qa-status:empty { display: none; }
@media (max-width: 649px) { .qa-bar { margin: 12px 0; padding: 12px; } #qa-seed { flex: 1; min-width: 100px; width: 140px; } }
