/* Chanukah 2026 Game Show — midnight navy, glowing royal blue, metallic silver */
:root {
  --navy-0: #030a24;
  --navy-1: #07123a;
  --navy-2: #0c1d5c;
  --royal: #1d4ed8;
  --royal-glow: #3b82f6;
  --ice: #bcd3ff;
  --silver-1: #f4f6fb;
  --silver-2: #c3cad8;
  --silver-3: #7d879c;
  --gold: #ffd23f;
  --good: #4ade80;
  --bad: #f87171;
  --radius: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--silver-1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(59,130,246,.35), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(29,78,216,.25), transparent 60%),
    linear-gradient(180deg, var(--navy-1), var(--navy-0));
  overflow-x: hidden;
}
/* metallic silver outer frame */
.frame {
  position: relative;
  min-height: 100vh;
  border: 10px solid transparent;
  border-image: linear-gradient(135deg, #ffffff, #9aa3b5 18%, #eef1f7 35%, #6f7a90 55%, #f6f8fc 75%, #a5aec0) 1;
  box-shadow: inset 0 0 0 2px rgba(59,130,246,.6), inset 0 0 60px rgba(59,130,246,.25);
  display: flex;
  flex-direction: column;
}
.sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sparkles i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 2px rgba(188,211,255,.8);
  animation: twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--delay, 0s); opacity: .2;
}
@keyframes twinkle { 0%,100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.4); } }

main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 20px 12px; }
.narrow { max-width: 560px; }

h1, h2, h3 { margin: 0 0 12px; letter-spacing: .02em; }
.brand {
  text-align: center; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  font-size: clamp(26px, 5vw, 52px); line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 10%, #c9d6f5 50%, #8ea2cf 51%, #eef2fb 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(59,130,246,.85)) drop-shadow(0 2px 0 #0b1a52);
}
.sub { text-align: center; color: var(--ice); margin: 4px 0 20px; font-weight: 600; }
.glow { text-shadow: 0 0 12px rgba(59,130,246,.9), 0 0 32px rgba(59,130,246,.6); }

.card {
  background: linear-gradient(180deg, rgba(29,78,216,.28), rgba(7,18,58,.85));
  border: 1px solid rgba(195,202,216,.45);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.18);
  padding: 20px;
  margin-bottom: 16px;
}
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; letter-spacing: .03em;
  color: #fff; padding: 14px 22px; border-radius: 999px; font-size: 17px;
  background: linear-gradient(180deg, #4f86ff, var(--royal) 55%, #173fae);
  box-shadow: 0 0 0 2px rgba(244,246,251,.65), 0 6px 18px rgba(29,78,216,.55), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .08s ease, filter .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.btn.silver { color: #0b1640; background: linear-gradient(180deg, #ffffff, #c3cad8 60%, #9aa3b5); }
.btn.ghost { background: transparent; box-shadow: 0 0 0 2px rgba(195,202,216,.6); }
.btn.big { font-size: 22px; padding: 18px 30px; }
.btn.small { font-size: 14px; padding: 8px 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; }
.muted { color: var(--silver-2); opacity: .85; }
.hidden { display: none !important; }

input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 20px; padding: 14px 16px; border-radius: 14px;
  color: #fff; background: rgba(3,10,36,.75); border: 2px solid rgba(195,202,216,.5); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--royal-glow); box-shadow: 0 0 0 4px rgba(59,130,246,.35); }
.code-input { text-transform: uppercase; letter-spacing: .5em; text-align: center; font-size: 34px; font-weight: 900; }

/* team picker */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.side-col h3 { text-align: center; text-transform: uppercase; letter-spacing: .12em; font-size: 15px; color: var(--ice); }
.team-btn {
  width: 100%; margin-bottom: 10px; text-align: left; padding: 14px 16px; border-radius: 14px; cursor: pointer; font: inherit;
  color: #fff; font-weight: 800; font-size: 17px; border: 1px solid rgba(195,202,216,.5);
  background: linear-gradient(180deg, rgba(59,130,246,.45), rgba(12,29,92,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.team-btn small { display: block; font-weight: 500; font-size: 13px; color: var(--ice); }
.team-btn:hover { filter: brightness(1.15); }
.team-btn.locked { cursor: not-allowed; opacity: .6; filter: grayscale(.5); background: linear-gradient(180deg, rgba(74,222,128,.18), rgba(12,29,92,.9)); border-color: rgba(74,222,128,.6); }
.team-btn.locked:hover { filter: grayscale(.5); }
.team-btn .locked-tag { color: var(--good); font-weight: 800; }

/* v4 multiple choice (identical A–E on TV and phones) */
.choices { display: grid; gap: 12px; margin: 14px 0; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: #fff; font-weight: 800; font-size: 20px;
  padding: 14px 16px; border-radius: 16px; border: 2px solid rgba(255,255,255,.35); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3); }
.choice .letter { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.95); color: #0b1640; font-size: 26px; font-weight: 900; }
.choice.c0 { background: linear-gradient(180deg, #ef4444, #991b1b); }
.choice.c1 { background: linear-gradient(180deg, #3b82f6, #1e3a8a); }
.choice.c2 { background: linear-gradient(180deg, #f59e0b, #92400e); }
.choice.c3 { background: linear-gradient(180deg, #22c55e, #14532d); }
.choice.c4 { background: linear-gradient(180deg, #a855f7, #581c87); }
.choice.c5 { background: linear-gradient(180deg, #ec4899, #831843); }
.choice:active { transform: scale(.97); }
.choice[disabled] { cursor: wait; opacity: .7; }
.choice.picked { box-shadow: 0 0 0 4px var(--gold), 0 0 24px rgba(255,210,63,.6); }
.choice.decoy { opacity: .45; filter: grayscale(.6); }
.choice.real { box-shadow: 0 0 0 4px var(--good), 0 0 24px rgba(74,222,128,.55); }
.choice small { display: block; font-size: .7em; font-weight: 700; opacity: .9; }
.tv-choices { grid-template-columns: 1fr 1fr; max-width: 1200px; margin: 18px auto; }
.tv-choices .choice { font-size: clamp(24px, 2.6vw, 40px); padding: 18px 22px; cursor: default; }
.tv-choices .choice .letter { width: 70px; height: 70px; font-size: 40px; }
@media (max-width: 900px) { .tv-choices { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pill.parents { background: rgba(255,210,63,.18); color: var(--gold); border: 1px solid rgba(255,210,63,.5); }
.pill.kids { background: rgba(74,222,128,.15); color: #86efac; border: 1px solid rgba(74,222,128,.5); }

/* progress */
.progress { height: 14px; border-radius: 999px; background: rgba(3,10,36,.8); border: 1px solid rgba(195,202,216,.4); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #93c5fd, var(--royal-glow), #e0e7ff); box-shadow: 0 0 12px var(--royal-glow); transition: width .35s ease; }

.qcard { animation: pop .35s cubic-bezier(.2,1.4,.4,1); text-align: center; }
.qcard .emoji { font-size: 72px; line-height: 1; display: block; margin: 6px 0 10px; filter: drop-shadow(0 0 18px rgba(59,130,246,.8)); }
.qcard .qtext { font-size: clamp(22px, 4.5vw, 34px); font-weight: 900; margin-bottom: 16px; }
@keyframes pop { from { transform: scale(.85) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.bounce { animation: bounce 1.4s ease-in-out infinite; display: inline-block; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* scoreboard */
.board { display: flex; flex-direction: column; gap: 10px; }
.board-row {
  display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 14px;
  padding: 10px 18px 10px 10px; border-radius: 16px;
  background: linear-gradient(180deg, #4f86ff 0%, #1d4ed8 48%, #1238a8 52%, #0f2f8f 100%);
  border: 1px solid rgba(244,246,251,.6);
  box-shadow: 0 6px 20px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.25);
  font-size: clamp(18px, 2.4vw, 28px); font-weight: 800;
  animation: slidein .5s ease both;
}
.board-row:nth-child(2) { animation-delay: .08s } .board-row:nth-child(3) { animation-delay: .16s }
.board-row:nth-child(4) { animation-delay: .24s } .board-row:nth-child(5) { animation-delay: .32s }
.board-row:nth-child(6) { animation-delay: .40s } .board-row:nth-child(7) { animation-delay: .48s }
.board-row:nth-child(8) { animation-delay: .56s }
@keyframes slidein { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.rank-badge {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 24px; color: #0b1640;
  background: radial-gradient(circle at 35% 30%, #ffffff, #d7dce6 40%, #8b95a9 75%, #c9cfdb);
  box-shadow: 0 0 0 3px rgba(11,22,64,.6), 0 0 14px rgba(255,255,255,.5);
}
.board-row .label { font-size: .7em; padding: 4px 12px; border-radius: 999px; background: rgba(3,10,36,.45); border: 1px solid rgba(244,246,251,.5); white-space: nowrap; }
.board-row .score { font-variant-numeric: tabular-nums; min-width: 80px; text-align: right; }
.board-row.first { box-shadow: 0 0 0 3px var(--gold), 0 0 30px rgba(255,210,63,.5), inset 0 2px 0 rgba(255,255,255,.45); }

.winner {
  text-align: center; font-weight: 900; text-transform: uppercase; line-height: 1.05;
  font-size: clamp(34px, 6.5vw, 88px); margin: 8px 0 18px;
  background: linear-gradient(180deg, #fff 15%, #ffe680 45%, #e6b800 55%, #fff6cc 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255,210,63,.75)) drop-shadow(0 0 40px rgba(59,130,246,.8));
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; margin: 18px 0; }
.vs .side { text-align: center; padding: 18px; border-radius: 20px; border: 2px solid rgba(244,246,251,.55); background: linear-gradient(180deg, rgba(59,130,246,.35), rgba(7,18,58,.9)); }
.vs .side.lead { box-shadow: 0 0 0 3px var(--gold), 0 0 40px rgba(255,210,63,.4); }
.vs .side .pts { font-size: clamp(40px, 6vw, 84px); font-weight: 900; font-variant-numeric: tabular-nums; }
.vs .mid { align-self: center; font-size: 40px; font-weight: 900; color: var(--silver-2); }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(3,10,36,.6); border: 1px solid rgba(195,202,216,.35); font-weight: 700; }
.check .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: rgba(195,202,216,.2); }
.check.done .mark { background: var(--good); color: #052e16; box-shadow: 0 0 10px rgba(74,222,128,.7); }

.room-code { font-size: clamp(48px, 8vw, 96px); font-weight: 900; letter-spacing: .25em; text-align: center; }
.qr { background: #fff; border-radius: 16px; padding: 10px; width: 200px; height: 200px; box-shadow: 0 0 0 4px var(--silver-2), 0 0 30px rgba(59,130,246,.6); }
.qr img { width: 100%; height: 100%; display: block; }

.toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 50; background: #0b1640; border: 2px solid var(--silver-2); padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.toast.err { border-color: var(--bad); }

/* clip modal */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(3,10,36,.82); backdrop-filter: blur(4px); }
.modal-inner { width: min(900px, 92vw); border-radius: 22px; padding: 14px; background: linear-gradient(180deg, #e9edf5, #9aa3b5); box-shadow: 0 0 60px rgba(59,130,246,.7); }
.modal video { width: 100%; border-radius: 12px; display: block; background: #000; aspect-ratio: 16/9; }
.fallback-card { aspect-ratio: 16/9; border-radius: 12px; display: grid; place-items: center; text-align: center; color: #fff; background: radial-gradient(circle, #1d4ed8, #07123a); }
.fallback-card .big-emoji { font-size: 120px; animation: bounce 1s ease-in-out infinite; }
.fallback-card .gag { font-size: 44px; font-weight: 900; text-transform: uppercase; }

.footer {
  position: relative; z-index: 1; text-align: center; padding: 14px 10px 16px; font-weight: 900; letter-spacing: .18em;
  font-size: clamp(11px, 1.6vw, 15px); color: var(--silver-1);
  border-top: 1px solid rgba(195,202,216,.35); background: linear-gradient(180deg, transparent, rgba(3,10,36,.8));
  text-shadow: 0 0 10px rgba(59,130,246,.8);
}

.reveal-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: clamp(16px, 2vw, 22px); }
.reveal-table td, .reveal-table th { padding: 10px 12px; text-align: left; }
.reveal-table tr td { background: rgba(29,78,216,.25); }
.reveal-table tr td:first-child { border-radius: 12px 0 0 12px; }
.reveal-table tr td:last-child { border-radius: 0 12px 12px 0; }
.pts-good { color: var(--good); font-weight: 900; }
.flip { animation: flip .6s ease both; }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

.confetti { position: fixed; top: -20px; z-index: 60; width: 10px; height: 16px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 640px) {
  .team-grid { grid-template-columns: 1fr; }
  .vs { grid-template-columns: 1fr; }
  .vs .mid { display: none; }
  .board-row { grid-template-columns: 48px 1fr auto; }
  .board-row .label { grid-column: 2; justify-self: start; font-size: 12px; }
  .rank-badge { width: 42px; height: 42px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
