:root {
  color-scheme: dark;
  --ink: #121720;
  --panel: #202730;
  --cream: #f6f1e6;
  --muted: #a8b2bd;
  --line: #ffffff18;
  --lime: #d3f88c;
  --mint: #9bd6c7;
  --lavender: #c1b1f0;
  --display: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 280px; min-height: 100%; background: var(--ink); }
body { margin: 0; min-width: 280px; min-height: 100svh; color: var(--cream); font: 16px/1.5 var(--body); background: radial-gradient(ellipse at 62% 35%, #3249432b, transparent 48%), radial-gradient(ellipse at 5% 90%, #50405d20, transparent 50%), #121720; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-underline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
[hidden], dialog:not([open]) { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button svg { width: 21px; height: 21px; flex: 0 0 auto; }

/* An editorial opening, with the experiment as the centre of attention. */
.site-shell { width: min(1160px, calc(100% - 80px)); margin: 0 auto; }
.site-header { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand > svg { width: 37px; height: 38px; }
.brand > span { font-size: 14px; font-weight: 800; line-height: 1.16; letter-spacing: -.2px; }
.brand > span > span { display: block; }
.header-label { display: inline-flex; align-items: center; gap: 10px; color: #9eacb3; font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px #d3f88736; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff1d; border-radius: 50%; color: #cbd4d8; background: #ffffff04; transition: color .16s, background .16s, border-color .16s; }
.icon-button:hover { background: #ffffff0c; color: var(--cream); border-color: #ffffff45; }
.icon-button:disabled { opacity: .35; }
.mute-mark { position: absolute; top: 20px; left: 10px; width: 24px; height: 2px; background: #eab09f; transform: rotate(-43deg); box-shadow: 0 0 0 2px var(--ink); }
.arcade { display: grid; grid-template-columns: minmax(0, 410px) minmax(0, 530px); justify-content: space-between; align-items: center; column-gap: 64px; padding: 42px 20px 36px; }
.story { min-width: 0; padding: 0 0 10px; }
.specimen-label { display: flex; align-items: center; gap: 7px; margin: 0 0 22px; color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: 1.6px; }
.specimen-label svg { width: 14px; height: 17px; }
h1 { position: relative; width: fit-content; margin: 0; font-family: var(--display); font-size: clamp(52px, 5.6vw, 72px); font-weight: 600; letter-spacing: -2.7px; line-height: 1.06; white-space: nowrap; }
h1 > span:not(.title-stitch) { color: var(--lime); }
.title-stitch { position: absolute; right: 5px; bottom: -15px; color: #7eab77; font: 500 13px/1 var(--body); letter-spacing: 9px; transform: rotate(-4deg); }
.tagline { margin: 20px 0 0; font-family: var(--display); font-size: 28px; font-weight: 400; }
.tagline em { font-style: normal; color: var(--lavender); }
.intro { margin: 24px 0 0; color: #c1c8ce; font-size: 17px; line-height: 1.7; }
.intro > span { color: #8d9ba7; }
.lab-notes { display: grid; gap: 19px; margin: 30px 0 0; }
.rule { display: flex; align-items: center; gap: 13px; }
.rule-symbol { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 40px; flex: 0 0 auto; color: var(--mint); border: 1px solid #9bd6c725; border-radius: 12px; background: #9bd6c708; transform: rotate(-4deg); }
.rule:nth-child(2) .rule-symbol { color: var(--lavender); border-color: #c1b1f025; background: #c1b1f008; transform: rotate(4deg); }
.rule:nth-child(3) .rule-symbol { color: var(--lime); border-color: #d3f88c25; background: #d3f88c08; }
.rule-symbol svg { width: 21px; height: 21px; }
.rule p { margin: 0; line-height: 1.5; }
.rule b { display: block; font-size: 14px; font-weight: 800; }
.rule p > span { display: block; color: #99a7b3; font-size: 13px; }
.section-label { display: block; color: var(--mint); font-size: 10px; line-height: 1.5; font-weight: 900; letter-spacing: 1.4px; }
.personal-best { display: flex; align-items: center; gap: 13px; margin: 30px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
.record-icon { display: grid; place-items: center; width: 40px; height: 44px; color: var(--lavender); }
.record-icon svg { width: 27px; height: 27px; }
.personal-best .section-label { color: #8d9ba7; font-size: 9px; letter-spacing: 1px; }
.personal-best p { margin: 0; color: #c5cbd3; font-size: 13px; line-height: 1.3; }
.personal-best strong { color: var(--cream); font: 500 28px/1.2 var(--display); margin-right: 2px; }
#best-subtitle { display: block; margin-top: 4px; color: #8797a4; font-size: 11px; }
.record-caption { margin-left: auto; color: #657681; font-size: 8px; line-height: 1.7; font-weight: 800; letter-spacing: 1.4px; text-align: right; }
.lab-signoff { margin: 25px 0 0; color: #758692; font-size: 11px; }

/* The cabinet has one reading order: score, creature, feedback, action. */
.machine { position: relative; width: 100%; min-width: 0; isolation: isolate; overflow: hidden; border: 1px solid #68778466; border-radius: 24px; background: #1e2630; box-shadow: 0 32px 70px #0005, 0 6px 0 #0a101b, 0 7px 0 #40505c66, inset 0 1px 0 #ffffff18; }
.machine-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; padding: 10px 20px; color: #9eaeb8; background: #242d35; border-bottom: 1px solid #ffffff13; }
.experiment { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 9px; font-weight: 800; letter-spacing: 1.1px; }
.machine-best { display: inline-flex; align-items: center; gap: 6px; color: #c7c0d8; font-size: 11px; font-weight: 700; white-space: nowrap; }
.machine-best svg { width: 14px; height: 14px; color: var(--lavender); }
.scoreboard { display: grid; grid-template-columns: 1fr 1.2fr 1fr 44px; align-items: center; gap: 16px; padding: 15px 22px 16px; background: #1e2630; }
body[data-phase='menu'] .scoreboard { display: none; }
.scoreboard > div { min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; color: #98a7b2; font-size: 10px; letter-spacing: 1px; font-weight: 800; white-space: nowrap; }
.stat-label svg { width: 10px; height: 12px; color: var(--lavender); }
.scoreboard strong { display: block; font: 500 34px/1 var(--display); letter-spacing: .2px; font-variant-numeric: tabular-nums; }
#height-stat { color: var(--lime); }
#streak-stat { color: var(--lavender); }
#streak-stat span { font-size: 20px; margin-left: 3px; opacity: .65; }
.pause-button { border-radius: 13px; background: #ffffff04; }
.pause-button svg { width: 17px; height: 17px; }
.playfield { position: relative; height: clamp(360px, calc(100svh - 374px), 490px); width: 100%; overflow: hidden; isolation: isolate; background: #23303b url('assets/laboratory.webp') center 61% / cover no-repeat; border-top: 1px solid #a4b6bc28; border-bottom: 1px solid #a4b6bc28; touch-action: manipulation; }
body[data-phase='menu'] .playfield { height: clamp(350px, calc(100svh - 333px), 480px); }
#game-canvas { display: block; position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; }
.stage-vignette { position: absolute; z-index: 2; inset: 0; pointer-events: none; box-shadow: inset 0 0 48px #0a16245c, inset 0 24px 30px -20px #101b28; }
.demo-label { position: absolute; z-index: 3; top: 18px; left: 0; right: 0; pointer-events: none; text-align: center; }
.stamped { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid #9dc0a047; border-radius: 20px; background: #142627cc; color: #d8edc4; font-size: 9px; font-weight: 900; letter-spacing: 1.6px; box-shadow: 0 3px 12px #07142036; }
.stamped .status-dot { width: 4px; height: 4px; }
.control-deck { padding: 17px 20px 15px; background: linear-gradient(120deg, #25303a, #202732); }
.feedback { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 54px; margin-bottom: 14px; gap: 5px; text-align: center; }
.feedback-heading { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 9px; }
.feedback strong { font: 500 20px/1.2 var(--display); letter-spacing: .1px; }
.feedback > span { color: #aebbc6; font-size: 12px; line-height: 1.4; }
.feedback[data-tone='perfect'] strong { color: var(--lime); }
.feedback[data-tone='warning'] strong, .feedback[data-tone='miss'] strong { color: #efb09a; }
.points-badge { display: inline-block; padding: 3px 7px 2px; border-radius: 5px; color: var(--mint); background: #9bd6c711; font-size: 12px; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }
.feedback[data-tone='perfect'] .points-badge { color: var(--lime); background: #d3f88c13; }
.primary-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 14px 20px; gap: 10px; color: #283624; background: var(--lime); border: 1px solid #e5ffb3; border-radius: 13px; box-shadow: 0 4px 0 #6d8d50, 0 5px 12px #0002, inset 0 1px 0 #f3ffda; font-size: 16px; font-weight: 900; line-height: 1.25; transition: background .15s, transform .1s, box-shadow .1s; }
.primary-button:hover { background: #e0ffa7; box-shadow: 0 4px 0 #789b55, 0 6px 22px #b2ed6320, inset 0 1px 0 #f3ffda; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 1px 0 #6d8d50, inset 0 1px 0 #f3ffda; }
.primary-button:disabled { opacity: .7; }
body[data-phase='dropping'] #drop-button { opacity: 1; transform: translateY(2px); box-shadow: 0 2px 0 #6d8d50, inset 0 1px 0 #f3ffda; }
.button-key { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); padding: 4px 6px; border: 1px solid #48633950; border-radius: 5px; color: #4e6a3a; font-size: 9px; font-weight: 900; letter-spacing: .5px; }
.button-key > span { margin-left: 3px; font-size: 11px; }
.deck-bottom { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 17px; margin-top: 15px; color: #92a1af; font-size: 11px; line-height: 1.4; }
.deck-bottom .text-button { min-height: 44px; padding: 10px 6px; font-size: 11px; }
.deck-bottom:has(#view-results-button:not([hidden])) #deck-hint { display: none; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0 26px; color: #7e8f9a; font-size: 11px; border-top: 1px solid var(--line); }
.site-footer > span a { color: #b2bdc8; text-decoration: none; }
.marketing-link { color: #adc7bc; font-size: 12px; text-decoration: none; }
.marketing-link:hover, .site-footer > span a:hover { color: var(--lime); }
.marketing-link > span { color: var(--lime); margin-left: 5px; }

/* Dialogs use the same calm hierarchy and generous touch targets. */
body:has(dialog[open]) { overflow: hidden; }
.modal { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 34px; color: var(--cream); background: linear-gradient(135deg, #242e38, #1b232e); border: 1px solid #63728288; border-radius: 24px; box-shadow: 0 24px 100px #0008, inset 0 1px 0 #ffffff13; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.modal[open] { animation: reveal .22s ease-out both; }
.modal::backdrop { background: #060c15cb; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.modal .section-label { padding-right: 30px; }
.modal h2 { margin: 14px 0 22px; font: 500 36px/1.1 var(--display); letter-spacing: -.6px; }
.close-modal { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; z-index: 3; }
.close-modal svg { width: 19px; height: 19px; }
.instructions { list-style: none; counter-reset: lab-step; padding: 0; margin: 26px 0; }
.instructions li { position: relative; counter-increment: lab-step; padding-left: 45px; margin-bottom: 22px; }
.instructions li::before { content: counter(lab-step, decimal-leading-zero); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 31px; height: 34px; border-radius: 9px; color: var(--lime); background: #d3f88c0d; border: 1px solid #d3f88c28; font: 500 15px var(--display); }
.instructions li b { font-size: 15px; font-weight: 800; }
.instructions li p { margin: 5px 0 0; font-size: 13px; color: #aebcc9; line-height: 1.6; }
kbd { padding: 1px 4px; font: 700 .9em var(--body); border: 1px solid #ffffff25; border-radius: 4px; color: #d6deea; background: #ffffff05; white-space: nowrap; }
.manual-note { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding: 14px 16px; color: #b8c9ce; font-size: 12px; line-height: 1.6; border-radius: 11px; background: #9bd6c709; border: 1px solid #9bd6c71c; }
.manual-note svg { width: 17px; height: 17px; color: var(--mint); flex: 0 0 auto; }
.modal > .primary-button { margin-bottom: 4px; }
.setting-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-row > span:first-child { min-width: 0; }
.setting-row b { display: block; font-size: 15px; font-weight: 800; }
.setting-row small { display: block; margin-top: 4px; color: #a3b1bf; font-size: 12px; line-height: 1.5; }
.setting-row input { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.switch { position: relative; width: 47px; height: 28px; flex: 0 0 auto; border-radius: 20px; background: #536171; border: 1px solid #ffffff20; transition: background .15s; }
.switch::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; left: 3px; top: 3px; background: #dce4e9; box-shadow: 0 1px 3px #0004; transition: transform .15s, background .15s; }
.setting-row input:checked + .switch { background: var(--lime); border-color: var(--lime); }
.setting-row input:checked + .switch::after { transform: translateX(19px); background: #34492a; }
.setting-row input:focus-visible + .switch { outline: 3px solid var(--lavender); outline-offset: 4px; }
.muted-copy { margin: 21px 0 25px; color: #94a5b4; font-size: 12px; line-height: 1.6; }
.pause-modal { text-align: center; }
.pause-modal .section-label { padding: 0; }
.pause-modal > p { margin: 0 0 28px; color: #adbac7; font-size: 14px; }
.pause-illustration { display: block; position: relative; width: 95px; height: 85px; margin: 4px auto 18px; color: var(--lavender); font: 500 72px/1 var(--display); transform: rotate(-12deg); }
.pause-illustration > span { position: absolute; font-size: 38px; top: 4px; right: -7px; color: var(--mint); }
.pause-illustration > i { position: absolute; font-style: normal; font-size: 22px; top: -5px; right: -26px; color: var(--lime); }
.text-button { min-height: 44px; padding: 10px 6px; border: 0; background: transparent; color: #b0bdc9; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--cream); }
.pause-links { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: #5f7382; }

/* A creature reveal, not a miniature export poster. */
.results-modal { width: min(820px, calc(100% - 40px)); max-width: none; padding: 34px; }
.results-modal[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; gap: 24px 30px; }
.result-copy { grid-column: 1; grid-row: 1; align-self: end; padding-top: 14px; }
.results-modal .section-label { padding-right: 0; color: var(--mint); font-size: 10px; }
.results-modal h2 { margin: 13px 0 13px; font-size: 43px; line-height: 1.03; letter-spacing: -.7px; overflow-wrap: anywhere; }
.results-modal h2:focus { outline: none; }
.result-joke { margin: 0; color: #aebdca; font-size: 14px; line-height: 1.6; }
.result-personality { display: grid; gap: 3px; margin-top: 17px; padding-left: 12px; border-left: 2px solid #9bd6c757; }
.result-personality > span { color: #8fa69f; font-size: 8px; font-weight: 900; letter-spacing: 1.4px; }
.result-personality > strong { color: var(--mint); font: 400 17px/1.25 var(--display); }
.result-specimen { position: relative; grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 420px; margin: 28px 0 0; padding: 38px 18px 20px; overflow: hidden; background: radial-gradient(ellipse at 50% 48%, #56774b29, transparent 67%), repeating-linear-gradient(0deg, #8fb3a004 0px, #8fb3a004 1px, transparent 1px, transparent 24px), repeating-linear-gradient(90deg, #8fb3a004 0px, #8fb3a004 1px, transparent 1px, transparent 24px), #17212a; border: 1px solid #8ba29633; border-radius: 18px; }
.specimen-tag { position: absolute; top: 17px; left: 18px; display: flex; align-items: center; gap: 7px; color: #7f9b99; font-size: 8px; font-weight: 900; letter-spacing: 1.4px; }
.specimen-tag .status-dot { width: 4px; height: 4px; background: var(--mint); }
#result-preview { display: block; width: 100%; height: 300px; object-fit: contain; min-height: 0; }
.result-specimen figcaption { margin-top: 11px; color: var(--lavender); text-align: center; font: 400 16px/1.3 var(--display); }
.result-stats { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: .9fr 1.15fr 1fr; gap: 10px; padding: 20px 0; border-block: 1px solid var(--line); }
.result-stats > div { min-width: 0; }
.result-stats strong { display: block; color: var(--lime); font: 500 35px/1 var(--display); font-variant-numeric: tabular-nums; }
.result-stats > div:nth-child(2) strong { color: var(--cream); }
.result-stats > div:nth-child(3) strong { color: var(--lavender); }
.result-stats span { display: block; margin-top: 7px; color: #94a7b5; font-size: 11px; font-weight: 700; white-space: nowrap; }
.result-actions { grid-column: 1; grid-row: 3; align-self: start; }
.result-actions .primary-button { font-size: 14px; padding-inline: 9px; }
.share-buttons { display: grid; grid-template-columns: 1.3fr 1fr; gap: 9px; margin-top: 16px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 8px; color: #c4d0da; background: #ffffff04; border: 1px solid #ffffff22; border-radius: 11px; font-size: 12px; font-weight: 800; line-height: 1.3; transition: border-color .15s, background .15s; }
.secondary-button:hover { border-color: #9bd6c780; background: #9bd6c70b; }
.secondary-button svg { width: 16px; height: 16px; }
.save-note { margin: 13px 0 0; text-align: center; color: #8396a6; font-size: 10px; }
.results-cta { grid-column: 1 / -1; grid-row: 4; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 9px; border-top: 1px solid var(--line); padding-top: 22px; text-align: center; color: #95a8b6; font-size: 11px; text-decoration: none; }
.results-cta b { color: var(--mint); font-size: 12px; font-weight: 800; }
.results-cta:hover b { color: var(--lime); text-decoration: underline; }
.toast { position: fixed; z-index: 100; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; border: 1px solid #7d9473; border-radius: 12px; background: #263a31; color: #e3f4d0; box-shadow: 0 6px 25px #0006; font-size: 13px; font-weight: 700; text-align: center; }
.noscript { position: fixed; z-index: 999; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(500px, calc(100% - 32px)); padding: 20px; background: #f2d8ca; color: #352331; border: 2px solid #edb197; border-radius: 14px; text-align: center; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) and (min-width: 761px) {
  .site-shell { width: calc(100% - 48px); }
  .arcade { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 35px; padding-inline: 0; }
  h1 { font-size: clamp(45px, 6.1vw, 64px); letter-spacing: -2px; }
  .specimen-label { font-size: 8px; letter-spacing: 1.2px; }
  .intro { font-size: 15px; }
  .rule b { font-size: 13px; }
  .rule p > span { font-size: 12px; }
  .rule { gap: 11px; }
  .record-caption { display: none; }
  .machine-top { padding-inline: 16px; gap: 8px; }
  .experiment { font-size: 8px; letter-spacing: .7px; }
  .machine-best { font-size: 10px; }
  .button-key { display: none; }
  .control-deck { padding-inline: 16px; }
  .feedback strong { font-size: 18px; }
  .feedback > span { font-size: 11px; }
  .scoreboard { padding-inline: 17px; gap: 12px; }
}
@media (min-width: 761px) and (max-height: 800px) {
  .site-header { min-height: 70px; }
  .arcade { padding-top: 26px; padding-bottom: 29px; }
  .specimen-label { margin-bottom: 17px; }
  .intro { margin-top: 20px; }
  .lab-notes { margin-top: 23px; gap: 15px; }
  .personal-best { margin-top: 23px; }
  .lab-signoff { margin-top: 16px; }
  .site-footer { padding-top: 18px; padding-bottom: 18px; }
  body[data-phase='menu'] .playfield { height: max(310px, calc(100svh - 330px)); }
  body:not([data-phase='menu']) .playfield { height: max(290px, calc(100svh - 410px)); }
}
/* Give desktop creatures more room without moving the controls during a run.
   Short laptops keep a narrower cabinet; the stage and chrome share a viewport budget. */
@media (min-width: 1101px) and (min-height: 701px) {
  .site-shell { width: min(1280px, calc(100% - 80px)); }
  .site-header { min-height: 64px; }
  .arcade { grid-template-columns: minmax(0, 410px) minmax(0, clamp(560px, calc(100svh - 140px), 650px)); column-gap: 64px; padding: 16px 0 8px; }
  .scoreboard { padding-block: 10px 11px; }
  .playfield, body:not([data-phase='menu']) .playfield { height: clamp(340px, calc(100svh - 360px), 620px); }
  body[data-phase='menu'] .playfield { height: clamp(360px, calc(100svh - 340px), 640px); }
  .control-deck { padding: 12px 20px 10px; }
  .feedback { min-height: 44px; margin-bottom: 10px; gap: 4px; }
  #drop-button { min-height: 54px; padding-block: 12px; }
  .deck-bottom { min-height: 14px; margin-top: 8px; line-height: 1.25; }
  .site-footer { padding-block: 18px; }
  body:not([data-phase='menu']) .site-footer { display: none; }
}
@media (max-width: 760px) {
  .site-shell { width: 100%; max-width: 510px; padding: max(8px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .site-header { min-height: 52px; gap: 15px; border-bottom: 0; }
  .brand { gap: 8px; }
  .brand > svg { width: 30px; height: 33px; }
  .brand > span { font-size: 12px; }
  .header-label { display: none; }
  .header-tools { gap: 4px; }
  .header-tools .icon-button { border-color: transparent; }
  .arcade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; padding: 16px 0 0; }
  .story { padding: 0; text-align: center; }
  .specimen-label { display: none; }
  h1 { margin: 0 auto; font-size: clamp(43px, 12vw, 58px); letter-spacing: -1.9px; }
  .title-stitch { display: none; }
  .tagline { margin: 6px 0 0; font-size: 20px; }
  .intro, .lab-notes, .personal-best, .lab-signoff { display: none; }
  .machine { border-radius: 20px; }
  .machine-top { min-height: 38px; padding: 8px 14px; gap: 8px; }
  .experiment { font-size: 8px; letter-spacing: .9px; }
  .machine-best { font-size: 10px; }
  .machine-best svg { width: 12px; height: 12px; }
  .scoreboard { grid-template-columns: 1fr 1.2fr 1fr 44px; gap: 13px; padding: 13px 17px 15px; }
  .stat-label { margin-bottom: 4px; font-size: 10px; letter-spacing: .5px; }
  .scoreboard strong { font-size: 31px; }
  .playfield, body[data-phase='menu'] .playfield { height: clamp(218px, calc(100svh - 397px), 440px); }
  .demo-label { top: 13px; }
  .stamped { font-size: 8px; padding: 5px 10px; letter-spacing: 1.2px; }
  .control-deck { padding: 13px 15px 13px; }
  .feedback { min-height: 49px; gap: 4px; margin-bottom: 11px; }
  .feedback strong { font-size: 18px; }
  .feedback > span { font-size: 11px; max-width: 100%; }
  .primary-button { min-height: 54px; border-radius: 12px; font-size: 15px; padding: 13px 15px; }
  .primary-button svg { width: 19px; height: 20px; }
  .button-key { display: none; }
  .deck-bottom { margin-top: 13px; font-size: 10px; min-height: 14px; }
  .site-footer { justify-content: center; padding: 22px 0 2px; border: 0; font-size: 10px; }
  .site-footer .marketing-link { display: none; }
  body:not([data-phase='menu']) .arcade { padding-top: 7px; gap: 10px; }
  body:not([data-phase='menu']) .story { display: none; }
  body:not([data-phase='menu']) .site-footer { display: none; }
  body:not([data-phase='menu']) .playfield { height: clamp(230px, calc(100svh - 365px), 560px); }
  body:not([data-phase='menu']) .machine-top { min-height: 33px; padding-block: 6px; }
  .modal { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 29px 23px; border-radius: 21px; }
  .modal h2 { margin-top: 17px; font-size: 32px; }
  .modal .section-label { font-size: 9px; }
  .close-modal { top: 9px; right: 9px; }
  .setting-row { gap: 15px; padding: 18px 0; }
  .setting-row small { font-size: 12px; }
  .results-modal { width: min(460px, calc(100% - 24px)); padding: 24px 20px 20px; }
  .results-modal[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto auto; gap: 16px; }
  .result-copy { grid-column: 1; grid-row: 1; padding: 0 27px 0 0; }
  .results-modal h2 { margin: 9px 0 8px; font-size: 32px; line-height: 1.03; }
  .result-joke { font-size: 12px; line-height: 1.5; }
  .result-specimen { grid-column: 1; grid-row: 2; min-height: 0; margin: 0; padding: 24px 14px 13px; }
  .specimen-tag { top: 11px; left: 13px; font-size: 7px; letter-spacing: 1.1px; }
  #result-preview { height: clamp(145px, calc(100dvh - 542px), 240px); }
  .result-specimen figcaption { margin-top: 5px; font-size: 14px; }
  .result-stats { grid-column: 1; grid-row: 3; padding: 13px 5px; gap: 10px; grid-template-columns: 1fr 1.2fr 1fr; text-align: center; }
  .result-stats strong { font-size: 29px; }
  .result-stats span { margin-top: 4px; font-size: 10px; }
  .result-actions { grid-column: 1; grid-row: 4; }
  .result-actions .primary-button { min-height: 52px; font-size: 15px; }
  .share-buttons { margin-top: 14px; grid-template-columns: 1.2fr 1fr; }
  .secondary-button { font-size: 12px; }
  .save-note { display: none; }
  .results-cta { grid-column: 1; grid-row: 5; gap: 2px 7px; padding-top: 14px; font-size: 10px; }
  .results-cta b { font-size: 11px; }
}
@media (max-width: 370px) {
  .site-shell { padding-inline: 12px; }
  .machine-top { padding-inline: 12px; }
  .experiment { letter-spacing: .5px; }
  .machine-best { font-size: 9px; }
  .machine-best svg { display: none; }
  .scoreboard { gap: 10px; padding-inline: 13px; }
  .scoreboard strong { font-size: 28px; }
  .stat-label { font-size: 9px; }
  .control-deck { padding-inline: 12px; }
  .feedback strong { font-size: 17px; }
  .feedback > span { font-size: 10px; }
  .points-badge { font-size: 11px; }
  .results-modal { padding-inline: 17px; }
  .results-modal h2 { font-size: 29px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .site-shell { padding-top: max(5px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .arcade { padding-top: 8px; gap: 11px; }
  h1 { font-size: 40px; }
  .tagline { margin-top: 3px; font-size: 17px; }
  body[data-phase='menu'] .playfield { height: max(190px, calc(100svh - 344px)); }
  .control-deck { padding-top: 10px; padding-bottom: 11px; }
  .feedback { min-height: 44px; margin-bottom: 10px; }
  .feedback > span { font-size: 10px; }
  .deck-bottom { margin-top: 10px; font-size: 10px; }
  .site-footer { display: none; }
  body:not([data-phase='menu']) .playfield { height: max(216px, calc(100svh - 344px)); }
  .results-modal { max-height: calc(100dvh - 16px); }
  .results-modal[open] { gap: 12px; }
  .result-specimen { padding-top: 22px; padding-bottom: 10px; }
  #result-preview { height: 138px; }
  .result-stats { padding-block: 11px; }
  .results-cta { display: none; }
  .pause-illustration { font-size: 55px; height: 62px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .site-shell { max-width: 970px; }
  .arcade { grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); gap: 25px; align-items: center; }
  .story { display: block; }
  .intro, .lab-notes, .personal-best, .lab-signoff, .site-footer { display: none; }
  h1 { font-size: 42px; }
  .specimen-label { display: none; }
  body:not([data-phase='menu']) .arcade { display: block; max-width: 480px; margin-inline: auto; }
  body:not([data-phase='menu']) .story { display: none; }
}
@media (hover: none) { .button-key { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .primary-button:active, body[data-phase='dropping'] #drop-button { transform: none; }
}
.gentle *, .gentle *::before, .gentle *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.gentle .primary-button:active, body.gentle[data-phase='dropping'] #drop-button { transform: none; }

.results-modal[data-record="true"] .result-copy .section-label { color: var(--lime); }
