/* KATABASIS — lamplight in a dark cave; the crystal is the only colour. */
:root { --bg: #050505; --text: #ece6dc; --dim: #9a9188; --border: #2c2824; --ice: #6fe0ff; --warm: #ffb46b;
  --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; }
[hidden] { display: none !important; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: fixed; left: 0; right: 0; top: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top)) 14px 6px; font: 12px var(--mono); color: var(--dim); pointer-events: none; background: linear-gradient(rgba(5, 5, 5, 0.75), rgba(5, 5, 5, 0)); }
#hud b { color: var(--text); } #lvl { color: var(--warm); letter-spacing: 0.08em; text-transform: uppercase; } .sep { opacity: 0.5; }
#hud button { pointer-events: auto; margin-left: auto; }
@media (max-width: 440px) { #hud { gap: 7px; font-size: 11px; } #hud .sep { display: none; } }
button.tiny { font: inherit; background: none; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 2px 9px; cursor: pointer; }
#line { position: fixed; left: 14px; right: 14px; top: calc(34px + env(safe-area-inset-top)); margin: 0; font-size: 13px; color: var(--dim); pointer-events: none; }
#msg { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); max-width: 86vw; text-align: center; font-size: 14px; color: var(--warm); background: rgba(5, 5, 5, 0.7); padding: 6px 12px; border-radius: 8px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#msg.show { opacity: 1; }
#stick { display: none; }
#flips { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, 52px); gap: 6px; }
#flips button { height: 44px; border-radius: 10px; border: 1px solid var(--border); background: rgba(10, 9, 8, 0.6); color: var(--text); font: 600 13px var(--mono); cursor: pointer; touch-action: none; }
#flips button[data-f="ana"], #flips button[data-f="kata"] { color: var(--ice); }
#flips button.tw { height: 36px; font-size: 12px; color: var(--ice); opacity: 0.85; }
@media (pointer: fine) { #flips { opacity: 0.55; } #flips:hover { opacity: 1; } }
@media (pointer: coarse) {
  #stick { display: block; position: fixed; left: 26px; bottom: calc(30px + env(safe-area-inset-bottom)); width: 110px; height: 110px; border-radius: 50%; border: 2px solid rgba(255, 180, 107, 0.35); pointer-events: none; }
  #stick.live { border-color: rgba(255, 180, 107, 0.7); }
  #knob { position: absolute; left: 34px; top: 34px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 180, 107, 0.45); }
}
.overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 18px; background: rgba(5, 5, 5, 0.9); overflow-y: auto; }
.overlay h1 { font: 800 clamp(34px, 8vw, 64px) var(--mono); letter-spacing: 0.22em; margin: 4px 0 14px; color: var(--warm); }
.overlay h2 { font: 600 11px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin: 0; }
.overlay p { max-width: 560px; line-height: 1.6; color: var(--dim); margin: 0 0 12px; } .overlay p b { color: var(--text); } b.ice { color: var(--ice) !important; }
.overlay .small { font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
button.primary, button.ghost { font-family: var(--mono); font-weight: 800; letter-spacing: 0.12em; border-radius: 10px; cursor: pointer; }
button.primary { background: var(--warm); color: #140c04; border: 0; font-size: 15px; padding: 12px 30px; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); font-size: 13px; padding: 10px 16px; }
button.ghost.small { font-size: 11px; padding: 7px 11px; font-weight: 600; letter-spacing: 0.04em; }
.foot { font-size: 12px; margin-top: 14px; } .foot a { color: var(--dim); }
