/* The O'Bryans' Halloween Trivia: shared theme (phone, host, TV). */
@font-face {
  font-family: 'Creepster';
  src: url('/fonts/creepster.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #0c0614;
  --bg2: #1a0b2e;
  --card: rgba(28, 14, 46, 0.86);
  --card2: rgba(44, 22, 70, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6efff;
  --muted: #b9a7d4;
  --pumpkin: #ff7a18;
  --pumpkin2: #ffb347;
  --slime: #a3e635;
  --blood: #f43f5e;
  --purple: #8b5cf6;
  --team: #ff7a18;
  --spooky: 'Creepster', 'Chiller', 'Papyrus', fantasy;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 80% -10%, rgba(255, 122, 24, 0.22), transparent 55%),
    radial-gradient(ellipse at 10% 110%, rgba(139, 92, 246, 0.30), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; }

.spooky { font-family: var(--spooky); font-weight: 400; letter-spacing: 0.02em; }
.muted { color: var(--muted); }

/* a moon and drifting fog behind everything */
.moon {
  position: fixed; top: -60px; right: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff7d6, #ffd27a 55%, #c98b2b 100%);
  box-shadow: 0 0 80px 30px rgba(255, 196, 92, 0.25);
  opacity: 0.55; pointer-events: none; z-index: 0;
}
.fog {
  position: fixed; left: -50%; right: -50%; bottom: -40px; height: 220px; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, rgba(200, 180, 255, 0.10), transparent 70%);
  animation: fog 40s linear infinite alternate;
}
@keyframes fog { from { transform: translateX(-10%); } to { transform: translateX(10%); } }

.haunt { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.haunt span {
  position: absolute; left: -10%; opacity: 0.5;
  animation-name: drift; animation-timing-function: linear; animation-iteration-count: infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(30vw, -4vh) rotate(6deg); }
  50% { transform: translate(60vw, 3vh) rotate(-6deg); }
  75% { transform: translate(90vw, -3vh) rotate(8deg); }
  100% { transform: translate(120vw, 0) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) { .fog { animation: none; } }

/* ---------- phone (player + host) ---------- */
.phone { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; min-height: 100vh; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
}
.chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--team); box-shadow: 0 0 10px var(--team); flex: none; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px; font-size: 0.9rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); margin-bottom: 14px;
}
.center { text-align: center; }
.big-emoji { font-size: 4.5rem; line-height: 1; margin: 6px 0 10px; }
.wobble { display: inline-block; animation: wobble 2.6s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-6px); } }

h1.title { font-family: var(--spooky); font-weight: 400; color: var(--pumpkin); text-shadow: 0 0 18px rgba(255, 122, 24, 0.55), 0 3px 0 #4a1d00; margin: 4px 0 8px; line-height: 1.05; }
.welcome h1.title { font-size: 2.6rem; }
.welcome p { font-size: 1.05rem; line-height: 1.5; }

.btn {
  display: block; width: 100%; min-height: 54px; border: 0; border-radius: 16px; padding: 14px 18px;
  font-weight: 800; font-size: 1.1rem; letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--pumpkin2), var(--pumpkin)); color: #2a1000;
  box-shadow: 0 6px 0 #9a3d00, 0 10px 24px rgba(255, 122, 24, 0.35);
  transition: transform 0.08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #9a3d00; }
.btn[disabled] { opacity: 0.45; }
.btn.ghost { background: var(--card2); color: var(--text); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5); border: 1px solid var(--line); }
.btn.danger { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; box-shadow: 0 5px 0 #7f1028; }
.btn + .btn { margin-top: 12px; }

label.field { display: block; font-weight: 700; margin: 4px 0 8px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.35); color: var(--text); font-size: 1.1rem;
}
.input:focus { outline: none; border-color: var(--pumpkin); }

.teams { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
.team-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px;
  border-radius: 18px; border: 2px solid var(--c); text-align: left;
  background: rgba(0, 0, 0, 0.3);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 34%, transparent), rgba(0, 0, 0, 0.25));
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 30%, transparent);
}
.team-btn .em { font-size: 2rem; }
.team-btn .nm { font-weight: 800; font-size: 1.15rem; flex: 1; }
.team-btn .ct { color: var(--muted); font-size: 0.9rem; }
.team-btn.mine { outline: 3px solid #fff; outline-offset: 2px; }

.meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: 0.95rem; margin: 2px 4px 10px; }
.timer {
  min-width: 64px; text-align: center; padding: 6px 12px; border-radius: 999px; font-weight: 900; font-variant-numeric: tabular-nums;
  background: var(--card2); color: var(--pumpkin2); border: 1px solid var(--line);
}
.timer.low { color: #fff; background: var(--blood); animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.qtext { font-size: 1.35rem; font-weight: 800; line-height: 1.35; margin: 0 0 16px; }

.choices { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 14px;
  border-radius: 18px; border: 2px solid var(--line); background: var(--card2); text-align: left;
  font-size: 1.1rem; font-weight: 700; transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.choice:active { transform: scale(0.98); }
.choice .lt {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); font-weight: 900; color: var(--pumpkin2);
}
.choice.picked { border-color: var(--team); background: rgba(255, 255, 255, 0.12); background: color-mix(in srgb, var(--team) 30%, var(--card2)); box-shadow: 0 0 18px color-mix(in srgb, var(--team) 45%, transparent); }
.choice.picked .lt { background: var(--team); color: #fff; }
.choice[disabled] { cursor: default; }
.choice.locked:not(.picked) { opacity: 0.5; }
.choice.right { border-color: var(--slime); background: rgba(163, 230, 53, 0.18); }
.choice.right .lt { background: var(--slime); color: #1a2e05; }
.choice.wrong { border-color: var(--blood); background: rgba(244, 63, 94, 0.16); opacity: 1; }
.choice.wrong .lt { background: var(--blood); color: #fff; }
.choice .tag { margin-left: auto; font-size: 1.3rem; }

.note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.note b { color: var(--text); }
.banner { text-align: center; padding: 16px; border-radius: 18px; font-size: 1.4rem; font-weight: 900; margin-bottom: 14px; }
.banner.good { background: rgba(163, 230, 53, 0.16); border: 2px solid var(--slime); color: var(--slime); }
.banner.bad { background: rgba(244, 63, 94, 0.14); border: 2px solid var(--blood); color: #fecdd3; }
.banner.meh { background: rgba(255, 179, 71, 0.14); border: 2px solid var(--pumpkin2); color: var(--pumpkin2); }
.banner small { display: block; font-size: 0.95rem; font-weight: 700; opacity: 0.9; margin-top: 4px; }

.names { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.names span { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); font-weight: 600; }
.place { font-family: var(--spooky); font-size: 3.6rem; color: var(--pumpkin); line-height: 1; margin: 6px 0; text-shadow: 0 0 18px rgba(255, 122, 24, 0.5); }
.err { color: #fecdd3; text-align: center; margin-top: 10px; min-height: 1.2em; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
  background: #2b1140; border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-width: 90vw; text-align: center;
}
.pop { animation: pop 0.35s ease-out; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- host ---------- */
.host h2 { margin: 0 0 10px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); font-weight: 700; }
.seg button.on { background: var(--pumpkin); color: #2a1000; border-color: var(--pumpkin); }
.hq { font-size: 1.15rem; font-weight: 800; margin: 6px 0 12px; line-height: 1.35; }
.hchoice { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; background: rgba(0, 0, 0, 0.25); }
.hchoice.ok { background: rgba(163, 230, 53, 0.18); color: var(--slime); font-weight: 800; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tbl td, .tbl th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pl { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pl .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c); padding: 0; opacity: 0.35; }
.mv.on { opacity: 1; border-color: #fff; }
.x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.3); }
.warn { border-color: var(--blood); }
.status { font-size: 1.3rem; font-weight: 800; }

/* ---------- fixes from the screenshot pass ---------- */
.choice.right { opacity: 1 !important; box-shadow: 0 0 20px rgba(163, 230, 53, 0.45); }
.choice.wrong { box-shadow: none; }
.card { background: rgba(24, 11, 40, 0.95); }
@media (max-width: 700px) { .moon { width: 160px; height: 160px; top: -70px; right: -50px; opacity: 0.3; } }
.phone.mid { display: flex; flex-direction: column; justify-content: center; }
