/* quiz-party — one stylesheet for builder, host screen and player phones. */

:root {
  --bg: #1b1033;
  --bg-2: #261646;
  --panel: #2f1d57;
  --panel-2: #3a2669;
  --line: #4b3683;
  --text: #f6f1ff;
  --muted: #bfb0e6;
  --accent: #ffd23f;
  --accent-ink: #2a1600;
  --good: #2ecc71;
  --bad: #ff5d73;
  /* Answer tiles: our own palette + letters, not shapes. */
  --a0: #8b5cf6;
  --a1: #14b8a6;
  --a2: #f59e0b;
  --a3: #ec4899;
  --radius: 16px;
  --shadow: 0 6px 0 rgba(0, 0, 0, .25);
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #3b1f78 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #5a1a5e 0%, transparent 55%),
              var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.inline { display: inline; }

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: rgba(0, 0, 0, .2);
}
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar-nav { flex-shrink: 0; }
.topbar nav a { color: var(--text); text-decoration: none; }
.nav-short { display: none; }
@media (max-width: 520px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 1.05rem; white-space: nowrap; flex-shrink: 0; }
  .brand-dot { width: 11px; height: 11px; flex-shrink: 0; }
  .topbar nav { gap: 10px; font-size: .88rem; }
  .topbar nav .link { font-size: .88rem; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
}
.brand { font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--a0) 0 25%, var(--a1) 0 50%, var(--a2) 0 75%, var(--a3) 0); }

.page { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }

/* --- buttons & forms --- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 12px 22px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.btn.secondary { background: var(--panel-2); color: var(--text); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 7px 14px; font-size: .9rem; border-radius: 10px; }
.btn.big { padding: 18px 34px; font-size: 1.3rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; }

label { display: block; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 2px solid var(--line); border-radius: 12px; padding: 11px 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field { margin-bottom: 16px; }
.helptext, .field .help { color: var(--muted); font-size: .85rem; }
.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 6px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.spacer { flex: 1; }

.panel { background: var(--panel); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }

.flash { list-style: none; padding: 0; margin: 0 0 16px; }
.flash li { background: var(--panel-2); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 10px; }
.flash li.error { border-color: var(--bad); }

/* --- home --- */
.hero { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; align-items: start; margin-top: 24px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.pin-input { font-size: 2rem !important; text-align: center; letter-spacing: .3em; font-weight: 700; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }

/* --- builder --- */
.quiz-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.quiz-card { background: var(--panel); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.quiz-card h3 { margin: 0; }
.quiz-card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.card-row { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: 14px; padding: 12px; }
.card-row .num { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; flex: none; }
.card-row .thumb { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; background: var(--bg-2); flex: none; }
.card-row .q { flex: 1; min-width: 0; }
.card-row .q strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row .tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-row.invalid { outline: 2px dashed var(--bad); }
.card-row .q .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* CSV import */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
.data-table td:first-child { white-space: nowrap; font-weight: 600; }
.data-table code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.report-table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.report-table { width: max-content; min-width: 100%; table-layout: fixed; }
.report-table .col-player { position: sticky; left: 0; z-index: 2; min-width: 11rem; width: 11rem; background: var(--panel); box-shadow: 2px 0 6px rgba(0, 0, 0, .12); white-space: normal; overflow: hidden; }
.report-table .report-player-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.report-table .report-player-status { display: block; font-weight: 400; font-size: .85rem; margin-top: 2px; }
.report-table .col-meta { width: 4.5rem; min-width: 4.5rem; white-space: nowrap; }
.report-table .col-q { width: 7rem; min-width: 7rem; max-width: 7rem; white-space: normal; vertical-align: top; line-height: 1.35; }
.report-table .report-ans { display: block; }
.report-table .report-time { display: block; font-size: .78rem; margin-top: 2px; }
.report-table thead th { background: var(--panel); font-weight: 600; font-size: inherit; }
.report-table thead th.col-q { font-weight: 600; font-size: inherit; }
.report-table thead th.col-player { z-index: 3; }
.import-errors { border-left: 4px solid var(--bad); }

/* AI generation review */
.ai-disabled code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.ai-kinds { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.ai-kinds-label, .ai-kinds > legend { display: block; font-weight: 500; margin-bottom: 6px; padding: 0; color: var(--text); float: none; width: 100%; }
.file-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.file-field .file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.file-field .file-name { flex: 1 1 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker { cursor: pointer; margin: 0; }
.ai-kinds ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ai-kinds label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.ai-notice { border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 10px; background: var(--panel-2); margin-bottom: 14px; }
.ai-draft { background: var(--panel-2); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.ai-draft-head { margin-bottom: 12px; }
.ai-draft-hint { margin: 10px 0 0; }
.ai-draft-meta { margin-top: 12px; }
.ai-draft-tools { margin-top: 12px; flex-wrap: wrap; }
.ai-draft-tools .ai-draft-msg { flex: 1 1 100%; margin: 6px 0 0; }
@media (max-width: 640px) {
  .ai-draft-tools .btn { flex: 1 1 calc(50% - 6px); }
}

.answer-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-edit .ans { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; }
.answer-edit .ans input[type=text] { background: rgba(0, 0, 0, .25); border-color: transparent; }
.answer-edit .ans .tick { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .9rem; margin: 0; }
.answer-edit .ans .tick input { width: 22px; height: 22px; accent-color: var(--good); }
@media (max-width: 640px) {
  .answer-edit { grid-template-columns: 1fr; }
  .answer-edit .ans {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    align-items: center;
  }
  .answer-edit .ans .tile { grid-column: 1; grid-row: 1; }
  .answer-edit .ans input[type=text] { grid-column: 2; grid-row: 1; min-width: 0; width: 100%; }
  .answer-edit .ans .tick { grid-column: 1 / -1; grid-row: 2; padding-left: 2px; }
}
#card-form:not([data-kind=choice]) .answer-edit .tick { display: none; }
.slider-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }

label.check { display: flex; align-items: center; gap: 8px; margin: 0; }
label.check input { width: 22px; height: 22px; accent-color: var(--good); }
.meme-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.meme-item { position: relative; width: 120px; height: 90px; border-radius: 10px; background: var(--bg-2); overflow: hidden; }
.meme-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meme-item form { position: absolute; top: 4px; right: 4px; }

.media-pick { display: grid; grid-template-columns: 1fr 160px; gap: 14px; align-items: start; }
.media-pick .preview { width: 160px; height: 120px; border-radius: 12px; background: var(--bg-2) center/contain no-repeat; border: 2px dashed var(--line); }
@media (max-width: 640px) { .media-pick { grid-template-columns: 1fr; } }

.gif-modal { position: fixed; inset: 0; background: rgba(10, 4, 25, .85); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.gif-modal .box { background: var(--panel); border-radius: var(--radius); width: min(900px, 100%); max-height: 90vh; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.gif-grid { overflow-y: auto; columns: 4 160px; column-gap: 8px; }
.gif-grid img { width: 100%; margin-bottom: 8px; border-radius: 8px; cursor: pointer; display: block; }
.gif-grid img:hover { outline: 3px solid var(--accent); }
.giphy-attr { font-size: .8rem; color: var(--muted); text-align: right; }

/* --- answer tiles (host + phones) --- */
.tile { border-radius: var(--radius); color: #fff; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; padding: 16px 18px; font-weight: 600; border: 0; font: inherit; text-align: left; }
.tile .letter { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; flex: none; }
.tile.c0 { background: var(--a0); } .tile.c1 { background: var(--a1); }
.tile.c2 { background: var(--a2); } .tile.c3 { background: var(--a3); }
.answer-edit .ans.c0 { background: var(--a0); } .answer-edit .ans.c1 { background: var(--a1); }
.answer-edit .ans.c2 { background: var(--a2); } .answer-edit .ans.c3 { background: var(--a3); }
.tile.dim { opacity: .3; }
.tile.right { outline: 5px solid #fff; }

/* --- host screen --- */
.stage { min-height: 100vh; display: flex; flex-direction: column; padding: 18px 28px; gap: 18px; }
.stage-top { display: flex; align-items: center; gap: 16px; }
.stage-top .spacer { flex: 1; }
.pill { background: var(--panel); padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.lobby { display: grid; grid-template-columns: 1fr 300px; gap: 24px; flex: 1; }
.join-box { background: var(--panel); border-radius: var(--radius); padding: 22px; display: flex; gap: 24px; align-items: center; }
.join-box .pin { font-size: clamp(3rem, 8vw, 6rem); font-weight: 700; letter-spacing: .08em; color: var(--accent); line-height: 1; }
.qr { background: #fff; border-radius: 14px; padding: 10px; width: 300px; align-self: start; }
.qr svg { width: 100%; height: auto; display: block; }
.players { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.player-chip { background: var(--panel-2); padding: 8px 14px; border-radius: 999px; font-weight: 600; animation: pop .25s ease; cursor: pointer; }
.player-chip:hover { background: var(--bad); text-decoration: line-through; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } .join-box { flex-direction: column; } }

.question-stage { flex: 1; display: grid; grid-template-rows: auto 1fr auto; gap: 18px; }
.question-text { background: #fff; color: #1b1033; border-radius: var(--radius); padding: 18px 24px; font-size: clamp(1.4rem, 3.2vw, 2.6rem); font-weight: 700; text-align: center; }
.question-mid { display: grid; grid-template-columns: 130px 1fr 130px; align-items: center; gap: 18px; min-height: 0; }
.question-mid .media { display: flex; justify-content: center; align-items: center; min-height: 0; height: 100%; }
.question-mid .media img { max-height: 42vh; border-radius: var(--radius); }
.timer { width: 120px; height: 120px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 3rem; font-weight: 700; box-shadow: var(--shadow); }
.timer.hurry { background: var(--bad); color: #fff; animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.answered { text-align: center; font-size: 1.1rem; }
.answered b { display: block; font-size: 3rem; }
.host-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.host-tiles .tile { font-size: clamp(1.1rem, 2.4vw, 1.9rem); min-height: 86px; }
.host-tiles .tile .count { margin-left: auto; font-size: 1.6rem; }

.bars { display: flex; gap: 18px; justify-content: center; align-items: flex-end; height: 34vh; }
.bar { width: 90px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar .fill { width: 100%; border-radius: 10px 10px 0 0; min-height: 6px; transition: height .6s cubic-bezier(.2, .9, .3, 1.2); }
.bar .n { font-size: 1.6rem; font-weight: 700; }
.bar.c0 .fill { background: var(--a0); } .bar.c1 .fill { background: var(--a1); }
.bar.c2 .fill { background: var(--a2); } .bar.c3 .fill { background: var(--a3); }
.bar.wrong { opacity: .35; }
.bar .letter { font-size: 1.4rem; font-weight: 700; }
.bar.labelled { width: auto; flex: 0 1 120px; min-width: 0; }
.bar.labelled .label { font-size: .95rem; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.bar.good .fill { background: var(--good); }
.bar.labelled.wrong .fill { background: var(--bad); }
.stage-hint { grid-column: 1 / -1; background: var(--panel); border-radius: var(--radius); padding: 22px; text-align: center; font-size: clamp(1.3rem, 2.8vw, 2.2rem); font-weight: 700; }
.reveal-media { display: flex; justify-content: center; }
.reveal-media img { max-height: 30vh; border-radius: var(--radius); }

.board { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: 14px; padding: 12px 18px; font-size: 1.3rem; font-weight: 600; animation: slidein .4s ease both; }
.board-row .rank { width: 36px; color: var(--muted); }
.board-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .streak { color: var(--accent); font-size: 1rem; }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0; } }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; flex: 1; padding-bottom: 20px; }
.podium .step { width: min(220px, 28vw); text-align: center; animation: rise 1s ease both; }
.podium .block { border-radius: 14px 14px 0 0; display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: var(--accent-ink); }
.podium .p1 .block { height: 38vh; background: var(--accent); }
.podium .p2 .block { height: 28vh; background: #d9d4ea; }
.podium .p3 .block { height: 20vh; background: #e3a26b; }
.podium .p1 { animation-delay: 2.4s; } .podium .p2 { animation-delay: 1.2s; } .podium .p3 { animation-delay: 0s; }
.podium .pname { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; overflow-wrap: anywhere; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }

.meme-break { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
.meme-break img { max-height: 62vh; max-width: min(900px, 100%); border-radius: var(--radius); box-shadow: var(--shadow); animation: pop .35s ease; }
/* --- teams (host + phones) --- */
.team-c0 { --team: #ff7a59; } .team-c1 { --team: #38bdf8; } .team-c2 { --team: #a3e635; }
.team-c3 { --team: #c4b5fd; } .team-c4 { --team: #6ee7b7; } .team-c5 { --team: #fcd9a8; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.team-controls select { width: auto; padding: 7px 12px; }
.players.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.team-col { background: var(--panel); border-radius: var(--radius); border-top: 6px solid var(--team); padding: 12px; }
.team-col h3 { margin: 0 0 10px; display: flex; justify-content: space-between; }
.players.teams .player-chip:hover { background: var(--team); color: var(--accent-ink); text-decoration: none; }
.team-row { border-left: 8px solid var(--team); }
.boards.two, .podiums.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.podiums { flex: 1; display: flex; flex-direction: column; }
.podium-wrap { display: flex; flex-direction: column; flex: 1; }
.podium-wrap .podium { flex: 1; }
.podiums.two .podium .step { width: min(180px, 14vw); }
.podiums.two .podium .pname { font-size: 1.3rem; }
.podiums.two .podium .p1 .block { height: 30vh; } .podiums.two .podium .p2 .block { height: 22vh; } .podiums.two .podium .p3 .block { height: 15vh; }
.player-menu { background: var(--panel); color: var(--text); border: 0; border-radius: var(--radius); padding: 22px; width: min(440px, 92vw); box-shadow: var(--shadow); }
.player-menu::backdrop { background: rgba(10, 4, 25, .7); }
.player-menu h2 { margin: 0; overflow-wrap: anywhere; }
.team-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 16px; }
.team-btn, button.team-btn { background: var(--team); color: var(--accent-ink); }
.team-btn.chosen { outline: 4px solid #fff; }
.team-card { background: var(--team); color: var(--accent-ink); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.team-card b { display: block; font-size: 1.8rem; }
.team-line { font-weight: 600; color: var(--team); }
@media (max-width: 900px) { .boards.two, .podiums.two { grid-template-columns: 1fr; } }

.host-controls { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.sound-toggle { min-width: 46px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* --- player phone --- */
.phone { min-height: 100dvh; display: flex; flex-direction: column; padding: 14px; gap: 14px; }
.phone-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.phone-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.phone-q { font-size: 1.25rem; font-weight: 600; text-align: center; }
.phone-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; max-height: 70dvh; }
.phone-tiles .tile { flex-direction: column; justify-content: center; text-align: center; font-size: 1.05rem; cursor: pointer; padding: 12px; }
.phone-tiles .tile .letter { width: 56px; height: 56px; font-size: 1.8rem; }
.phone-tiles.two { grid-template-columns: 1fr; }
.phone-type { display: flex; flex-direction: column; gap: 12px; }
.phone-type input { font-size: 1.3rem; text-align: center; }
.phone-order { display: flex; flex-direction: column; gap: 10px; }
.order-row { padding: 10px 12px; gap: 10px; }
.order-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-row .letter { width: 36px; height: 36px; font-size: 1.2rem; }
.phone-slider { background: var(--panel); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.phone-slider input[type=range] { width: 100%; height: 36px; accent-color: var(--accent); }
.slider-value { font-size: 3rem; font-weight: 700; text-align: center; color: var(--accent); line-height: 1; }
.big-msg { text-align: center; font-size: 1.6rem; font-weight: 700; }
.big-emoji { font-size: 4.5rem; text-align: center; line-height: 1; }
.result-box { border-radius: var(--radius); padding: 26px 18px; text-align: center; box-shadow: var(--shadow); }
.result-box.ok { background: var(--good); color: #062b14; }
.result-box.no { background: var(--bad); color: #fff; }
.result-box.poll { background: var(--panel-2); }
.result-box .pts { font-size: 2.4rem; font-weight: 700; }
.score-chip { background: var(--panel); padding: 6px 12px; border-radius: 999px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--panel-2); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.conn-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--bad); color: #fff; text-align: center; padding: 6px; font-weight: 600; z-index: 60; }

.host-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.host-grid .panel + .panel { margin-top: 0; }
@media (max-width: 720px) { .host-grid { grid-template-columns: 1fr; } }
.host-grid .panel > h2:first-child { margin-top: 0; }
.host-grid .host-share .qr-wrap { margin: 12px 0; }
.host-grid .qr-wrap svg { max-width: 220px; height: auto; }
.join-url-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px; }
.join-url-row .join-url { margin: 0; flex: 1 1 12rem; text-align: center; }
.join-url { word-break: break-all; font-weight: 600; }
.pill.ok { background: var(--good); color: #062b14; }
.phone-media { max-width: 100%; border-radius: 14px; margin-bottom: 12px; }

.assignment-cards { display: none; }
.assignment-table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .assignment-table-wrap,
  .live-table-wrap { display: none; }
  .assignment-cards { display: flex; flex-direction: column; gap: 12px; }
  .assignment-card { padding: 14px 16px; }
  .assignment-card-title { font-weight: 600; margin-bottom: 8px; line-height: 1.25; }
  .assignment-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .92rem; margin-bottom: 6px; }
  .assignment-card-meta code { font-size: .88rem; }
  .assignment-card-extra { font-size: .85rem; margin-bottom: 4px; }
  .assignment-card-actions { gap: 8px; margin-top: 10px; flex-wrap: wrap; }
}

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