/* v13 Analyst Dashboard: tokens, type, buttons, the frame every page sits in. */
:root {
  --bg: #060b17;
  --bg-2: #0a1224;
  --panel: #0d1730;
  --panel-2: #111d3b;
  --line: rgba(130, 170, 255, .14);
  --line-2: rgba(130, 170, 255, .28);
  --ink: #eef3ff;
  --ink-2: #aab8d6;
  --ink-3: #7385aa;
  --you: #39e4ff;          /* the player: electric cyan */
  --you-soft: rgba(57, 228, 255, .18);
  --pro: #ffc84a;          /* the pro line: gold */
  --pro-soft: rgba(255, 200, 74, .16);
  --good: #34e39a;
  --warn: #ffb547;
  --alert: #ff5f6d;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.dim { color: var(--ink-3); }

/* a faint analyst grid behind every dashboard page (static: no repaint) */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(57, 228, 255, .08), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px;
  opacity: .55;
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
}
body[data-phase="play"] .grid-bg, body[data-phase="reveal"] .grid-bg { display: none; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; z-index: 40; left: 0; right: 0; top: 0;
  padding: calc(var(--sat) + 12px) calc(var(--sar) + 16px) 10px calc(var(--sal) + 16px);
  display: flex; align-items: center; gap: 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { font: 700 12px/1 var(--mono); letter-spacing: .14em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand em { font-style: normal; color: var(--you); }
.brand__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--you); box-shadow: 0 0 10px var(--you); animation: blink 2s infinite; }
.topbar__step { margin-left: auto; font: 600 11px/1 var(--mono); letter-spacing: .12em; color: var(--ink-3); white-space: nowrap; }
.mute {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(10, 18, 36, .7);
  display: grid; place-items: center; flex: none; transition: transform .15s var(--ease), border-color .2s;
}
.mute:active { transform: scale(.92); }
.mute svg { width: 20px; height: 20px; }
body[data-phase="play"] .topbar, body[data-phase="reveal"] .topbar, body[data-phase="results"] .topbar__step { display: none; }
body[data-phase="results"] .topbar { position: absolute; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- the page container + screen transitions ---------- */
.screens { position: relative; z-index: 10; min-height: 100%; }
.scr {
  position: relative; min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--sat) + 72px) calc(var(--sar) + 16px) calc(var(--sab) + 24px) calc(var(--sal) + 16px);
  display: flex; flex-direction: column;
  overflow-x: clip;
  animation: scr-in .5s var(--ease) both;
}
.scr.is-leaving { position: absolute; inset: 0 0 auto 0; animation: scr-out .28s ease both; pointer-events: none; }
@keyframes scr-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes scr-out { to { opacity: 0; transform: translateY(-10px); } }
.rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--d, 0) * 90ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- panels ---------- */
.panel {
  position: relative; background: linear-gradient(180deg, rgba(17, 29, 59, .92), rgba(11, 19, 40, .92));
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
}
.panel::before { /* the analyst corner ticks */
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(var(--you), var(--you)) 0 0 / 14px 2px no-repeat,
    linear-gradient(var(--you), var(--you)) 0 0 / 2px 14px no-repeat,
    linear-gradient(var(--you), var(--you)) 100% 100% / 14px 2px no-repeat,
    linear-gradient(var(--you), var(--you)) 100% 100% / 2px 14px no-repeat;
  opacity: .7;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; white-space: nowrap; color: var(--you); padding: 6px 9px; border-radius: 6px; background: var(--you-soft);
}
.tag--pro { color: var(--pro); background: var(--pro-soft); }
.tag--alert { color: var(--alert); background: rgba(255, 95, 109, .14); }
.kicker { font: 700 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0; }

/* ---------- the one forward button ---------- */
.cta {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 60px; padding: 14px 22px; border: 0; border-radius: 16px;
  background: linear-gradient(180deg, #5cecff, #1fc8ea); color: #031220;
  font: 800 18px/1.1 var(--sans); letter-spacing: .01em;
  box-shadow: 0 10px 30px rgba(57, 228, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .15s var(--ease), box-shadow .2s, opacity .25s, filter .25s;
  overflow: hidden;
}
.cta::after { /* a light sweep that says "tap me" */
  content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  animation: sweep 2.8s 1.2s ease-in-out infinite;
}
.cta:active { transform: scale(.97); }
.cta[disabled] { filter: saturate(.2) brightness(.55); box-shadow: none; cursor: default; }
.cta[disabled]::after { animation: none; }
.cta .arrow { font-family: var(--mono); font-weight: 700; transition: transform .2s var(--ease); }
.cta:not([disabled]):hover .arrow { transform: translateX(4px); }
.cta.is-pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes sweep { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
@keyframes pulse { 50% { box-shadow: 0 10px 40px rgba(57, 228, 255, .55), 0 0 0 6px rgba(57, 228, 255, .15); } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* during a play the (empty) page container must not sit over the stage and eat the taps */
body[data-phase="play"] .screens, body[data-phase="reveal"] .screens { display: none; }
