@charset "UTF-8";

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/manrope-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --paper: #0b1119;
  --surface: #101923;
  --ink: #edf2f6;
  --brand-accent: #68e3ce;
  --muted: #a2afbc;
  --line: #26323f;
  --lcd: #a9b976;
  --lcd-background: #a9b976;
  --lcd-ink: #29351f;
  --sans: "Manrope Variable", system-ui, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, select { font: inherit; }
a { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 4px; }
::selection { background: var(--brand-accent); color: var(--paper); }
.hidden, [hidden] { display: none !important; }
.skip-link { position: absolute; top: -80px; left: 16px; z-index: 20; border-radius: 6px; padding: 12px 18px; background: var(--brand-accent); color: var(--paper); }
.skip-link:focus { top: 12px; }
.site-header, main, .site-footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.brand-name { display: flex; flex-direction: column; align-items: flex-start; color: var(--ink); text-decoration: none; }
.brand-wordmark { display: inline-block; font-size: 29px; font-weight: 800; line-height: 1; letter-spacing: -1.8px; }
.brand-cursor { color: var(--brand-accent); }
.brand-tagline { margin-top: 5px; color: var(--ink); font-size: 9px; font-weight: 400; letter-spacing: -.1px; line-height: 1; }
.brand-divider { width: 1px; height: 22px; margin-inline: 16px; background: var(--line); }
.brand-section { color: var(--muted); font-size: 13px; }
.header-nav { display: flex; align-items: center; gap: 25px; }
.header-link, .external-link { font-size: 13px; font-weight: 500; text-decoration: none; }
.external-link { color: var(--muted); }
.header-link span, .external-link span { margin-left: 5px; }
.header-link:hover, .external-link:hover, .site-footer a:hover { color: var(--brand-accent); text-decoration: underline; text-underline-offset: 4px; }

.game-section { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); grid-template-areas: "intro phone" "settings phone"; grid-template-rows: auto 1fr; gap: 36px; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 30px #0000001f; }
.intro { grid-area: intro; padding-top: 22px; }
.eyebrow { margin: 0 0 17px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .13em; line-height: 1.5; }
.intro > .eyebrow::before { content: ""; display: inline-block; width: 20px; height: 3px; margin-right: 9px; background: var(--brand-accent); vertical-align: middle; }
h1 { margin: 0 0 18px; font-size: 64px; font-weight: 650; line-height: 1.05; letter-spacing: -3px; }
.intro-copy { max-width: 350px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.game-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 23px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; }
.game-facts > * + *::before { content: "·"; margin-right: 16px; color: var(--muted); }
.jump-to-game { display: none; }
.game-settings { grid-area: settings; align-self: start; max-width: 380px; min-width: 0; padding-top: 23px; border-top: 1px solid var(--line); }
.settings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.settings-row { display: flex; align-items: flex-end; gap: 12px; }
.level-setting { flex: 1; display: block; min-width: 0; }
.level-setting > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.level-setting select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 28px 9px 10px; color: var(--ink); background: var(--paper); font-size: 12px; cursor: pointer; }
.level-setting select:disabled { opacity: .6; }
.sound-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 95px; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; color: var(--muted); background: var(--paper); font-size: 12px; white-space: nowrap; }
.sound-toggle:hover { border-color: var(--brand-accent); }
.sound-toggle[aria-pressed="true"] { color: var(--brand-accent); border-color: var(--brand-accent); background: #15312f; }
.sound-on-icon, .sound-toggle[aria-pressed="true"] .sound-off-icon { display: none; }
.sound-toggle[aria-pressed="true"] .sound-on-icon { display: block; }
.setting-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.desktop-hint { max-width: 360px; margin: 23px 0 0; color: var(--muted); font-size: 11px; line-height: 2; }
kbd { display: inline-block; min-width: 20px; margin-right: 2px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--paper); color: var(--ink); font: 11px/1.6 var(--sans); text-align: center; }

.phone-stage { grid-area: phone; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 22px 20px; background: var(--paper); border-radius: 12px; scroll-margin-top: 20px; }
.phone { width: 340px; max-width: 100%; padding: 19px 21px 15px; border: 2px solid #59616b; border-radius: 50px 50px 62px 62px / 50px 50px 70px 70px; background: linear-gradient(115deg, #4a5059, #333941 20%, #292f37 65%, #393f47); box-shadow: inset 0 2px 2px #ffffff26, inset 0 -3px 3px #171b20, 0 14px 24px -14px #20242a66; }
.phone-top { height: 58px; display: flex; flex-direction: column; align-items: center; }
.speaker { display: block; width: 58px; height: 5px; margin: 1px 0 12px; border-radius: 5px; background: repeating-linear-gradient(90deg, #161b21 0 2px, #555e68 2px 4px); box-shadow: 0 1px #69727d; }
.phone-wordmark { padding-left: .22em; color: #e5e8ec; font-size: 15px; font-weight: 700; line-height: 1; letter-spacing: .22em; }
.model-label { margin-top: 6px; color: #a9b1bb; font: 6px/1 var(--mono); letter-spacing: .16em; }
.lcd-frame { padding: 8px; border: 1px solid #1c2229; border-radius: 10px 10px 16px 16px; background: linear-gradient(145deg, #1d242b, #69727b); box-shadow: 0 1px #ffffff26; }
.lcd-screen { position: relative; overflow: hidden; border: 1px solid #233018; border-radius: 2px 2px 7px 7px; padding: 8px 8px 6px; color: var(--lcd-ink); background: var(--lcd); box-shadow: inset 0 2px 6px #29351f50; font-family: var(--mono); }
.lcd-screen::after { content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 2px, #32451e50 2px 3px); }
.lcd-topline { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #29351f66; padding-bottom: 5px; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: 1.5px; }
.lcd-signal { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: 0; }
.battery { position: relative; display: inline-block; width: 17px; height: 8px; border: 1px solid var(--lcd-ink); background: repeating-linear-gradient(90deg, transparent 0 1px, var(--lcd-ink) 1px 4px); }
.battery::after { content: ""; position: absolute; top: 1px; right: -3px; width: 2px; height: 4px; background: var(--lcd-ink); }
.scoreboard { display: flex; justify-content: space-between; margin: 8px 0; }
.scoreboard > div { display: flex; flex-direction: column; }
.score-label { font-size: 7px; line-height: 1.4; letter-spacing: 1.2px; }
.scoreboard output { font-size: 23px; font-weight: 700; line-height: 1.1; letter-spacing: 1px; }
.best-score { text-align: right; }
.playfield { position: relative; overflow: hidden; border: 2px solid var(--lcd-ink); background: var(--lcd); }
#game-canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; image-rendering: pixelated; }
#game-canvas:focus-visible { outline-color: var(--lcd-ink); outline-offset: -4px; }
.game-overlay { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; background: #a9b976ed; text-align: center; }
.game-overlay h2 { margin: 9px 0 6px; font: 700 25px/1.1 var(--mono); letter-spacing: -1.3px; text-transform: uppercase; }
.game-overlay p { max-width: 220px; margin: 0 0 10px; font: 9px/1.5 var(--mono); }
.game-overlay button { min-height: 44px; border: 1px solid var(--lcd-ink); padding: 9px 12px; background: transparent; color: var(--lcd-ink); box-shadow: 2px 2px var(--lcd-ink); font: 700 10px/1.4 var(--mono); }
.game-overlay button:hover { background: var(--lcd-ink); color: var(--lcd); }
.game-overlay button:focus-visible { outline-color: var(--lcd-ink); }
.game-overlay button:active { transform: translate(1px, 1px); box-shadow: 1px 1px var(--lcd-ink); }
.game-overlay button span[aria-hidden] { margin-left: 7px; font-size: 8px; }
.overlay-snake { position: relative; width: 61px; height: 23px; flex-shrink: 0; }
.overlay-snake i { position: absolute; top: 0; left: 0; width: 10px; height: 10px; background: var(--lcd-ink); }
.overlay-snake i:nth-child(2) { top: 11px; }
.overlay-snake i:nth-child(3) { top: 11px; left: 11px; }
.overlay-snake i:nth-child(4) { top: 11px; left: 22px; }
.overlay-snake i:nth-child(5) { top: 11px; left: 33px; }
.overlay-snake i:nth-child(6) { top: 11px; left: 44px; }
.overlay-snake i:nth-child(6)::after { content: ""; position: absolute; top: 2px; right: 2px; width: 2px; height: 2px; background: var(--lcd); }
.lcd-bottomline { display: flex; justify-content: space-between; gap: 6px; min-height: 17px; padding-top: 7px; font-size: 8px; font-weight: 700; letter-spacing: .5px; }
.phone-actions { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 7px; }
.phone-actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 82px; min-height: 44px; border: 0; padding: 4px 8px; background: transparent; color: #e4e8ed; font-size: 10px; }
.phone-actions button:disabled { opacity: .4; }
.phone button:focus-visible { outline-color: #dce2e9; outline-offset: 3px; }
.phone .game-overlay button:focus-visible { outline-color: var(--lcd-ink); }
.softkey-line { display: block; width: 43px; height: 5px; border-radius: 5px; background: linear-gradient(#929ca8, #56616d); box-shadow: 0 2px #171c22; }
.phone-actions button:not(:disabled):active .softkey-line { transform: translateY(1px); box-shadow: none; }
.phone-emblem { color: #929ca8; font-size: 10px; }
.direction-pad { display: grid; grid-template: repeat(3, 44px) / repeat(3, 1fr); gap: 5px 8px; width: 230px; max-width: 100%; margin: 0 auto; }
.direction-key { display: flex; align-items: center; justify-content: center; gap: 11px; min-height: 44px; border: 1px solid #737e8b; border-bottom-color: #1b222a; border-radius: 12px 12px 15px 15px; background: linear-gradient(170deg, #59636f, #414b57 70%); color: #edf0f4; box-shadow: 0 3px #192029, inset 0 1px 1px #ffffff14; user-select: none; -webkit-user-select: none; }
.direction-key:hover { background: linear-gradient(170deg, #687381, #4b5765); }
.direction-key:active, .direction-key.pressed { transform: translateY(2px); box-shadow: 0 1px #192029; }
.key-number { font-size: 18px; line-height: 1; }
.key-arrow { font-size: 8px; line-height: 1; opacity: .75; }
.key-up { grid-area: 1 / 2; }
.key-left { grid-area: 2 / 1; }
.key-right { grid-area: 2 / 3; }
.key-down { grid-area: 3 / 2; }
.key-center { grid-area: 2 / 2; display: grid; place-items: center; }
.key-center span { width: 23px; height: 23px; border: 1px solid #657180; border-radius: 50%; color: #97a2af; font-size: 14px; text-align: center; box-shadow: inset 0 1px 2px #1a222b; }
.phone-chin { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 13px 0 1px; }
.phone-chin span { width: 26px; height: 1px; background: #1c232c; box-shadow: 0 1px #5e6875; }
.phone-chin span:nth-child(2) { width: 19px; }
.phone-chin span:nth-child(3) { width: 12px; }
.stage-footnote { margin-top: 18px; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: center; }

.how-to { display: grid; grid-template-columns: 1.05fr repeat(3, 1fr); gap: 28px; padding: 42px 0; }
.how-heading .eyebrow { margin-bottom: 10px; }
.how-heading h2 { margin: 0; font-size: 23px; font-weight: 600; line-height: 1.3; letter-spacing: -.6px; }
.instruction-number { display: block; margin-bottom: 12px; color: var(--muted); font: 11px/1 var(--mono); }
.instruction h3 { margin: 0 0 7px; font-size: 13px; font-weight: 600; }
.instruction p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.rootpilot-promo { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-block: 1px solid var(--line); padding: 20px 0; }
.rootpilot-signature { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.promo-services { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; line-height: 1.6; }
.rootpilot-promo a { color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
.rootpilot-promo a span { margin-left: 8px; }
.rootpilot-promo a:hover { color: var(--brand-accent); text-decoration: underline; text-underline-offset: 4px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 0 26px; color: var(--muted); font-size: 11px; }
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.footer-actions { display: flex; align-items: center; gap: 18px; }
.footer-actions button { min-height: 44px; border: 0; padding: 8px 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.footer-actions button:hover { color: var(--brand-accent); }
.footer-actions button:disabled { opacity: .5; cursor: default; }
.noscript-message { position: fixed; inset: auto 12px 12px; z-index: 30; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface); box-shadow: 0 4px 20px #00000040; text-align: center; }

@media (max-width: 1000px) {
  .game-section { gap: 26px; padding: 28px; }
  .phone-stage { padding-inline: 15px; }
  .intro { padding-top: 12px; }
  .how-to { gap: 22px; }
  .settings-row { gap: 8px; }
  .sound-toggle { min-width: 88px; }
}
@media (max-width: 800px) {
  .site-header, main, .site-footer { width: calc(100% - 40px); }
  .site-header { height: 76px; }
  .game-section { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "phone" "settings"; grid-template-rows: auto; gap: 26px; padding: 26px; }
  .intro { padding-top: 0; }
  h1 { margin-bottom: 14px; font-size: 48px; letter-spacing: -2px; }
  .eyebrow { margin-bottom: 12px; }
  .intro-copy { max-width: 470px; font-size: 14px; }
  .game-facts { margin-top: 16px; }
  .jump-to-game { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 9px; font-size: 12px; font-weight: 600; text-underline-offset: 4px; }
  .phone-stage { padding: 25px 20px 18px; }
  .game-settings { max-width: none; padding-top: 23px; }
  .settings-row { gap: 12px; }
  .desktop-hint { max-width: none; }
  .how-to { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 32px 0; }
  .how-heading { grid-column: 1 / -1; }
  .how-heading h2 { font-size: 22px; }
  .site-footer { flex-wrap: wrap; gap: 6px 18px; }
}
@media (max-width: 600px) {
  .rootpilot-promo { flex-direction: column; align-items: flex-start; gap: 12px; }
  .header-nav .external-link { display: none; }
  .brand-divider { margin-inline: 12px; }
  .how-to { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .instruction { display: grid; grid-template-columns: 25px minmax(0, 1fr); column-gap: 10px; }
  .instruction-number { grid-column: 1; grid-row: 1 / 3; margin-bottom: 0; padding-top: 4px; }
  .instruction h3, .instruction p { grid-column: 2; }
  .footer-actions { flex-wrap: wrap; gap: 0 16px; }
}
@media (max-width: 420px) {
  .site-header, main, .site-footer { width: calc(100% - 32px); }
  .site-header { height: 70px; gap: 14px; }
  .brand-wordmark { font-size: 26px; }
  .brand-divider { margin-inline: 9px; }
  .brand-section, .header-link { font-size: 12px; }
  .game-section { gap: 22px; padding: 16px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  h1 { font-size: 44px; }
  .intro-copy { font-size: 13px; line-height: 1.7; }
  .game-facts { gap: 6px 12px; font-size: 10px; }
  .game-facts > * + *::before { margin-right: 12px; }
  .phone-stage { padding: 20px 10px 16px; border: 1px solid var(--line); border-radius: 8px; }
  .phone { padding: 17px 15px 13px; border-radius: 42px 42px 52px 52px; }
  .phone-top { height: 54px; }
  .lcd-frame { padding: 6px; }
  .lcd-screen { padding: 7px 6px 5px; }
  .scoreboard output { font-size: 21px; }
  .game-overlay { padding: 8px; }
  .overlay-snake { display: none; }
  .game-overlay h2 { margin: 0 0 6px; font-size: 22px; }
  .game-overlay p { margin-bottom: 8px; font-size: 8px; line-height: 1.4; }
  .game-overlay button { padding: 8px; font-size: 9px; }
  .direction-pad { width: 216px; gap: 5px; }
  .direction-key { gap: 7px; }
  .phone-actions button { min-width: 76px; padding-inline: 3px; font-size: 9px; }
  .stage-footnote { margin-top: 14px; font-size: 9px; }
  .settings-row { gap: 8px; }
  .level-setting select { padding-left: 8px; font-size: 11px; }
  .sound-toggle { min-width: 84px; gap: 5px; padding-inline: 7px; font-size: 11px; }
  .rootpilot-promo { gap: 14px; }
  .rootpilot-promo a { font-size: 11px; }
  .site-footer, .footer-actions button { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
