@font-face {
  font-family: Outfit;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #203653;
  --muted: #59697c;
  --paper: #f5f7fa;
  --surface: #e9eef4;
  --white: #fff;
  --blue: #2559ce;
  --blue-hover: #1745ab;
  --yellow: #ffcf48;
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 16px/1.5 Outfit, "Avenir Next", sans-serif; }
button, input, select { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); text-underline-offset: 4px; }
button, select { border: 0; }
button, a, select { transition: background-color 160ms, color 160ms; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; }
h1 { font-size: clamp(48px, 5.5vw, 78px); line-height: 1.02; letter-spacing: -.055em; }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.035em; }
h3 { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
svg { display: block; }
.skip-link { position: fixed; top: -90px; left: 20px; z-index: 50; padding: 12px 20px; background: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.topbar, body > main { width: min(1240px, calc(100% - 80px)); margin-inline: auto; }
.topbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 48px; height: 48px; flex-shrink: 0; }
.brand strong { font-size: 25px; font-weight: 600; letter-spacing: -1px; }
.brand strong span { color: var(--blue); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--blue); }
.site-nav .nav-cta { padding: 8px 16px; color: #fff; background: var(--blue); border-radius: 10px; }
.site-nav .nav-cta:hover { color: #fff; background: var(--blue-hover); }
.site-nav button { min-height: 44px; padding: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; }
.site-nav button:hover { color: var(--blue); }
.account-kicker { color: var(--blue); font: 700 12px/1.2 "Courier New", monospace; letter-spacing: .14em; }
.player-dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 30px 0 32px; }
.player-dashboard-heading h1 { margin-top: 10px; font-size: clamp(36px, 5vw, 58px); }
.player-dashboard-heading p { max-width: 52ch; margin-top: 10px; color: var(--muted); }
.dashboard-credit-link { display: block; flex: 0 0 auto; min-width: 180px; padding: 18px 22px; color: var(--ink); background: var(--yellow); border-radius: 18px 14px 20px 15px; text-decoration: none; transform: rotate(1deg); }
.dashboard-credit-link:hover { color: var(--ink); background: #ffda6c; }
.dashboard-credit-link strong, .dashboard-credit-link span { display: block; }
.dashboard-credit-link strong { font: 800 42px/1 "Courier New", monospace; font-variant-numeric: tabular-nums; }
.dashboard-credit-link span { margin-top: 5px; font-size: 13px; }
.landing-hero { min-height: min(650px, calc(100dvh - 96px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); align-items: center; gap: 26px; }
.landing-hero-copy { padding: 30px 0 44px; }
.landing-hero-copy h1 { max-width: 10ch; font-size: clamp(44px, 5vw, 70px); }
.landing-hero-copy p { max-width: 37ch; margin-top: 22px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.landing-hero-copy .primary-button { margin-top: 28px; text-decoration: none; }
.landing-hero-art object { display: block; width: 100%; height: auto; aspect-ratio: 640 / 380; pointer-events: none; }
.landing-story { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; gap: clamp(32px, 6vw, 80px); margin: 30px 0 76px; padding: clamp(24px, 4vw, 48px); background: #fff; border-radius: var(--radius); }
.landing-story img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; }
.landing-story h2 { max-width: 12ch; font-size: clamp(32px, 4vw, 50px); }
.landing-story p { max-width: 46ch; margin-top: 16px; color: var(--muted); line-height: 1.65; }
.landing-footer { width: min(1240px, calc(100% - 80px)); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 auto; padding: 26px 0 42px; border-top: 1px solid #dce3eb; color: var(--muted); font-size: 13px; }
.landing-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.landing-footer a { color: var(--muted); }
.screen { display: none; padding-bottom: 32px; }
.screen--active { display: block; }
.hero { display: grid; grid-template-columns: 1fr 1.12fr; gap: 12px; align-items: center; padding: 4px 0 24px; }
.hero-copy { padding: 14px 0 28px; }
.lede { margin-top: 22px; font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 430px; }
.hero-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 24px; padding-block: 6px; min-height: 44px; font-weight: 500; text-decoration: none; }
.hero-link:hover { color: var(--blue-hover); }
.hero-link svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hero-art { position: relative; }
.hero-art object { display: block; width: 100%; height: auto; aspect-ratio: 640 / 380; pointer-events: none; }
.workbench { display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; padding: 32px; background: var(--surface); border-radius: var(--radius); scroll-margin-top: 24px; }
.drawing-setup { min-width: 0; padding: 3px 4px; }
.section-note { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.mode-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 24px 0; }
.mode-picker button { position: relative; min-width: 0; padding: 13px 5px 15px; background: transparent; border-radius: 15px; text-align: center; }
.mode-picker button:hover { background: #dce5ef; }
.mode-picker button[aria-pressed="true"] { background: #fff; box-shadow: 0 5px 13px #20365306; }
.mode-picker button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 6px; left: calc(50% - 8px); width: 16px; height: 3px; background: var(--blue); border-radius: 3px; }
.mode-picker svg { width: 64px; height: 50px; max-width: 100%; margin: 0 auto 9px; color: #456381; }
.mode-picker .doodle-icon { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.mode-picker strong { display: block; font-size: 15px; font-weight: 600; }
.mode-picker span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.drawing-rules h3 { font-size: 16px; font-weight: 500; }
.mode-instructions { margin-top: 8px; color: var(--muted); line-height: 1.65; font-size: 14px; max-width: 60ch; }
.drawing-example { margin-top: 20px; }
.drawing-example-photo { width: 100%; aspect-ratio: 3 / 2; background: url('/doodle-examples.jpg') 0 0 / 200% 200%; border-radius: 3px; box-shadow: 0 3px 9px #20365312; }
.drawing-example[data-example="racing"] .drawing-example-photo { background-position: 0 100%; }
.drawing-example[data-example="tanks"] .drawing-example-photo { background-position: 100% 100%; }
.drawing-example figcaption { color: var(--muted); font-size: 12px; margin-top: 10px; }
.color-key { display: flex; flex-wrap: wrap; gap: 12px 19px; margin-top: 21px; }
.color-rule { display: inline-flex; align-items: center; gap: 7px; color: #42546c; }
.color-rule-label { font-size: 12px; }
.marker-icon { width: 35px; height: 20px; flex: 0 0 auto; overflow: visible; transform: rotate(-5deg); }
.marker-barrel, .marker-tip, .marker-collar { stroke: #253342; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.marker-collar { fill: #e7e3d9; }
.marker-highlight { fill: none; stroke: #ffffffb8; stroke-width: 1.3; stroke-linecap: round; }
.marker-nib { fill: #253342; }
.marker-shadow { fill: #20365318; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.upload-panel { min-width: 0; align-self: start; position: sticky; top: 24px; }
.drop-zone { padding: 18px 24px 22px; background: white; border-radius: 18px; display: flex; align-items: center; flex-direction: column; text-align: center; transition: background-color 160ms; }
.drop-zone.is-dragging { background: #dce8ff; outline: 3px solid var(--blue); outline-offset: 4px; }
.upload-doodle { width: 108px; height: 86px; margin-bottom: 7px; }
.drop-zone h2 { font-size: 25px; }
.drop-zone p { font-size: 14px; color: var(--muted); margin-top: 7px; }
.primary-button, .launch-button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 12px 28px; border-radius: 10px; background: var(--blue); color: white; font-size: 15px; font-weight: 500; }
.primary-button:hover, .launch-button:not(:disabled):hover { background: var(--blue-hover); }
.drop-zone .primary-button { margin-top: 21px; }
.drop-zone small { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }
.paper-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.paper-choice select { min-height: 40px; max-width: 72%; background: #dfe6ee; color: var(--ink); padding: 8px 28px 8px 10px; border-radius: 8px; font-size: 12px; }
.upload-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; }
.upload-actions a, .text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 0; background: none; color: var(--blue); font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.upload-actions a:hover, .text-button:hover { color: var(--blue-hover); }
.text-button:disabled { opacity: .5; }
.inline-error { color: #a73030; font-size: 13px; line-height: 1.5; }
.inline-error:not(:empty) { margin-top: 10px; }
.lab-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 24px 4px 6px; color: var(--muted); font-size: 12px; }
.lab-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
.lab-footer nav a { min-height: 28px; color: var(--muted); }
.lab-footer nav a:hover { color: var(--blue); }
.paper-story { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: clamp(28px, 5vw, 64px); align-items: center; margin-top: 72px; padding: clamp(24px, 4vw, 48px); background: #fff; border-radius: var(--radius); }
.paper-story img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px 12px 18px 13px; }
.paper-story h2 { font-size: clamp(30px, 4vw, 48px); max-width: 11ch; }
.paper-story p { max-width: 42ch; margin-top: 18px; color: var(--muted); line-height: 1.65; }
.paper-story a { min-height: 44px; display: inline-flex; align-items: center; margin-top: 18px; font-weight: 600; }
.processing-screen.screen--active { display: grid; place-items: center; min-height: calc(100vh - 130px); text-align: center; }
.processing-stage { max-width: 540px; }
.processing-stage h2 { font-size: clamp(32px, 4vw, 48px); }
.processing-stage p { color: var(--muted); margin-top: 20px; max-width: 45ch; margin-inline: auto; }
.scanner-orbit { width: 90px; height: 100px; background: #fff; border-radius: 7px; margin: 0 auto 35px; transform: rotate(-6deg); position: relative; box-shadow: 8px 8px #e0e7f0; }
.scanner-orbit span { position: absolute; left: 22px; top: 25px; width: 44px; height: 40px; border-radius: 8px; background: #c3dccf; }
.scanner-orbit i { position: absolute; top: 10px; left: -8px; width: 106px; height: 3px; background: var(--blue); animation: scan 1.5s ease-in-out infinite alternate; }
.processing-track { height: 4px; background: #dce4ed; border-radius: 5px; overflow: hidden; margin: 28px auto 0; width: 220px; }
.processing-track span { display: block; height: 100%; width: 45%; background: var(--blue); animation: progress 1.5s ease-in-out infinite alternate; }
@keyframes scan { to { transform: translateY(80px); } }
@keyframes progress { to { transform: translateX(125%); } }
.review-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 0; }
.review-heading h2 { font-size: clamp(28px, 3.5vw, 43px); }
.ghost-button { min-height: 44px; padding: 10px 18px; background: #e4eaf1; border-radius: 10px; font-weight: 500; font-size: 14px; flex-shrink: 0; }
.ghost-button:hover { background: #d8e1ec; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
.preview-frame { background: #e5ebf1; border-radius: 20px; padding: 14px; position: sticky; top: 20px; }
.preview-frame img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; background: #fff; border-radius: 10px; }
.preview-frame figcaption { padding: 14px 4px 3px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.review-panel { padding: 24px; background: #edf1f6; border-radius: 20px; }
.object-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.object-count { flex: 1 1 28%; padding-bottom: 10px; }
.object-count strong { font-size: 28px; line-height: 1.2; font-weight: 500; display: block; }
.object-count span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.object-count span::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--count-color); }
.assist-choice { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 14px; margin-top: 10px; cursor: pointer; }
.assist-choice input { width: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
#route-summary { font-weight: 500; font-size: 17px; margin: 20px 0 8px; }
.route-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.validation-messages { margin-block: 20px; display: grid; gap: 8px; }
.validation-message { padding: 12px 14px; border-radius: 9px; background: #f6dcd8; color: #83372c; font-size: 13px; line-height: 1.5; }
.validation-message--warning { background: #f4ebd0; color: #715720; }
.validation-message--success { background: #deece3; color: #335e47; }
.launch-button { width: 100%; }
.launch-button:disabled { background: #d2dce9; color: #5e6d82; }
.review-panel > .text-button { margin-top: 8px; }
#checkpoint-editor { margin-top: 18px; }
#checkpoint-editor .paper-choice { margin-bottom: 16px; }
#checkpoint-editor > strong { font-size: 15px; font-weight: 500; }
.game-active { overflow: hidden; }
.game-screen.screen--active { position: fixed; inset: 0; z-index: 40; width: 100vw; height: 100dvh; padding: 0; background: #111725; }
.game-stage { position: relative; width: 100%; height: 100%; }
.game-root { position: relative; width: 100%; height: 100%; min-height: 300px; overflow: hidden; background: #dcecf4; }
.game-root canvas { display: block; }
.game-pause-button { position: absolute; z-index: 220; top: max(12px, env(safe-area-inset-top)); left: 50%; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; color: #fffdf7; background: #172033e8; border: 2px solid #ffffffb8; border-radius: 50% 46% 49% 44%; box-shadow: 0 4px 0 #080b12a8; transform: translateX(-50%) rotate(-1deg); }
.game-pause-button:hover, .game-pause-button:focus-visible { background: #273752; }
.game-pause-button:active { box-shadow: 0 2px 0 #080b12a8; transform: translate(-50%, 2px) rotate(-1deg); }
.game-pause-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.game-pause-button[hidden] { display: none; }
.game-results { position: absolute; inset: 0; z-index: 300; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: #111725cf; }
.game-results-card { width: min(760px, 100%); max-height: 100%; overflow: auto; padding: clamp(24px, 4vw, 42px); color: #fffdf7; text-align: center; background: #172033; border-radius: 22px 18px 24px 17px; box-shadow: 9px 10px 0 #0a0e18aa; transform: rotate(-.25deg); }
.game-results-card::before { content: ""; display: block; width: 76px; height: 7px; margin: 0 auto 17px; background: var(--yellow); border-radius: 40% 60% 48% 52%; transform: rotate(-2deg); }
.game-results-kicker { color: var(--yellow) !important; font: 700 12px/1.2 "Courier New", monospace; letter-spacing: .16em; }
.game-results-card h2 { margin-top: 7px; color: white; font: 700 clamp(30px, 5vw, 46px)/1 "Courier New", monospace; letter-spacing: -.045em; text-transform: uppercase; }
#game-results-summary { margin-top: 12px; color: #cbd4df; font-size: 15px; }
.game-results-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 25px 0 28px; }
.game-result-score { min-width: 0; padding: 13px 10px 12px; background: #27344a; border-radius: 11px 8px 12px 9px; transform: rotate(var(--score-tilt, 0deg)); }
.game-result-score dt { color: #aebed0; font: 700 11px/1.25 "Courier New", monospace; text-transform: uppercase; }
.game-result-score dd { margin: 5px 0 0; color: white; font: 700 clamp(18px, 3vw, 25px)/1.15 "Courier New", monospace; overflow-wrap: anywhere; }
.game-controls-visual { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 24px 0; text-align: center; }
.control-card { min-width: 172px; min-height: 148px; display: flex; flex: 1 1 200px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px 14px; background: #27344a; border: 1px solid #485872; border-radius: 12px 9px 13px 10px; }
.control-card--small { min-width: 120px; min-height: 112px; flex: 1 1 130px; }
.control-card > span:last-child { min-width: 0; }
.control-card strong, .control-card small { display: block; }
.control-card strong { color: #fff; font-size: 15px; line-height: 1.2; }
.control-card small { margin-top: 5px; color: #bdc9d8; font-size: 12px; line-height: 1.4; }
.keyboard-key { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 7px; color: #172033; background: #fffdf7; border: 1px solid #fff; border-bottom: 4px solid #aeb9c6; border-radius: 6px 5px 7px 5px; font: 700 13px/1 "Courier New", monospace; box-shadow: 0 2px 0 #0c111c; }
.keyboard-key.key-wide { min-width: 70px; font-size: 10px; }
.key-cluster { display: grid; grid-template-columns: repeat(3, 32px); grid-template-rows: repeat(2, 32px); gap: 4px; }
.key-cluster .key-up { grid-column: 2; }
.key-cluster .key-left { grid-column: 1; grid-row: 2; }
.key-cluster .key-down { grid-column: 2; grid-row: 2; }
.key-cluster .key-right { grid-column: 3; grid-row: 2; }
.game-results-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tank-ground-choice { border:0;padding:0;margin:0 0 24px;min-width:0;color:#fffdf7; }
.tank-ground-choice legend { margin:auto;padding:0 0 8px;font-weight:700;font-size:16px; }
.tank-ground-choice>div { display:flex;justify-content:center;gap:10px;flex-wrap:wrap; }
.tank-ground-choice button { min-height:44px;min-width:104px;padding:10px 20px;border:2px solid #8394ad;border-radius:10px;color:#fffdf7;background:#26364c;font:600 16px Outfit,sans-serif; }
.tank-ground-choice button[aria-pressed=true] { border-color:#ffcf48;background:#ffcf48;color:#172033; }
.tank-ground-choice button[aria-pressed=true]::before { content:'✓ '; }
.tank-ground-choice button:focus-visible { outline:3px solid #fff;outline-offset:3px; }
.tank-ground-choice small { display:block;color:#cbd4df;font-size:13px;margin-top:8px; }
.result-action { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; color: white; background: #34435a; border: 2px solid #53637a; border-radius: 13px 10px 14px 11px; }
.result-action:hover, .result-action:focus-visible { background: #43536a; }
.result-action--primary { color: #172033; background: var(--yellow); border-color: #ffe08a; }
.result-action--primary:hover, .result-action--primary:focus-visible { background: #ffdb69; }
.result-action svg { width: 27px; height: 27px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-action--primary svg { fill: currentColor; stroke-width: 1.5; }
.result-action span { display: flex; align-items: center; gap: 8px; }
.result-action strong { font-size: 15px; font-weight: 700; }
.result-action small { min-width: 24px; padding: 2px 6px; color: inherit; background: #ffffff30; border-radius: 5px; font: 700 11px/1.5 "Courier New", monospace; }
.result-action--primary small { background: #1720331f; }
dialog { width: min(760px, calc(100% - 32px)); max-height: 82vh; padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px #20365330; }
dialog::backdrop { background: #20365388; }
.auth-dialog { width: min(520px, calc(100% - 24px)); max-height: min(88dvh, 780px); overflow: hidden; background: #fff; border-radius: 22px; }
.auth-dialog::backdrop { background: #14243baf; }
.auth-dialog iframe { display: block; width: 100%; height: min(82dvh, 720px); border: 0; }
.auth-dialog[data-view="login"] iframe { height: min(76dvh, 590px); }
.auth-dialog-close { position: absolute; z-index: 1; top: 13px; right: 13px; width: 44px; height: 44px; border-radius: 10px; background: #e9eef4; font-size: 28px; line-height: 1; }
.auth-dialog-close:hover { background: #d9e4f0; }
.dialog-heading { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; background: #e2e8f0; }
.dialog-heading button { width: 44px; height: 44px; border-radius: 8px; background: white; font-size: 24px; }
pre { margin: 0; padding: 24px; max-height: 65vh; overflow: auto; font: 12px/1.6 monospace; }

@media (max-width: 1050px) {
  .topbar, body > main { width: calc(100% - 48px); }
  .workbench { gap: 28px; grid-template-columns: 1.15fr 1fr; padding: 26px; }
  .hero { padding-block: 16px 30px; }
  .mode-picker { gap: 4px; }
  .mode-picker span { font-size: 11px; }
}
@media (max-width: 800px) {
  .site-nav a:not(.nav-cta) { display: none; }
  .landing-page .site-nav a[href="/login"], .dashboard-page .site-nav a[href="/credits"] { display: inline-flex; }
  .hero { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 52px; }
  .lede { font-size: 15px; }
  .desktop-break { display: none; }
  .workbench { grid-template-columns: 1fr; padding: 28px; }
  .mode-picker { gap: 10px; }
  .mode-picker span { font-size: 13px; }
  .upload-panel { max-width: none; position: static; }
  .drop-zone { padding-block: 22px; }
  .review-grid { grid-template-columns: 1fr; }
  .paper-story { grid-template-columns: 1fr; margin-top: 48px; }
  .preview-frame { position: static; }
  .object-count { flex: 1; }
  .game-results-actions { grid-template-columns: 1fr; }
  .landing-hero { min-height: 0; grid-template-columns: 1fr; padding: 30px 0; }
  .landing-hero-copy { padding: 0; }
  .landing-hero-art { max-width: 650px; }
  .landing-story { grid-template-columns: 1fr; }
  .player-dashboard-heading { align-items: start; }
}
@media (max-width: 540px) {
  .topbar, body > main { width: calc(100% - 36px); }
  .topbar { min-height: 80px; }
  .brand strong { font-size: 23px; }
  .brand-mark { width: 40px; height: 40px; }
  .site-nav { gap: 8px; }
  .site-nav .nav-cta { padding-inline: 12px; font-size: 13px; }
  .landing-page .site-nav a[href="#how-it-works"] { display: none; }
  .landing-page .site-nav a[href="/login"] { display: inline-flex; }
  .dashboard-page .site-nav a[href="/credits"] { display: inline-flex; }
  .dashboard-page .site-nav a[href="/dashboard"] { display: none; }
  .dashboard-page .site-nav button { font-size: 13px; }
  .landing-hero-copy h1 { font-size: clamp(42px, 11vw, 56px); }
  .landing-hero-copy p { font-size: 16px; }
  .landing-hero-art { margin-inline: -8px; }
  .landing-story { margin-top: 18px; padding: 22px 18px; }
  .landing-footer { width: calc(100% - 36px); }
  .player-dashboard-heading { flex-direction: column; padding-block: 18px 24px; }
  .player-dashboard-heading h1 { font-size: 38px; }
  .dashboard-credit-link { width: 100%; }
  .hero { grid-template-columns: 1fr; gap: 0; padding: 24px 0; }
  .hero-copy { padding: 0; }
  h1 { font-size: clamp(48px, 12vw, 64px); }
  .lede { max-width: 32ch; font-size: 16px; margin-top: 18px; }
  .hero-link { margin-top: 14px; }
  .hero-art { margin: 6px -8px 0; padding: 0; }
  .hero-art object { max-height: 245px; }
  .workbench { padding: 22px 16px; gap: 26px; border-radius: 20px; }
  .drawing-setup { padding: 0; }
  .workbench h2 { font-size: 25px; }
  .section-note { font-size: 14px; }
  .mode-picker { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block: 20px; }
  .mode-picker button { padding-block: 12px 17px; }
  .mode-picker svg { width: 58px; height: 44px; margin-bottom: 5px; }
  .color-key { column-gap: 14px; }
  .drop-zone { padding: 18px 12px; }
  .drop-zone p { font-size: 13px; }
  .paper-choice { align-items: start; }
  .paper-choice > span { padding-top: 10px; }
  .paper-choice select { max-width: 72%; padding-right: 8px; font-size: 11px; }
  .upload-actions a, .upload-actions .text-button { font-size: 12px; }
  .lab-footer { font-size: 11px; padding: 20px 2px; }
  .lab-footer { gap: 16px; }
  .paper-story { margin-top: 36px; padding: 16px; border-radius: 20px; }
  .review-heading { align-items: start; flex-direction: column; padding-top: 20px; gap: 18px; }
  .review-heading h2 { font-size: 32px; max-width: 14ch; }
  .review-panel { padding: 20px; }
  .object-count { flex-basis: 25%; }
  .game-results { padding: 10px; }
  .game-results-card { padding: 20px 16px; border-radius: 16px 13px 18px 14px; }
  .game-results-scores { margin-block: 18px; }
  .game-controls-visual { gap: 9px; margin-block: 18px; }
  .control-card { min-width: 100%; min-height: 112px; }
  .control-card--small { min-width: calc(50% - 5px); min-height: 78px; }
  .result-action { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
