/* The audience's page: the game show's look on a phone. Dark night, neon edges, gold for what matters. */
:root {
  --night: #0b0620;
  --panel: rgba(22, 10, 52, 0.92);
  --text: #ffffff;
  --muted: #bab3d6;
  --gold: #ffd440;
  --magenta: #ff2bd6;
  --cyan: #22e3ff;
  --red: #ff5a78;
  --a: #00ccff;
  --b: #ff1acc;
  --c: #ffb31a;
  --d: #1aff4d;
  --e: #ff590d;
  --f: #7340ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at top, #2a0f5c 0%, var(--night) 60%) fixed, var(--night);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
}

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

.logo {
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 212, 64, 0.55);
}
.logo span { color: var(--magenta); text-shadow: 0 0 10px rgba(255, 43, 214, 0.6); }

.me { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; }
.me b { color: var(--gold); font-size: 16px; }

.card {
  background: var(--panel);
  border: 2px solid var(--cyan);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 0 18px rgba(34, 227, 255, 0.25), inset 0 0 0 2px rgba(255, 43, 214, 0.35);
}

h1, h2 { font-weight: 900; font-style: italic; text-transform: uppercase; margin: 0 0 8px; }
h1 { font-size: 24px; color: var(--gold); }
h2 { font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.error { color: var(--red); font-weight: 700; margin: 10px 0 0; }

label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  outline: none;
}
input:focus { border-color: var(--gold); }
#code { letter-spacing: 10px; text-transform: uppercase; text-align: center; font-size: 28px; }

button {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: var(--text);
  background: #3a1670;
  border: 2px solid var(--magenta);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}
button.gold { background: var(--gold); border-color: #fff2b8; color: #2a1100; }
button:disabled { opacity: 0.4; }
button:active:not(:disabled) { transform: scale(0.97); }

.banner {
  background: var(--red);
  color: #2a0010;
  font-weight: 900;
  text-align: center;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.round { font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.teams { list-style: none; margin: 0; padding: 0; }
.teams li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-left: 6px solid var(--cyan);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-weight: 800;
}
.teams li.active { border-left-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.teams li.out { opacity: 0.45; text-decoration: line-through; }
.teams .money { color: var(--gold); white-space: nowrap; }

.poll h2 { color: var(--magenta); }
.poll .question { font-size: 19px; font-weight: 800; margin: 4px 0 12px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-style: normal;
  text-transform: none;
  border-radius: 14px;
  background: rgba(3, 4, 16, 0.85);
  border-width: 3px;
}
.option .letter { font-size: 24px; font-weight: 900; font-style: italic; min-width: 22px; }
.option.chosen { box-shadow: 0 0 0 3px #fff inset; }
.option-0 { border-color: var(--a); } .option-0 .letter { color: var(--a); }
.option-1 { border-color: var(--b); } .option-1 .letter { color: var(--b); }
.option-2 { border-color: var(--c); } .option-2 .letter { color: var(--c); }
.option-3 { border-color: var(--d); } .option-3 .letter { color: var(--d); }
.option-4 { border-color: var(--e); } .option-4 .letter { color: var(--e); }
.option-5 { border-color: var(--f); } .option-5 .letter { color: var(--f); }

.timer { height: 8px; background: rgba(255, 255, 255, 0.12); border-radius: 99px; overflow: hidden; margin: 12px 0 4px; }
.timer > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--magenta)); transition: width 0.25s linear; }

.result { display: grid; grid-template-columns: 28px 1fr 52px; gap: 8px; align-items: center; margin-bottom: 8px; font-weight: 800; }
.result .bar { height: 18px; background: rgba(255, 255, 255, 0.1); border-radius: 99px; overflow: hidden; }
.result .bar > div { height: 100%; border-radius: 99px; }
.result .percent { text-align: right; color: var(--gold); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choices button, .pair button { font-size: 15px; padding: 12px 8px; font-style: normal; text-transform: none; }
.choices button.picked, .pair button.picked { background: var(--gold); color: #2a1100; border-color: #fff2b8; }
.prediction h2 { color: var(--cyan); }
.prediction p { margin: 0 0 8px; font-weight: 800; }

.idle { text-align: center; color: var(--muted); font-weight: 700; }

.leaders { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.leaders li { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); font-weight: 800; }
.leaders li::before { counter-increment: rank; content: counter(rank) "."; color: var(--gold); margin-right: 10px; }
.leaders li span:first-child { flex: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--gold);
  color: #2a1100;
  font-weight: 900;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

[hidden] { display: none !important; }
