/* Quiz ICC — Kahoot-like look: bold purple, shapes, big colored tiles */
:root {
  --purple: #46178f;
  --purple-dark: #25076b;
  --purple-light: #864cbf;
  --red: #e21b3c;
  --blue: #1368ce;
  --yellow: #d89e00;
  --green: #26890c;
  --gold: #ffd23f;
  --silver: #c8d1dc;
  --bronze: #e08a4f;
  --white: #fff;
  --ink: #1d1d1f;
  --radius: 10px;
  --shadow: 0 4px 0 rgba(0, 0, 0, .25);
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--white);
  background: var(--purple);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.07) 0 80px, transparent 81px),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,.06) 0 140px, transparent 141px),
    linear-gradient(160deg, var(--purple) 0%, var(--purple-dark) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3 { font-weight: 900; letter-spacing: -.01em; margin: .2em 0 .5em; }
.muted { opacity: .7; font-weight: 500; }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* floating background shapes */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.bg-shapes span { position: absolute; opacity: .08; animation: float 18s ease-in-out infinite; }
.bg-shapes .s1 { left: 6%; top: 60%; width: 0; height: 0; border-left: 40px solid transparent; border-right: 40px solid transparent; border-bottom: 70px solid #fff; }
.bg-shapes .s2 { right: 10%; top: 12%; width: 60px; height: 60px; background: #fff; transform: rotate(45deg); animation-delay: -6s; }
.bg-shapes .s3 { left: 70%; top: 80%; width: 70px; height: 70px; border-radius: 50%; background: #fff; animation-delay: -12s; }
@keyframes float { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 20px -30px; rotate: 25deg; } }

/* layout */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.logo { font-weight: 900; font-size: 1.25rem; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--white); color: var(--purple); display: grid; place-items: center; font-size: .95rem; }
.me { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
main { max-width: 760px; margin: 0 auto; padding: 8px 16px 100px; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: rgba(0,0,0,.35); backdrop-filter: blur(8px); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); z-index: 20; }
.bottom-nav a { text-decoration: none; display: flex; flex-direction: column; align-items: center; font-size: .75rem; gap: 2px; padding: 4px 16px; border-radius: 10px; opacity: .75; }
.bottom-nav a.active { opacity: 1; background: rgba(255,255,255,.15); }
.bottom-nav .ico { font-size: 1.35rem; }

/* cards & buttons */
.card { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.glass { background: rgba(255,255,255,.12); color: var(--white); box-shadow: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 12px 20px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; color: var(--white); background: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:hover { filter: brightness(1.08); }
.btn-big { font-size: 1.3rem; padding: 18px 28px; width: 100%; }
.btn-white { background: var(--white); color: var(--purple); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-blue { background: var(--blue); }
.btn-yellow { background: var(--yellow); }
.btn-ghost { background: rgba(255,255,255,.15); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }

/* forms */
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: .9rem; }
input, textarea, select { font: inherit; font-weight: 600; padding: 12px; border: 2px solid #d9d9e3; border-radius: 8px; width: 100%; color: var(--ink); background: #fff; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--purple-light); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 12px; font-weight: 700; animation: pop .35s ease-out; }
.flash-success { background: var(--green); }
.flash-error { background: var(--red); }

/* avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 900; color: #fff; flex-shrink: 0; border: 3px solid rgba(255,255,255,.85); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* home quiz tiles */
.quiz-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; transition: transform .1s; }
.quiz-tile:active { transform: scale(.98); }
.quiz-tile .shape { width: 52px; height: 52px; border-radius: 10px; display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0; }
.quiz-tile .grow { flex: 1; min-width: 0; }
.quiz-tile .title { font-weight: 900; font-size: 1.05rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 800; background: var(--purple); color: #fff; }
.badge.live { background: var(--red); animation: pulse 1.4s infinite; }
.badge.done { background: var(--green); }
.badge.soon { background: #888; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- play screen ---------- */
.play { position: fixed; inset: 0; display: flex; flex-direction: column; background: #f2f2f2; color: var(--ink); z-index: 30; }
.play-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); font-weight: 800; }
.timer-bar { height: 8px; background: #ddd; }
.timer-bar > div { height: 100%; background: var(--purple-light); transform-origin: left; }
.question-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 18px; }
.question-text { background: #fff; padding: 18px 20px; border-radius: 6px; box-shadow: 0 3px 8px rgba(0,0,0,.12); font-size: clamp(1.15rem, 4.5vw, 1.8rem); font-weight: 800; text-align: center; max-width: 900px; width: 100%; animation: drop .45s cubic-bezier(.2,1.4,.4,1); }
.countdown { width: 74px; height: 74px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 900; box-shadow: 0 4px 0 var(--purple-dark); }
.countdown.hurry { background: var(--red); box-shadow: 0 4px 0 #8f0f24; animation: shake .5s infinite; }
.choices { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .choices { grid-template-columns: repeat(3, 1fr); } .choice { min-height: 160px; } }
.choice { position: relative; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 6px; padding: 18px 16px; min-height: 84px; font: inherit; font-size: 1.15rem; font-weight: 800; color: #fff; text-align: left; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.3); opacity: 0; animation: tile-in .4s cubic-bezier(.2,1.4,.4,1) forwards; transition: transform .1s, opacity .25s, filter .25s; }
.choice:nth-child(2) { animation-delay: .08s; }
.choice:nth-child(3) { animation-delay: .16s; }
.choice:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.choice.c0 { background: var(--red); }
.choice.c1 { background: var(--blue); }
.choice.c2 { background: var(--yellow); }
.choice .icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; }
.choices.locked .choice:not(.picked) { opacity: .25 !important; filter: grayscale(.6); }
.choices.locked .choice.picked { transform: scale(1.03); }
.waiting { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(70,23,143,.92); color: #fff; z-index: 40; font-size: 1.4rem; font-weight: 900; text-align: center; animation: fade .2s; }
.spinner { width: 54px; height: 54px; border: 6px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 14px; }

/* svg shapes in tiles */
.shape-tri { width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent; border-bottom: 30px solid #fff; }
.shape-dia { width: 24px; height: 24px; background: #fff; transform: rotate(45deg); }
.shape-cir { width: 30px; height: 30px; border-radius: 50%; background: #fff; }

/* ---------- feedback screen ---------- */
.feedback { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; z-index: 30; }
.feedback.ok { background: var(--green); }
.feedback.ko { background: var(--red); }
.feedback.timeout { background: #333; }
.feedback .big { font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 900; animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.feedback .mark { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 3.4rem; animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.feedback.ok .mark { color: var(--green); }
.feedback.ko .mark, .feedback.timeout .mark { color: var(--red); }
.points-pill { background: rgba(0,0,0,.25); padding: 10px 22px; border-radius: 99px; font-size: 1.3rem; font-weight: 900; animation: rise .6s .2s both; }
.verse { background: rgba(0,0,0,.2); border-radius: 10px; padding: 14px 18px; max-width: 560px; font-weight: 600; line-height: 1.45; animation: rise .6s .35s both; }
.verse strong { display: block; margin-bottom: 4px; }

/* ---------- lobby & 3-2-1 ---------- */
.lobby { text-align: center; padding-top: 6vh; }
.lobby .book { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 900; animation: drop .6s cubic-bezier(.2,1.4,.4,1); }
.rules { display: grid; gap: 8px; text-align: left; max-width: 380px; margin: 20px auto; }
.rules div { background: rgba(255,255,255,.12); padding: 10px 14px; border-radius: 8px; }
.go-overlay { position: fixed; inset: 0; background: var(--purple); display: grid; place-items: center; z-index: 50; }
.go-overlay .n { font-size: 9rem; font-weight: 900; animation: zoom .9s ease-out; }
.go-overlay .ring { position: absolute; width: 220px; height: 220px; border-radius: 50%; border: 10px solid rgba(255,255,255,.25); animation: spin 1s linear infinite; border-top-color: #fff; }

/* ---------- leaderboard & podium ---------- */
.tabs { display: flex; background: rgba(0,0,0,.25); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.tabs a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 8px; text-decoration: none; font-weight: 800; font-size: .95rem; opacity: .75; }
.tabs a.active { background: #fff; color: var(--purple); opacity: 1; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: 270px; margin: 10px 0 20px; }
.podium .step { width: 31%; max-width: 160px; display: flex; flex-direction: column; align-items: center; }
.podium .who { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; opacity: 0; animation: rise .5s forwards; text-align: center; }
.podium .name { font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 8px 8px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 10px; color: var(--ink); font-weight: 900; transform-origin: bottom; animation: grow .8s cubic-bezier(.2,1.2,.4,1) both; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.podium .medal { font-size: 2rem; }
.podium .p1 .block { height: 150px; background: var(--gold); animation-delay: 1.1s; }
.podium .p2 .block { height: 110px; background: var(--silver); animation-delay: .6s; }
.podium .p3 .block { height: 80px; background: var(--bronze); animation-delay: .2s; }
.podium .p1 .who { animation-delay: 1.8s; }
.podium .p2 .who { animation-delay: 1.3s; }
.podium .p3 .who { animation-delay: .9s; }
.podium .p1 .avatar { width: 70px; height: 70px; font-size: 1.8rem; box-shadow: 0 0 0 4px var(--gold), 0 0 30px var(--gold); }
.podium .crown { font-size: 1.8rem; animation: bounce 1.2s 2.3s infinite; }
.ranking { list-style: none; padding: 0; margin: 0; }
.ranking li { display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; box-shadow: 0 3px 0 rgba(0,0,0,.2); opacity: 0; animation: slide .4s forwards; }
.ranking li.me { outline: 4px solid var(--gold); }
.ranking .pos { width: 28px; font-weight: 900; font-size: 1.15rem; text-align: center; }
.ranking .nick { flex: 1; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .stats { font-size: .75rem; opacity: .6; font-weight: 600; }
.ranking .pts { font-weight: 900; font-size: 1.15rem; background: var(--purple); color: #fff; border-radius: 6px; padding: 4px 10px; min-width: 56px; text-align: center; }
.provisional { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; background: rgba(255,255,255,.15); padding: 4px 10px; border-radius: 99px; }
.provisional::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3f3; animation: pulse 1.2s infinite; }
.winner-banner { text-align: center; background: linear-gradient(135deg, var(--gold), #ffb100); color: var(--ink); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; font-weight: 900; box-shadow: var(--shadow); animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
.score-big { font-size: 4rem; font-weight: 900; line-height: 1; }
.q-recap { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.q-recap span { width: 46px; height: 46px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; opacity: 0; animation: pop .4s forwards; }
.q-recap .p3 { background: var(--gold); color: var(--ink); }
.q-recap .p2 { background: var(--green); }
.q-recap .p0 { background: var(--red); }

/* admin */
.admin table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin td, .admin th { padding: 8px 4px; border-bottom: 1px solid #eee; text-align: left; vertical-align: middle; }
.admin .q-block { border: 2px solid #eee; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.admin .q-choices { display: grid; gap: 6px; }
.admin .q-choice { display: flex; align-items: center; gap: 8px; }
.admin .q-choice input[type=radio] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--green); }
.admin .q-choice .sw { width: 14px; height: 38px; border-radius: 4px; flex-shrink: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details summary { cursor: pointer; font-weight: 800; }
pre.prompt { white-space: pre-wrap; background: #f5f3fa; padding: 12px; border-radius: 8px; font-size: .8rem; max-height: 220px; overflow: auto; }

/* sound toggle */
.sound-toggle { background: rgba(255,255,255,.15); border: 0; border-radius: 50%; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; }
.play .sound-toggle { background: #eee; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* animations */
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes drop { 0% { transform: translateY(-40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes rise { 0% { transform: translateY(30px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slide { 0% { transform: translateX(-30px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes grow { 0% { transform: scaleY(0); } 100% { transform: scaleY(1); } }
@keyframes tile-in { 0% { transform: scale(.6) translateY(20px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes zoom { 0% { transform: scale(2.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(.9); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* live refresh: no replay of the entrance animations */
.no-anim, .no-anim * { animation: none !important; opacity: 1 !important; }

/* admin on phones */
.grid-2 > *, .q-choice > input:not([type=radio]) { min-width: 0; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.admin .table-wrap { overflow-x: auto; margin: 12px 0; }
.admin table td, .admin table th { white-space: nowrap; }
.admin table td.wrap { white-space: normal; }
.icon-btn { width: 34px; height: 34px; padding: 0; font-size: 1.05rem; }
.admin td .row { flex-wrap: nowrap; gap: 6px; }
.admin td .avatar { vertical-align: middle; margin-right: 6px; }
@media (max-width: 520px) { .hide-sm { display: none; } }

/* ---------- SVG icons ---------- */
.i { flex-shrink: 0; vertical-align: -0.18em; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.with-icon > span:not(.avatar) { flex: 1; }
.with-icon > .avatar { flex: 0 0 auto; }
h1.with-icon > .i, h2.with-icon > .i { color: var(--gold); }
.card h2.with-icon > .i, .card h3.with-icon > .i { color: var(--purple-light); }
.sound-toggle { display: inline-grid; place-items: center; color: #fff; }
.play .sound-toggle { color: var(--ink); }
.sound-toggle .off, .sound-toggle.muted .on { display: none; }
.sound-toggle.muted .off { display: inline; }
.bottom-nav .ico { width: 24px; height: 24px; }
.rules .with-icon .i { color: var(--gold); }
.badge .i { vertical-align: -0.2em; }
.shape-sq { width: 26px; height: 26px; background: #fff; border-radius: 3px; }
.quiz-tile .shape .shape-tri { border-left-width: 15px; border-right-width: 15px; border-bottom-width: 26px; }
.quiz-tile .shape .shape-dia { width: 22px; height: 22px; }
.quiz-tile .shape .shape-cir { width: 28px; height: 28px; }
.rank-disc { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 900; color: var(--ink); }
.rank-disc.r1 { background: var(--gold); } .rank-disc.r2 { background: var(--silver); } .rank-disc.r3 { background: var(--bronze); }
.podium .medal { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.6); display: grid; place-items: center; font-size: 1.35rem; font-weight: 900; margin-bottom: 4px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.podium .crown { color: var(--gold); display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.podium .crown .i { fill: var(--gold); stroke: #b8860b; }
.ranking .stats .i { vertical-align: -0.2em; color: var(--yellow); }
.q-recap span .i { color: currentColor; }
.q-recap .p3 { color: var(--ink); }
.points-pill .i { vertical-align: -0.2em; margin: 0 2px; }
.points-pill .i:first-child { color: var(--gold); }
.winner-banner .i { color: var(--ink); }
.legend { line-height: 2; }
.legend .mini { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #fff; vertical-align: middle; }
.btn .i { margin: 0; }
details summary .i { vertical-align: -0.2em; }

/* =====================================================================
   LIVE MODE
   ===================================================================== */

/* ---------- player phone ---------- */
.live-player { position: fixed; inset: 0; display: flex; flex-direction: column; transition: background .35s; color: #fff; }
.live-player.bg-purple { background: linear-gradient(160deg, var(--purple), var(--purple-dark)); }
.live-player.bg-light { background: #f2f2f2; color: var(--ink); }
.live-player.bg-green { background: var(--green); }
.live-player.bg-red { background: var(--red); }
.live-player.bg-dark { background: #333; }
.live-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.live-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 64px 12px 14px; font-weight: 800; }
.bg-light .live-top { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.pts-chip { background: rgba(0,0,0,.25); color: #fff; padding: 4px 10px; border-radius: 99px; font-size: .85rem; }
.live-sound { position: fixed; top: 8px; right: 10px; z-index: 5; }
.bg-light .live-sound { color: var(--ink); background: #eee; }
.live-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px; animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
.live-center h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); margin: 0; }
.live-center p { margin: 0; opacity: .9; }
.live-center .mark { width: 96px; height: 96px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.bg-green .mark { color: var(--green); } .bg-red .mark, .bg-dark .mark { color: var(--red); }
.live-timer { height: 8px; background: #ddd; } .live-timer > div { height: 100%; background: var(--purple-light); transform-origin: left; }
.live-buttons { flex: 1; display: grid; grid-template-rows: repeat(3, 1fr); gap: 10px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
.live-buttons .choice { justify-content: center; min-height: 0; }
.live-buttons .choice .icon { width: 90px; height: 90px; }
.live-buttons .choice .shape-tri { border-left-width: 42px; border-right-width: 42px; border-bottom-width: 72px; }
.live-buttons .choice .shape-dia { width: 60px; height: 60px; }
.live-buttons .choice .shape-cir { width: 76px; height: 76px; }
.live-buttons.locked .choice:not(.picked) { opacity: .2; filter: grayscale(.7); }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; border-width: 2px; }
.avatar.xl { width: 110px; height: 110px; font-size: 3rem; border-width: 5px; }
.avatar.pulse { animation: pulse 1.4s infinite; }
.big-rank { font-size: 7rem; font-weight: 900; line-height: 1; }
.big-rank sup { font-size: 2.4rem; }
.rank-line { font-size: 1.2rem; margin-top: 8px !important; }
.mini-podium { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.mini-podium li { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15); padding: 6px 12px; border-radius: 8px; }
.mini-podium li strong { margin-left: auto; padding-left: 16px; }

/* ---------- host big screen ---------- */
.live-host { position: fixed; inset: 0; display: flex; flex-direction: column; background: linear-gradient(160deg, var(--purple), var(--purple-dark)); color: #fff; font-size: clamp(16px, 1.4vw, 26px); }
.host-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: rgba(0,0,0,.25); }
.host-bar .logo { font-size: 1.1em; }
.host-count { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.3em; background: rgba(255,255,255,.15); padding: 4px 16px; border-radius: 99px; }
.host-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2vh 3vw; overflow: hidden; }
.host-footer { display: flex; justify-content: flex-end; padding: 0 3vw 2vh; }
.host-footer .btn { width: auto; min-width: 260px; font-size: 1.2em; }
.btn-ghost.on { background: var(--green); }

.host-lobby { flex: 1; display: grid; grid-template-columns: minmax(300px, 34%) 1fr; gap: 3vw; align-items: start; }
.join-box { background: #fff; color: var(--ink); border-radius: 14px; padding: 2vh 2vw; text-align: center; box-shadow: var(--shadow); }
.join-how { font-size: 1.05em; } .join-how strong { color: var(--purple); }
.pin-label { margin-top: 1.5vh; opacity: .6; text-transform: uppercase; letter-spacing: .1em; font-size: .8em; }
.pin { font-size: 4.2em; font-weight: 900; letter-spacing: .06em; color: var(--purple); line-height: 1.05; }
.qr { width: min(16vw, 30vh); margin: 1.5vh auto 0; }
.qr svg { width: 100%; height: auto; display: block; }
.lobby-players h2 { font-size: 2em; margin-top: 0; }
.player-cloud { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.player-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border: 0; border-radius: 99px; padding: 6px 16px 6px 6px; font: inherit; font-weight: 800; cursor: pointer; animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
.player-chip:hover { background: #ffe1e6; text-decoration: line-through; }
.waiting-players { font-size: 1.3em; animation: pulse 1.6s infinite; }
.hint { font-size: .8em; margin-top: 2vh; }

.host-question { flex: 1; display: flex; flex-direction: column; gap: 2vh; min-height: 0; }
.q-head { display: flex; justify-content: center; }
.q-num { background: rgba(255,255,255,.15); padding: 4px 16px; border-radius: 99px; font-weight: 800; }
.q-text { background: #fff; color: var(--ink); border-radius: 8px; padding: 2.2vh 2vw; text-align: center; font-size: 2em; font-weight: 900; box-shadow: var(--shadow); animation: drop .45s cubic-bezier(.2,1.4,.4,1); }
.q-mid { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 3vw; min-height: 150px; }
.countdown.big { width: 150px; height: 150px; font-size: 4.2em; box-shadow: 0 6px 0 var(--purple-dark); background: var(--purple-light); }
.answers-count { display: flex; flex-direction: column; align-items: center; font-weight: 800; }
.answers-count strong { font-size: 3.6em; line-height: 1; }
.host-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2vw; }
.host-choices .choice { opacity: 1; animation: tile-in .45s cubic-bezier(.2,1.4,.4,1) both; min-height: 15vh; font-size: 1.35em; cursor: default; }
.host-choices .choice:nth-child(2) { animation-delay: .1s; } .host-choices .choice:nth-child(3) { animation-delay: .2s; }
.host-choices .choice .txt { flex: 1; }
.host-choices .choice.wrong { opacity: .28; filter: grayscale(.6); transition: opacity .5s .3s, filter .5s .3s; }
.host-choices .choice.right { transform: scale(1.03); box-shadow: 0 0 0 5px #fff, 0 8px 0 rgba(0,0,0,.3); }
.host-choices .choice .ok { margin-left: auto; }

.dist { display: flex; align-items: flex-end; gap: 2vw; height: 100%; padding-top: 2vh; }
.dist-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 7vw; min-width: 60px; }
.dist-col .bar { width: 100%; border-radius: 6px 6px 0 0; transform-origin: bottom; animation: grow .7s cubic-bezier(.2,1.2,.4,1) both; }
.dist-col.c0 .bar { background: var(--red); } .dist-col.c1 .bar { background: var(--blue); } .dist-col.c2 .bar { background: var(--yellow); }
.dist-col:not(.right) { opacity: .45; }
.dist-col .n { font-size: 1.6em; font-weight: 900; }
.dist-col .shape-holder { height: 34px; display: grid; place-items: center; }
.reveal-side { flex: 1; display: flex; flex-direction: column; gap: 1.5vh; max-width: 58%; }
.fastest { display: flex; align-items: center; gap: 14px; background: var(--gold); color: var(--ink); border-radius: 10px; padding: 1.4vh 1.4vw; font-size: 1.15em; animation: rise .5s .3s both; }
.fastest small { display: block; font-weight: 700; opacity: .7; }
.fastest.none { background: rgba(255,255,255,.15); color: #fff; }
.verse-box { background: rgba(0,0,0,.25); border-radius: 10px; padding: 1.4vh 1.4vw; line-height: 1.4; animation: rise .5s .5s both; }
.verse-box strong { margin-bottom: 4px; }

.host-board { flex: 1; display: flex; flex-direction: column; align-items: center; }
.host-board h1 { font-size: 2.6em; } .host-board h1 .i { color: var(--gold); }
.host-board ol { list-style: none; padding: 0; margin: 0; width: min(1100px, 100%); display: grid; gap: 1.2vh; }
.host-board li { display: flex; align-items: center; gap: 16px; background: #fff; color: var(--ink); border-radius: 10px; padding: 1.2vh 1.4vw; font-size: 1.3em; box-shadow: var(--shadow); opacity: 0; animation: slide .45s forwards; }
.host-board .pos { width: 1.6em; font-weight: 900; text-align: center; }
.host-board .nick { width: 26%; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-board .bar-wrap { flex: 1; height: 18px; background: #eee; border-radius: 99px; overflow: hidden; }
.host-board .bar { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: grow-x 1s .4s cubic-bezier(.2,1,.4,1) both; }
.host-board .pts { font-weight: 900; min-width: 3.4em; text-align: right; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.host-final { flex: 1; display: flex; flex-direction: column; align-items: center; overflow: auto; }
.host-final h1 { font-size: 2.2em; margin: 0; }
.podium.host { height: 40vh; width: min(900px, 100%); flex-shrink: 0; }
.podium.host .p1 .block { height: 20vh; } .podium.host .p2 .block { height: 14vh; } .podium.host .p3 .block { height: 10vh; }
.podium.host .block { font-size: 1.4em; }
.podium.host .name { font-size: 1.3em; }
.host-final .ranking { width: min(700px, 100%); }

@media (max-width: 900px) {
  .host-lobby { grid-template-columns: 1fr; }
  .host-choices { grid-template-columns: 1fr; }
  .q-mid { flex-wrap: wrap; }
  .reveal-side { max-width: 100%; }
  .host-bar .row .btn:not([data-next]) { display: none; }
}

/* families */
.logo > span { display: flex; flex-direction: column; line-height: 1.1; }
.family-name { font-size: .7rem; font-weight: 700; opacity: .75; letter-spacing: .02em; }
.family-switch { display: flex; align-items: center; gap: 8px; margin: -6px 0 14px; }
.family-switch select { width: auto; flex: 1; padding: 8px 10px; }
.family-label { margin: -6px 0 14px; opacity: .85; }

/* ---------- 2 to 5 choices ---------- */
.choice.c3 { background: var(--green); }
.choice.c4 { background: var(--purple-light); }
.shape-star { width: 34px; height: 34px; background: #fff; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.choice .shape-sq { width: 28px; height: 28px; }
.choice:nth-child(4) { animation-delay: .24s; } .choice:nth-child(5) { animation-delay: .32s; }
@media (min-width: 720px) {
  .choices.n2, .choices.n4 { grid-template-columns: repeat(2, 1fr); }
  .choices.n5 { grid-template-columns: repeat(6, 1fr); }
  .choices.n5 .choice { grid-column: span 2; }
  .choices.n5 .choice:nth-child(4) { grid-column: 2 / span 2; }
}
@media (max-width: 719px) { .choices.n4, .choices.n5 { gap: 8px; } .choices.n4 .choice, .choices.n5 .choice { min-height: 64px; padding: 12px 14px; } }
.dist-col.c3 .bar { background: var(--green); } .dist-col.c4 .bar { background: var(--purple-light); }

/* live phone buttons: shape + answer text */
.live-buttons.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.live-buttons.n2 { grid-template-rows: 1fr 1fr; }
.live-buttons.n5 { grid-template-rows: repeat(5, 1fr); gap: 8px; }
.live-buttons .choice { flex-direction: column; justify-content: center; gap: 10px; text-align: center; padding: 10px; }
.live-buttons .choice .icon { width: auto; height: auto; }
.live-buttons .choice .txt { font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.live-buttons.n4 .choice .txt { font-size: 1rem; }
.live-buttons .choice .shape-tri { border-left-width: 26px; border-right-width: 26px; border-bottom-width: 44px; }
.live-buttons .choice .shape-dia { width: 36px; height: 36px; }
.live-buttons .choice .shape-cir { width: 44px; height: 44px; }
.live-buttons .choice .shape-sq { width: 40px; height: 40px; }
.live-buttons .choice .shape-star { width: 48px; height: 48px; }
.live-buttons.n5 .choice { flex-direction: row; justify-content: flex-start; padding: 8px 16px; }
.live-buttons.n5 .choice .icon { transform: scale(.7); width: 40px; display: grid; place-items: center; }
.live-buttons.n5 .choice .txt { text-align: left; font-size: 1rem; }

/* live big screen with 4 or 5 choices */
.host-choices.n2, .host-choices.n4 { grid-template-columns: repeat(2, 1fr); }
.host-choices.n5 { grid-template-columns: repeat(6, 1fr); }
.host-choices.n5 .choice { grid-column: span 2; }
.host-choices.n5 .choice:nth-child(4) { grid-column: 2 / span 2; }
.host-choices.n4 .choice, .host-choices.n5 .choice { min-height: 10vh; }
.host-choices .choice:nth-child(4) { animation-delay: .3s; } .host-choices .choice:nth-child(5) { animation-delay: .4s; }

/* live: Kahoot points */
.x2, .x0 { display: inline-block; margin-left: 10px; padding: 4px 14px; border-radius: 99px; font-weight: 900; }
.x2 { background: var(--gold); color: var(--ink); animation: pulse 1.2s infinite; }
.x0 { background: rgba(255,255,255,.2); }
.live-tag { text-align: center; padding: 6px 0 0; }
.streak { background: rgba(0,0,0,.25); padding: 6px 16px; border-radius: 99px; font-weight: 800; animation: rise .5s .3s both; }
.host-board .pts { min-width: 4.4em; }
.pts-chip { white-space: nowrap; }
.host-question.reveal { gap: 1.4vh; }
.host-question.reveal .q-text { font-size: 1.6em; padding: 1.4vh 2vw; }
.host-question.reveal .host-choices .choice { min-height: 0; padding: 12px 16px; }
.host-question.reveal .q-mid { min-height: 130px; }
