:root {
  --bg: #07131c; --panel: rgba(9, 22, 40, .86); --line: rgba(230, 194, 110, .38);
  --text: #f3ead2; --muted: #aab3c0; --gold: #e6c26e; --gold2: #f1cf86;
  --you: #f1cf86; --opp: #e0795c; --ok: #6fbf8f; --bad: #d65a43;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Mukta", system-ui, sans-serif; overflow: hidden; }
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; transition: opacity .6s; }
.screen { position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column; }
.screen.scroll { overflow-y: auto; }
body.lang-hi h1, body.lang-hi h2 { font-family: "Rozha One", serif; font-weight: 400; }

.topicons { position: fixed; top: 10px; right: 10px; z-index: 9; display: flex; gap: 8px; }
.icon { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: rgba(7, 19, 28, .6); font-size: 17px; cursor: pointer; display: grid; place-items: center; }
.icon.off { opacity: .45; text-decoration: line-through; }
.icon.lang { font-weight: 800; }
body.in-match .topicons { top: auto; bottom: 10px; }

/* ---------- home ---------- */
#home { overflow-y: auto; display: block; }
.titlebox { position: absolute; top: 4vh; left: 0; right: 0; text-align: center; pointer-events: none; padding: 0 16px; }
.titlebox h1 { margin: 0; font: 700 clamp(44px, 11vw, 92px)/1 "Cormorant Garamond", serif; color: var(--gold2); text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.kicker { margin: 6px 0 0; font-size: clamp(12px, 3.2vw, 16px); letter-spacing: .22em; text-transform: uppercase; text-shadow: 0 1px 8px #000; }
.panel { width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 16px 26px; position: relative; }
#home .panel { margin-top: calc(56vh - 40px); background: linear-gradient(180deg, rgba(7, 19, 28, 0), rgba(7, 19, 28, .94) 40px, var(--bg)); padding-top: 34px; min-height: 44vh; }
.panel.center { margin: auto; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; max-width: 420px; width: calc(100% - 32px); }
.rankchip { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; background: rgba(230, 194, 110, .06); font-size: 14px; }
.rankchip b { color: var(--gold2); font-size: 17px; }
.rankchip .bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rankchip .bar i { display: block; height: 100%; background: linear-gradient(90deg, #d9ac55, #f6dc97); }
.namebox { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.namebox input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: rgba(7, 19, 28, .7); color: var(--text); font: 600 17px "Mukta", sans-serif; }
.invite { border: 1.5px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; background: rgba(230, 194, 110, .1); text-align: center; font-weight: 600; }
.big { display: block; width: 100%; padding: 15px 12px; border-radius: 14px; cursor: pointer; font: 800 20px "Mukta", sans-serif; margin: 0 0 10px; line-height: 1.15; transition: transform .1s; }
.big:active { transform: translateY(2px) scale(.99); }
.big small { display: block; font-weight: 400; font-size: 13px; opacity: .8; margin-top: 2px; }
.gold { border: 0; color: #1a1206; background: linear-gradient(180deg, #f3d792, #d9ac55); box-shadow: 0 8px 24px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .18); }
.ghost { border: 1.5px solid var(--line); background: rgba(7, 19, 28, .7); }
.wa { border: 0; background: #1f9d55; color: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .big { font-size: 17px; }
.langswitch { display: block; width: 100%; margin: 6px 0 14px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--gold); background: transparent; font: 800 22px "Mukta", sans-serif; cursor: pointer; }
.langswitch small { display: block; font: 400 13px "Mukta", sans-serif; color: var(--muted); }
.how { border-top: 1px solid var(--line); padding-top: 10px; }
.how summary { cursor: pointer; color: var(--gold); font-weight: 600; }
.how li { margin: 6px 0; }
.draft { color: var(--muted); font-size: 12px; text-align: center; }
.muted { color: var(--muted); }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; margin-top: 6px; }
h2 { font: 700 28px/1.15 "Cormorant Garamond", serif; color: var(--gold2); margin: 6px 0 6px; }

/* searching */
.churnring { width: 96px; height: 96px; margin: 6px auto 10px; position: relative; }
.churnring i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--gold); animation: spin 1.4s linear infinite; }
.churnring i:nth-child(2) { inset: 14px; border-top-color: var(--opp); animation-direction: reverse; animation-duration: 1.1s; }
.churnring i:nth-child(3) { inset: 28px; border-top-color: #9fc4e8; animation-duration: .8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.code { font: 700 44px/1 "Cormorant Garamond", serif; letter-spacing: .18em; color: var(--gold2); margin: 12px 0 16px; }
.waiting { margin-top: 10px; }
.dotpulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.6); } }

/* ---------- match ---------- */
.hud { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start; padding: 10px 10px 0; }
.pl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 8px; min-width: 0; position: relative; }
.pl.opp { text-align: right; }
.pl .nm { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .sub { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pl .sc { font: 800 28px/1 "Mukta", sans-serif; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pl.you .sc { color: var(--you); } .pl.opp .sc { color: var(--opp); }
.dots { display: flex; gap: 3px; margin-top: 5px; }
.pl.opp .dots { justify-content: flex-end; }
.dots i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, .14); }
.dots i.ok { background: var(--ok); } .dots i.no { background: var(--bad); } .dots i.cur { outline: 1.5px solid var(--gold); }
.ansflag { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%) scale(.6); opacity: 0; background: var(--opp); color: #1a0d08; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 10px; white-space: nowrap; transition: .25s; }
.ansflag.on { opacity: 1; transform: translateX(-50%) scale(1); }
.clock { width: 70px; text-align: center; position: relative; }
.clock svg { width: 64px; height: 64px; transform: rotate(-90deg); display: block; margin: 0 auto; }
.cbg { fill: rgba(7, 19, 28, .75); stroke: rgba(255, 255, 255, .12); stroke-width: 5; }
.cfg { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 0; }
.clock.hurry .cfg { stroke: var(--bad); }
.clock b { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: grid; place-items: center; font-size: 24px; font-variant-numeric: tabular-nums; }
.clock small { display: inline-block; font-size: 11px; color: var(--text); margin-top: 3px; letter-spacing: .04em; white-space: nowrap; background: rgba(7, 19, 28, .8); padding: 1px 7px; border-radius: 8px; }
.tug { padding: 8px 12px 0; }
.tugbar { height: 6px; border-radius: 3px; display: flex; overflow: hidden; background: rgba(255, 255, 255, .08); max-width: 520px; margin: 0 auto; }
.tugbar i { display: block; height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
#tugYou { background: linear-gradient(90deg, #d9ac55, #f6dc97); width: 50%; }
#tugOpp { background: linear-gradient(90deg, #e0795c, #b8432a); width: 50%; }

.fly { position: fixed; z-index: 6; left: 22%; top: 30%; font: 800 34px "Mukta", sans-serif; color: var(--you); pointer-events: none; opacity: 0; text-shadow: 0 2px 10px #000; }
.fly.opp { left: auto; right: 22%; color: var(--opp); }
.fly.go { animation: fly 1.3s ease-out; }
@keyframes fly { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-50px) scale(1); } }

.versus { margin: auto; text-align: center; padding: 16px; animation: rise .5s ease-out; }
.versus .vs { font: 700 64px/1 "Cormorant Garamond", serif; color: var(--gold2); margin: 8px 0; }
.versus .who { font: 800 26px "Mukta", sans-serif; }
.versus .who small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.versus .tip { margin-top: 18px; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.qcard { margin-top: auto; width: 100%; max-width: 560px; align-self: center; padding: 0 12px 58px; animation: rise .35s ease-out; }
.lvl { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; margin-bottom: 6px; border: 1px solid var(--line); background: rgba(7, 19, 28, .8); }
.lvl.l1 { color: #9fd4b2; } .lvl.l2 { color: #9fc4e8; } .lvl.l3 { color: #f2b48f; } .lvl.l4 { color: #1a1206; background: linear-gradient(180deg, #f3d792, #d9ac55); border: 0; }
.q { font: 600 clamp(19px, 5vw, 24px)/1.3 "Mukta", sans-serif; margin: 0 0 12px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); background: rgba(7, 19, 28, .78); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.opts { display: grid; gap: 9px; }
.opt { position: relative; text-align: left; padding: 13px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: rgba(12, 28, 52, .92); font: 600 18px/1.25 "Mukta", sans-serif; cursor: pointer; opacity: 0; transform: translateY(8px); transition: transform .2s, background .2s, border-color .2s, opacity .25s; }
.opts.open .opt { opacity: 1; transform: none; }
.opts.open .opt:nth-child(2) { transition-delay: .04s; } .opts.open .opt:nth-child(3) { transition-delay: .08s; } .opts.open .opt:nth-child(4) { transition-delay: .12s; }
.opt:hover { border-color: var(--gold); }
.opt.picked { border-color: var(--gold); background: rgba(230, 194, 110, .2); }
.opt.right { border-color: var(--ok); background: rgba(80, 170, 110, .35); }
.opt.wrong { border-color: var(--bad); background: rgba(200, 70, 50, .35); animation: shake .35s; }
.opts.locked .opt { cursor: default; }
.opt .tag { position: absolute; top: -9px; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 8px; letter-spacing: .06em; }
.opt .tag.y { right: 54px; background: var(--you); color: #1a1206; } .opt .tag.o { right: 8px; background: var(--opp); color: #1a0d08; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cite { min-height: 18px; font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.cite b { color: var(--gold); font-weight: 600; }

/* ---------- end ---------- */
#end { background: linear-gradient(180deg, rgba(7, 19, 28, .2), rgba(7, 19, 28, .9) 40%); }
.endpanel { margin-top: 32vh; text-align: center; animation: rise .6s ease-out; }
.verdict { font: 700 clamp(48px, 13vw, 76px)/1 "Cormorant Garamond", serif; color: var(--gold2); margin: 0; text-shadow: 0 2px 20px rgba(0, 0, 0, .7); }
.verdict.lose { color: #e9b3a4; }
.versusline { display: flex; justify-content: center; align-items: baseline; gap: 14px; margin: 10px 0 4px; font-weight: 800; }
.versusline .s { font-size: 40px; font-variant-numeric: tabular-nums; }
.versusline .y { color: var(--you); } .versusline .o { color: var(--opp); }
.versusline small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.line2 { color: var(--muted); margin: 0 0 12px; }
.xp { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0 14px; background: rgba(230, 194, 110, .06); text-align: left; }
.endbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.endbtns .big { font-size: 17px; margin: 0; }
.endbtns .full { grid-column: 1 / -1; }
.rounds { text-align: left; margin-top: 18px; }
.rounds h3 { font: 700 22px "Cormorant Garamond", serif; color: var(--gold2); margin: 0 0 8px; }
.rd { border-top: 1px solid rgba(230, 194, 110, .2); padding: 9px 0; font-size: 15px; }
.rd .qq { font-weight: 600; }
.rd .aa { color: var(--ok); }
.rd .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.rd .meta .y { color: var(--you); } .rd .meta .o { color: var(--opp); }
.sharecard { width: 100%; border-radius: 14px; margin: 12px 0; border: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 20; background: #111d2e; border: 1px solid var(--gold); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); text-align: center; animation: rise .3s; }

@media (min-width: 760px) {
  .opts { grid-template-columns: 1fr 1fr; }
  .fly { left: 30%; } .fly.opp { right: 30%; }
}
@media (max-height: 640px) {
  .q { font-size: 18px; padding: 9px 12px; }
  .opt { padding: 10px 12px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .opts .opt { opacity: 1; transform: none; } }

/* Devanagari must never be letter-spaced or upper-cased: it breaks the conjuncts */
body.lang-hi .kicker, body.lang-hi .pl .sub, body.lang-hi .lvl, body.lang-hi .clock small, body.lang-hi .code { letter-spacing: 0; text-transform: none; }
body.lang-hi .kicker { font-size: clamp(14px, 3.8vw, 18px); }
