/* outlier — flow UI. Minimal text, rich motion. Inter, lowercase chrome, near-black, glass panels,
   every text pair ≥ 4.5:1 on its rendered background. Motion follows ART-DIRECTION.md §2 and is off
   under prefers-reduced-motion. */
:root {
  /* typography.css sets Inter alone; Inter's served subsets have no Greek, so Greek tier letters get a
     clean system sans fallback instead of the browser's serif default. */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
  --bg: #05070b;
  --text: #f2f5fa;
  --text-2: #c9d1de;
  --text-3: #9aa6ba; /* ≥ 16px only */
  --cyan: #5ee6ff;
  --pink: #ff5d8f;
  --orange: #ff9f5a;
  --accent: var(--cyan); /* SCENE.accent overrides this per prototype */
  /* glass */
  --glass: rgba(10, 14, 24, 0.58);
  --glass-text: rgba(10, 14, 24, 0.66);
  --glass-solid: rgba(10, 14, 24, 0.9);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.2);
  --r-card: 24px;
  --r-pod: 16px;
  --r-btn: 14px;
  /* easing */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --legible: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 14px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body.ol {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ol-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ol-skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-btn);
  background: var(--glass-solid);
  border: 1px solid var(--accent);
}

.ol-skip:focus {
  top: 1rem;
}

.ol-num {
  font-variant-numeric: tabular-nums;
}

.ol-pink {
  color: var(--pink);
}

.ol-secondary {
  color: var(--text-2);
}

.ol-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--text-2);
}

/* ------------------------------------------------------------ glass */
.ol-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ol-panel {
    background: var(--glass-solid);
  }
}

.ol-message {
  margin: 0.75rem 0 0;
  color: var(--orange);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

/* ------------------------------------------------------------ scene host + overlays */
.ol-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #0d2236, #071019 55%, #030508);
}

.ol-fx {
  position: fixed;
  inset: 0;
  z-index: 45;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ol-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.95), color-mix(in srgb, var(--accent) 55%, transparent) 45%, transparent 80%);
}

.ol-flash.is-on {
  animation: ol-flash 0.6s var(--ease-out) both;
}

@keyframes ol-flash {
  0% { opacity: 0; }
  18% { opacity: 0.9; }
  100% { opacity: 0; }
}

.ol-edge {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 60px 12px rgba(255, 90, 60, 0.85);
}

body.is-low-time .ol-edge {
  animation: ol-throb 0.55s var(--ease-io) infinite alternate;
}

@keyframes ol-throb {
  from { opacity: 0.15; }
  to { opacity: 0.85; }
}

.ol-zap {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.28), transparent 70%);
}

.ol-zap.is-on {
  animation: ol-zap 0.28s steps(3) both;
}

@keyframes ol-zap {
  0% { opacity: 1; transform: scaleY(1.02); }
  50% { opacity: 0.4; transform: scaleY(0.98) translateX(3px); }
  100% { opacity: 0; transform: none; }
}

/* ------------------------------------------------------------ corner buttons */
.ol-corner {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  z-index: 40;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-btn);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  color: var(--text);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-snap);
}

.ol-corner:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.ol-corner:active {
  transform: scale(0.94);
}

.ol-corner svg {
  width: 20px;
  height: 20px;
}

.ol-corner--left {
  left: max(12px, env(safe-area-inset-left));
}

.ol-corner--right {
  right: max(12px, env(safe-area-inset-right));
}

.ol-ico-off,
.ol-corner[aria-pressed='true'] .ol-ico-on {
  display: block;
}

.ol-ico-on,
.ol-corner[aria-pressed='true'] .ol-ico-off {
  display: none;
}

/* ------------------------------------------------------------ HUD: progress (centre) + score (right) */
.ol-hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 70px;
  right: 70px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  pointer-events: none;
}

.ol-hud-panel {
  grid-column: 3;
  justify-self: end;
  position: relative;
  overflow: hidden;
  min-width: 8.5rem;
  display: grid;
  padding: 8px 18px 10px;
  border-radius: var(--r-pod);
  text-align: right;
  line-height: 1.15;
  animation: ol-pod-in 0.6s var(--ease-snap) 0.15s both;
}

.ol-hud-value {
  display: inline-block;
  justify-self: end;
  transform-origin: right center;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 0 16px rgba(255, 93, 143, 0.45);
}

.ol-hud-progress {
  grid-column: 2;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 8px;
  animation: ol-drop-in 0.6s var(--ease-snap) both;
}

.ol-hud-progress .ol-label {
  color: var(--text);
  letter-spacing: 0.12em;
  text-shadow: var(--legible);
  white-space: nowrap;
}

@keyframes ol-pod-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes ol-drop-in {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: none; }
}

.ol-pips {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ol-pip {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(5, 7, 11, 0.6);
  color: #05070b;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.ol-pip.is-current {
  border-color: var(--text);
  box-shadow: 0 0 10px rgba(242, 245, 250, 0.55);
  animation: ol-pulse 1.4s var(--ease-io) infinite alternate;
}

.ol-pip.is-done {
  border-color: transparent;
  background: var(--tier);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tier) 55%, transparent);
}

.ol-pip.is-new {
  animation: ol-pip-pop 0.5s var(--ease-snap);
}

@keyframes ol-pulse {
  from { transform: scale(1.05); }
  to { transform: scale(1.35); }
}

@keyframes ol-pip-pop {
  from { transform: scale(0.4); }
  to { transform: none; }
}

/* score: rolls with a "crank", then "slams" on landing */
.ol-hud-value.is-crank {
  animation: ol-crank 0.12s var(--ease-snap);
}

@keyframes ol-crank {
  50% { transform: translateY(3px) scale(1.06); }
}

.ol-hud-value.is-slam {
  animation: ol-slam 0.5s var(--ease-snap);
}

@keyframes ol-slam {
  0% { transform: none; }
  35% { transform: scale(1.4) rotate(-2deg); text-shadow: 0 0 22px var(--pink), 0 0 6px var(--pink); }
  100% { transform: none; }
}

/* a faint slow sheen across the pod */
.ol-hud-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.08) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: ol-sheen 7s var(--ease-io) infinite;
}

@keyframes ol-sheen {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* ------------------------------------------------------------ screens */
.ol-main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  min-height: 100dvh;
  outline: none;
}

.ol-screen {
  width: min(46rem, calc(100% - 32px));
  margin: 0 auto;
}

.ol-screen--center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.ol-boot {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  text-shadow: var(--legible);
  animation: ol-blink 1.2s var(--ease-io) infinite alternate;
}

@keyframes ol-blink {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* ------------------------------------------------------------ landing: title, subtitle, begin */
.ol-landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(80px, 16vh, 160px) 0 48px;
}

.ol-title {
  margin: 0;
  font-size: clamp(76px, 19vw, 150px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: lowercase;
  color: #ffffff;
  text-shadow:
    -0.035em 0 0 rgba(255, 93, 143, 0.95),
    0.035em 0 0 rgba(94, 230, 255, 0.95),
    0 0.05em 0.35em rgba(0, 0, 0, 0.55),
    0 0 0.6em color-mix(in srgb, var(--accent) 35%, transparent);
  animation: ol-flicker 5s step-end infinite;
}

.ol-title span {
  display: inline-block;
  animation: ol-letter 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}

@keyframes ol-letter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes ol-flicker {
  0%, 92% { opacity: 1; }
  93% { opacity: 0.7; }
  93.6% { opacity: 0.94; }
  94.3% { opacity: 0.62; }
  95% { opacity: 1; }
}

.ol-subtitle {
  margin: 22px 0 0;
  padding-left: 0.4em;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: lowercase;
  color: var(--accent);
  text-shadow: var(--legible);
}

/* primary button: glass with an accent rim, a breathing glow and a gentle bob */
.ol-primary {
  position: relative;
  width: min(30rem, 100%);
  min-height: 60px;
  margin-top: clamp(36px, 8vh, 72px);
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--r-btn);
  background: rgba(10, 14, 24, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 32px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  cursor: pointer;
  animation: ol-bob 1.9s var(--ease-io) infinite alternate;
  transition: background 200ms ease;
}

.ol-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
  opacity: 0.35;
  animation: ol-breathe 2.8s var(--ease-io) infinite alternate;
}

.ol-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 16%, rgba(10, 14, 24, 0.66));
}

.ol-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ol-primary--slim {
  width: auto;
  min-height: 52px;
  margin-top: 0;
  letter-spacing: 0.16em;
  animation: none;
}

@keyframes ol-bob {
  from { transform: translateY(0); }
  to { transform: translateY(5px); }
}

@keyframes ol-breathe {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.ol-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-text);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.ol-pill:hover,
.ol-pill[aria-expanded='true'] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------ play */
.ol-play {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 0 240px;
}

/* prompt card: text-heavy glass, inner border, faint scanline texture */
.ol-card {
  position: relative;
  width: 100%;
  padding: 30px 34px 28px;
  border-radius: var(--r-card);
  background: var(--glass-text);
}

.ol-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
}

.ol-card::after {
  content: '';
  position: absolute;
  inset: 6px;
  z-index: -1;
  border-radius: 18px;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  opacity: 0.25;
  animation: ol-breathe 3.2s var(--ease-io) infinite alternate;
}

.ol-card.is-in {
  animation: ol-card-in 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.ol-card.is-out {
  animation: ol-card-out 0.6s ease-in both;
}

@keyframes ol-card-in {
  from { opacity: 0; transform: translateY(46px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* leaves upward and fades (transform + opacity only) */
@keyframes ol-card-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-28px) scale(0.9); }
}

.ol-prompt-text {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text);
}

.ol-blurb {
  margin: 14px 0 0;
  font-size: 20px;
  line-height: 1.45;
  color: var(--text-2);
}

/* generic panel fade (used for small things) */
.is-in {
  animation: ol-in 0.26s var(--ease-out) both;
}

.is-out {
  animation: ol-out 0.2s var(--ease) both;
}

@keyframes ol-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes ol-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* reveal banner: glass, overshoot in, bobbing creature, rising button */
.ol-reveal {
  --tier: var(--text);
  position: relative;
  margin-top: clamp(0px, 5vh, 56px);
  min-width: min(26rem, 100%);
  padding: 22px 32px 28px;
  display: grid;
  justify-items: center;
  text-align: center;
  border-radius: var(--r-card);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), 0 0 60px color-mix(in srgb, var(--tier) 18%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.ol-reveal.is-in {
  animation: ol-banner-in 0.8s cubic-bezier(0.2, 1.7, 0.4, 1) both;
}

@keyframes ol-banner-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: none; }
}

.ol-reveal-creature {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--tier) 60%, transparent));
  animation: ol-creature-bob 2.6s var(--ease-io) infinite;
}

@keyframes ol-creature-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.ol-reveal-tier {
  margin: 10px 0 0;
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--tier);
  text-shadow: 0 0 28px color-mix(in srgb, var(--tier) 40%, transparent);
}

.ol-reveal-pts {
  margin: 12px 0 0;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ol-reveal-flavour {
  margin: 8px 0 0;
  max-width: 26rem;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text-2);
}

.ol-outline {
  position: relative;
  margin-top: 24px;
  min-width: 13rem;
  min-height: 56px;
  padding: 10px 26px;
  border: 1px solid var(--tier);
  border-radius: var(--r-btn);
  background: rgba(5, 7, 11, 0.55);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 180ms ease;
}

.ol-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--tier) 45%, transparent);
  opacity: 0.35;
  animation: ol-breathe 2.8s var(--ease-io) infinite alternate;
}

.ol-outline:hover:not(:disabled) {
  background: color-mix(in srgb, var(--tier) 16%, rgba(5, 7, 11, 0.55));
}

.ol-outline:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ol-reveal.is-in .ol-outline {
  animation:
    ol-rise 0.5s var(--ease-snap) 0.35s both,
    ol-bob 1.9s var(--ease-io) 0.85s infinite alternate;
}

@keyframes ol-rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.ol-play-error {
  text-align: center;
}

/* ------------------------------------------------------------ bottom bar */
.ol-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: 0 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}

/* 3 · 2 · 1 — digits only, each pops */
.ol-countdown {
  margin: 0 0 18px;
  display: flex;
  gap: 28px;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ol-countdown span {
  color: rgba(242, 245, 250, 0.32);
  text-shadow: var(--legible);
  transition: color 200ms ease, opacity 200ms ease;
}

.ol-countdown span.is-now {
  color: var(--accent);
  text-shadow: 0 0 26px color-mix(in srgb, var(--accent) 65%, transparent), var(--legible);
  animation: ol-count-pop 0.55s var(--ease-snap);
}

.ol-countdown span.is-past {
  opacity: 0.25;
}

@keyframes ol-count-pop {
  from { transform: scale(1.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* the input housing is the glass; the field inside is a darker inset (no glass on glass) */
.ol-form-bar {
  pointer-events: auto;
  width: min(46rem, 100%);
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-pod);
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.32s var(--ease-snap), opacity 0.26s var(--ease-out);
}

.ol-bar.is-up .ol-form-bar {
  transform: none;
  opacity: 1;
}

.ol-bar-msg {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.ol-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* radar timer: accent ring, crosshair, orbiting sweep, big seconds */
.ol-ring {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.ol-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ol-ring circle {
  fill: none;
  stroke-width: 4;
}

.ol-ring-track {
  stroke: rgba(255, 255, 255, 0.16);
}

.ol-ring-arc {
  stroke: var(--accent);
  transition: stroke-dashoffset 120ms linear, stroke 200ms ease;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 60%, transparent));
}

.ol-ring-cross {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
}

.ol-ring-sweep {
  transform-box: view-box;
  transform-origin: 28px 28px;
  animation: ol-spin 2.4s linear infinite;
}

.ol-ring-sweep path {
  fill: color-mix(in srgb, var(--accent) 28%, transparent);
}

@keyframes ol-spin {
  to { transform: rotate(360deg); }
}

.ol-ring-secs {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ol-input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  height: 60px;
  padding: 0 18px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  caret-color: var(--pink);
  transition: box-shadow 200ms ease;
}

.ol-input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.ol-input:focus {
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 30%, transparent);
}

.ol-input.is-reject {
  animation: ol-reject 0.4s var(--ease-out);
}

@keyframes ol-reject {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.ol-sign {
  flex: 0 0 52px;
  height: 60px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  font-size: 22px;
  cursor: pointer;
}

.ol-dive {
  flex: 0 0 auto;
  height: 60px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: #05070b;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: filter 160ms ease, transform 160ms var(--ease-snap);
}

.ol-dive:hover:not(:disabled) {
  filter: brightness(1.08);
}

.ol-dive:active:not(:disabled) {
  transform: scale(0.96);
}

.ol-dive:disabled,
.ol-sign:disabled,
.ol-input:disabled {
  opacity: 0.6;
}

.ol-timebar {
  margin-top: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ol-timebar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 120ms linear, background 200ms ease;
}

.ol-bar.is-low .ol-ring-arc {
  stroke: var(--orange);
  filter: drop-shadow(0 0 4px rgba(255, 159, 90, 0.7));
}

.ol-bar.is-low .ol-ring-secs {
  color: var(--orange);
}

.ol-bar.is-low .ol-ring-sweep path {
  fill: rgba(255, 159, 90, 0.3);
}

.ol-bar.is-low .ol-timebar span {
  background: var(--orange);
}

/* ------------------------------------------------------------ results */
.ol-results {
  display: grid;
  gap: 18px;
  padding: 84px 0 72px;
  font-size: 18px;
}

/* staggered reveal of the sections */
.ol-results > * {
  animation: ol-in 0.55s var(--ease-out) both;
}

.ol-results > :nth-child(2) { animation-delay: 0.08s; }
.ol-results > :nth-child(3) { animation-delay: 0.16s; }
.ol-results > :nth-child(4) { animation-delay: 0.26s; }
.ol-results > :nth-child(5) { animation-delay: 0.36s; }
.ol-results > :nth-child(6) { animation-delay: 0.46s; }
.ol-results > :nth-child(7) { animation-delay: 0.56s; }
.ol-results > :nth-child(8) { animation-delay: 0.66s; }
.ol-results > :nth-child(9) { animation-delay: 0.76s; }

.ol-res-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.ol-res-head .ol-label {
  color: var(--text);
  font-size: 15px;
  text-shadow: var(--legible);
}

.ol-res-logo {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: -1.5px 0 0 rgba(255, 93, 143, 0.95), 1.5px 0 0 rgba(94, 230, 255, 0.95);
}

.ol-res-score {
  display: flex;
  justify-content: center;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.ol-res-big {
  font-size: clamp(88px, 22vw, 136px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-shadow: 0 0 40px rgba(255, 93, 143, 0.3), var(--legible);
}

.ol-res-rank {
  margin: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  text-transform: lowercase;
  text-shadow: var(--legible);
}

.ol-res-block {
  padding: 20px 22px 22px;
  border-radius: var(--r-card);
  background: rgba(10, 14, 24, 0.7);
}

.ol-res-block > .ol-label {
  margin-bottom: 12px;
}

.ol-curve {
  position: relative;
  height: 180px;
  margin-top: 30px;
}

.ol-curve svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ol-curve-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ol-draw 1.6s var(--ease-out) 0.3s forwards;
}

.ol-curve-area {
  opacity: 0;
  animation: ol-fade 1.2s var(--ease-out) 1s forwards;
}

.ol-curve-youline {
  opacity: 0;
  filter: drop-shadow(0 0 6px var(--pink));
  animation: ol-fade 0.5s var(--ease-out) 1.7s forwards;
}

.ol-curve-you {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pink);
  color: #05070b;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(255, 93, 143, 0.6);
  opacity: 0;
  animation: ol-fade 0.5s var(--ease-out) 1.7s forwards;
}

.ol-curve-you.is-left {
  transform: translateX(-100%);
}

@keyframes ol-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes ol-fade {
  to { opacity: 1; }
}

.ol-curve-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.ol-beat {
  margin: 14px 0 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.ol-beat strong {
  color: var(--pink);
}

/* the catch: compact list, tap to expand the crowd's answers */
.ol-catch {
  display: grid;
}

.ol-catch-row {
  border-top: 1px solid var(--line);
}

.ol-catch-row:first-child {
  border-top: 0;
}

.ol-catch-summary {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 4px;
  list-style: none;
  cursor: pointer;
  border-radius: 12px;
  transition: background 160ms ease;
}

.ol-catch-summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ol-catch-summary::-webkit-details-marker {
  display: none;
}

.ol-catch-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
}

.ol-catch-num::before {
  content: '▸ ';
  color: var(--accent);
}

.ol-catch-row[open] .ol-catch-num::before {
  content: '▾ ';
}

.ol-catch-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ol-catch-prompt {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ol-catch-row[open] .ol-catch-prompt {
  -webkit-line-clamp: unset;
  display: block;
}

.ol-catch-yours {
  font-size: 18px;
  font-weight: 700;
  color: var(--tier);
  overflow-wrap: anywhere;
}

.ol-catch-pts {
  font-size: 18px;
  font-weight: 800;
  color: var(--tier);
  white-space: nowrap;
}

.ol-catch-panel {
  padding: 0 4px 14px calc(2.2rem + 16px);
}

.ol-catch-top {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ol-catch-top li {
  display: grid;
  grid-template-columns: 1fr 3.6rem 3.2rem;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 17px;
}

.ol-catch-top li.is-you {
  background: rgba(255, 93, 143, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 93, 143, 0.45);
}

.ol-catch-top-letter {
  font-weight: 800;
  color: var(--tier);
}

.ol-catch-top-answer {
  overflow-wrap: anywhere;
}

.ol-catch-top-share {
  text-align: right;
  color: var(--text-2);
}

.ol-catch-top-pts {
  text-align: right;
  font-weight: 800;
  color: var(--tier);
}

/* share */
.ol-share {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.ol-share .ol-secondary {
  font-size: 17px;
  text-shadow: var(--legible);
}

.ol-copy-fallback {
  flex-basis: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgba(10, 14, 24, 0.8);
  font-family: inherit;
  font-size: 18px;
  white-space: pre-wrap;
  user-select: all;
}

/* leaderboard */
.ol-board {
  font-size: 18px;
}

.ol-board-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ol-board-list li {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  gap: 10px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
}

.ol-board-list li:first-child {
  border-top: 0;
}

.ol-board-list li.is-you {
  color: var(--pink);
  font-weight: 700;
}

.ol-board-rank {
  color: var(--text-2);
}

.ol-board-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ol-board-score {
  font-weight: 700;
  color: var(--accent);
}

.ol-nudge {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
}

/* logbook: five tiny stats */
.ol-logbook {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.ol-logbook-stat {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: var(--r-pod);
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--glass-border);
}

.ol-logbook dd {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ol-idea {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.ol-idea-box {
  width: 100%;
}

/* forms */
.ol-suggest {
  display: grid;
  gap: 14px;
}

.ol-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ol-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ol-field textarea,
.ol-field input,
.ol-field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 18px;
  line-height: 1.4;
  resize: vertical;
}

.ol-field textarea::placeholder,
.ol-field input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.ol-field textarea:focus,
.ol-field input:focus,
.ol-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.ol-signed-note {
  margin: 0;
  font-size: 17px;
}

.ol-form-status {
  margin: 0;
  min-height: 1.4em;
  font-size: 17px;
}

.ol-form-status.is-error {
  color: var(--orange);
}

.ol-form-status.is-ok {
  color: #7cf0b2;
}

.ol-suggest .ol-primary {
  justify-self: start;
}

/* dialogs */
.ol-dialog {
  width: min(34rem, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 22px 24px 26px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  background: var(--glass-solid);
  box-shadow: var(--glass-shadow);
  color: var(--text);
  font-size: 18px;
}

.ol-dialog[open] {
  animation: ol-banner-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.ol-dialog::backdrop {
  background: rgba(2, 3, 6, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ol-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ol-dialog-head .ol-label {
  font-size: 16px;
  color: var(--text);
}

.ol-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-btn);
  background: transparent;
  cursor: pointer;
}

/* ☰ menu: slide-out panel */
.ol-menu {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(21rem, 86vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: max(18px, env(safe-area-inset-top)) 20px 24px;
  border: 0;
  border-right: 1px solid var(--glass-border);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  overflow-y: auto;
}

.ol-menu[open] {
  animation: ol-menu-in 0.32s var(--ease-out) both;
}

@keyframes ol-menu-in {
  from { transform: translateX(-100%); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.ol-menu-list {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ol-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  text-transform: lowercase;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-snap);
}

.ol-menu-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(4px);
}

.ol-menu-proto .ol-label {
  margin: 6px 0 8px;
}

.ol-menu-proto .ol-menu-item[aria-current='page'] {
  border-color: var(--accent);
  color: var(--accent);
}

.ol-menu-proto .ol-menu-item[aria-current='page']::after {
  content: '●';
  margin-left: auto;
  font-size: 12px;
}

.ol-menu-back {
  margin-top: 6px;
  background: transparent;
  border-color: var(--line-2);
}

/* ------------------------------------------------------------ maths (KaTeX)
   typography.css puts Inter on every element with !important, which would break KaTeX's glyphs.
   Hand KaTeX its own fonts back (rules mirror katex.min.css) and never transform maths. */
body.ol .katex {
  font-family: KaTeX_Main, 'Times New Roman', serif !important;
  font-size: 1.05em;
  color: inherit;
  letter-spacing: normal;
  text-transform: none !important;
}

body.ol .katex * {
  font-family: inherit !important;
  text-transform: none !important;
  letter-spacing: normal;
}

body.ol .katex .textrm {
  font-family: KaTeX_Main !important;
}

body.ol .katex .textsf {
  font-family: KaTeX_SansSerif !important;
}

body.ol .katex .texttt {
  font-family: KaTeX_Typewriter !important;
}

body.ol .katex .mathnormal {
  font-family: KaTeX_Math !important;
}

body.ol .katex .mathit {
  font-family: KaTeX_Main !important;
}

body.ol .katex .mathbf {
  font-family: KaTeX_Main !important;
}

body.ol .katex .boldsymbol {
  font-family: KaTeX_Math !important;
}

body.ol .katex .amsrm,
body.ol .katex .mathbb,
body.ol .katex .textbb {
  font-family: KaTeX_AMS !important;
}

body.ol .katex .mathcal {
  font-family: KaTeX_Caligraphic !important;
}

body.ol .katex .mathfrak,
body.ol .katex .textfrak {
  font-family: KaTeX_Fraktur !important;
}

body.ol .katex .mathboldfrak,
body.ol .katex .textboldfrak {
  font-family: KaTeX_Fraktur !important;
}

body.ol .katex .mathtt {
  font-family: KaTeX_Typewriter !important;
}

body.ol .katex .mathscr,
body.ol .katex .textscr {
  font-family: KaTeX_Script !important;
}

body.ol .katex .mathsf,
body.ol .katex .textsf {
  font-family: KaTeX_SansSerif !important;
}

body.ol .katex .mathboldsf,
body.ol .katex .textboldsf {
  font-family: KaTeX_SansSerif !important;
}

body.ol .katex .mathitsf,
body.ol .katex .mathsfit,
body.ol .katex .textitsf {
  font-family: KaTeX_SansSerif !important;
}

body.ol .katex .mainrm {
  font-family: KaTeX_Main !important;
}

body.ol .katex .delimsizing.size1 {
  font-family: KaTeX_Size1 !important;
}

body.ol .katex .delimsizing.size2 {
  font-family: KaTeX_Size2 !important;
}

body.ol .katex .delimsizing.size3 {
  font-family: KaTeX_Size3 !important;
}

body.ol .katex .delimsizing.size4 {
  font-family: KaTeX_Size4 !important;
}

body.ol .katex .delimsizing.mult .delim-size1>span {
  font-family: KaTeX_Size1 !important;
}

body.ol .katex .delimsizing.mult .delim-size4>span {
  font-family: KaTeX_Size4 !important;
}

body.ol .katex .op-symbol.small-op {
  font-family: KaTeX_Size1 !important;
}

body.ol .katex .op-symbol.large-op {
  font-family: KaTeX_Size2 !important;
}

/* ------------------------------------------------------------ small screens (360–640 px) */
@media (max-width: 640px) {
  .ol-hud {
    left: 66px;
    right: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .ol-hud-progress {
    grid-column: 1;
    justify-items: start;
    padding-top: 4px;
    gap: 6px;
  }

  .ol-hud-panel {
    grid-column: 2;
    min-width: 0;
    padding: 6px 12px 8px;
  }

  .ol-hud-value {
    font-size: 26px;
  }

  .ol-pips {
    gap: 4px;
  }

  .ol-pip {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .ol-title {
    font-size: clamp(72px, 24vw, 112px);
  }

  .ol-play {
    padding: 104px 0 220px;
  }

  .ol-card {
    padding: 22px 20px 20px;
  }

  .ol-prompt-text {
    font-size: 28px;
  }

  .ol-blurb {
    font-size: 17px;
  }

  .ol-reveal {
    min-width: 0;
    width: 100%;
    padding: 18px 18px 24px;
  }

  .ol-reveal-creature {
    width: 96px;
    height: 96px;
  }

  .ol-reveal-tier {
    font-size: 52px;
  }

  .ol-reveal-pts {
    font-size: 24px;
  }

  .ol-reveal-flavour {
    font-size: 17px;
  }

  .ol-bar {
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
  }

  .ol-countdown {
    font-size: 52px;
    gap: 22px;
  }

  .ol-form-bar {
    padding: 10px;
  }

  .ol-bar-row {
    gap: 8px;
  }

  .ol-ring {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .ol-ring-secs {
    font-size: 26px;
  }

  .ol-input {
    height: 56px;
    padding: 0 12px;
    font-size: 18px;
  }

  .ol-sign {
    flex-basis: 44px;
    height: 56px;
  }

  .ol-dive {
    height: 56px;
    padding: 0 16px;
    letter-spacing: 0.06em;
  }

  .ol-res-block {
    padding: 16px 14px 18px;
  }

  .ol-res-rank {
    font-size: 24px;
  }

  .ol-beat {
    font-size: 21px;
  }

  .ol-logbook {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .ol-logbook dd {
    font-size: 18px;
  }

  .ol-logbook .ol-label {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .ol-field-row {
    grid-template-columns: 1fr;
  }

  .ol-catch-panel {
    padding-left: 4px;
  }

  .ol-catch-top li {
    grid-template-columns: 1fr 3.2rem 2.8rem;
    font-size: 16px;
  }
}

/* ------------------------------------------------------------ reduced motion: everything still, instantly */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }

  .ol-curve-line {
    stroke-dashoffset: 0 !important;
  }

  .ol-curve-area,
  .ol-curve-youline,
  .ol-curve-you {
    opacity: 1 !important;
  }

  body.is-low-time .ol-edge {
    opacity: 0.5;
  }
}

/* Glass, second pass (owner: "why is this not translucent?"). A 58–66 % near-black
   tint over dark water reads as a solid slab; glass needs a lighter, cooler,
   lower-alpha tint, a stronger blur and a faint diagonal sheen so the scene shows
   through. White text stays ≥ 4.5:1 because the blurred water behind is dark. */
:root {
  --glass: rgba(34, 48, 76, 0.26);
  --glass-text: rgba(24, 34, 56, 0.38);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 18px 50px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --glass-sheen: linear-gradient(140deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 38%,
    rgba(255, 255, 255, 0.02) 62%, rgba(255, 255, 255, 0.08) 100%);
  --glass-filter: blur(22px) saturate(170%) brightness(1.12);
}

.ol-panel,
.ol-card,
.ol-reveal,
.ol-primary,
.ol-pill {
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}

.ol-card {
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.ol-primary {
  background-color: rgba(24, 34, 56, 0.34);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ol-panel,
  .ol-card,
  .ol-reveal,
  .ol-primary,
  .ol-pill {
    background-color: rgba(10, 14, 24, 0.9);
  }
}

/* CRT consistency (owner: "these panels lack the consistency of the crt lines").
   Every scene draws 1px dark lines every 3px; a blurred glass panel smears them
   away, so each panel carries the same lines, pinned to the viewport
   (background-attachment: fixed) so they line up with the scene's. */
:root {
  --crt-lines: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
}

.ol-panel,
.ol-card,
.ol-reveal,
.ol-primary,
.ol-pill,
.ol-dialog,
.ol-menu-item {
  background-image: var(--crt-lines), var(--glass-sheen);
  background-attachment: fixed, scroll;
}

.ol-card::before {
  background: none;
}

/* Menu and dialogs in the game's own look ("make sure the menu panel has the same
   colour scheme and aesthetic as the game mode"): the same glass, tinted by the
   current scene's accent, over a softly blurred scene. */
.ol-dialog {
  background-color: var(--glass-text);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  color: var(--text);
}

.ol-dialog::backdrop {
  background: rgba(3, 6, 12, 0.35);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ol-menu {
  border-left: 0;
  background-color: color-mix(in srgb, var(--accent) 7%, var(--glass));
}

.ol-menu .ol-label {
  color: var(--accent);
}

.ol-menu-item {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ol-menu-item:hover,
.ol-menu-item:focus-visible {
  background-color: color-mix(in srgb, var(--accent) 14%, transparent);
}

.ol-menu-proto .ol-menu-item[aria-current='page'] {
  background-color: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 25%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ol-menu-back {
  background-color: transparent;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ol-dialog,
  .ol-menu {
    background-color: rgba(10, 14, 24, 0.94);
  }
}

/* The clock now counts down from 240 (owner: "all questions give you 4 minutes"),
   so the ring grows a little and the three digits sit comfortably inside it. */
.ol-ring {
  flex-basis: 74px;
  width: 74px;
  height: 74px;
}

.ol-ring-secs {
  font-size: 25px;
  letter-spacing: -0.03em;
}

/* Top-left toolbar (owner: "put all the menu and prototype buttons here through
   segmented buttons but remove the back to games button. that way the menu becomes
   unnecessary"): two glass segmented controls, the current scene lit in its accent. */
.ol-toolbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 84px);
}

.ol-seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background-color: var(--glass);
  background-image: var(--crt-lines), var(--glass-sheen);
  background-attachment: fixed, scroll;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}

.ol-seg-item {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2, #c3cbd9);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ol-seg-item:hover {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.08);
}

.ol-seg-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ol-seg-item[aria-current='page'] {
  color: var(--accent);
  background-color: color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* The progress pips sit top-centre during play; stack the two groups so they clear them
   (side by side the toolbar is ~575px wide, which meets the pips below ~1440px). */
@media (max-width: 1440px) {
  body[data-screen='play'] .ol-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Phones: the toolbar lives on the landing and results screens and steps aside
   during play, so it never covers the prompt. */
@media (max-width: 900px) {
  body[data-screen='play'] .ol-toolbar {
    display: none;
  }
}

@media (max-width: 560px) {
  .ol-seg-item {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 13px;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ol-seg {
    background-color: rgba(10, 14, 24, 0.9);
  }
}

/* Bigger, wider leaderboard and suggestion panels (owner: "make this leaderboard panel
   bigger and wider as is this suggest a question button"). */
.ol-dialog {
  width: min(50rem, calc(100% - 32px));
  padding: 30px 38px 34px;
}

.ol-dialog-head {
  margin-bottom: 18px;
}

.ol-dialog-head .ol-label {
  font-size: 18px;
}

.ol-dialog .ol-board {
  font-size: 21px;
}

.ol-dialog .ol-board-list li {
  grid-template-columns: 4.4rem 1fr auto;
  gap: 14px;
  padding: 15px 8px;
}

.ol-dialog .ol-board-score {
  font-size: 23px;
}

.ol-dialog .ol-nudge {
  margin-bottom: 14px;
  font-size: 19px;
}

.ol-dialog .ol-suggest {
  gap: 20px;
}

.ol-dialog .ol-field textarea {
  min-height: 112px;
  font-size: 19px;
}

.ol-dialog .ol-field input,
.ol-dialog .ol-field select {
  min-height: 58px;
  font-size: 19px;
}

.ol-dialog .ol-suggest .ol-primary {
  width: auto;
  min-width: 17rem;
  min-height: 62px;
  margin-top: 6px;
  padding: 14px 36px;
  font-size: 19px;
}

@media (max-width: 560px) {
  .ol-dialog {
    padding: 22px 18px 26px;
  }

  .ol-dialog .ol-board {
    font-size: 19px;
  }

  .ol-dialog .ol-board-list li {
    grid-template-columns: 3.2rem 1fr auto;
    padding: 12px 4px;
  }

  .ol-dialog .ol-suggest .ol-primary {
    width: 100%;
    min-width: 0;
  }
}

/* leaderboard dialog: "your name on the board" (members choose a nickname) */
.ol-name-form {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.ol-name-row {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.ol-name-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font: inherit;
  font-size: 19px;
}

.ol-name-input::placeholder {
  color: var(--text-3, rgba(255, 255, 255, 0.55));
}

.ol-name-input:focus-visible {
  outline: 2px solid var(--accent, #5ee6ff);
  outline-offset: 2px;
}

.ol-name-form .ol-primary {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 22px;
}

.ol-name-form .ol-form-status:empty {
  display: none;
}

/* finish screen: "enter your username" under the curve, full panel width */
.ol-username {
  display: grid;
  gap: 10px;
}

.ol-username-row {
  position: relative;
  min-width: 0;
}

.ol-username-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 7.5rem 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 20px;
}

.ol-username-input::placeholder {
  color: var(--text-3);
}

.ol-username-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ol-username .ol-primary {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  min-height: 0;
  padding: 0 20px;
}

.ol-username .ol-form-status:empty {
  display: none;
}
