:root {
  --ink: #1b1340; --ink-2: #2a1f5c; --ink-3: #3a2d78; --cream: #fff6e5; --paper: #ffffff;
  --coral: #ff5d6c; --sky: #3b9cff; --sun: #ffc531; --mint: #25d6a0; --grape: #8a5cf6; --pink: #ff8bd0;
  --muted: #6b6490; --line: #e6dfcf;
  --c0: var(--coral); --c1: var(--sky); --c2: var(--sun); --c3: var(--mint); --c4: var(--grape); --c5: var(--pink);
  --font-head: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px; --shadow: 0 5px 0 var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream); line-height: 1.45; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- buttons ---------- */
.btn { --bg: var(--paper); --fg: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 3px solid var(--ink); background: var(--bg); color: var(--fg); border-radius: 14px; padding: 10px 18px; font-weight: 800; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; white-space: nowrap; min-height: 46px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: 0 2px 0 var(--ink); }
.btn.primary { --bg: var(--coral); --fg: #fff; }
.btn.sun { --bg: var(--sun); }
.btn.mint { --bg: var(--mint); }
.btn.sky { --bg: var(--sky); --fg: #fff; }
.btn.grape { --bg: var(--grape); --fg: #fff; }
.btn.danger { --bg: #fff; --fg: #c81e3a; }
.btn.ghost { --bg: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(27,19,64,.08); box-shadow: none; transform: none; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .92rem; border-radius: 11px; box-shadow: 0 3px 0 var(--ink); }
.btn.lg { padding: 14px 28px; font-size: 1.2rem; min-height: 58px; border-radius: 18px; box-shadow: 0 6px 0 var(--ink); }
.btn.block { width: 100%; }
.dark .btn { border-color: #000; box-shadow: 0 4px 0 #000; }
.dark .btn.ghost { color: #fff; border-color: transparent; box-shadow: none; }
.dark .btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.dark .btn.lg { box-shadow: 0 6px 0 #000; }
.icon-btn { width: 40px; height: 40px; padding: 0; min-height: 0; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; border: 3px solid var(--ink); border-radius: 14px; padding: 11px 14px; background: #fff; min-height: 48px; font-weight: 600; }
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; box-shadow: 0 0 0 4px rgba(138,92,246,.35); }
.input.invalid { border-color: #d6204a; background: #fff1f3; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.error-text { color: #c81e3a; font-weight: 700; font-size: .92rem; margin: 6px 0; }
.card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 800; font-size: .78rem; border: 2px solid var(--ink); background: var(--sun); }
.badge.mint { background: var(--mint); } .badge.grey { background: #eee; } .badge.coral { background: var(--coral); color: #fff; }

/* ---------- logo / nav ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; text-decoration: none; letter-spacing: -.02em; }
.logo img { width: 38px; height: 38px; }
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,246,229,.92); backdrop-filter: blur(8px); border-bottom: 3px solid var(--ink); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.nav-links { display: flex; gap: 22px; font-weight: 800; }
.nav-links a { text-decoration: none; padding: 6px 2px; }
.nav-links a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--coral); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) { .nav-links { display: none; } .nav-actions .btn { padding: 8px 12px; min-height: 40px; } .logo { font-size: 1.35rem; } .logo img { width: 32px; height: 32px; } }
@media (max-width: 420px) { .nav-actions .btn.ghost { display: none; } }

/* ---------- landing ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 800; }
.hero h1 em { font-style: normal; background: var(--sun); padding: 0 .15em; border-radius: 14px; box-decoration-break: clone; -webkit-box-decoration-break: clone; border: 3px solid var(--ink); display: inline-block; transform: rotate(-2deg); }
.hero p.lead { font-size: 1.25rem; max-width: 34em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.quickjoin { display: flex; gap: 10px; max-width: 420px; }
.quickjoin .input { font-family: var(--font-head); font-size: 1.4rem; letter-spacing: .25em; text-align: center; font-weight: 700; }
.blob { position: absolute; border-radius: 50%; z-index: -1; opacity: .9; }
.blob.a { width: 340px; height: 340px; background: var(--pink); right: -80px; top: -60px; opacity: .35; }
.blob.b { width: 220px; height: 220px; background: var(--mint); left: -60px; bottom: -40px; opacity: .35; }
.stage { position: relative; min-height: 420px; }
.pin-card { position: absolute; left: 0; top: 10px; width: min(330px, 80%); background: var(--ink); color: #fff; border-radius: 22px; padding: 22px; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--sun); transform: rotate(-3deg); }
.pin-card small { opacity: .7; font-weight: 800; letter-spacing: .1em; }
.pin-card .pin { font-family: var(--font-head); font-size: 3.4rem; font-weight: 800; letter-spacing: .08em; line-height: 1; margin: 6px 0 12px; }
.pin-card .fake-qr { width: 96px; height: 96px; background: #fff; border-radius: 10px; padding: 8px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pin-card .fake-qr i { background: var(--ink); border-radius: 1px; } .pin-card .fake-qr i.o { background: transparent; }
.phone { position: absolute; right: 0; bottom: 0; width: min(240px, 58%); background: #fff; border: 4px solid var(--ink); border-radius: 30px; padding: 16px 12px; box-shadow: 8px 8px 0 var(--coral); transform: rotate(4deg); }
.phone .q { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; text-align: center; margin-bottom: 10px; }
.phone .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.phone .grid b { display: block; height: 62px; border-radius: 12px; border: 3px solid var(--ink); }
.phone .bar { height: 10px; border-radius: 6px; background: var(--mint); border: 2px solid var(--ink); margin-bottom: 12px; width: 70%; }
.float-chip { position: absolute; background: #fff; border: 3px solid var(--ink); border-radius: 99px; padding: 6px 14px; font-weight: 800; box-shadow: 0 4px 0 var(--ink); animation: bob 3.2s ease-in-out infinite; }
.float-chip.c1 { left: 6%; top: 52%; background: var(--mint); } .float-chip.c2 { left: 32%; top: 72%; background: var(--sky); color: #fff; animation-delay: -1.2s; } .float-chip.c3 { right: 6%; top: 2%; background: var(--sun); animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .stage { min-height: 380px; max-width: 520px; margin: 0 auto; width: 100%; } .hero { padding-top: 32px; } }
.section { padding: 64px 0; }
.section h2 { font-size: clamp(1.9rem, 4vw, 3rem); text-align: center; }
.section .sub { text-align: center; max-width: 36em; margin: 0 auto 36px; font-size: 1.1rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } } @media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 22px; }
.feature .ico { width: 54px; height: 54px; border-radius: 16px; border: 3px solid var(--ink); display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.35rem; } .feature p { margin: 0; color: var(--muted); }
.band { background: var(--ink); color: #fff; border-block: 3px solid var(--ink); }
.band .sub { color: #cbc4ee; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--ink-2); border: 3px solid #000; border-radius: var(--r); padding: 26px 22px; position: relative; box-shadow: 0 6px 0 #000; }
.step .n { width: 48px; height: 48px; border-radius: 50%; background: var(--sun); color: var(--ink); font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; display: grid; place-items: center; border: 3px solid #000; margin-bottom: 12px; }
.step:nth-child(2) .n { background: var(--mint); } .step:nth-child(3) .n { background: var(--coral); color: #fff; }
.step h3 { font-size: 1.4rem; } .step p { margin: 0; color: #cbc4ee; }
.cta { text-align: center; padding: 70px 0; }
.cta h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
footer.site { border-top: 3px solid var(--ink); padding: 22px 0; font-weight: 700; }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: min(440px, 100%); }
.tabs { display: flex; gap: 6px; background: #f1ead8; border: 3px solid var(--ink); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }

/* ---------- dashboard ---------- */
.page { padding: 28px 0 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .input { width: auto; flex: 1 1 200px; } .toolbar select.input { flex: 0 1 170px; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.qcard { display: flex; flex-direction: column; gap: 10px; position: relative; padding: 0; overflow: visible; }
.qcard .stripe { height: 14px; border-radius: 14px 14px 0 0; background: linear-gradient(90deg, var(--coral) 0 25%, var(--sky) 25% 50%, var(--sun) 50% 75%, var(--mint) 75%); border-bottom: 3px solid var(--ink); }
.qcard .body { padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.qcard h3 { font-size: 1.35rem; margin: 0; overflow-wrap: anywhere; }
.qcard .desc { color: var(--muted); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.qcard .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; font-weight: 700; color: var(--muted); }
.qcard .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; align-items: center; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 170px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); padding: 6px; z-index: 15; }
.menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 9px; font-weight: 700; cursor: pointer; }
.menu-list button:hover { background: #f4eddc; } .menu-list button.danger { color: #c81e3a; }
.empty { text-align: center; padding: 44px 20px; border: 3px dashed var(--ink); border-radius: var(--r); background: rgba(255,255,255,.5); }
.empty .big { font-size: 3rem; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.skeleton { background: linear-gradient(90deg, #eee 25%, #f7f3ea 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); height: 200px; border: 3px solid #ddd; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- modal / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(27,19,64,.6); display: grid; place-items: center; z-index: 100; padding: 16px; overflow-y: auto; }
.modal { background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); width: min(560px, 100%); padding: 24px; max-height: 92vh; overflow-y: auto; }
.modal.wide { width: min(860px, 100%); }
.modal h3 { font-size: 1.6rem; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; width: min(460px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border: 3px solid #000; border-radius: 14px; padding: 12px 16px; font-weight: 700; box-shadow: 0 4px 0 #000; animation: pop .25s; }
.toast.err { background: #c81e3a; } .toast.ok { background: #0f9d74; }
@keyframes pop { from { transform: translateY(12px) scale(.96); opacity: 0; } }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.editor-top { position: sticky; top: 64px; z-index: 10; background: var(--cream); padding: 10px 0; border-bottom: 3px solid var(--ink); margin-bottom: 18px; }
.qlist { display: flex; flex-direction: column; gap: 8px; max-height: 66vh; overflow-y: auto; padding: 4px 6px 8px 2px; }
@media (max-width: 900px) { .qlist { max-height: none; flex-direction: row; overflow-x: auto; } .qlist .qitem { min-width: 220px; } }
.qitem { display: flex; gap: 8px; align-items: center; border: 3px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 10px; cursor: pointer; text-align: left; box-shadow: 0 3px 0 var(--ink); }
.qitem.sel { background: var(--sun); } .qitem.bad { border-color: #d6204a; }
.qitem.dragover { outline: 3px dashed var(--grape); }
.qitem .num { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .9rem; }
.qitem .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.qitem .grip { cursor: grab; opacity: .5; user-select: none; }
.optrow { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.optrow .swatch { width: 40px; height: 48px; border-radius: 12px; border: 3px solid var(--ink); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; flex: none; color: #fff; font-size: 1.1rem; }
.correct-toggle { width: 48px; height: 48px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; cursor: pointer; font-size: 1.3rem; flex: none; display: grid; place-items: center; font-weight: 800; }
.correct-toggle[aria-pressed="true"] { background: var(--mint); }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
.imgbox { border: 3px dashed var(--ink); border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fffdf7; }
.imgbox img { max-height: 110px; border-radius: 10px; border: 3px solid var(--ink); }
.errbox { background: #fff1f3; border: 3px solid #d6204a; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.errbox ul { margin: 6px 0 0; padding-left: 20px; } .errbox button.link { background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; text-align: left; color: #a3112f; font-weight: 700; }

/* ---------- live game (dark) ---------- */
.dark { background: radial-gradient(1200px 700px at 80% -10%, #3a2d78 0%, transparent 60%), radial-gradient(900px 600px at -10% 110%, #5b2a86 0%, transparent 55%), var(--ink); color: #fff; min-height: 100vh; }
.dark .card { background: var(--ink-2); border-color: #000; box-shadow: 0 6px 0 #000; color: #fff; }
.dark .muted { color: #b8afe3; }
.dark .modal { color: var(--ink); }
.dark .input { color: var(--ink); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; flex-wrap: wrap; border-bottom: 3px solid #000; background: rgba(0,0,0,.25); }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: .85rem; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.2); }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); } .pill.off .dot { background: var(--coral); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.lobby { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 24px; padding: 24px; max-width: 1400px; margin: 0 auto; align-items: start; }
@media (max-width: 960px) { .lobby { grid-template-columns: 1fr; padding: 16px; } }
.join-panel { text-align: center; }
.join-panel .pin { font-family: var(--font-head); font-size: clamp(3.4rem, 9vw, 5.6rem); font-weight: 800; letter-spacing: .08em; line-height: 1; color: var(--sun); text-shadow: 0 4px 0 #000; }
.join-panel .qr { width: min(280px, 70%); margin: 12px auto; background: #fff; padding: 8px; border-radius: 18px; border: 3px solid #000; }
.join-panel .qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.join-url { font-weight: 800; word-break: break-all; background: rgba(0,0,0,.3); padding: 8px 12px; border-radius: 12px; font-size: .95rem; margin: 8px 0 12px; }
.counter { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 4vw, 3rem); }
.counter b { color: var(--mint); font-size: 1.25em; padding-left: .25em; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 16px 0; max-height: 52vh; overflow-y: auto; padding: 4px; list-style: none; padding-left: 4px; }
.player { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.18); border-radius: 14px; padding: 8px 10px; animation: pop .3s; min-width: 0; }
.player .i { width: 30px; height: 30px; border-radius: 9px; background: var(--c1); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; }
.player .nm { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player.off { opacity: .5; } .player .x { background: none; border: 0; color: #ff9aa6; cursor: pointer; font-size: 1.3rem; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.player .x:hover { background: rgba(255,93,108,.25); }
.empty-lobby { text-align: center; padding: 36px 16px; border: 3px dashed rgba(255,255,255,.3); border-radius: var(--r); margin: 16px 0; }
.empty-lobby .big { font-size: 3rem; animation: bob 2.4s ease-in-out infinite; }
.stage-screen { max-width: 1200px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-direction: column; gap: 18px; min-height: calc(100vh - 70px); }
.qtext { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.7rem, 4.2vw, 3.2rem); text-align: center; background: #fff; color: var(--ink); border: 3px solid #000; border-radius: 22px; padding: 18px 22px; box-shadow: 0 6px 0 #000; overflow-wrap: anywhere; }
.qimg { max-height: 36vh; margin: 0 auto; display: block; border-radius: 16px; border: 3px solid #000; }
.timer { display: flex; align-items: center; gap: 14px; }
.timer .bar { flex: 1; height: 18px; border-radius: 99px; background: rgba(0,0,0,.4); border: 3px solid #000; overflow: hidden; }
.timer .bar i { display: block; height: 100%; background: var(--mint); width: 100%; transition: width .1s linear, background .3s; }
.timer .bar i.warn { background: var(--sun); } .timer .bar i.low { background: var(--coral); }
.timer .secs { font-family: var(--font-head); font-weight: 800; font-size: 2.4rem; min-width: 2.2ch; text-align: center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .opts { grid-template-columns: 1fr; } }
.opt { --c: var(--c0); position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 18px; min-height: 76px; border-radius: 18px; background: var(--c); color: #fff; border: 3px solid #000; box-shadow: 0 6px 0 #000; font-weight: 800; font-size: clamp(1.05rem, 2.2vw, 1.55rem); text-align: left; overflow: hidden; }
.opt:nth-child(1) { --c: var(--c0); } .opt:nth-child(2) { --c: var(--c1); } .opt:nth-child(3) { --c: var(--c2); color: var(--ink); } .opt:nth-child(4) { --c: var(--c3); color: var(--ink); } .opt:nth-child(5) { --c: var(--c4); } .opt:nth-child(6) { --c: var(--c5); color: var(--ink); }
.opt .l { width: 40px; height: 40px; border-radius: 12px; background: rgba(0,0,0,.25); display: grid; place-items: center; font-family: var(--font-head); font-size: 1.3rem; flex: none; color: #fff; }
.opt .tx { flex: 1; overflow-wrap: anywhere; position: relative; z-index: 1; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.35); z-index: 0; transition: width .6s; }
.opt .cnt { position: relative; z-index: 1; font-family: var(--font-head); font-size: 1.6rem; }
.opt.right::after { content: '✓'; position: absolute; right: 14px; top: 6px; font-size: 1.8rem; background: #fff; color: #0a7a5a; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 3px solid #000; }
.opt.wrong { opacity: .45; }
button.opt { cursor: pointer; width: 100%; }
button.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #000; }
button.opt:disabled { cursor: default; }
button.opt.picked { outline: 5px solid #fff; outline-offset: 2px; }
.lb { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.lb li { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; background: #fff; color: var(--ink); border: 3px solid #000; border-radius: 16px; padding: 10px 16px; font-weight: 800; box-shadow: 0 4px 0 #000; animation: slide .45s both; }
.lb li:nth-child(1) { background: var(--sun); } .lb li.me { outline: 4px solid var(--mint); }
.lb .rk { font-family: var(--font-head); font-size: 1.6rem; } .lb .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.15rem; }
.lb .sc { font-family: var(--font-head); font-size: 1.5rem; } .lb .gain { color: #0a7a5a; font-size: .95rem; min-width: 5ch; text-align: right; }
.lb .mv { font-size: .9rem; } .up { color: #0a7a5a; } .down { color: #c81e3a; }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
.countdown { font-family: var(--font-head); font-weight: 800; font-size: clamp(8rem, 30vw, 18rem); line-height: 1; color: var(--sun); text-shadow: 0 8px 0 #000; animation: pulse 1s infinite; }
@keyframes pulse { 0% { transform: scale(.7); opacity: .4; } 40% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 10px 0 24px; min-height: 280px; }
.podium .pl { width: min(180px, 30%); text-align: center; }
.podium .nm { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .blk { border: 3px solid #000; border-radius: 14px 14px 0 0; display: grid; place-items: start center; padding-top: 10px; font-family: var(--font-head); font-size: 2.6rem; font-weight: 800; color: var(--ink); animation: rise 1s both; transform-origin: bottom; }
.podium .p1 .blk { height: 190px; background: var(--sun); } .podium .p2 .blk { height: 140px; background: #dfe5f2; animation-delay: .25s; } .podium .p3 .blk { height: 100px; background: #f0a36b; animation-delay: .4s; }
.podium .sc { font-weight: 800; color: var(--sun); }
@keyframes rise { from { transform: scaleY(0); } }
.ctrl { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.statline { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.stat { background: rgba(0,0,0,.3); border-radius: 14px; padding: 8px 18px; text-align: center; font-weight: 800; }
.stat b { display: block; white-space: nowrap; font-family: var(--font-head); font-size: 1.8rem; }
.paused-banner { background: var(--sun); color: var(--ink); text-align: center; font-weight: 800; padding: 6px; border-bottom: 3px solid #000; }

/* ---------- player ---------- */
.pscreen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 0 env(safe-area-inset-bottom); }
.pbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(0,0,0,.3); font-weight: 800; gap: 8px; }
.pbody { flex: 1; display: flex; flex-direction: column; padding: 16px; gap: 14px; max-width: 640px; margin: 0 auto; width: 100%; }
.pbody.mid { justify-content: center; align-items: center; text-align: center; }
.pbig { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.4rem, 11vw, 4rem); line-height: 1; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 6px solid rgba(255,255,255,.25); border-top-color: var(--sun); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pq { font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; background: #fff; color: var(--ink); border-radius: 18px; border: 3px solid #000; padding: 12px 14px; text-align: center; overflow-wrap: anywhere; }
.popts { display: grid; grid-template-columns: 1fr; gap: 12px; flex: 1; align-content: start; }
.popts.two { grid-template-columns: 1fr 1fr; } .popts.two .opt { flex-direction: column; justify-content: center; text-align: center; min-height: 110px; }
.verdict { font-family: var(--font-head); font-weight: 800; font-size: clamp(2.2rem, 10vw, 3.6rem); }
.verdict.ok { color: var(--mint); } .verdict.no { color: var(--coral); } .verdict.late { color: var(--sun); }
.rankbox { background: rgba(0,0,0,.3); border-radius: 18px; padding: 14px 24px; font-weight: 800; }
.rankbox b { font-family: var(--font-head); font-size: 2.2rem; display: block; }
.overlay-paused { position: fixed; inset: 0; background: rgba(27,19,64,.85); display: grid; place-items: center; text-align: center; z-index: 50; padding: 20px; }
.join-hero { text-align: center; padding: 28px 16px 8px; }
.join-card { width: min(440px, 100%); margin: 0 auto; }
.pinbox { font-family: var(--font-head); font-size: 2.2rem; letter-spacing: .3em; text-align: center; font-weight: 700; }

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

.field .seg { display: flex; width: fit-content; max-width: 100%; }
