:root {
  --night: #0c1a2b;
  --night-2: #132a40;
  --pine: #0f3d2e;
  --snow: #f6f4ee;
  --muted: #a9b8c6;
  --gold: #f2c14e;
  --red: #d7263d;
  --c0: #d7263d;
  --c1: #1e9e5a;
  --c2: #e0a020;
  --c3: #2b7bd6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--snow);
  background:
    radial-gradient(1200px 700px at 15% -10%, #1d4a6b 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, #0f3d2e 0%, transparent 60%),
    var(--night);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }

/* falling snow */
.snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.snow i {
  position: absolute; top: -10px; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75); filter: blur(0.5px);
  animation: fall linear infinite;
}
@keyframes fall { to { transform: translate3d(var(--drift, 30px), 110vh, 0); } }
@media (prefers-reduced-motion: reduce) { .snow { display: none; } }

main { position: relative; z-index: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.8em 1.4em; border-radius: 999px; font-weight: 700;
  background: var(--red); color: #fff; box-shadow: var(--shadow);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }
.btn.gold { background: var(--gold); color: #3a2a00; }
.btn.ghost { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.btn.small { padding: 0.45em 0.9em; font-size: 0.9em; }
.btn:disabled { opacity: 0.5; cursor: default; }

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.field { display: grid; gap: 0.4em; text-align: left; }
.field label { font-size: 0.85em; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.field input, .field select {
  width: 100%; min-width: 0;
  padding: 0.75em 0.9em; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25); outline: none; font-size: 1.15em;
}
.field input:focus, .field select:focus { border-color: var(--gold); }

.error { color: #ff9aa6; min-height: 1.3em; font-weight: 600; }

.title-font { font-weight: 900; letter-spacing: -0.02em; }
.gold-text { color: var(--gold); }
.muted { color: var(--muted); }

/* answer shapes */
.shape { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; font-size: 1em; }
.choice-0 { background: var(--c0); }
.choice-1 { background: var(--c1); }
.choice-2 { background: var(--c2); }
.choice-3 { background: var(--c3); }

.avatar { font-size: 2em; line-height: 1; }
.offline { opacity: 0.4; }

/* connection banner */
.conn {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: #5a1520; color: #fff; padding: 0.4em 1em; border-radius: 999px; font-weight: 600; font-size: 0.9em;
}

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 16px;
  animation: confetti 3.5s ease-in forwards;
}
@keyframes confetti { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }

@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Jingles the announcer: speech bubble on the TV */
.jingles {
  position: fixed; left: 2vw; bottom: 2.2vh; z-index: 50; max-width: min(46vw, 720px);
  display: flex; align-items: flex-end; gap: 0.6em; pointer-events: none;
  opacity: 0; transform: translateY(20px) scale(.96); transition: opacity .25s ease, transform .3s cubic-bezier(.2,1.4,.4,1);
}
.jingles.show { opacity: 1; transform: none; }
.jingles .j-face {
  font-size: 3.4em; line-height: 1; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5));
  animation: jbob 0.5s ease-in-out infinite alternate;
}
.jingles .j-text {
  position: relative; background: var(--snow); color: #0c1a2b; font-weight: 800; font-size: 1.35em; line-height: 1.25;
  padding: 0.7em 1em; border-radius: 22px 22px 22px 6px; box-shadow: var(--shadow);
}
@keyframes jbob { to { transform: translateY(-5px) rotate(-4deg); } }
