:root {
  --bg: #2b1055;
  --bg2: #7597de;
  --card: #ffffffee;
  --ink: #1d1d2c;
  --muted: #6b6b80;
  --c0: #e21b3c; /* red triangle */
  --c1: #1368ce; /* blue diamond */
  --c2: #d89e00; /* yellow circle */
  --c3: #26890c; /* green square */
  --good: #26890c;
  --bad: #e21b3c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg), #5b2a86 50%, var(--bg2));
  background-attachment: fixed;
  min-height: 100vh;
}
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
main.wide { max-width: 1100px; }

h1, h2, h3 { margin: 0 0 8px; }
.title { color: #fff; text-align: center; font-size: 2.2rem; margin: 24px 0 4px; text-shadow: 0 3px 0 #0004; }
.sub { color: #fffc; text-align: center; margin: 0 0 24px; }
.card { background: var(--card); border-radius: 18px; padding: 18px; box-shadow: 0 8px 24px #0003; margin-bottom: 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }

button { font: inherit; border: 0; border-radius: 14px; cursor: pointer; }
.btn { background: #fff; color: var(--ink); padding: 14px 18px; font-weight: 700; font-size: 1.05rem; box-shadow: 0 4px 0 #0003; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0003; }
.btn.primary { background: #ffd23f; }
.btn.go { background: var(--good); color: #fff; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .4; }
.link { background: none; color: #fffa; text-decoration: underline; padding: 8px; font-size: .9rem; }

.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.names .btn { padding: 18px; font-size: 1.2rem; }
input[type=text], input[type=number] {
  font: inherit; font-size: 1.1rem; padding: 12px; border-radius: 12px; border: 2px solid #ccc; width: 100%;
}
label.toggle { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: 1.05rem; }
label.toggle input { width: 24px; height: 24px; }

/* Player question screen */
.topbar { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; margin-bottom: 10px; }
.pill { background: #fff3; padding: 6px 12px; border-radius: 99px; }
.round { color: #ffd23f; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
.question { font-size: 1.35rem; font-weight: 800; line-height: 1.3; }
.tv { background: #000; color: #fff; padding: 8px 12px; border-radius: 10px; display: inline-block; margin-top: 8px; font-weight: 700; }
.double { background: #ffd23f; padding: 4px 10px; border-radius: 99px; font-weight: 800; display: inline-block; margin-bottom: 6px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt {
  color: #fff; min-height: 96px; padding: 12px; font-size: 1.1rem; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 5px 0 #0004; transition: transform .1s, opacity .2s, outline .1s; text-align: center;
}
.opt .shape { font-size: 1.3rem; opacity: .9; }
.opt .emoji { font-size: 2.6rem; line-height: 1; }
.opt.c0 { background: var(--c0); } .opt.c1 { background: var(--c1); }
.opt.c2 { background: var(--c2); } .opt.c3 { background: var(--c3); }
.opt.selected { outline: 5px solid #fff; transform: scale(1.03); }
.opt.dim { opacity: .3; }
.opt.wrong { opacity: .55; outline: 5px dashed #fff; }
.opt.right { outline: 6px solid #fff; animation: pop .4s; }
.kid .opt { min-height: 140px; }
.kid .opt .emoji { font-size: 4rem; }
.kid .opt .label { font-size: .95rem; }

.status { margin-top: 14px; text-align: center; color: #fff; font-size: 1.15rem; font-weight: 700; }
.feedback { font-size: 2rem; text-align: center; margin: 8px 0; color: #fff; font-weight: 900; }
.actions { margin-top: 14px; display: grid; gap: 10px; }

.bigscore { font-size: 6rem; font-weight: 900; text-align: center; color: #ffd23f; text-shadow: 0 5px 0 #0005; line-height: 1; }

/* Host */
.tabs { display: flex; gap: 8px; margin: 8px 0 16px; justify-content: center; flex-wrap: wrap; }
.tabs .btn { padding: 10px 16px; }
.tabs .btn.on { background: #ffd23f; }
.host .question { font-size: 2.4rem; }
.host .opt { min-height: 120px; font-size: 1.6rem; }
.host .opt .emoji { font-size: 3rem; }
.video { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; margin: 12px 0; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.roundcard { text-align: center; padding: 48px 18px; }
.roundcard h2 { font-size: 2.6rem; }

table.scores { width: 100%; border-collapse: collapse; }
table.scores td, table.scores th { padding: 8px 4px; border-bottom: 1px solid #0001; text-align: center; }
table.scores td:first-child, table.scores th:first-child { text-align: left; font-weight: 800; }
table.scores input { width: 70px; text-align: center; padding: 8px; }
.pm { display: inline-flex; align-items: center; gap: 6px; }
.pm button { width: 40px; height: 40px; font-size: 1.3rem; font-weight: 900; background: #eee; }
.total { font-size: 1.4rem; font-weight: 900; }

.challenges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.challenge { cursor: pointer; }
.challenge .pts { color: var(--good); font-weight: 800; }
.overlay { position: fixed; inset: 0; background: #000c; display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10; }
.overlay .card { max-width: 800px; width: 100%; text-align: center; }
.overlay h2 { font-size: 3rem; }
.overlay p { font-size: 1.6rem; }

.podium { list-style: none; padding: 0; margin: 0; }
.podium li { font-size: 1.6rem; font-weight: 800; padding: 12px; border-radius: 12px; margin: 8px 0; background: #f2f2f7; display: flex; justify-content: space-between; animation: pop .4s; }
.podium li.first { background: #ffd23f; font-size: 2.2rem; }

@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

#confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
#confetti span { position: absolute; top: -40px; font-size: 28px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.podium small { font-size: .85rem; font-weight: 600; margin-left: 6px; }
