:root { --bg: #140b33; --card: #22154f; --card2: #2d1d68; --accent: #7C5CFF; --cyan: #22D3EE; --gold: #FFC94A; --green: #2fbf71; --red: #ff5a6a; --ink: #f4f0ff; --muted: #b8acdf; --me: #FFB020; --opp: #22D3EE; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 50% -10%, #3a2288, var(--bg) 62%); color: var(--ink); font-family: 'Noto Sans Devanagari','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Tamil','Noto Sans Malayalam', system-ui, sans-serif; }
[hidden] { display: none !important; }
.screen { min-height: 100dvh; padding: 56px 12px 64px; display: flex; flex-direction: column; align-items: center; }
.screen.center { justify-content: center; text-align: center; gap: 8px; padding-top: 40px; }
.card { width: min(480px, 100%); background: var(--card); border: 1.5px solid rgba(124,92,255,.5); border-radius: 22px; padding: 18px; }
.logo { font-size: 32px; font-weight: 800; text-align: center; color: var(--gold); }
.sub { text-align: center; color: var(--muted); margin: 4px 0 12px; line-height: 1.45; }
.lbl { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.err { color: #ff8a92; min-height: 18px; font-size: 13px; margin-top: 8px; text-align: center; }
.fine { font-size: 12px; color: var(--muted); }
button { font: inherit; color: inherit; }
button.primary { width: 100%; margin-top: 10px; padding: 13px; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(180deg, #9b82ff, var(--accent)); border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 4px 0 #4a2fc0; }
button.primary.alt { background: linear-gradient(180deg, #4de3f7, #14a9c4); box-shadow: 0 4px 0 #0c6e82; color: #052a33; }
button.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #4a2fc0; }
button.primary:disabled { opacity: .5; }
button.ghost { width: 100%; margin-top: 10px; padding: 10px; font-weight: 700; color: var(--gold); background: transparent; border: 1.5px solid rgba(255,201,74,.5); border-radius: 14px; cursor: pointer; }
button.ghost.narrow { width: auto; padding: 10px 28px; }
.kind { font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); cursor: pointer; white-space: nowrap; }
.prow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prow input { flex: 1; min-width: 0; font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.28); color: inherit; }
.code-in { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-weight: 800; }
.once { text-align: center; font-size: 13px; color: var(--gold); margin: 12px 0 0; }
.once.done { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; color: var(--ink); line-height: 1.45; }

/* setup choices */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.centered { justify-content: center; margin-bottom: 10px; }
.chips button, .chip { padding: 7px 12px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); font-size: 13px; font-weight: 700; cursor: pointer; }
.chip { cursor: default; background: rgba(124,92,255,.25); border-color: rgba(124,92,255,.6); }
.chips button.on { border-color: var(--gold); background: rgba(255,201,74,.18); color: var(--gold); }
.chips.nums { display: grid; grid-template-columns: repeat(6, 1fr); }
.chips.nums button { padding: 9px 0; border-radius: 12px; text-align: center; position: relative; }
.chips.nums button.soon { opacity: .38; cursor: default; }
.chips.nums button.soon::after { content: ''; }
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.subjects button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); font-weight: 700; text-align: left; cursor: pointer; }
.subjects button span { font-size: 22px; }
.subjects button.on { border-color: var(--gold); background: rgba(255,201,74,.16); }
.subjects button.soon { opacity: .4; cursor: default; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { padding: 10px 6px; border-radius: 14px; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); cursor: pointer; text-align: center; }
.seg button b { display: block; font-size: 15px; } .seg button small { color: var(--muted); font-size: 11px; }
.seg .lv-easy.on { border-color: var(--green); background: rgba(47,191,113,.2); }
.seg .lv-medium.on { border-color: var(--gold); background: rgba(255,201,74,.18); }
.seg .lv-hard.on { border-color: var(--red); background: rgba(255,90,106,.2); }

/* finding / lobby */
.radar { position: relative; width: 150px; height: 150px; display: grid; place-items: center; font-size: 50px; margin-bottom: 8px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ping 2.4s ease-out infinite; opacity: 0; }
.radar i:nth-child(2) { animation-delay: .8s; } .radar i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ping { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }
.room-code { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 40px; font-weight: 900; letter-spacing: 8px; color: var(--gold); }
.room-code .kind { letter-spacing: 0; font-size: 13px; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: dotb 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotb { 50% { transform: translateY(-8px); opacity: .5; } }

/* avatars */
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 20px; color: #1a0f40; background: var(--me); border: 3px solid rgba(255,255,255,.85); flex: none; }
.opp .av { background: var(--opp); }

/* versus intro */
.vs { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 6px; width: min(480px, 100%); }
.fighter { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; animation: slideIn .6s ease-out both; }
.fighter.opp { animation-name: slideInR; }
.fighter .av { width: 84px; height: 84px; font-size: 38px; }
.fighter b { font-size: 16px; overflow-wrap: anywhere; } .fighter small { color: var(--muted); font-size: 11px; }
.vsmark { font-size: 34px; font-weight: 900; color: var(--gold); text-shadow: 0 0 18px rgba(255,201,74,.6); animation: pop .5s .4s ease-out both; }
.count { font-size: 88px; font-weight: 900; color: var(--gold); line-height: 1; animation: pulseNum 1s ease-in-out infinite; }
@keyframes slideIn { from { transform: translateX(-70px); opacity: 0; } } @keyframes slideInR { from { transform: translateX(70px); opacity: 0; } }
@keyframes pop { from { transform: scale(0); } } @keyframes pulseNum { 50% { transform: scale(1.12); } }

/* the quiz */
.quiz { padding-top: 46px; gap: 8px; }
.vsbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; width: min(520px, 100%); }
.pl { display: flex; align-items: center; gap: 8px; min-width: 0; position: relative; }
.pl.opp { justify-content: flex-end; }
.pn { display: flex; flex-direction: column; min-width: 0; } .pn.r { text-align: right; }
.pn b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc { font-size: 22px; font-weight: 900; color: var(--gold); line-height: 1.1; }
.sc.bump { animation: pop .35s ease-out; }
.tick { position: absolute; right: -4px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-style: normal; font-size: 12px; font-weight: 900; display: grid; place-items: center; animation: pop .25s ease-out; }
.pips { display: flex; gap: 4px; } .pips i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.2); }
.pips i.now { background: var(--gold); transform: scale(1.3); } .pips i.ok { background: var(--green); } .pips i.no { background: var(--red); }
.timer { position: relative; width: min(520px, 100%); height: 16px; border-radius: 10px; background: rgba(255,255,255,.12); overflow: hidden; }
#timerBar { height: 100%; width: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--green), #b6e04a); transform-origin: left; }
#timerBar.warn { background: linear-gradient(90deg, var(--gold), #ff9a3d); } #timerBar.crit { background: linear-gradient(90deg, var(--red), #ff8a6a); }
#timerNum { position: absolute; right: 8px; top: -1px; font-size: 12px; text-shadow: 0 1px 2px #000; }
.banner { min-height: 26px; font-weight: 900; text-align: center; letter-spacing: 1px; color: var(--gold); }
.banner.double { animation: pulseNum 0.8s ease-in-out infinite; text-shadow: 0 0 14px rgba(255,201,74,.8); }
.qmeta { display: flex; justify-content: space-between; width: min(520px, 100%); font-size: 12px; color: var(--muted); }
.qlevel { font-weight: 800; } .qlevel.d1 { color: var(--green); } .qlevel.d2 { color: var(--gold); } .qlevel.d3 { color: var(--red); }
.qcard { width: min(520px, 100%); min-height: 96px; display: grid; place-items: center; text-align: center; padding: 16px; border-radius: 20px; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1.5px solid rgba(124,92,255,.55); font-size: 19px; font-weight: 700; line-height: 1.4; animation: qIn .35s ease-out; }
@keyframes qIn { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.opts { display: grid; gap: 9px; width: min(520px, 100%); }
.opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 16px; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; transition: transform .1s, background .2s, border-color .2s; animation: optIn .4s ease-out both; }
.opt:nth-child(2) { animation-delay: .05s; } .opt:nth-child(3) { animation-delay: .1s; } .opt:nth-child(4) { animation-delay: .15s; }
@keyframes optIn { from { transform: translateX(-20px); opacity: 0; } }
.opt .ltr { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 900; background: rgba(255,255,255,.14); }
.opt .txt { flex: 1; overflow-wrap: anywhere; }
.opt:not(:disabled):active { transform: scale(.98); }
.opt.picked { border-color: var(--me); background: rgba(255,176,32,.18); }
.opt.gone { opacity: .18; text-decoration: line-through; pointer-events: none; }
.opt.right { border-color: var(--green); background: rgba(47,191,113,.28); animation: rightPop .4s ease-out; }
.opt.wrong { border-color: var(--red); background: rgba(255,90,106,.25); animation: shake .4s; }
.opt .who { display: flex; gap: 4px; }
.opt .who i { width: 22px; height: 22px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 900; display: grid; place-items: center; color: #1a0f40; border: 2px solid #fff; background: var(--me); }
.opt .who i.o { background: var(--opp); }
@keyframes rightPop { 40% { transform: scale(1.04); } } @keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: min(520px, 100%); }
.fifty { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--cyan); background: rgba(34,211,238,.12); font-weight: 900; color: var(--cyan); cursor: pointer; }
.fifty:disabled { opacity: .35; border-color: rgba(255,255,255,.3); color: var(--muted); text-decoration: line-through; }
.reacts { display: flex; gap: 4px; } .reacts button { font-size: 20px; padding: 4px 6px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); cursor: pointer; }
.reacts button:active { transform: scale(1.3); }
.status { min-height: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.status.good { color: var(--green); } .status.bad { color: #ff8a92; }
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fl { position: absolute; font-weight: 900; font-size: 30px; text-shadow: 0 2px 8px rgba(0,0,0,.6); animation: floatUp 1.6s ease-out forwards; }
.fl.pts { color: var(--gold); font-size: 34px; } .fl.emo { font-size: 42px; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-16px) scale(1.15); } 100% { transform: translateY(-160px) scale(1); opacity: 0; } }
.confetti { position: absolute; top: -30px; font-size: 26px; animation: fall 2.8s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* results */
.res-icon { font-size: 64px; text-align: center; } .res-title { text-align: center; margin: 4px 0 10px; color: var(--gold); font-size: 26px; }
.res-scores { display: flex; justify-content: space-around; gap: 10px; }
.rs { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; } .rs b { font-size: 14px; overflow-wrap: anywhere; text-align: center; } .rs span { font-size: 30px; font-weight: 900; color: var(--gold); }
.rs.winner .av { box-shadow: 0 0 0 4px var(--gold), 0 0 22px rgba(255,201,74,.7); }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 4px; }
.res-stats div { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 4px; text-align: center; } .res-stats b { display: block; font-size: 17px; color: var(--cyan); } .res-stats small { font-size: 11px; color: var(--muted); }
.review { display: grid; gap: 8px; }
.rv { background: rgba(0,0,0,.22); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.rv .q { font-weight: 700; margin-bottom: 4px; } .rv .a { color: var(--green); } .rv .m { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rv .m .ok { color: var(--green); } .rv .m .no { color: #ff8a92; }
.rv button { margin-left: auto; font-size: 12px; padding: 3px 9px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: transparent; cursor: pointer; color: var(--muted); }
.rv button:disabled { opacity: .55; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #000d; border: 1.5px solid rgba(255,201,74,.6); padding: 8px 14px; border-radius: 12px; z-index: 70; font-weight: 700; }
#toasts { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#toasts .toast { position: static; transform: none; }
.ad-slot { width: min(480px, 100%); margin-top: 12px; }
@media (max-height: 700px) { .qcard { min-height: 72px; font-size: 17px; padding: 10px; } .opt { padding: 9px 12px; } .banner { min-height: 18px; } }
button.primary.solo { background: linear-gradient(180deg, #ffd466, #ff9933); box-shadow: 0 4px 0 #b3661a; color: #3a1a00; }
