:root {
  color-scheme: dark;
  --bg: #0b1216;
  --panel: #101b20;
  --muted: #9fafb3;
  --ink: #edf5f2;
  --accent: #b6f36a;
  --line: #2b3b40;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
button, select { font: inherit; }
button, select { border: 1px solid #53656c; border-radius: 7px; background: #19272d; color: var(--ink); padding: 10px 16px; }
button { cursor: pointer; min-height: 44px; touch-action: manipulation; }
button:hover:enabled { background: #2b3e40; }
button:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.shell { max-width: 1220px; margin: auto; padding: 0 42px; }
.skip { position: absolute; top: -90px; background: var(--accent); color: var(--bg); padding: 12px; z-index: 3; }
.skip:focus { top: 8px; }
header { min-height: 104px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 20px; }
.brand { font-size: 25px; font-weight: 750; text-decoration: none; letter-spacing: -1px; }
.brand-icon { display: inline-block; font: 700 20px monospace; color: var(--accent); margin-right: 7px; }
.brand-dot { color: var(--accent); }
nav { display: flex; gap: 30px; align-items: center; font-size: 14px; }
nav a { text-decoration: none; }
.profile-link { border: 1px solid var(--line); border-radius: 30px; padding: 9px 18px; }
.intro { display: grid; grid-template-columns: 1fr 300px; gap: 55px; align-items: center; padding: 76px 0 64px; }
.eyebrow { font: 11px/1.5 ui-monospace, monospace; letter-spacing: 1.7px; margin: 0 0 18px; color: var(--muted); }
.signal { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; }
h1 { font-size: clamp(42px, 5.2vw, 68px); font-weight: 650; line-height: 1.08; letter-spacing: -3px; margin: 0 0 26px; }
h1 span { color: var(--accent); }
.lead { color: var(--muted); font-size: 17px; line-height: 1.8; margin: 0 0 23px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; font: 11px ui-monospace, monospace; }
.tags span { border: 1px solid var(--line); padding: 7px 12px; border-radius: 20px; color: #b7c9c8; }
.note { border-left: 1px solid var(--line); padding: 12px 0 12px 28px; }
.note-label { color: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: 2px; }
.note p { font-size: 23px; font-weight: 300; line-height: 1.6; }
.note strong { color: var(--accent); font-weight: 500; }
.note a { font-size: 13px; }
.arcade { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px; }
.arcade-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.arcade .eyebrow { color: var(--accent); margin-bottom: 6px; }
h2 { margin: 0; font-size: 26px; font-weight: 550; letter-spacing: -.7px; }
.arcade h2 span { color: var(--accent); }
.score { display: grid; grid-template-columns: auto auto; column-gap: 16px; align-items: center; font: 9px ui-monospace, monospace; color: var(--muted); }
.score strong { grid-row: span 2; grid-column: 2; color: var(--accent); font-size: 36px; line-height: 1.2; }
#remaining { font-size: 11px; }
.game-options { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 16px; }
.game-options label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 12px; }
select { font-size: 12px; max-width: 100%; }
.board-tag { color: var(--muted); font: 10px ui-monospace, monospace; }
.data-status { font-size: 11px; color: var(--muted); margin: 15px 0 10px; }
.game { position: relative; border: 1px solid #34494d; background: #081216; padding: 13px; border-radius: 8px; }
.grid { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); grid-template-rows: repeat(14, auto); grid-auto-flow: column; gap: 4px; }
.cell { aspect-ratio: 1; border-radius: 3px; }
.level-0 { background: #18292e; }
.level-1 { background: #1d503e; }
.level-2 { background: #307653; }
.level-3 { background: #53a669; }
.level-4 { background: #87cc73; }
.cell.food { background: #d3fba1; position: relative; box-shadow: 0 0 12px #b6f36a44; }
.cell.food::after { content: ""; position: absolute; inset: 34%; background: #13231b; border-radius: 50%; }
.cell.snake { background: #85bce2; }
.cell.head { background: #e6f4ff; position: relative; }
.cell.head::after { content: ""; position: absolute; width: 35%; height: 35%; background: #153449; border-radius: 1px; top: 20%; right: 15%; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 16px; text-align: center; gap: 10px; background: #081216dc; border-radius: 8px; pointer-events: none; }
.overlay[hidden] { display: none; }
.overlay-icon { color: var(--accent); font: 32px ui-monospace, monospace; }
.overlay strong { font-size: clamp(16px, 2vw, 23px); font-weight: 550; }
.overlay > span:last-child { color: #c1d0d0; font-size: 13px; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; }
.actions { display: flex; gap: 9px; flex-shrink: 0; }
.primary { background: var(--accent); color: #132116; border-color: var(--accent); font-weight: 650; min-width: 105px; }
button.primary:hover:enabled { background: #d0ff93; }
#game-status { color: #c1d0d0; font-size: 12px; max-width: 440px; margin: 0; }
.position { font: 11px/1.7 ui-monospace, monospace; color: var(--muted); }
.below-board { display: grid; grid-template-columns: 1fr 160px; align-items: center; gap: 36px; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 9px; }
#instructions p { font-size: 12px; color: var(--muted); margin: 8px 0; }
#read-position { margin-top: 5px; font-size: 12px; }
kbd { color: #dce5df; font: 11px ui-monospace, monospace; }
.dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 5px; justify-content: center; }
.dpad button { padding: 0; font-size: 22px; }
.dpad [data-direction="up"] { grid-column: 2; }
.dpad [data-direction="left"] { grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; text-align: center; align-self: center; color: var(--muted); }
.dpad [data-direction="right"] { grid-column: 3; grid-row: 2; }
.dpad [data-direction="down"] { grid-column: 2; grid-row: 3; }
.legend { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin-top: 23px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.legend-note { margin-left: auto; }
.explore { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 32px 0 60px; }
.explore a { padding: 27px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.explore a:hover { border-color: #698255; }
.explore a > span { font: 10px ui-monospace, monospace; color: var(--muted); letter-spacing: 1px; }
.explore h2 { font-size: 20px; margin-top: 15px; }
.explore h2 span { float: right; color: var(--accent); }
.explore p { font-size: 13px; color: var(--muted); margin-bottom: 0; }
footer { border-top: 1px solid var(--line); padding: 24px 0 35px; display: flex; justify-content: space-between; gap: 20px; font-size: 11px; color: var(--muted); }
.error { color: #ffd194; }
.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: 760px) {
  .shell { padding: 0 18px; }
  header { min-height: 84px; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
  nav { gap: 16px; font-size: 12px; }
  .brand { font-size: 22px; }
  .profile-link { padding: 6px 12px; }
  .intro { grid-template-columns: 1fr; padding: 44px 0 35px; gap: 28px; }
  h1 { letter-spacing: -2px; }
  .note { display: none; }
  .lead { font-size: 15px; }
  .arcade { padding: 18px 12px; }
  .arcade-heading { gap: 10px; }
  h2 { font-size: 20px; }
  .score { column-gap: 9px; font-size: 8px; }
  .score strong { font-size: 29px; }
  .board-tag { display: none; }
  .game { padding: 7px; }
  .grid { gap: 2px; }
  .cell { border-radius: 1px; }
  .game-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .below-board { grid-template-columns: 1fr; gap: 18px; }
  .dpad { grid-row: 1; }
  .legend-note { margin-left: 0; flex-basis: 100%; margin-top: 6px; }
  .explore { grid-template-columns: 1fr; gap: 12px; margin-bottom: 35px; }
  footer { flex-wrap: wrap; gap: 10px; }
}
@media (forced-colors: active) {
  .cell { border: 1px solid GrayText; }
  .cell.snake { background: Highlight; forced-color-adjust: none; }
  .cell.head { background: CanvasText; forced-color-adjust: none; }
  .cell.food { background: Mark; outline: 2px solid CanvasText; forced-color-adjust: none; }
}
