:root {
  color-scheme: dark;
  --bg: #06060c;
  --text: #f5f3ff;
  --muted: #a7a2cc;
  --pink: #ff6fae;
  --pink-soft: #f9a8d4;
  --lilac: #c084fc;
  --live: #ff3b5c;
  --error: #ff8fa3;
  --ink: #170a2c;            /* dark text on the sunset gradient */
  --glow: 168 85 247;        /* purple light, used as rgb(var(--glow) / a) */
  --hot: 255 111 174;        /* pink light */
  --edge: 192 132 252;       /* lilac borders */
  --sunset: linear-gradient(120deg, #ffb36b 0%, #ff6fae 38%, #b04dff 68%, #5b6cff 100%);
  --display: 'Anton', 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgb(98 54 190 / .35) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 100%, #120d26 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--pink);
}
::selection { background: rgb(var(--hot) / .45); color: #fff; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
[hidden] { display: none !important; }

/* floating particles like the reference */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.particles span { position: absolute; border-radius: 50%; animation: drift ease-in-out infinite; box-shadow: 0 0 10px currentColor; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(12px, -34px); } }
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }

main, .form-wrap { position: relative; z-index: 1; }

/* ---------- shared type ---------- */
.kicker { font-weight: 800; letter-spacing: .32em; text-transform: uppercase; font-size: clamp(11px, min(1.1vw, 1.9vh), 14px); color: var(--pink-soft); }
.kicker .dot {
  display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .35em; vertical-align: .02em;
  background: var(--live); animation: blink 1.4s infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.title {
  font-family: var(--display); text-transform: uppercase; line-height: .95; letter-spacing: .01em;
  font-size: clamp(44px, min(9vw, 12vh), 130px);
  background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgb(236 72 153 / .35));
}
.sub { color: var(--muted); letter-spacing: .16em; text-transform: uppercase; font-size: clamp(12px, min(1.3vw, 2.1vh), 16px); margin-top: clamp(4px, 1.2vh, 10px); }

/* ---------- neon box (countdown style from the reference) ---------- */
.box {
  position: relative; border-radius: 22px;
  border: 2px solid rgb(var(--edge) / .85);
  background: linear-gradient(180deg, rgb(42 28 86 / .55), rgb(10 10 26 / .85));
  box-shadow: 0 0 32px rgb(var(--glow) / .35), inset 0 0 22px rgb(var(--glow) / .14);
}
.box::before, .box::after {
  content: ''; position: absolute; left: 20%; right: 20%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #d08cff, #6366f1);
  box-shadow: 0 0 10px rgb(var(--glow) / .8);
}
.box::before { top: -2px; }
.box::after { bottom: -2px; }

/* ---------- countdown ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 2vw, 26px); width: min(100%, 780px, 80vh); }
.unit { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.unit b {
  font-family: var(--display); font-weight: 400; line-height: 1; font-size: clamp(30px, min(6.4vw, 8.5vh), 86px);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 35%, #c9b8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.unit span { font-size: clamp(11px, min(1.3vw, 2vh), 16px); letter-spacing: .12em; text-transform: uppercase; color: #ece8ff; }
.countdown.final .unit { animation: pulse 1s ease-in-out infinite; border-color: var(--pink); }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 60px rgb(var(--hot) / .7); } }

/* ---------- dashboard: always exactly one screen ---------- */
.stage {
  height: 100vh; height: 100dvh; max-width: 1200px; margin: 0 auto; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 3vh, 38px); padding: clamp(12px, 3vh, 40px) clamp(16px, 3vw, 40px);
}
.stage > * { flex: none; }
.hero { text-align: center; }
.launched { text-align: center; }
.launched .title { font-size: clamp(70px, min(14vw, 26vh), 200px); animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { to { filter: drop-shadow(0 0 60px rgb(var(--hot) / .8)); transform: scale(1.03); } }

.stage > .card { flex: 0 1 auto; min-height: 0; }
.card {
  width: min(100%, 920px); min-height: clamp(150px, 26vh, 300px);
  padding: clamp(16px, min(3vw, 3.5vh), 40px); display: flex; flex-direction: column; gap: clamp(6px, 1.5vh, 12px);
  overflow: hidden;
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.card.out { opacity: 0; transform: translateY(14px) scale(.98); transition-duration: .3s; transition-timing-function: ease-in; }
.card-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ticket {
  font-family: var(--display); font-size: clamp(18px, min(2vw, 3.4vh), 26px); padding: 3px 14px; border-radius: 10px;
  background: var(--sunset); color: var(--ink); font-variant-numeric: tabular-nums;
}
.who { font-family: var(--display); font-size: clamp(22px, min(2.8vw, 5vh), 38px); text-transform: uppercase; letter-spacing: .03em; overflow-wrap: anywhere; }
.q { color: var(--pink-soft); text-transform: uppercase; letter-spacing: .2em; font-weight: 800; font-size: clamp(11px, min(1.2vw, 2vh), 15px); }
.a { font-size: clamp(18px, min(2.7vw, 4.8vh), 38px); font-weight: 600; line-height: 1.3; flex: 1 1 auto; min-height: 0; overflow: hidden; overflow-wrap: anywhere; text-wrap: pretty; }
.a.long { font-size: clamp(16px, min(2vw, 3.5vh), 27px); }
.progress { flex: none; height: 3px; background: rgb(255 255 255 / .08); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb36b, #ff6fae, #b04dff); }
.progress i.run { animation: fill linear forwards; }
@keyframes fill { to { width: 100%; } }

.line { width: min(100%, 1000px); }
.line-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--muted); text-transform: uppercase; letter-spacing: .15em; font-size: 13px; font-weight: 800; }
.line-head #count { color: #fff; font-family: var(--display); font-size: 22px; font-weight: 400; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.join { margin-left: auto; letter-spacing: .04em; text-transform: none; font-weight: 600; }
.join b { color: var(--pink-soft); }
/* two rows max; overflow collapses into a "+N more" chip (see index.html) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(6px, 1.2vh, 10px); max-height: calc(2 * (2.2em + 2px) + 8px); overflow: hidden; font-size: clamp(12px, min(1.1vw, 2vh), 14px); }
.chip { padding: .4em .85em; line-height: 1.4; border-radius: 999px; border: 1px solid rgb(var(--edge) / .45); background: rgb(40 28 80 / .5); white-space: nowrap; transition: box-shadow .3s, border-color .3s; }
.chip em { font-style: normal; color: var(--pink-soft); font-weight: 800; margin-right: 6px; }
.chip.speaking { border-color: var(--pink); box-shadow: 0 0 16px rgb(var(--hot) / .65); }
.chip.more { color: var(--muted); border-style: dashed; }
/* short screens (720p shares): one row of chips so the answer keeps its room */
@media (max-height: 820px) { .chips { max-height: calc(2.2em + 2px); } }

.toast {
  position: fixed; top: 18px; left: 50%; z-index: 10; transform: translate(-50%, calc(-100% - 60px)); visibility: hidden;
  padding: 12px 22px; border-radius: 14px; background: var(--sunset); color: var(--ink); font-weight: 800;
  box-shadow: 0 10px 40px rgb(var(--hot) / .45); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  transition: transform .35s ease-in, visibility 0s linear .35s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .55s var(--ease-out), visibility 0s; }

/* host controls: visible while the mouse moves, gone on the shared screen */
.controls {
  position: fixed; top: 12px; right: 14px; z-index: 5; display: flex; gap: 8px;
  transition: opacity .4s var(--ease-out);
}
.controls.idle { opacity: 0; pointer-events: none; }
.controls.idle:focus-within { opacity: 1; pointer-events: auto; }
.ctl {
  font: 600 13px/1 'Inter', system-ui, sans-serif; color: var(--text); cursor: pointer;
  min-height: 40px; padding: 0 14px; border-radius: 12px;
  background: rgb(20 14 44 / .85); border: 1px solid rgb(var(--edge) / .55);
}
.ctl:hover { border-color: var(--pink); }
.ctl kbd { font: inherit; color: var(--muted); margin-left: 6px; }

/* ---------- join page ---------- */
.form-wrap { width: min(100%, 680px); margin: 0 auto; padding: 32px 18px 70px; }
.form-wrap .hero { margin-bottom: 22px; }
.form-wrap .title { font-size: clamp(40px, 12vw, 80px); text-wrap: balance; }
.form-wrap .countdown { margin: 0 auto 28px; width: min(100%, 420px); gap: 10px; }
.form-wrap .unit { border-radius: 16px; }
.form-wrap .unit b { font-size: clamp(26px, 7vw, 40px); }
.form-wrap .unit span { font-size: 11px; }
.panel { padding: 22px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 800; margin-bottom: 8px; line-height: 1.35; }
.field .count { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
input, textarea {
  width: 100%; background: rgb(12 10 30 / .85); color: var(--text);
  border: 1.5px solid rgb(var(--edge) / .45); border-radius: 14px; padding: 14px; font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgb(var(--hot) / .3); }
input[aria-invalid="true"] { border-color: var(--error); }
::placeholder { color: rgb(167 162 204 / .8); }
.btn {
  display: block; width: 100%; padding: 16px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--sunset); color: var(--ink); font-family: var(--display); font-size: 22px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 8px 30px rgb(var(--hot) / .35);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.btn:hover { box-shadow: 0 10px 36px rgb(var(--hot) / .5); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid rgb(var(--edge) / .6); box-shadow: none; margin-top: 12px; font-size: 18px; }
.btn.ghost:hover { border-color: var(--pink); }
.error { color: var(--error); font-weight: 600; margin: 0 0 12px; min-height: 1.2em; }
.done { text-align: center; padding: 34px 22px; }
.done .big { font-family: var(--display); font-size: clamp(80px, 26vw, 150px); line-height: 1; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.done .big:focus { outline: none; }
.done p { color: var(--muted); margin: 10px 0 22px; }
a.btn { text-decoration: none; text-align: center; }
.load-error { position: relative; z-index: 2; max-width: 520px; margin: 20vh auto 0; padding: 24px; text-align: center; color: var(--error); font-weight: 600; }

/* ---------- reduced motion: keep the state changes, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .particles { display: none; }
  .kicker .dot { animation: none; }
  /* final 10 seconds: hot pink boxes instead of a pulsing scale */
  .countdown.final .unit { animation: none; box-shadow: 0 0 40px rgb(var(--hot) / .6), inset 0 0 22px rgb(var(--hot) / .2); }
  .launched .title { animation: none; filter: drop-shadow(0 0 50px rgb(var(--hot) / .7)); }
  .card, .card.out { transform: none; transition: opacity .3s linear; }
  .toast, .toast.show { transform: translate(-50%, 0); opacity: 0; transition: opacity .3s linear, visibility 0s linear .3s; }
  .toast.show { opacity: 1; transition: opacity .3s linear, visibility 0s; }
  .btn, .btn:active { transform: none; }
}
