/* Hinton — first person in four dimensions: night teal, ana warm, kata cool, anchors cyan. */
:root {
  --bg: #04080b; --surface: #0c1820; --border: #1f3a46; --text: #e9f7f6; --dim: #8fb0b2;
  --ana: #ff9a55; --kata: #6aa8ff; --anchor: #36d9f2; --goal: #6dff94; --x: #ff6b6b; --y: #6be38a; --z: #efeafc; --w: #c27bff; --teal: #57e6c8;
  --mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; touch-action: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[hidden] { display: none !important; }
#app { position: fixed; inset: 0; }
#gl, #over { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#gl { image-rendering: auto; }
#over { pointer-events: none; }
#top { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 16px; align-items: flex-end; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; font-family: var(--mono); pointer-events: none;
  background: linear-gradient(rgba(4, 8, 11, 0.85), rgba(4, 8, 11, 0)); }
#top .h { display: flex; flex-direction: column; gap: 2px; }
#top .h.grow { margin-left: auto; align-items: flex-end; }
#top .lab { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
#top .val { font-size: 16px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#seeing { font-size: 14px !important; }
#seeing i { font-style: normal; }
#hint { position: absolute; left: 50%; transform: translateX(-50%); top: calc(58px + env(safe-area-inset-top)); width: max-content; max-width: min(560px, calc(100% - 24px)); display: flex; gap: 10px; align-items: flex-start;
  background: rgba(12, 24, 32, 0.9); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px 9px 13px; font-size: 13.5px; line-height: 1.5; color: #d9d2ee; }
#hint button { background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
#toast { position: absolute; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-family: var(--mono); font-size: 13px; background: rgba(12, 24, 32, 0.92);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; opacity: 0; transition: opacity .2s; pointer-events: none; width: max-content; max-width: calc(100% - 24px); text-align: center; }
#toast.show { opacity: 1; }
#pad { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; gap: 10px; }
#pad > * { pointer-events: auto; }
.cluster { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 44px); gap: 4px; }
.cluster [data-k="up"] { grid-column: 2; grid-row: 1; } .cluster [data-k="left"] { grid-column: 1; grid-row: 2; }
.cluster [data-k="right"] { grid-column: 3; grid-row: 2; } .cluster [data-k="down"] { grid-column: 2; grid-row: 3; }
.side { display: flex; flex-direction: column; gap: 6px; }
.side.small { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 200px; }
button.key, button.act { font-family: var(--mono); font-weight: 800; color: var(--text); background: rgba(12, 24, 32, 0.82); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
button.key { font-size: 16px; }
button.act { font-size: 13px; letter-spacing: 0.1em; padding: 12px 16px; min-width: 92px; }
.side.small button.act { min-width: 0; padding: 9px 11px; font-size: 14px; letter-spacing: 0; }
#hook.on { background: var(--anchor); color: #00222a; border-color: var(--anchor); box-shadow: 0 0 18px rgba(54, 217, 242, 0.5); }
@media (hover: hover) and (pointer: fine) { .cluster { opacity: 0.55; } }
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 18px; text-align: center; background: rgba(4, 8, 11, 0.9); backdrop-filter: blur(3px); overflow-y: auto; }
.overlay > :first-child { margin-top: auto; } .overlay > :last-child { margin-bottom: auto; }
.overlay h1 { font-family: var(--mono); font-size: clamp(34px, 11vw, 60px); margin: 0; letter-spacing: 0.22em;
  background: linear-gradient(90deg, var(--kata), var(--teal), var(--ana)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin: 0; font-weight: 600; }
.overlay p { margin: 0; color: var(--dim); font-size: 14.5px; line-height: 1.65; max-width: 36em; }
.overlay p b { color: var(--text); }
.overlay p b.ana { color: var(--ana); } .overlay p b.kata { color: var(--kata); } .overlay p b.anc { color: var(--anchor); }
.overlay .small { font-size: 13px; }
.overlay .foot { font-family: var(--mono); font-size: 12px; }
.overlay a { color: var(--dim); }
.overlay .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
button.primary, button.ghost { font-family: var(--mono); font-weight: 800; letter-spacing: 0.12em; border-radius: 10px; cursor: pointer; }
button.primary { background: linear-gradient(90deg, var(--kata), var(--teal), var(--ana)); color: #031512; border: 0; font-size: 15px; padding: 12px 26px; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); font-size: 13px; padding: 11px 18px; }
#level-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: min(560px, 100%); }
#level-list button { font-family: var(--mono); text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
#level-list button small { color: var(--dim); font-size: 11px; }
#level-list button.done { border-color: rgba(109, 255, 148, 0.5); }
#level-list button.par small { color: var(--goal); }
#level-list button:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 480px) { #top { gap: 11px; } #top .val { font-size: 14px; } .cluster { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 42px); } button.act { min-width: 80px; padding: 11px 12px; } }
#levels, #won { background: rgba(4, 8, 11, 0.97); }
#seeing .hid { color: var(--dim); font-weight: 400; }
#alt i, #seeing i { font-style: normal; }
#alt i { font-weight: 400; margin: 0 1px 0 3px; }
#gl { cursor: crosshair; touch-action: none; }
#pad { justify-content: flex-end; }
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; width: min(820px, 100%); text-align: left; }
.lane h3 { font-family: var(--mono); letter-spacing: 0.18em; font-size: 15px; margin: 0 0 4px; }
.lane h3.ak { color: var(--w); } .lane h3.ab { color: var(--ana); }
.lane p { font-size: 12.5px !important; margin: 0 0 8px !important; }
.lane .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.lane .list button { font-family: var(--mono); text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 8px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.lane .list button small { color: var(--dim); font-size: 10.5px; }
.lane .list button.done { border-color: rgba(109, 255, 148, 0.5); }
.lane .list button.par small { color: var(--goal); }
.lane .row { justify-content: flex-start; margin-top: 8px; }
.lane .row button { padding: 8px 11px; font-size: 11.5px; }
@media (max-width: 520px) { #seeing .hid { display: none; } }
@media (max-width: 560px) {
  #top { flex-wrap: wrap; row-gap: 4px; }
  #top .h.grow { margin-left: 0; align-items: flex-start; flex-basis: 100%; }
  #hint { top: calc(96px + env(safe-area-inset-top)); }
}
/* the touch stick: drawn where it rests, and under your thumb while you hold it */
#stick, #lookpad { display: none; }
body.touch #stick { display: block; position: absolute; left: 22px; top: calc(100% - 190px - env(safe-area-inset-bottom)); width: 104px; height: 104px; border-radius: 50%;
  border: 2px solid rgba(87, 230, 200, 0.45); background: radial-gradient(rgba(87, 230, 200, 0.10), rgba(87, 230, 200, 0.03)); pointer-events: none; opacity: 0.75; transition: opacity .15s; }
body.touch #stick.live { opacity: 1; transition: none; }
#knob { position: absolute; left: 32px; top: 32px; width: 40px; height: 40px; border-radius: 50%; background: rgba(87, 230, 200, 0.55); box-shadow: 0 0 14px rgba(87, 230, 200, 0.5); }
#stick span { position: absolute; left: 0; right: 0; top: 108px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
#stick.live span { display: none; }
body.touch #lookpad { display: block; position: absolute; right: 18px; top: 45%; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); opacity: 0.6; pointer-events: none; }
