/* DBZ Viktorina – theme: night sky + ki glow, dragon balls, scouter readouts, capsule buttons. */
:root {
  --bg: #06091a; --bg-2: #0d1430;
  --panel: rgba(255, 255, 255, 0.045); --panel-2: rgba(255, 255, 255, 0.085); --line: rgba(255, 255, 255, 0.13);
  --orange: #ff7a00; --orange-2: #ffb000; --gold: #ffd23f; --blue: #2f7bff; --blue-deep: #0d1f5c; --blue-deep-2: #071238;
  --red: #e8262c; --green: #22c55e; --scouter: #7dff8a; --text: #f6f7ff; --muted: #9aa3c7;
  --font-display: 'Bangers', 'Impact', 'Arial Narrow', sans-serif; --font-head: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif; --font-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 1.35; background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(255, 122, 0, 0.26), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(47, 123, 255, 0.24), transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 38%, rgba(255, 255, 255, 0.035) 0deg 1.2deg, transparent 1.2deg 7deg);
  background-attachment: fixed;
}
button, input { font: inherit; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; margin: 0; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 6px currentColor; }

/* ---------- logo / top bar ---------- */
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo .dball { filter: drop-shadow(0 0 10px rgba(255, 150, 0, 0.7)); }
.logo-text { line-height: 0.95; }
.logo-text .top { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.06em; background: linear-gradient(180deg, #fff2b3, var(--gold) 40%, var(--orange) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text .sub { font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.polling { background: var(--gold); }
.dot.offline, .dot.reconnecting { background: var(--red); }

/* ---------- panels, buttons, inputs ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(6px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 0; border-radius: 999px; padding: 12px 22px;
  font-family: var(--font-head); font-weight: 800; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase; color: #1a0c00;
  background: linear-gradient(180deg, var(--gold), var(--orange)); box-shadow: 0 5px 0 #9c3a00, 0 0 22px rgba(255, 140, 0, 0.35); transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #9c3a00; }
.btn:disabled { filter: grayscale(0.7) brightness(0.6); cursor: not-allowed; box-shadow: none; transform: none; }
.btn.secondary { color: var(--text); background: linear-gradient(180deg, #2a3a78, var(--blue-deep)); box-shadow: 0 5px 0 #04102e; }
.btn.secondary:active { box-shadow: 0 1px 0 #04102e; }
.btn.ghost { color: var(--text); background: var(--panel-2); box-shadow: none; border: 1px solid var(--line); }
.btn.danger { color: #fff; background: linear-gradient(180deg, #ff5a5f, #b3141a); box-shadow: 0 5px 0 #5a0608; }
.btn.small { padding: 7px 14px; font-size: 15px; }
.btn.block { width: 100%; }
.input { width: 100%; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--text); font-size: 19px; outline: none; }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.25); }
label.lbl { display: block; font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.error { color: #ffb4b4; background: rgba(232, 38, 44, 0.15); border: 1px solid rgba(232, 38, 44, 0.4); padding: 10px 12px; border-radius: 10px; margin-top: 10px; }

/* ---------- DBZ elements ---------- */
.ballb { position: relative; display: inline-block; flex: none; filter: drop-shadow(0 0 6px rgba(255, 150, 0, 0.55)); }
.ballb b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.35em; color: #fff; text-shadow: 0 0 3px #7a2a00, 0 2px 0 #7a2a00, 0 0 8px rgba(0, 0, 0, 0.7); }
.balls-progress { display: inline-flex; gap: 4px; align-items: center; }
.balls-progress .unlit .dball { filter: grayscale(1) brightness(0.45); opacity: 0.55; }
.balls-progress .lit .dball { filter: drop-shadow(0 0 7px rgba(255, 160, 0, 0.8)); }
.radar { filter: drop-shadow(0 0 16px rgba(80, 255, 120, 0.35)); }
.radar .sweep { transform-origin: 50px 50px; animation: sweep 2.4s linear infinite; }
.radar .blip { animation: blip 2s ease-in-out infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.scouter { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 10px; background: rgba(20, 70, 30, 0.55); border: 1px solid rgba(125, 255, 138, 0.45); box-shadow: inset 0 0 18px rgba(125, 255, 138, 0.15), 0 0 10px rgba(125, 255, 138, 0.2); font-family: var(--font-head); color: var(--scouter); text-transform: uppercase; letter-spacing: 0.1em; }
.scouter .lab { font-size: 12px; opacity: 0.8; }
.scouter .val { font-family: 'Courier New', monospace; font-weight: 700; font-size: 22px; letter-spacing: 0.06em; text-shadow: 0 0 8px rgba(125, 255, 138, 0.8); }
.saga { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 122, 0, 0.25), rgba(255, 176, 0, 0.1)); border: 1px solid rgba(255, 176, 0, 0.5); font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; color: var(--gold); }
.aura { animation: aura 1.1s ease-in-out infinite alternate; }
@keyframes aura { from { box-shadow: 0 0 10px rgba(255, 210, 63, 0.5), 0 0 24px rgba(255, 150, 0, 0.3); } to { box-shadow: 0 0 22px rgba(255, 210, 63, 0.95), 0 0 48px rgba(255, 150, 0, 0.6); } }
.zap { position: relative; }
.zap::after { content: ''; position: absolute; inset: -6px; border-radius: inherit; background: radial-gradient(closest-side, rgba(255, 210, 63, 0.35), transparent); pointer-events: none; animation: aura 0.9s ease-in-out infinite alternate; }

/* ---------- question ---------- */
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.qmeta .pts { color: var(--gold); font-size: 18px; }
.qimg { display: block; width: 100%; max-height: 42vh; object-fit: contain; border-radius: 14px; background: rgba(0, 0, 0, 0.35); margin: 0 0 12px; border: 1px solid var(--line); }
.qtext { position: relative; font-family: var(--font-head); font-weight: 700; font-size: 24px; line-height: 1.2; padding: 16px 20px; text-align: center; border-radius: 18px; background: linear-gradient(180deg, #16255f, var(--blue-deep-2)); border: 2px solid var(--orange-2); box-shadow: 0 0 20px rgba(255, 140, 0, 0.18), inset 0 0 40px rgba(47, 123, 255, 0.15); }
.answers { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .answers { grid-template-columns: 1fr 1fr; } }
.ans { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 14px 8px 10px; text-align: left; cursor: pointer; color: var(--text); border-radius: 999px; border: 2px solid rgba(255, 176, 0, 0.55); background: linear-gradient(180deg, #16255f, var(--blue-deep-2)); -webkit-tap-highlight-color: transparent; transition: transform 0.08s, background 0.15s, border-color 0.15s; }
.ans .txt { font-family: var(--font-head); font-weight: 600; font-size: 20px; line-height: 1.15; flex: 1; }
.ans:hover:not(:disabled), .ans:active:not(:disabled) { border-color: var(--gold); background: linear-gradient(180deg, #223a8f, #0d1f5e); }
.ans.selected { background: linear-gradient(180deg, var(--orange-2), var(--orange)); border-color: #fff3c0; color: #1a0c00; box-shadow: 0 0 18px rgba(255, 176, 0, 0.6); }
.ans.final { border-color: #fff; }
.ans.correct { background: linear-gradient(180deg, #2fd46e, #128a3f); border-color: #d8ffe6; color: #04210f; animation: aura 0.9s ease-in-out infinite alternate; }
.ans.wrong { background: linear-gradient(180deg, #ff5a5f, #8e0f14); border-color: #ffb4b4; color: #fff; }
.ans:disabled { cursor: default; }
.ans.dim { opacity: 0.4; }
.ans .count { margin-left: auto; font-family: var(--font-display); color: inherit; font-size: 20px; padding-right: 6px; }
.ans.dim .count, .ans.correct .count { color: inherit; }

.timer { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.timer .ki { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.1em; color: var(--scouter); text-shadow: 0 0 8px rgba(125, 255, 138, 0.8); }
.timer .bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; border: 1px solid var(--line); }
.timer .fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--blue), #7de0ff 50%, var(--gold)); box-shadow: 0 0 12px rgba(125, 224, 255, 0.8); transition: width 0.12s linear; }
.timer .num { font-family: var(--font-display); font-size: 30px; min-width: 48px; text-align: right; color: var(--gold); }
.timer.urgent .fill { background: linear-gradient(90deg, #ff2e2e, var(--orange)); box-shadow: 0 0 12px rgba(255, 90, 0, 0.9); }
.timer.urgent .num { color: #ff5a5f; animation: pulse 0.6s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.15); } }

.banner { margin-top: 14px; padding: 12px 16px; border-radius: 14px; text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--panel-2); border: 1px solid var(--line); }
.banner.good { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.5); color: #b8ffd0; }
.banner.bad { background: rgba(232, 38, 44, 0.18); border-color: rgba(232, 38, 44, 0.5); color: #ffb4b4; }
.banner.gold { background: rgba(255, 176, 0, 0.16); border-color: rgba(255, 176, 0, 0.55); color: var(--gold); }
.explain { margin-top: 10px; color: var(--muted); text-align: center; }

/* ---------- ranking ---------- */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.board li .rank { font-family: var(--font-display); font-size: 26px; color: var(--muted); text-align: center; }
.board li:nth-child(1) .rank { color: var(--gold); text-shadow: 0 0 10px rgba(255, 210, 63, 0.8); } .board li:nth-child(2) .rank { color: #d7dcf0; } .board li:nth-child(3) .rank { color: #d08a4a; }
.board li .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.board li .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .score { font-family: 'Courier New', monospace; color: var(--scouter); font-size: 22px; font-weight: 700; text-shadow: 0 0 8px rgba(125, 255, 138, 0.7); font-variant-numeric: tabular-nums; }
.board li.me { outline: 2px solid var(--orange); background: rgba(255, 122, 0, 0.12); }
.board li .delta { font-size: 15px; color: var(--green); margin-left: 8px; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; margin: 18px 0; }
.podium .p { text-align: center; border-radius: 14px 14px 0 0; padding: 14px 8px; font-family: var(--font-head); font-weight: 800; background: linear-gradient(180deg, #2a3a78, var(--blue-deep)); border: 1px solid var(--line); }
.podium .p .pname { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .p .pscore { color: var(--scouter); font-size: 24px; font-family: 'Courier New', monospace; }
.podium .p.first { order: 2; min-height: 150px; background: linear-gradient(180deg, var(--gold), var(--orange)); color: #1a0c00; animation: aura 1s ease-in-out infinite alternate; } .podium .p.first .pscore { color: #1a0c00; }
.podium .p.second { order: 1; min-height: 115px; } .podium .p.third { order: 3; min-height: 90px; }
.podium .medal { font-family: var(--font-display); font-size: 34px; }

/* ---------- lobby ---------- */
.balls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0; }
.balls .dball { animation: float 3s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(255, 140, 0, 0.55)); }
.balls .dball:nth-child(2n) { animation-delay: -1s; } .balls .dball:nth-child(3n) { animation-delay: -2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.teamtag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-family: var(--font-head); font-weight: 700; font-size: 18px; }
footer.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 10px; }
@media (prefers-reduced-motion: reduce) { .radar .sweep, .radar .blip, .balls .dball, .aura, .ans.correct, .podium .p.first, .zap::after, .timer.urgent .num { animation: none; } }
