/* Gaspol! — bright, chunky, touch-first. The 3D scene is the background; cards float on top. */
:root {
  --ink: #1f2433;
  --ink-2: #4b5368;
  --muted: #7a8296;
  --line: #e6e9f0;
  --paper: #ffffff;
  --paper-2: #f5f7fb;
  --orange: #f97316;
  --orange-2: #fb923c;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --green: #16a34a;
  --green-2: #22c55e;
  --red: #ef4444;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --gold: #f59e0b;
  --sky: #7cc8f8;
  --radius: 24px;
  --shadow: 0 18px 50px -18px rgba(18, 34, 70, 0.45), 0 2px 0 rgba(255, 255, 255, 0.6) inset;
  --head: "Baloo 2", "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.5 var(--body);
  color: var(--ink);
  background: linear-gradient(#8fd3ff, #d9f1ff 60%, #8bd45f 60%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
a { color: var(--blue); }
kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--paper-2); font-size: 0.85em; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#app { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain; }

.screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  gap: 12px;
}
.screen[data-screen="menu"] { justify-content: flex-start; }
.preview-space { flex: 0 0 min(30vh, 260px); width: 100%; }

/* ------------------------------------------------------------ cards */
.card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.card-wide { max-width: 620px; }
.card-sm { max-width: 340px; }
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 26px; color: #fff; text-shadow: 0 2px 0 rgba(124, 45, 18, 0.35);
  border-radius: 16px; background: linear-gradient(135deg, #fde68a, #fb923c); box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.12) inset;
}
.brand h1 { margin: 0; font: 800 2rem/1 var(--head); color: var(--orange); letter-spacing: -0.01em; }
.brand p { margin: 2px 0 0; color: var(--ink-2); font-size: 0.92rem; }

.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { margin: 0; font: 800 1.5rem/1.1 var(--head); }
h2, h3 { font-family: var(--head); }
.back {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--paper-2);
  font-size: 1.2rem; font-weight: 800;
}
.back:hover { background: var(--line); }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: 0.9rem; }
.field em { font-style: normal; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 0.86rem; margin: 0; }
.center { text-align: center; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange-2); }
textarea { resize: vertical; line-height: 1.45; }
.code-input { text-align: center; font: 800 1.9rem/1.2 var(--head); letter-spacing: 0.3em; text-transform: uppercase; }
.shake { animation: shake 0.4s; border-color: var(--red) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 16px;
  border: 0; border-radius: 16px;
  font: 700 1.05rem/1.1 var(--head);
  color: #fff;
  box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.16) inset, 0 6px 14px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, filter 0.15s;
  text-decoration: none;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.16) inset; }
.btn:disabled { filter: grayscale(0.7) opacity(0.6); cursor: not-allowed; transform: none; }
.btn i { font-size: 0.95em; }
.btn-lg { min-height: 56px; font-size: 1.25rem; border-radius: 18px; }
.btn-sm { min-height: 38px; font-size: 0.95rem; padding: 6px 12px; border-radius: 12px; }
.btn-orange { background: linear-gradient(#fb923c, #f97316); }
.btn-blue { background: linear-gradient(#3b82f6, #2563eb); }
.btn-green { background: linear-gradient(#22c55e, #16a34a); }
.btn-soft { background: var(--paper-2); color: var(--ink); box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.07) inset; }
.btn-soft:hover { background: #edf0f6; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { padding: 10px 8px; font-size: 1rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.icon-btn {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4); font-size: 1.05rem;
}
.icon-btn-sm { width: 34px; height: 34px; font-size: 0.95rem; box-shadow: none; background: var(--paper-2); }
.icon-btn.is-off { opacity: 0.45; }

/* ------------------------------------------------------------ pickers */
.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.picker button {
  display: grid; justify-items: center; gap: 4px; padding: 10px 2px 6px;
  border: 2px solid var(--line); border-radius: 16px; background: var(--paper);
  font-size: 1.4rem; line-height: 1.1; color: var(--ink-2);
}
.picker button[aria-checked="true"] i { color: var(--orange); }
.picker button small { font: 700 0.72rem var(--body); color: var(--ink-2); }
.picker button[aria-checked="true"] { border-color: var(--orange); background: #fff4ea; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--line), 0 -3px 0 rgba(0, 0, 0, 0.18) inset;
}
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--orange), 0 -3px 0 rgba(0, 0, 0, 0.18) inset; transform: scale(1.08); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--paper-2); }
.seg button i { margin-right: 2px; }
.seg button { border: 0; border-radius: 12px; padding: 9px 6px; background: transparent; font-weight: 700; font-size: 0.9rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.25); }
.seg-sm button { padding: 6px 4px; font-size: 0.84rem; }

.stepper { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 4px; border-radius: 16px; background: var(--paper-2); }
.stepper button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--paper); font: 800 1.3rem var(--head); box-shadow: 0 2px 6px -3px rgba(0, 0, 0, 0.3); }
.stepper output { min-width: 48px; text-align: center; font: 800 1.35rem var(--head); }
.stepper-sm button { width: 36px; height: 36px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 0.92rem; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #d5dae4; transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch input:checked + i { background: var(--green-2); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding-top: 4px; }

.hint { margin: 0; color: var(--muted); font-size: 0.8rem; text-align: center; line-height: 1.6; }
.footer-note { margin: -6px 0 0; text-align: center; font-size: 0.78rem; color: var(--muted); }
.invite { padding: 10px 14px; border-radius: 14px; background: #ecfdf3; color: #14532d; font-size: 0.9rem; }

/* ------------------------------------------------------------ join + lobby */
.room-info { padding: 12px 14px; border-radius: 14px; background: var(--paper-2); font-size: 0.9rem; display: grid; gap: 2px; }
.room-info b { font-family: var(--head); font-size: 1.05rem; }
.room-info i { width: 1.2em; text-align: center; color: var(--ink-2); }
.room-info.is-bad { background: #fef2f2; color: #991b1b; }

.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #eff6ff, #fff7ed); }
.code-box small { font-weight: 700; color: var(--ink-2); }
.room-code { font: 800 2.4rem/1.05 var(--head); letter-spacing: 0.12em; color: var(--blue); user-select: all; }
.code-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.qr { width: 112px; height: 112px; border-radius: 12px; background: #fff; padding: 4px; image-rendering: pixelated; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); font-size: 0.8rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.players-title { margin: 4px 0 -4px; font-size: 1.15rem; }
.players-title span { color: var(--muted); font-size: 0.95rem; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--paper-2); font-weight: 700; }
.players li.is-me { background: #fff4ea; }
.players li.is-off { opacity: 0.5; }
.players .avatar, .ranking .avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 1rem; color: #fff; box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.15) inset; }
.players .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: #fde68a; color: #78350f; }
.players .tag.off { background: #e5e7eb; color: #4b5563; }
.players .kick { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1rem; }
.players .kick:hover { background: #fee2e2; color: var(--red); }
.host-panel { display: grid; gap: 12px; padding-top: 6px; border-top: 2px dashed var(--line); }
.waiting { margin: 0; text-align: center; font-weight: 700; color: var(--ink-2); }
.waiting i { color: var(--orange); margin-right: 4px; }

/* ------------------------------------------------------------ race */
.screen.race { position: fixed; inset: 0; padding: 0; display: block; pointer-events: none; overflow: hidden; }
.race > * { pointer-events: auto; }
.race .countdown, .race .banner { pointer-events: none; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-top)) 12px 0; display: grid; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4); font-weight: 800; font-size: 0.88rem; white-space: nowrap; }
.pill-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; font-weight: 700; }
.pill-title span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Phones: no room for the pack title next to rank, clock, score and the two buttons */
@media (max-width: 420px) {
  .pill { padding: 0 9px; font-size: 0.82rem; }
  .hud-row { gap: 4px; }
  .pill-title { display: none; }
  .pill-score { margin-right: auto; }
}
.pill-score b { font-family: var(--head); font-size: 1.05rem; }
.pill-score i { color: var(--gold); }
#hud-rank i { color: var(--purple); }
.pill.is-low { color: var(--red); }
.track-bar { position: relative; height: 22px; margin: 0 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4); }
.track-dots { position: absolute; inset: 0 30px 0 12px; }
.track-dots i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transition: left 0.5s ease-out; }
.track-dots i.is-me { width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 3px solid var(--orange); z-index: 2; }
.track-flag { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--ink); }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; font: 800 min(32vw, 200px)/1 var(--head); color: #fff; -webkit-text-stroke: 6px rgba(31, 36, 51, 0.18); text-shadow: 0 10px 0 rgba(0, 0, 0, 0.12), 0 0 40px rgba(0, 0, 0, 0.15); }
.countdown:empty { display: none; }
.countdown span { animation: count 0.9s ease-out forwards; }
.countdown .go { color: #fde047; }
@keyframes count { from { transform: scale(1.8); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } to { transform: scale(0.85); opacity: 0; } }

.banner {
  position: absolute; left: 50%; top: calc(96px + var(--safe-top)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px;
  font: 800 1.05rem/1.2 var(--head); color: #fff; text-align: center; white-space: nowrap;
  background: linear-gradient(90deg, #f97316, #ef4444); box-shadow: 0 10px 24px -10px rgba(239, 68, 68, 0.9);
  animation: banner 1.8s ease-out forwards;
}
.banner.is-good { background: linear-gradient(90deg, #16a34a, #22c55e); box-shadow: 0 10px 24px -10px rgba(22, 163, 74, 0.9); }
.banner.is-bad { background: linear-gradient(90deg, #64748b, #475569); box-shadow: none; }
@keyframes banner { from { transform: translate(-50%, -12px) scale(0.9); opacity: 0; } 12% { transform: translate(-50%, 0) scale(1); opacity: 1; } 80% { opacity: 1; } to { opacity: 0; } }

.panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 640px;
  padding: 14px 14px calc(14px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -16px 40px -20px rgba(18, 34, 70, 0.5);
  display: grid; gap: 10px;
  animation: slide-up 0.3s ease-out;
}
@media (min-width: 700px) { .panel { bottom: 16px; border-radius: 26px; } }
@keyframes slide-up { from { transform: translate(-50%, 30px); opacity: 0; } }
.panel-top { display: flex; align-items: center; gap: 6px; }
.panel-top .icon-btn { margin-left: auto; }
.chip-count { background: #fff4ea; color: #9a3412; }
.chip-fire { background: #fef3c7; color: #92400e; }
.chip-fire i { color: #ea580c; }
.chip-timer { background: #eff6ff; color: #1e40af; font-variant-numeric: tabular-nums; }
.chip-timer.is-low { background: #fee2e2; color: #991b1b; }
.timebar { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #84cc16); transform-origin: 0 50%; }
.question { margin: 0; font: 700 1.2rem/1.35 var(--head); min-height: 1.6em; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; text-align: left;
  border: 2px solid var(--line); border-radius: 16px; background: var(--paper);
  font-weight: 700; font-size: 0.98rem; line-height: 1.25;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.2s;
}
.opt:not(:disabled):hover { border-color: #cbd2df; transform: translateY(-1px); }
.opt:not(:disabled):active { transform: translateY(1px); }
.opt .key { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; font: 800 0.95rem var(--head); box-shadow: 0 -3px 0 rgba(0, 0, 0, 0.16) inset; }
.opt:nth-child(1) .key { background: var(--orange); }
.opt:nth-child(2) .key { background: var(--blue-2); }
.opt:nth-child(3) .key { background: var(--purple); }
.opt:nth-child(4) .key { background: var(--teal); }
.opt:disabled { cursor: default; }
.options.is-locked .opt:not(.is-right):not(.is-wrong):not(.is-picked) { opacity: 0.45; }
.opt.is-picked { border-color: var(--blue-2); background: #eff6ff; }
.opt.is-right { border-color: var(--green-2); background: #dcfce7; }
.opt.is-wrong { border-color: var(--red); background: #fee2e2; animation: shake 0.4s; }
.panel-note { padding: 10px 12px; border-radius: 14px; background: var(--paper-2); font-weight: 700; font-size: 0.9rem; text-align: center; }
.panel-note ol { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; text-align: left; font-weight: 600; }
.panel-note li { display: flex; justify-content: space-between; gap: 8px; }
.panel-note li.is-me { color: var(--orange); }
.panel.is-waiting .options { opacity: 0.5; }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px); }
.overlay .card { text-align: center; }
.overlay h2 { margin: 0; font-size: 1.8rem; }

/* ------------------------------------------------------------ results */
.result-head { text-align: center; display: grid; gap: 2px; justify-items: center; }
.medal { font-size: 64px; line-height: 1; animation: bounce 1s ease-out; }
.medal-1 { color: #f5b014; }
.medal-2 { color: #9aa7b8; }
.medal-3 { color: #c47a3d; }
.medal-rest { color: var(--ink-2); }
@keyframes bounce { 0% { transform: scale(0.3) rotate(-30deg); } 60% { transform: scale(1.2) rotate(8deg); } 100% { transform: none; } }
.result-head h2 { margin: 6px 0 0; font-size: 1.9rem; line-height: 1.1; color: var(--orange); }
.stars { display: flex; gap: 6px; font-size: 34px; margin-top: 4px; }
.stars i { color: #dde2ea; }
.stars i.on { color: #f5b014; animation: pop 0.4s backwards; }
.stars i:nth-child(2) { animation-delay: 0.15s; }
.stars i:nth-child(3) { animation-delay: 0.3s; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 10px; border-radius: 16px; background: var(--paper-2); text-align: center; }
.stat b { display: block; font: 800 1.5rem/1.1 var(--head); }
.stat small { color: var(--muted); font-weight: 600; }
.note-box i { color: var(--gold); }
.note-box { padding: 10px 14px; border-radius: 14px; background: #fffbeb; color: #78350f; font-weight: 700; text-align: center; }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 38vh; overflow-y: auto; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--paper-2); }
.ranking li.is-me { background: #fff4ea; box-shadow: 0 0 0 2px var(--orange-2) inset; }
.ranking .pos, .history .pos { width: 30px; flex: none; text-align: center; font: 800 1.15rem var(--head); }
.ranking .who { flex: 1; min-width: 0; display: grid; }
.ranking .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .who small { color: var(--muted); font-weight: 600; }
.ranking .pts { font: 800 1.1rem var(--head); }

/* ------------------------------------------------------------ editor + history */
.ed-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.ed-list { display: grid; gap: 10px; }
.ed-empty { padding: 18px; border-radius: 16px; border: 2px dashed var(--line); text-align: center; color: var(--muted); font-weight: 600; }
.q-item { display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--paper-2); }
.q-item.is-bad { box-shadow: 0 0 0 2px var(--red) inset; }
.q-head { display: flex; align-items: center; gap: 8px; }
.q-head b { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--orange); color: #fff; font: 800 0.95rem var(--head); }
.q-head select { width: auto; padding: 6px 10px; font-size: 0.85rem; border-radius: 10px; }
.q-head .q-del { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.q-head .q-del:hover { background: #fee2e2; color: var(--red); }
.q-opts { display: grid; gap: 6px; }
.q-opt { display: flex; align-items: center; gap: 8px; }
.q-opt input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--green); }
.q-opt input[type="text"] { padding: 8px 12px; border-radius: 12px; }
.q-opt.tf { font-weight: 700; }
.errors { padding: 10px 14px; border-radius: 14px; background: #fef2f2; color: #991b1b; font-size: 0.88rem; font-weight: 600; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
.ed-paste { display: grid; gap: 8px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--paper-2); }
.history .pos { font-size: 1.3rem; }
.history .who { flex: 1; display: grid; min-width: 0; }
.history .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .who small { color: var(--muted); }
.history .pts { font: 800 1.05rem var(--head); }

/* ------------------------------------------------------------ toast, net banner, confetti */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px;
  background: #1f2433; color: #fff; font-weight: 700; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  animation: toast 0.25s ease-out;
}
.toast.is-bad { background: #b91c1c; }
.toast i { color: #fde68a; }
@keyframes toast { from { transform: translate(-50%, 14px); opacity: 0; } }
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 60; padding: calc(8px + var(--safe-top)) 12px 8px; background: #b45309; color: #fff; font-weight: 700; text-align: center; font-size: 0.9rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }

@media (max-width: 380px) {
  .card { padding: 16px; }
  .picker { gap: 6px; }
  .picker button { font-size: 1.35rem; }
  .room-code { font-size: 2rem; }
  .qr { width: 92px; height: 92px; }
  .opt { min-height: 46px; font-size: 0.92rem; }
  .question { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
