:root {
  --bg: #05060a;
  --fg: #f4f6ff;
  --muted: rgba(244, 246, 255, 0.6);
  --accent: #8be9fd;
  --card: rgba(12, 14, 24, 0.82);
  --card-border: rgba(255, 255, 255, 0.12);
  --danger: #ff6b81;
  --ok: #7cf5a0;
  --font: ui-sans-serif, -apple-system, "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 38% at 50% 50%, rgba(5,6,10,.55), rgba(5,6,10,0) 70%);
  pointer-events: none;
}
.hero {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}

.title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(2.2rem, 7.4vw, 7.5rem);   /* sized so "You are Spencer Fishman" still fits on one line */
  text-shadow:
    0 0 24px rgba(139, 233, 253, 0.35),
    0 0 80px rgba(255, 121, 198, 0.25);
  animation: rise 1.4s cubic-bezier(.2,.8,.2,1) both;
}
.title-line {
  font-weight: 300;
  opacity: 0.85;
  display: inline-block;
  transition: opacity .42s ease, transform .42s cubic-bezier(.4,0,.2,1), filter .42s ease;
}
.title-line.swap { opacity: 0; transform: translateY(-0.35em) rotateX(70deg); filter: blur(6px); }
.title-name {
  background: linear-gradient(100deg, #fff 0%, #cfefff 45%, #ffd6f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.contact {
  pointer-events: auto;
  margin-top: 28px;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s, letter-spacing .25s;
  animation: rise 1.4s .35s cubic-bezier(.2,.8,.2,1) both;
}
.contact:hover, .contact:focus-visible {
  color: var(--fg);
  border-color: var(--accent);
  letter-spacing: 0.26em;
  outline: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- Captcha overlay ---------- */

.captcha-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 4, 8, 0.55);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  animation: fade .3s ease both;
}
.captcha-root[hidden] { display: none; }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.card {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 22px 24px 24px;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.3) both;
}
.card.shake { animation: shake .4s ease; }

@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px) }
  20%, 80% { transform: translateX(4px) }
  30%, 50%, 70% { transform: translateX(-7px) }
  40%, 60% { transform: translateX(7px) }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.brand .logo {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 90deg, #8be9fd, #ff79c6, #ffb86c, #50fa7b, #8be9fd);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.stage-count { font-family: var(--mono); font-size: .75rem; color: var(--muted); }

.progress {
  height: 4px; border-radius: 4px; overflow: hidden;
  background: rgba(255,255,255,.08); margin-bottom: 18px;
}
.progress > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #8be9fd, #ff79c6);
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}

.card h2 { margin: 0 0 6px; font-size: 1.25rem; letter-spacing: -0.01em; }
.card p.sub { margin: 0 0 16px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.card .fine { font-size: .72rem; color: var(--muted); margin-top: 14px; line-height: 1.4; }

.msg {
  min-height: 1.2em; margin-top: 12px; font-size: .88rem;
}
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.btn {
  appearance: none; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: var(--fg);
  font: inherit; font-size: .95rem; padding: 10px 18px; border-radius: 10px;
  cursor: pointer; transition: background .2s, transform .1s, border-color .2s;
}
.btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: linear-gradient(120deg, #8be9fd, #ff79c6); color: #0b0c12; border: none; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

input[type="text"], input[type="number"] {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.35); color: var(--fg);
  width: 100%;
}
input:focus { outline: 2px solid rgba(139,233,253,.5); outline-offset: 1px; }

/* Stage: runaway checkbox */
.arena { position: relative; height: 150px; border-radius: 12px; border: 1px dashed rgba(255,255,255,.15); overflow: hidden; }
.robot-box {
  position: absolute; left: 16px; top: 55px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18); cursor: pointer; user-select: none;
  transition: left .18s cubic-bezier(.2,.9,.3,1.2), top .18s cubic-bezier(.2,.9,.3,1.2);
}
.robot-box .cb { width: 20px; height: 20px; border-radius: 5px; border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center; }
.robot-box.checked .cb { background: var(--ok); border-color: var(--ok); color: #05060a; }

/* Stage: image grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tile {
  aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(1.4rem, 5vw, 2.2rem);
  border-radius: 8px; background: rgba(255,255,255,.05); border: 2px solid transparent; cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s; user-select: none;
}
.tile:hover { transform: scale(1.04); }
.tile.sel { border-color: var(--accent); background: rgba(139,233,253,.15); }
.tile.blur { filter: blur(1.2px) contrast(1.4); }
.tile.rot { transform: rotate(var(--r)); }
.tile.rot:hover { transform: rotate(var(--r)) scale(1.04); }

/* Stage: slider */
.slider-wrap { display: flex; flex-direction: column; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.big-num { font-family: var(--mono); font-size: 2rem; text-align: center; letter-spacing: .05em; }
.flip { display: inline-block; transform: rotate(180deg); }

/* Stage: distorted text */
.distort { width: 100%; height: 110px; border-radius: 10px; display: block; background: #0a0c14; border: 1px solid rgba(255,255,255,.12); }

/* Stage: hold button */
.hold {
  position: relative; width: 100%; height: 64px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.05);
  font: inherit; color: var(--fg); font-size: 1rem; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.hold > i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(139,233,253,.35), rgba(255,121,198,.35)); }
.hold > span { position: relative; }
.timer { font-family: var(--mono); font-size: 1.6rem; text-align: center; margin-top: 10px; }

/* Stage: stroop */
.stroop {
  width: 100%; height: 120px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  font-size: 2.6rem; font-weight: 800; letter-spacing: .08em; cursor: pointer; user-select: none;
}

/* Stage: who is spencer */
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.face { aspect-ratio: 1; display: grid; place-items: center; font-size: 2.6rem; border-radius: 12px; background: rgba(255,255,255,.05); cursor: pointer; border: 2px solid transparent; transition: transform .12s; }
.face:hover { transform: scale(1.05); }
.face.sel { border-color: var(--accent); }

/* Stage: terms */
.terms {
  height: 180px; overflow: auto; padding: 12px 14px; border-radius: 10px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12);
  font-size: .78rem; line-height: 1.5; color: var(--muted); font-family: var(--mono);
}
.terms h4 { margin: 14px 0 4px; color: var(--fg); }
label.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: .9rem; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Stage: verifying */
.verify { text-align: center; padding: 10px 0 4px; }
.verify .pct { font-family: var(--mono); font-size: 2.4rem; }
.verify .bar { height: 10px; border-radius: 10px; background: rgba(255,255,255,.08); overflow: hidden; margin: 14px 0; }
.verify .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #50fa7b, #8be9fd); transition: width .25s linear; }
.verify .status { color: var(--muted); font-size: .88rem; min-height: 1.3em; }

/* Stage: keypad / sequence */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad .btn { font-size: 1.3rem; padding: 14px; font-family: var(--mono); }
.seq { font-family: var(--mono); letter-spacing: .4em; font-size: 1.4rem; text-align: center; min-height: 1.6em; margin: 10px 0; }

/* ---------- Rainbow ---------- */

.rainbow-root {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden;
}
.rainbow-root[hidden] { display: none; }
.rainbow-root svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rainbow-root path {
  fill: none; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.6s cubic-bezier(.65,0,.25,1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.rainbow-text {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0) rotate(-8deg);
  font-size: clamp(1.8rem, 10.5vw, 9rem); font-weight: 900; letter-spacing: -0.03em; white-space: nowrap;
  background: linear-gradient(90deg, #ff3b3b, #ff9f1c, #ffe72e, #35e05a, #2bb7ff, #6a5cff, #d04bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 8px 0 rgba(0,0,0,.55)) drop-shadow(0 0 30px rgba(255,255,255,.35));
  animation: jump 1.1s 1.5s cubic-bezier(.2,1.6,.3,1) forwards, hue 3s 2.6s linear infinite;
}
@keyframes jump {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-8deg); }
  60% { transform: translate(-50%, -50%) scale(1.15) rotate(3deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
}
@keyframes hue { to { filter: hue-rotate(360deg) drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 8px 0 rgba(0,0,0,.55)); } }

.sparkle {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; opacity: 0;
  animation: sparkle 1.4s ease-out forwards;
}
@keyframes sparkle {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

@media (prefers-reduced-motion: reduce) {
  .title, .contact, .card { animation: none; }
}

/* ---------- secret key cheat sheet (hold ?) ---------- */
.keys-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 10, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.keys-root[hidden] { display: none; }
.keys {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 20px 22px 18px;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.3) both;
}
.keys-title {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.keys-now {
  margin-top: 6px;
  font-size: 1.15rem;
  font-weight: 600;
  background: linear-gradient(90deg, #8be9fd, #ff79c6, #f1fa8c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.keys-list { margin: 16px 0 0; }
.keys-list > div {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.keys-list dt { margin: 0; display: flex; gap: 6px; min-width: 76px; }
.keys-list dd { margin: 0; color: var(--muted); font-size: 0.95rem; }
kbd {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--fg);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 2px 0 rgba(0,0,0,.5);
}

/* ---------- style & shape menu (m) ---------- */
.menu-root {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 10, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.menu-root[hidden] { display: none; }
.menu {
  width: min(640px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 20px 22px 16px;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.3) both;
}
.menu-title {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.menu-cols {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 2fr;
  gap: 14px;
}
.menu-head {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 6px;
}
.menu-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  height: min(46vh, 380px);     /* fixed, so the menu never resizes between styles */
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
  scrollbar-width: thin;
}
.menu-list.focus { border-color: rgba(139, 233, 253, .35); }
.menu-list li {
  position: relative;
  padding: 8px 12px 8px 26px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-list li:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.menu-list li.peek { color: var(--fg); }
.menu-list li.cur {
  color: var(--fg);
  background: linear-gradient(90deg, rgba(139,233,253,.22), rgba(255,121,198,.12));
}
.menu-list li.cur::before {
  content: '›';
  position: absolute;
  left: 11px;
  color: var(--accent);
  font-weight: 700;
}
.menu-list li.active::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8be9fd, #ff79c6);
  box-shadow: 0 0 10px rgba(255,121,198,.7);
}
.menu-foot {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.menu-foot kbd { padding: 4px 6px; font-size: 0.72rem; }
@media (max-width: 520px) {
  .menu-cols { grid-template-columns: 1fr; }
  .menu-list { height: 28vh; }
}

/* ---------- shift-drag orbit ---------- */
body.orbiting, body.orbiting * { cursor: grabbing !important; user-select: none; }
.keys-list .plus { color: var(--muted); align-self: center; font-size: 0.8rem; }

/* ---------- pause / play indicator (space) ---------- */
.play-state {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12, 14, 24, 0.55);
  color: var(--fg);
  cursor: pointer;
  opacity: 0.28;
  transition: opacity .6s ease, transform .3s ease, box-shadow .3s ease;
}
.play-state:hover { opacity: 0.8; }
.play-state.hidden { opacity: 0; pointer-events: none; }
.play-state svg { width: 16px; height: 16px; fill: currentColor; grid-area: 1 / 1; }
.play-state .icon-pause { display: none; }
.play-state.paused .icon-play { display: none; }
.play-state.paused .icon-pause { display: block; }
.play-state.paused {
  opacity: 0.95;
  color: var(--accent);
  border-color: rgba(139, 233, 253, .45);
  box-shadow: 0 0 18px rgba(139, 233, 253, .35);
}
.play-state.flash { animation: statePop .5s cubic-bezier(.2,.9,.3,1.3); }
@keyframes statePop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- music pill (fish style): now playing, click to play / pause ---------- */
.music {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(70vw, 420px);
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 19px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(12, 14, 24, 0.55);
  color: var(--fg);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0.32;
  transition: opacity .6s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.music[hidden] { display: none; }
.music:hover, .music:focus-visible { opacity: 0.9; outline: none; }
.music svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.music span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music.playing svg { animation: bounce 0.48s ease-in-out infinite alternate; }
.music.blocked {
  opacity: 0.95;
  color: var(--accent);
  border-color: rgba(139, 233, 253, .45);
  box-shadow: 0 0 18px rgba(139, 233, 253, .35);
  animation: beckon 1.6s ease-in-out infinite;
}
@keyframes bounce { from { transform: translateY(1px) scale(.95); } to { transform: translateY(-2px) scale(1.08); } }
@keyframes beckon { 50% { box-shadow: 0 0 28px rgba(139, 233, 253, .6); } }
/* The YouTube player is audio only as far as the page is concerned: parked off-screen, never display:none. */
#yt-player { position: fixed; left: -9999px; top: 0; width: 200px; height: 200px; border: 0; pointer-events: none; }

/* ---------- tron (cyberfish) ---------- */
.game-prompts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-prompts[hidden] { display: none; }
.offline-badge {
  font: 500 0.66rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffb86c;
  border: 1px solid rgba(255, 184, 108, .4);
  border-radius: 10px;
  padding: 4px 8px;
  opacity: 0.8;
}
.offline-badge[hidden] { display: none; }
.tron-prompt {
  padding: 0 14px;
  height: 34px;
  border-radius: 17px;
  border: 1px solid rgba(139, 233, 253, .3);
  background: rgba(12, 14, 24, 0.55);
  color: var(--accent);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity .6s ease, box-shadow .3s ease;
}
.tron-prompt kbd {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  border: 1px solid rgba(139, 233, 253, .5);
  border-radius: 4px;
  font: inherit;
}
.tron-prompt:hover, .tron-prompt:focus-visible { opacity: 1; box-shadow: 0 0 18px rgba(139, 233, 253, .35); outline: none; }
.tron-prompt[hidden] { display: none; }
.game-hud {
  position: fixed;
  left: 0; right: 0;
  top: 14%;
  z-index: 20;
  text-align: center;
  pointer-events: none;
  font-family: var(--mono);
  color: #8be9fd;
  text-shadow: 0 0 12px rgba(139, 233, 253, .8), 0 0 40px rgba(255, 60, 220, .4);
}
.game-hud[hidden] { display: none; }
.game-hud .tron-line { font-size: clamp(2rem, 7vw, 5rem); font-weight: 700; letter-spacing: 0.12em; line-height: 1; }
.game-hud .tron-sub { margin-top: 10px; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
.game-hud.play { top: auto; bottom: 70px; }
.game-hud.play .tron-sub { opacity: 0.55; }
.game-hud.lose .tron-line { color: #ff3cdc; text-shadow: 0 0 12px rgba(255, 60, 220, .9), 0 0 40px rgba(255, 60, 220, .5); }
.game-hud.count .tron-line { animation: statePop .5s cubic-bezier(.2,.9,.3,1.3); }
body.game .music, body.game .play-state { opacity: 0.12; }
body.game .contact { animation: none; opacity: 0; transform: translateY(40px); transition: opacity .5s ease, transform .5s ease; }   /* animation: none, or the entrance animation's fill keeps it at full opacity */
body.game .hero::before { opacity: 0; }
.hero::before { transition: opacity 1s ease; }
.title .ch {
  display: inline-block;
  will-change: transform, opacity;
  transition: transform 1.1s cubic-bezier(.3,0,.8,.4), opacity 1s ease;
}
body.title-gone .title { pointer-events: none; }
.game-hud.reef { color: #bfeeff; text-shadow: 0 0 12px rgba(120, 220, 255, .7), 0 0 40px rgba(60, 160, 255, .35); }
.game-hud.reef.lose .tron-line { color: #ff8a6b; text-shadow: 0 0 12px rgba(255, 120, 90, .9), 0 0 40px rgba(255, 90, 60, .5); }
.game-hud.reef.win .tron-line { color: #ffe08a; text-shadow: 0 0 14px rgba(255, 220, 120, .9), 0 0 50px rgba(255, 200, 80, .5); }
#reef-prompt { color: #bfeeff; border-color: rgba(191, 238, 255, .3); }

/* ---------- leaderboard (both games) ---------- */
.game-hud .gb-entry, .game-hud .gb-board, .game-hud .gb-touch { pointer-events: auto; }
.game-hud .gb-entry[hidden], .game-hud .gb-board[hidden], .game-hud .gb-touch[hidden] { display: none; }
.game-hud .gb-entry { margin-top: 18px; }
.game-hud .gb-input {
  width: 14ch;
  font: 700 1.4rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: #8be9fd;
  background: rgba(12, 14, 24, 0.65);
  border: 1px solid rgba(139, 233, 253, .55);
  border-radius: 8px;
  padding: 10px 12px;
  caret-color: #ff3cdc;
  box-shadow: 0 0 18px rgba(139, 233, 253, .35), inset 0 0 12px rgba(139, 233, 253, .12);
}
.game-hud .gb-input:focus { outline: none; border-color: #ff3cdc; box-shadow: 0 0 24px rgba(255, 60, 220, .5); }
.game-hud .gb-input:disabled { opacity: 0.6; }
.game-hud .gb-hint { margin-top: 10px; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.75; }
.game-hud .gb-entry.shake { animation: shake .4s ease; }
.game-hud .gb-board {
  margin: 18px auto 0;
  width: min(380px, 92vw);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(139, 233, 253, .3);
  background: rgba(12, 14, 24, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  text-shadow: none;
}
.game-hud .gb-title { font-size: 0.7rem; letter-spacing: 0.22em; opacity: 0.7; margin-bottom: 6px; }
.game-hud .gb-list { list-style: none; margin: 0; padding: 0; }
.game-hud .gb-list li { display: grid; grid-template-columns: 3ch 1fr auto 3.5ch; gap: 10px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.07); }
.game-hud .gb-list li.me { color: #ff3cdc; text-shadow: 0 0 12px rgba(255, 60, 220, .8); }
.game-hud .gb-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-hud .gb-list .sc { text-align: right; font-weight: 700; }
.game-hud .gb-list .ago, .game-hud .gb-foot { color: var(--muted); }
.game-hud .gb-foot { margin-top: 8px; font-size: 0.68rem; letter-spacing: 0.14em; white-space: pre-wrap; }
.game-hud .gb-touch { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.game-hud .gb-touch button[hidden] { display: none; }
.game-hud.reef .gb-input { color: #bfeeff; border-color: rgba(191, 238, 255, .55); caret-color: #ffe08a; box-shadow: 0 0 18px rgba(120, 220, 255, .3); }
.game-hud.reef .gb-input:focus { border-color: #ffe08a; box-shadow: 0 0 24px rgba(255, 224, 138, .45); }
.game-hud.reef .gb-board { border-color: rgba(191, 238, 255, .3); }
.game-hud.reef .gb-list li.me { color: #ffe08a; text-shadow: 0 0 12px rgba(255, 224, 138, .8); }
.game-hud.board { top: 14%; }

/* key chips in the game HUDs */
.game-hud .hud-text { display: block; }
.game-hud .hud-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 14px; }
.game-hud .hk { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.9; }
.game-hud .hk kbd {
  font: 600 0.7rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: rgba(12, 14, 24, 0.55);
  box-shadow: 0 0 10px rgba(139, 233, 253, .25);
}
.game-hud.reef .hk kbd { box-shadow: 0 0 10px rgba(120, 220, 255, .25); }
.game-hud .gb-hint .hud-keys { margin-top: 8px; }

/* ---------- phones and touch screens ---------- */
/* Narrow screens: the music pill, the game pills and the play glyph cannot share one row, so the
   game pills get their own row above the other two. */
@media (max-width: 640px) {
  .game-prompts { bottom: 68px; width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center; }
  .game-hud { padding: 0 16px; }
  .game-hud .tron-sub { font-size: 0.72rem; letter-spacing: 0.12em; }
}
.touch-only { display: none; }                      /* wording that only makes sense with a finger ("tap to play") */
/* No keyboard: drop every key hint (the chips in the pills and the HUD) and the leaderboard pill,
   which is one tap away after a round anyway; pills get bigger and brighter since nothing hovers. */
@media (pointer: coarse) {
  .tron-prompt kbd, .game-hud .hud-keys, #tron-board-prompt, #reef-board-prompt { display: none; }
  .tron-prompt { height: 40px; padding: 0 16px; opacity: 0.7; }
  .touch-only { display: inline; }
}
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }   /* no double-tap zoom: Tron is steered with quick taps */
body.game { touch-action: none; }                   /* a finger dragged across the reef must stay a pointer, not become a scroll */
/* Tron on touch: edge markers that say where to tap, shown through the countdown and the first taps */
.turn-hints[hidden] { display: none; }
.turn-hints span {
  position: fixed; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 500 0.66rem/1.35 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-align: center;
  color: #8be9fd; opacity: 0.95; animation: hintPulse 1.4s ease-in-out infinite;
}
@keyframes hintPulse { 50% { opacity: 0.55; transform: translateY(-50%) scale(0.94); } }
.turn-hints span:first-child { left: 14px; }
.turn-hints span:last-child { right: 14px; }
.turn-hints b { font-size: 2.2rem; line-height: 1; font-weight: 400; text-shadow: 0 0 14px rgba(139, 233, 253, .9); }

/* ---------- tron online: the lobby card and the pill's offline marker ---------- */
.pill-off { color: #ffb86c; }
.pill-off[hidden] { display: none; }
.game-hud .tron-lobby .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); vertical-align: middle; }
.game-hud .tron-lobby .ago { text-align: right; }
.game-hud.lobby .gb-entry { margin-top: 10vh; }
