/* ------------------------------------------------------------------ *
 * KRILLION
 * ------------------------------------------------------------------ */

:root {
  --ink:        #dbe9f2;
  --ink-dim:    #7d94a8;
  --ink-faint:  #4d6274;
  --pink:       #ff4d6d;
  --pink-deep:  #b32c47;
  --cyan:       #6fd6ef;
  --cyan-deep:  #2b7f9b;
  --gold:       #ffd166;
  --panel:      #0b1a2c;
  --panel-solid:#081525;
  --line:       #2a4260;
  --abyss:      #040c17;

  --font-body: 'DotGothic16', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-display: 'Press Start 2P', var(--font-body);

  --track-wide: 0.22em;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

button,
summary,
input,
.mode-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #02070d;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: none;
  font-smooth: never;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  /* Faint glow behind the letterbox bars on wide screens. */
  background:
    radial-gradient(120% 80% at 50% 0%, #0a1a2b 0%, #02070d 70%);
}

/* Fixed rather than flex centred: on iOS the body's 100% and 100dvh disagree
   as the URL bar slides, which pushed the bottom of the app (every primary
   button) out of reach. --app-h is kept in sync with the visual viewport, so
   the keyboard opening shrinks the box instead of hiding it. */
.app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 560px;
  height: 100%;
  height: var(--app-h, 100%);
  overflow: hidden;
  background: var(--abyss);
  isolation: isolate;
  box-shadow: 0 0 0 1px rgba(111, 214, 239, 0.06), 0 0 60px rgba(0, 0, 0, 0.8);
}

/* ---------------------------------------------------------------- *
 * Backdrop layers
 * ---------------------------------------------------------------- */

.ocean {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 1;
}

.grain {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0.55;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.20) 0px,
    rgba(0, 0, 0, 0.20) 1px,
    rgba(255, 255, 255, 0.012) 1px,
    rgba(255, 255, 255, 0.012) 3px
  );
  mix-blend-mode: multiply;
}

.vignette {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 13;
  pointer-events: none;
  background: radial-gradient(115% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* Depth ruler down the right edge */
.ruler {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62px;
  z-index: 11;
  pointer-events: none;
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(219, 233, 242, 0.32);
}

.ruler .tick {
  position: absolute;
  right: 0;
  width: 100%;
  height: 0;
  transform: translateY(-50%);
}

.ruler .tick::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 0;
  width: 7px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.ruler .tick.major::after { width: 13px; opacity: 0.75; }

.app.is-title .ruler .tick span { display: none; }
.app.is-title .ruler { opacity: 0.5; }

.ruler .tick span {
  position: absolute;
  right: 22px;
  top: -7px;
  white-space: nowrap;
}

.ruler .tick.muted span { display: none; }
.ruler .tick.muted::after { opacity: 0.25; }

.ruler .you {
  position: absolute;
  right: 0;
  width: 100%;
  transform: translateY(-50%);
  color: var(--pink);
  opacity: 0.95;
}

.ruler .you span {
  position: absolute;
  right: 26px;
  top: -7px;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.ruler .you::after {
  content: '';
  position: absolute;
  right: 2px;
  top: -4px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 7px solid var(--pink);
}

/* ---------------------------------------------------------------- *
 * Pixel frame helper
 * ---------------------------------------------------------------- */

.cut {
  --frame: var(--line);
  border: 0;
  background: var(--panel-solid);
  box-shadow:
     0 -2px 0 0 var(--frame),
     0  2px 0 0 var(--frame),
    -2px 0 0 0 var(--frame),
     2px 0 0 0 var(--frame);
}

/* ---------------------------------------------------------------- *
 * HUD
 * ---------------------------------------------------------------- */

.hud {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 10px;
  right: 10px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.hud[hidden] { display: none; }

/* The centre column has no panel of its own, so the strip gets a soft scrim.
   Without it the pip row vanishes whenever the boat drifts behind it. */
.hud::before {
  content: '';
  position: absolute;
  top: calc(-10px - var(--safe-top));
  right: -14px;
  bottom: -22px;
  left: -14px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(3, 10, 19, 0.72), rgba(3, 10, 19, 0.3) 68%, transparent);
  pointer-events: none;
}

.hud-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 11px 7px;
  min-width: 86px;
  background: rgba(8, 21, 37, 0.92);
}

.hud-box.align-right { align-items: flex-end; }

.hud-label {
  font-size: 9px;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hud-value {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.hud-value.depth { color: var(--cyan); }
.hud-value.score { color: var(--pink); }

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
  flex: 1;
}

.pips {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.pip {
  width: 15px;
  height: 15px;
  background: rgba(8, 21, 37, 0.9);
  box-shadow: inset 0 0 0 2px rgba(42, 66, 96, 0.9);
}

.pip.is-now {
  box-shadow: inset 0 0 0 2px var(--pink);
  background: rgba(255, 77, 109, 0.28);
  animation: pipPulse 1.1s steps(2, end) infinite;
}

.pip.is-done { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45); }
.pip.is-fail { background: #2a1420 !important; box-shadow: inset 0 0 0 2px #6d2438; }

@keyframes pipPulse { 50% { opacity: 0.45; } }

.hud-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #8ea3b6;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.air { display: flex; gap: 5px; }

.air i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(111, 214, 239, 0.85);
  box-shadow: 0 0 6px rgba(111, 214, 239, 0.5);
}

.air i.spent {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(125, 148, 168, 0.5);
}

/* ---------------------------------------------------------------- *
 * Mute
 * ---------------------------------------------------------------- */

.mute {
  position: absolute;
  top: calc(74px + var(--safe-top));
  right: 12px;
  z-index: 31;
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(38, 50, 62, 0.9);
  --frame: rgba(120, 140, 160, 0.5);
}

.app.is-title .mute { top: calc(16px + var(--safe-top)); }

.mute-icon {
  display: block;
  width: 20px;
  height: 16px;
  background: var(--ink);
  clip-path: polygon(0 30%, 30% 30%, 60% 0, 60% 100%, 30% 70%, 0 70%);
}

.mute::after {
  content: '';
  position: absolute;
  right: 8px;
  width: 8px;
  height: 2px;
  background: var(--ink);
  transform: rotate(0deg);
}

.mute[aria-pressed='true'] .mute-icon { background: var(--ink-faint); }
.mute[aria-pressed='true']::after {
  background: var(--pink);
  transform: rotate(-45deg);
  width: 16px;
  right: 6px;
}

/* ---------------------------------------------------------------- *
 * Screens
 * ---------------------------------------------------------------- */

.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: calc(78px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  gap: 12px;
}

.screen[hidden] { display: none; }

/* ---- Title ---- */

.screen-title {
  justify-content: space-between;
  padding-top: calc(66px + var(--safe-top));
  text-align: center;
}

/* The title sits over bright sky, so its text runs dark instead of light. */
.screen-title .logo-sub { color: #6d9ab2; }
.screen-title .tagline { color: #5b8299; }

.title-top { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.logo {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 11.5vw, 54px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: -1;
}

.logo::before { color: var(--pink); transform: translate(-3px, 0); }
.logo::after  { color: var(--cyan); transform: translate(3px, 0); }

.app.is-title .logo::before { animation: glitchA 4.5s steps(1, end) infinite; }
.app.is-title .logo::after  { animation: glitchB 4.5s steps(1, end) infinite; }

@keyframes glitchA {
  0%, 88%, 100% { transform: translate(-3px, 0); }
  90% { transform: translate(-6px, -2px); }
  93% { transform: translate(-1px, 2px); }
  96% { transform: translate(-5px, 1px); }
}
@keyframes glitchB {
  0%, 88%, 100% { transform: translate(3px, 0); }
  90% { transform: translate(6px, 2px); }
  93% { transform: translate(1px, -2px); }
  96% { transform: translate(5px, -1px); }
}

.logo-sub {
  margin: 0;
  font-size: clamp(11px, 3.6vw, 15px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(111, 214, 239, 0.55);
  text-transform: uppercase;
}

.tagline {
  margin: 0;
  max-width: 22em;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(219, 233, 242, 0.5);
}

.title-bottom {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Scrim so the controls stay legible over kelp and light rays. */
.title-bottom::before {
  content: '';
  position: absolute;
  top: -24px;
  right: -20px;
  bottom: calc(-24px - var(--safe-bottom));
  left: -20px;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, rgba(4, 12, 23, 0.82) 22%, rgba(4, 12, 23, 0.92));
  pointer-events: none;
}

.mode-row { display: flex; gap: 8px; }

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 6px 11px;
  cursor: pointer;
  color: var(--ink-dim);
  font-family: inherit;
  background: rgba(8, 21, 37, 0.85);
  --frame: rgba(42, 66, 96, 0.9);
  transition: color 0.12s;
}

.mode-name { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.mode-note { font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); }

.mode-btn.is-active { color: var(--cyan); --frame: var(--cyan-deep); background: rgba(14, 42, 60, 0.9); }
.mode-btn.is-active .mode-note { color: rgba(111, 214, 239, 0.6); }

.how {
  text-align: left;
  font-size: 12px;
  color: var(--ink-dim);
}

.how summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 2px;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-faint);
}

.how summary::-webkit-details-marker { display: none; }
.how .caret { display: inline-block; transition: transform 0.15s; font-size: 9px; }
.how[open] .caret { transform: rotate(90deg); }

.how-body {
  max-height: min(38vh, 320px);
  overflow-y: auto;
  padding: 10px 12px 12px;
  line-height: 1.75;
  /* The panel carries its own ground: it opens over bright sky. */
  background: rgba(4, 12, 23, 0.94);
  border-top: 1px solid rgba(42, 66, 96, 0.7);
}

.how[open] summary { background: rgba(4, 12, 23, 0.94); }

.how-body p { margin: 8px 0; }
.how-body b { color: var(--ink); font-weight: normal; text-decoration: underline; }

.ladder { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 3px; }

.ladder li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.ladder i {
  width: 8px;
  height: 8px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.ladder .lad-depth { color: var(--ink-faint); letter-spacing: 0.04em; }

.engine-note {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-align: center;
  min-height: 12px;
}

/* ---- Buttons ---- */

.big-btn {
  width: 100%;
  padding: 16px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(15px, 4.6vw, 19px);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(10, 27, 45, 0.94);
  --frame: var(--cyan);
  transition: background 0.12s, color 0.12s;
}

.big-btn:hover { background: rgba(20, 52, 74, 0.96); }
.big-btn:active { transform: translateY(1px); }
.big-btn .arrow { color: var(--cyan); font-size: 0.8em; }

.ghost-btn {
  flex: 1;
  padding: 11px 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(8, 21, 37, 0.9);
  --frame: rgba(42, 66, 96, 0.9);
}

.ghost-btn:hover { color: var(--ink); --frame: var(--ink-faint); }

button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.answer-input:focus-visible {
  outline: none;
  --frame: #a6e9fb;
  background: rgba(12, 30, 48, 0.95);
}

/* ---- Play ---- */

.screen-play,
.screen-reveal { padding-top: calc(122px + var(--safe-top)); }

.screen-play { justify-content: space-between; }

.prompt-card {
  position: relative;
  padding: 16px 18px 14px;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 4px),
    rgba(7, 18, 31, 0.94);
  --frame: rgba(30, 52, 78, 0.95);
  box-shadow:
     0 -2px 0 0 var(--frame),
     0  2px 0 0 var(--frame),
    -2px 0 0 0 var(--frame),
     2px 0 0 0 var(--frame),
     7px 9px 0 rgba(2, 8, 15, 0.5);
  animation: cardIn 0.32s ease-out both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

.prompt-kicker {
  font-size: 11px;
  letter-spacing: var(--track-wide);
  color: var(--pink);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.prompt-text {
  margin: 0 0 10px;
  font-size: clamp(19px, 6.2vw, 27px);
  font-weight: normal;
  line-height: 1.32;
  letter-spacing: 0.01em;
  color: #f2f8fc;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.prompt-hint {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.prompt-hint .arrow { color: rgba(111, 214, 239, 0.5); }

.prompt-card.is-waiting { opacity: 0.55; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: auto;
  font-size: 11px;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.loading[hidden] { display: none; }

.loading-dots { display: flex; gap: 4px; }
.loading-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cyan);
  animation: bob 0.9s ease-in-out infinite;
}
.loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.loading-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.answer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.timer {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) calc(var(--p, 1) * 360deg), rgba(111, 214, 239, 0.12) 0);
  display: grid;
  place-items: center;
  transition: background 0.1s linear;
}

.timer-face {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(6, 17, 31, 0.95);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(111, 214, 239, 0.25);
}

.timer.low { background: conic-gradient(var(--pink) calc(var(--p, 1) * 360deg), rgba(255, 77, 109, 0.14) 0); }
.timer.low .timer-face { color: var(--pink); animation: tick 1s steps(2, end) infinite; }
@keyframes tick { 50% { opacity: 0.45; } }

.answer-input {
  flex: 1;
  min-width: 0;
  padding: 17px 14px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(6, 17, 31, 0.9);
  --frame: var(--cyan);
}

.answer-input::placeholder { color: rgba(111, 214, 239, 0.4); }
.answer-input:disabled { opacity: 0.5; }

.dive-btn {
  flex: 0 0 auto;
  padding: 17px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: #fff;
  background: var(--pink-deep);
  --frame: var(--pink);
}

.dive-btn:hover { background: #cf3557; }
.dive-btn:disabled { opacity: 0.45; cursor: default; }

/* ---- Reveal ---- */

.screen-reveal { justify-content: center; text-align: center; }

.reveal-inner {
  position: relative;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 10px 30px;
  animation: revealIn 0.35s ease-out both;
}

.reveal-inner::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -28px;
  bottom: -10px;
  left: -28px;
  z-index: -1;
  background: radial-gradient(70% 62% at 50% 50%, rgba(3, 10, 19, 0.88) 0%, rgba(3, 10, 19, 0.7) 55%, transparent 100%);
  pointer-events: none;
}

@keyframes revealIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.reveal-icon { width: 26px; height: 26px; }

.reveal-tier {
  position: relative;
  font-size: clamp(26px, 8.4vw, 42px);
  letter-spacing: 0.14em;
  line-height: 1.15;
  color: var(--tier, var(--ink));
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}

.reveal-tier::before,
.reveal-tier::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: -1;
  opacity: 0.7;
}

.reveal-tier::before { color: var(--pink); transform: translate(-2px, 0); }
.reveal-tier::after  { color: var(--cyan); transform: translate(2px, 0); }

.reveal-answer {
  font-size: clamp(18px, 5.6vw, 26px);
  color: var(--ink);
  letter-spacing: 0.04em;
}

.reveal-score {
  font-size: clamp(15px, 4.6vw, 20px);
  letter-spacing: 0.08em;
  color: #eaf4fa;
}

.reveal-score .pts { color: var(--tier, var(--cyan)); }

.reveal-flavor {
  margin: 2px 0 0;
  max-width: 24em;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.reveal-extra {
  margin: 0;
  max-width: 24em;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: rgba(111, 214, 239, 0.55);
}

.reveal-extra[hidden] { display: none; }

/* ---- Game over ---- */

.screen-over {
  justify-content: space-between;
  text-align: center;
  background: linear-gradient(to bottom, rgba(3, 10, 19, 0.9), rgba(3, 10, 19, 0.96) 30%, rgba(3, 10, 19, 0.9));
}

.over-inner {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow-y: auto;
}

.over-kicker {
  font-size: 12px;
  letter-spacing: var(--track-wide);
  color: var(--pink);
  text-transform: uppercase;
}

.over-depth {
  font-family: var(--font-display);
  font-size: clamp(34px, 12vw, 56px);
  color: var(--cyan);
  line-height: 1.1;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.over-depth .unit { font-size: 0.45em; color: rgba(111, 214, 239, 0.6); }

.over-depth-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.over-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.over-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  background: rgba(8, 21, 37, 0.9);
  --frame: rgba(42, 66, 96, 0.9);
  text-align: left;
}

.over-label { font-size: 9px; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-faint); }
.over-value { font-size: 20px; color: var(--ink); }
.over-value.small { font-size: 13px; line-height: 1.4; }

.over-rank {
  margin: 12px 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.over-log {
  width: 100%;
  max-height: 26vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(42, 66, 96, 0.6);
  padding-top: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  color: var(--ink-dim);
}

.log-row .log-n { color: var(--ink-faint); }
.log-row .log-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .log-d { color: var(--tier, var(--ink-dim)); }
.log-row.is-miss .log-a { color: var(--ink-faint); text-decoration: line-through; }

.over-actions { display: flex; flex-direction: column; gap: 8px; }
.over-actions .row { display: flex; gap: 8px; }

/* ---- Shake and flash ---- */

.app.shake { animation: shake 0.34s steps(2, end); }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 1px); }
  50% { transform: translate(3px, -1px); }
  75% { transform: translate(-2px, 2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-height: 700px) {
  .tagline { font-size: 11px; }
  .prompt-text { font-size: clamp(17px, 5.4vw, 22px); }
  .big-btn { padding: 13px 12px; }
  .screen-title { padding-top: calc(58px + var(--safe-top)); }
}

/* Landscape phones and short windows: drop the flourishes, keep the game. */
@media (max-height: 560px) {
  .mute { width: 34px; height: 30px; top: calc(46px + var(--safe-top)); right: 8px; }
  .app.is-title .mute { top: calc(10px + var(--safe-top)); }
  .mute-icon { width: 16px; height: 13px; }
  .screen { padding: calc(80px + var(--safe-top)) 14px calc(12px + var(--safe-bottom)); }
  .screen-play,
  .screen-reveal { padding-top: calc(82px + var(--safe-top)); }
  .screen-title { padding-top: calc(40px + var(--safe-top)); }
  .title-top { gap: 6px; }
  .tagline { display: none; }
  .logo { font-size: clamp(24px, 7vw, 36px); }
  .logo-sub { font-size: 10px; letter-spacing: 0.3em; }
  .prompt-card { padding: 10px 14px 9px; }
  .prompt-kicker { margin-bottom: 4px; }
  .prompt-text { font-size: clamp(16px, 4vw, 20px); margin-bottom: 5px; }
  .prompt-hint { display: none; }
  .reveal-inner { gap: 5px; padding: 14px 10px 16px; }
  .reveal-flavor { display: none; }
  .over-depth-label { margin-bottom: 4px; }
  .over-log { max-height: 18vh; }
  .timer { width: 46px; height: 46px; }
  .timer-face { width: 38px; height: 38px; font-size: 15px; }
  .answer-input, .dive-btn { padding: 12px 12px; }
}
