/* ==========================================================================
   Viktorina — «Koshin» dizayni: Samarqand–Buxoro koshinlari ranglari,
   sakkiz qirrali yulduz (xotam) belgisi. Fon — lojuvard, urg'u — feruza va za'faron.
   ========================================================================== */
:root { --u: 1vh;
  /* o'yin ekranlari mavzusi (standart — «Koshin», qorong'i lojuvard) */
  --gbg: #13294b; --gfg: #ffffff; --on: 255,255,255; --gpanel: #f6f1e4; --gpfg: #1c2733; --gshade: rgba(0,0,0,.22);
  --gacc: #e3a33a; --gwarn: #ffd27a; --gurg: #ffb3b9; --hdr: #13294b;
  --r-ok: #0f6f72; --r-bad: #8d2832; --r-none: #2d3b4e;
  --lapis: #13294b;      /* lojuvard — o'yin foni */
  --lapis-2: #0b1b33;
  --lapis-3: #1d3a66;
  --tq: #17a2a0;         /* feruza */
  --saf: #e3a33a;        /* za'faron */
  --pom: #c2414b;        /* anor */
  --cob: #3c63b8;        /* kobalt */
  --plum: #7a5aa6;
  --olive: #5f8d3e;
  --ivory: #f6f1e4;      /* koshin oqi (faqat matn maydonlarida) */
  --bg: #edf2f4;         /* chinni — o'qituvchi bo'limi foni */
  --card: #ffffff;
  --fg: #10202f;
  --muted: #5a6a78;
  --line: #d2dce1;
  --ok: #17a2a0;
  --bad: #c2414b;
  --gold: #e3a33a;
  --fd: "Unbounded", "Golos Text", system-ui, sans-serif;
  --fb: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --far: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;
  --star: polygon(50% 0%, 64.6% 14.7%, 85.4% 14.6%, 85.3% 35.4%, 100% 50%, 85.3% 64.6%, 85.4% 85.4%, 64.6% 85.3%, 50% 100%, 35.4% 85.3%, 14.6% 85.4%, 14.7% 64.6%, 0% 50%, 14.7% 35.4%, 14.6% 14.6%, 35.4% 14.7%);
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.055' stroke-width='1.4'%3E%3Cpath d='M50 18 L59.4 27.4 L72.6 27.4 L72.6 40.6 L82 50 L72.6 59.4 L72.6 72.6 L59.4 72.6 L50 82 L40.6 72.6 L27.4 72.6 L27.4 59.4 L18 50 L27.4 40.6 L27.4 27.4 L40.6 27.4 Z'/%3E%3Cpath d='M0 0 L18 50 M100 0 L82 50 M0 100 L18 50 M100 100 L82 50 M50 0 L50 18 M50 100 L50 82 M0 50 L18 50 M100 50 L82 50'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e1a27; --card: #15263a; --fg: #e7eef3; --muted: #9db0bf; --line: #283c52; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0e1a27; --card: #15263a; --fg: #e7eef3; --muted: #9db0bf; --line: #283c52; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--fb); -webkit-tap-highlight-color: transparent; }
body.k { background-color: var(--gbg); background-image: var(--gimg, var(--girih)); background-size: var(--gsz, auto); background-attachment: fixed; color: var(--gfg); transition: background-color .35s; }
body.k.r-ok, body.k.r-bad, body.k.r-none { background-image: var(--gpat, var(--girih)); background-size: var(--gpsz, auto); }
body.k.r-ok { background-color: var(--r-ok); }
body.k.r-bad { background-color: var(--r-bad); }
body.k.r-none { background-color: var(--r-none); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--saf); outline-offset: 2px; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.15; text-wrap: balance; font-family: var(--fd); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.1rem; }

/* ---------- belgi: sakkiz qirrali yulduz ---------- */
.star { clip-path: var(--star); display: inline-grid; place-items: center; }

/* ---------- o'yin: umumiy bloklar ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; min-height: 100vh; }
.card { background: var(--card); color: var(--fg); border-radius: 18px 6px 18px 6px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
body.k .card { box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 30px rgba(0,0,0,.25); }
.eb { font-size: .82rem; font-weight: 600; color: var(--gacc); }
.mut { color: var(--muted); }
body.k .mut { color: rgba(var(--on),.72); }
.btn { background: var(--tq); color: #fff; border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; width: 100%; font-family: var(--fd); font-size: .95rem; letter-spacing: .01em; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.w { background: var(--saf); color: var(--lapis-2); }
.btn.g { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.sm { width: auto; padding: 10px 14px; font-size: .85rem; }
select, input[type=text] { font: inherit; font-weight: 600; padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--fg); width: 100%; }
.bar { height: 8px; background: rgba(var(--on),.14); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--tq), var(--saf)); transform-origin: left; transition: transform .25s linear; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; }
.pill { background: rgba(var(--on),.1); border: 1px solid rgba(var(--on),.16); border-radius: 999px; padding: 3px 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.gold { background: linear-gradient(100deg, #b97a17, var(--saf) 40%, #ffe3a3 50%, var(--saf) 60%, #b97a17); background-size: 250% 100%; color: var(--lapis-2); border-radius: 10px; padding: 8px 12px; font-weight: 800; text-align: center; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.qt { background: var(--gpanel); color: var(--gpfg); border-radius: 16px 6px 16px 6px; padding: 16px 18px; font-weight: 600; font-size: 1.12rem; line-height: 1.45; }
.aq, .ar { font-family: var(--far); }
.aq { font-size: 1.12em; font-weight: 400; }

/* ---------- variantlar ---------- */
.tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tile { border: 0; border-radius: 14px; color: #fff; font-weight: 600; text-align: left; padding: 12px 14px 12px 10px; min-height: 64px; display: flex; align-items: center; gap: 12px; font-size: 1rem; line-height: 1.3; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); position: relative; }
.tile .sh { clip-path: var(--star); flex: none; width: 2.3em; height: 2.3em; display: grid; place-items: center; background: rgba(255,255,255,.92); font-family: var(--fd); font-weight: 800; font-size: .95rem; }
.t0 { background: var(--tq); } .t0 .sh { color: var(--tq); }
.t1 { background: var(--saf); color: #2a1a00; } .t1 .sh { color: #9a6410; }
.t2 { background: var(--pom); } .t2 .sh { color: var(--pom); }
.t3 { background: var(--cob); } .t3 .sh { color: var(--cob); }
.t4 { background: var(--plum); } .t4 .sh { color: var(--plum); }
.t5 { background: var(--olive); } .t5 .sh { color: var(--olive); }
.tile:disabled { cursor: default; }
.tiles.done .tile { opacity: .3; transform: scale(.97); transition: .25s; }
.tiles.done .tile.pick { opacity: 1; transform: scale(1.02); box-shadow: 0 0 0 4px rgb(var(--on)), 0 0 26px rgba(var(--on),.45); }
.tiles.tf { grid-template-columns: 1fr 1fr; }
.tiles.tf .tile { min-height: 132px; flex-direction: column; justify-content: center; font-size: 1.2rem; font-family: var(--fd); text-align: center; padding: 14px; }
.tiles.tf .tile .sh { width: 2.8em; height: 2.8em; font-size: 1.2rem; }
.tiles.multi .tile .ck { margin-left: auto; width: 26px; height: 26px; border-radius: 7px; border: 2px solid rgba(255,255,255,.8); display: grid; place-items: center; font-size: .95rem; color: transparent; }
.tiles.multi .tile.sel { box-shadow: 0 0 0 3px rgb(var(--on)), inset 0 -4px 0 rgba(0,0,0,.18); }
.tiles.multi .tile.sel .ck { background: #fff; color: var(--lapis); }
.hint { margin: 0; text-align: center; font-weight: 600; opacity: .88; font-size: .92rem; }
.ord, .mt { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ord li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--gpanel); color: var(--gpfg); border-radius: 12px; padding: 9px 10px; border-left: 8px solid; font-weight: 600; }
.ord .n { font-family: var(--fd); font-weight: 800; color: var(--lapis-3); width: 1.4em; text-align: center; }
.mv { display: flex; flex-direction: column; gap: 4px; }
.mv button { border: 0; background: #dfe6ea; border-radius: 7px; width: 40px; height: 30px; font-size: .9rem; color: var(--lapis); }
.mv button:disabled { opacity: .3; }
.mt li { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.mt .l, .mt .r { border-radius: 12px; padding: 10px; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.mt .l { color: #fff; }
.mt .r { background: var(--gpanel); color: var(--gpfg); }
.mt .eq { font-weight: 800; color: var(--saf); }
.gtx { background: var(--gpanel); color: var(--gpfg); border-radius: 16px 6px 16px 6px; padding: 14px; font-size: 1.15rem; line-height: 2.2; font-weight: 600; }
.gtx .gp { border: 2px dashed var(--lapis-3); background: #e3eaf5; color: var(--lapis-3); border-radius: 8px; padding: 2px 10px; min-width: 4.5em; font-weight: 800; margin: 0 2px; }
.gtx .gp.f { border-style: solid; background: var(--lapis-3); color: #fff; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bank button { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; background: var(--saf); color: var(--lapis-2); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); font-size: 1.05rem; }
.bank button:disabled { opacity: .3; }
.sv { font-family: var(--fd); font-size: 3rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--saf); }
input[type=range] { width: 100%; height: 36px; accent-color: var(--saf); }

/* ---------- natija va kutish ---------- */
.big { font-family: var(--fd); font-size: 4.5rem; font-weight: 800; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.res { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 7vh; }
.res .ic { clip-path: var(--star); width: 104px; height: 104px; background: rgba(var(--on),.16); display: grid; place-items: center; font-size: 2.8rem; font-weight: 800; }
.res .pts { background: var(--gshade); border-radius: 10px; padding: 8px 18px; font-family: var(--fd); font-size: 1.3rem; font-weight: 700; }
.praise { font-family: var(--fd); font-size: 2rem; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: rgba(var(--on),.12); border-radius: 10px; padding: 6px 12px; font-weight: 600; }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; background: var(--gpanel); color: var(--gpfg); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.board .rk { font-family: var(--fd); color: var(--lapis-3); font-weight: 800; }
.board .pt { font-variant-numeric: tabular-nums; font-weight: 700; }
.card .board li { background: var(--bg); color: var(--fg); }
.rv { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.rv p { margin: 0; }
.tag { font-size: .8rem; font-weight: 700; }
.tag.ok { color: var(--ok); } .tag.bad { color: var(--bad); }
.ar { font-size: 1.2rem; line-height: 1.9; background: var(--bg); border-radius: 8px; padding: 6px 10px; text-align: start; }
.msg { min-height: 1.3em; font-weight: 600; color: var(--bad); }
body.k .msg { color: var(--gwarn); }

/* ---------- avatar ---------- */
.avpick { display: flex; gap: 12px; align-items: flex-end; }
.avbig { font-size: 4rem; line-height: 1; text-align: center; }
.avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; max-height: 236px; overflow: auto; padding: 2px; }
.avgrid button { font-size: 1.75rem; line-height: 1; border: 2px solid transparent; border-radius: 12px; background: var(--bg); padding: 7px 0; }
.avgrid button.on { border-color: var(--tq); background: rgba(23,162,160,.14); }
.avtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.avtabs button { border: 0; border-radius: 999px; padding: 5px 11px; font-size: .85rem; font-weight: 600; background: var(--bg); color: var(--fg); }
.avtabs button.on { background: var(--lapis); color: #fff; }

/* ==========================================================================
   Katta ekran
   ========================================================================== */
body.scr { --u: 1vh; }
body.scr .wrap { max-width: none; padding: calc(2.4 * var(--u)) 2.4vw calc(9 * var(--u)); gap: calc(2 * var(--u)); height: calc(100 * var(--u)); min-height: 0; overflow: hidden; }
.s-head { display: flex; justify-content: space-between; align-items: center; gap: 2vw; font-weight: 600; font-size: calc(2.3 * var(--u)); }
.s-q { background: var(--gpanel); color: var(--gpfg); border-radius: calc(2.2 * var(--u)) .8vh calc(2.2 * var(--u)) .8vh; padding: calc(2.6 * var(--u)) 2.4vw; font-size: clamp(20px, calc(4.1 * var(--u)), 56px); font-weight: 700; text-align: center; line-height: 1.3; box-shadow: 0 calc(1.2 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.25); }
.s-mid { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 3vw; min-height: 0; }
.s-timer { position: relative; width: calc(18 * var(--u)); height: calc(18 * var(--u)); flex: none; display: grid; place-items: center; }
.s-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.s-timer .trk { fill: rgba(var(--on),.06); stroke: rgba(var(--on),.14); stroke-width: 3; }
.s-timer .prg { fill: none; stroke: var(--gacc); stroke-width: 5; stroke-linejoin: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.s-timer b { position: relative; font-family: var(--fd); font-size: calc(6.5 * var(--u)); font-weight: 800; font-variant-numeric: tabular-nums; }
.s-timer.urgent .prg { stroke: var(--pom); }
.s-timer.urgent b { animation: beat 1s ease-in-out infinite; color: var(--gurg); }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } }
.s-cnt { text-align: center; font-weight: 600; font-size: calc(2.6 * var(--u)); flex: none; }
.s-cnt b { display: block; font-family: var(--fd); font-size: calc(7 * var(--u)); line-height: 1; }
.s-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: calc(1.4 * var(--u)); }
.s-tiles .tile { min-height: calc(11 * var(--u)); font-size: clamp(16px, calc(3 * var(--u)), 40px); padding: calc(1.4 * var(--u)) 1.4vw calc(1.4 * var(--u)) 1vw; border-radius: calc(1.6 * var(--u)); }
.s-tiles .tile .sh { font-size: calc(2.6 * var(--u)); }
.s-tiles.rev .tile:not(.right) { opacity: .22; filter: saturate(.4); transform: scale(.96); transition: .5s; }
.s-tiles .tile.right { box-shadow: 0 0 0 .5vh rgb(var(--on)), 0 0 calc(4 * var(--u)) rgba(var(--on),.5); animation: glow 1.4s ease-in-out infinite; }
.s-tiles .tile.right::after { content: "✓"; margin-left: auto; clip-path: var(--star); background: #fff; color: var(--tq); width: calc(6 * var(--u)); height: calc(6 * var(--u)); display: grid; place-items: center; font-size: calc(3.4 * var(--u)); font-weight: 800; animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes glow { 50% { box-shadow: 0 0 0 .5vh rgb(var(--on)), 0 0 calc(7 * var(--u)) rgba(var(--on),.75); } }
@keyframes stamp { from { transform: scale(2.4) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.s-hist { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2.4vw; height: 100%; padding-bottom: calc(1 * var(--u)); }
.s-hist .col { display: flex; flex-direction: column; align-items: center; gap: .8vh; font-weight: 700; font-size: calc(2.8 * var(--u)); }
.s-hist .col i { display: block; width: 7vw; border-radius: calc(1 * var(--u)) calc(1 * var(--u)) 0 0; min-height: 4px; transform-origin: bottom; animation: grow .9s cubic-bezier(.2, .9, .3, 1.2) both; }
.s-hist .col:nth-child(2) i { animation-delay: .1s; } .s-hist .col:nth-child(3) i { animation-delay: .2s; } .s-hist .col:nth-child(4) i { animation-delay: .3s; }
.s-hist .col i.t1 { background: var(--saf); }
@keyframes grow { from { transform: scaleY(0); } }
.s-hist .col .sh { clip-path: var(--star); width: calc(4.6 * var(--u)); height: calc(4.6 * var(--u)); display: grid; place-items: center; background: rgb(var(--on)); color: var(--gbg); font-family: var(--fd); font-weight: 800; font-size: calc(2 * var(--u)); }
.s-ans { background: var(--gpanel); color: var(--gpfg); border-radius: calc(2 * var(--u)) .8vh calc(2 * var(--u)) .8vh; padding: calc(2 * var(--u)) 2vw; font-size: calc(4 * var(--u)); font-weight: 700; text-align: center; }
.s-match { display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; font-size: calc(3 * var(--u)); font-weight: 600; }
.s-match ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(1 * var(--u)); }
.s-match li { border-radius: calc(1.2 * var(--u)); padding: calc(1.2 * var(--u)) 1.2vw; color: #fff; }
.s-match .rt li { background: var(--gpanel); color: var(--gpfg); }
.s-gap { display: inline-block; min-width: 5em; border-bottom: .5vh solid var(--lapis-3); color: var(--lapis-3); text-align: center; margin: 0 .3em; font-weight: 800; }
.s-gap.f { background: #dff3f2; color: #0d6c6b; border-color: var(--tq); border-radius: .6vh; padding: 0 .4em; animation: stamp .5s both; }
.s-board { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: calc(1 * var(--u)); width: min(70vw, 1100px); }
.s-board li { display: grid; grid-template-columns: 3em 1fr auto auto; gap: 2vw; align-items: center; background: var(--gpanel); color: var(--gpfg); border-radius: calc(1.2 * var(--u)); padding: calc(1.4 * var(--u)) 2vw; font-weight: 700; font-size: calc(3.2 * var(--u)); animation: slidein .5s cubic-bezier(.2, .9, .3, 1) both; }
.s-board li:nth-child(2) { animation-delay: .12s; } .s-board li:nth-child(3) { animation-delay: .24s; } .s-board li:nth-child(4) { animation-delay: .36s; } .s-board li:nth-child(5) { animation-delay: .48s; }
.s-board .rk { font-family: var(--fd); color: var(--lapis-3); }
.s-board .sc { font-family: var(--fd); font-variant-numeric: tabular-nums; }
.dl { font-size: calc(2.2 * var(--u)); font-weight: 800; border-radius: 999px; padding: .2vh .9vw; }
.dl.up { background: #d6f2ef; color: #0d6c6b; } .dl.dn { background: #f6dbde; color: #8d2832; }
@keyframes slidein { from { transform: translateX(-12vw); opacity: 0; } }
.s-lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 3vw; align-items: start; min-height: 0; }
.s-join { background: var(--gpanel); color: var(--gpfg); border-radius: calc(2.4 * var(--u)) .8vh calc(2.4 * var(--u)) .8vh; padding: calc(2.4 * var(--u)); display: flex; flex-direction: column; align-items: center; gap: calc(1.2 * var(--u)); font-weight: 600; font-size: calc(2.4 * var(--u)); max-width: 36vw; }
.s-join .u { font-size: calc(2.2 * var(--u)); word-break: break-all; text-align: center; color: var(--lapis-3); font-weight: 700; }
#qr img, #qr canvas { width: calc(26 * var(--u)) !important; height: calc(26 * var(--u)) !important; }
.s-names { display: flex; flex-wrap: wrap; gap: calc(1.2 * var(--u)); align-content: flex-start; }
.s-names .chip { font-size: calc(2.8 * var(--u)); padding: .8vh 1.4vw; background: rgba(var(--on),.1); border: 1px solid rgba(var(--on),.15); animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.s-scr { width: 100%; margin-top: calc(1 * var(--u)); padding-top: calc(1.6 * var(--u)); border-top: 2px dashed rgba(19,41,75,.25); display: flex; flex-direction: column; align-items: center; gap: calc(.8 * var(--u)); font-size: calc(1.9 * var(--u)); }
.s-scr b { font-size: calc(2.2 * var(--u)); color: var(--lapis-3); word-break: break-all; text-align: center; user-select: all; }
.s-scr button { border: 0; border-radius: 999px; background: var(--lapis); color: #fff; font: inherit; font-weight: 700; padding: calc(.9 * var(--u)) calc(2.2 * var(--u)); cursor: pointer; }
.s-pin { display: flex; flex-direction: column; align-items: center; }
.s-pin b { font-family: var(--fd); font-size: calc(8.5 * var(--u)); letter-spacing: .08em; line-height: 1; color: var(--lapis); }
.s-ctl { position: fixed; left: 1.4vw; bottom: calc(1.6 * var(--u)); display: flex; gap: .8vw; z-index: 9; }
.s-ctl button, .s-ctl a { border: 0; border-radius: 999px; background: rgba(var(--on),.12); color: var(--gfg); font-weight: 700; font-size: calc(2.1 * var(--u)); padding: .9vh 1.4vw; text-decoration: none; font-family: var(--fb); }
.s-ctl .w { background: var(--saf); color: var(--lapis-2); }
.s-ctl .snd.big { background: var(--saf); color: var(--lapis-2); animation: breathe 1.8s ease-in-out infinite; }
.s-ctl { flex-wrap: wrap; max-width: calc(100vw - 2.8vw); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 2vw; flex: 1; min-height: 0; }
.podium .p { display: flex; flex-direction: column; align-items: center; gap: calc(1 * var(--u)); width: 22vw; font-weight: 700; opacity: 0; animation: rise .9s cubic-bezier(.2, .9, .3, 1) forwards; }
.podium .p:nth-child(3) { animation-delay: .6s; } .podium .p:nth-child(1) { animation-delay: 2.2s; } .podium .p:nth-child(2) { animation-delay: 4s; }
@keyframes rise { from { opacity: 0; transform: translateY(calc(14 * var(--u))); } to { opacity: 1; transform: none; } }
.podium .av { font-size: calc(9 * var(--u)); line-height: 1; }
.podium .nm { font-size: calc(3 * var(--u)); text-align: center; background: var(--gpanel); color: var(--gpfg); border-radius: calc(1.4 * var(--u)); padding: calc(1 * var(--u)) 1.4vw; }
.podium .nm span { font-family: var(--fd); color: var(--lapis-3); }
.podium .blk { width: 100%; border-radius: calc(1.6 * var(--u)) calc(1.6 * var(--u)) 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: calc(2 * var(--u)); font-family: var(--fd); font-size: calc(7 * var(--u)); background: linear-gradient(var(--lapis-3), var(--lapis-2)); border: 1px solid rgba(255,255,255,.12); border-bottom: 0; }
.podium .p:nth-child(2) .blk { background: linear-gradient(#c78a22, #7c4f0b); }
.podium .blk small { font-family: var(--fb); font-size: calc(2.6 * var(--u)); opacity: .85; }
.rest { display: flex; flex-wrap: wrap; gap: calc(1 * var(--u)) 2vw; justify-content: center; font-size: calc(2.3 * var(--u)); font-weight: 600; opacity: 0; animation: rise .8s 5.2s forwards; }
@keyframes breathe { 50% { transform: scale(1.06); } }

/* ---------- kirish animatsiyalari (har savolda tasodifiy) ---------- */
.in-slide .s-q { animation: inSlide .6s cubic-bezier(.2, .9, .3, 1) both; }
.in-zoom .s-q { animation: inZoom .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.in-flip .s-q { animation: inFlip .7s cubic-bezier(.2, .9, .3, 1) both; }
.in-drop .s-q { animation: inDrop .7s cubic-bezier(.3, 1.5, .5, 1) both; }
.in-unfold .s-q { animation: inUnfold .7s cubic-bezier(.2, .9, .3, 1) both; }
.in-twirl .s-q { animation: inTwirl .8s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes inSlide { from { transform: translateX(-60vw); opacity: 0; } }
@keyframes inZoom { from { transform: scale(.2); opacity: 0; } }
@keyframes inFlip { from { transform: perspective(900px) rotateX(90deg); opacity: 0; } }
@keyframes inDrop { from { transform: translateY(-60vh); } }
@keyframes inUnfold { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
@keyframes inTwirl { from { transform: rotate(-12deg) scale(.5); opacity: 0; } }
.s-tiles .tile, .tiles .tile, .ord li, .mt li, .bank button { animation: tileIn .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.s-tiles .tile:nth-child(2), .tiles .tile:nth-child(2), .ord li:nth-child(2), .mt li:nth-child(2) { animation-delay: .08s; }
.s-tiles .tile:nth-child(3), .tiles .tile:nth-child(3), .ord li:nth-child(3), .mt li:nth-child(3) { animation-delay: .16s; }
.s-tiles .tile:nth-child(4), .tiles .tile:nth-child(4), .ord li:nth-child(4), .mt li:nth-child(4) { animation-delay: .24s; }
.s-tiles.rev .tile { animation: none; }
@keyframes tileIn { from { transform: translateY(24px) scale(.9); opacity: 0; } }
.shake { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.bounce { animation: bounce .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bounce { from { transform: scale(.3); } }
.spin8 { animation: spin8 6s linear infinite; }
@keyframes spin8 { to { transform: rotate(360deg); } }
.flame { display: inline-block; animation: flick .6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scale(1.15) rotate(6deg); } }
.cd-num { animation: cdpop 1s ease-out infinite; display: inline-block; }
@keyframes cdpop { 0% { transform: scale(1.6); opacity: .2; } 30% { transform: scale(1); opacity: 1; } }

/* tik ekran (telefon yoki planshet tik holatda): o'lchamlar kenglikka qarab */
@media (max-aspect-ratio: 4/5) {
  body.scr { --u: 1.05vw; }
  body.scr .wrap { height: auto; min-height: 100vh; overflow: visible; padding: 14px 14px 90px; }
  .s-lobby { grid-template-columns: 1fr; }
  .s-join { max-width: none; }
  #qr img, #qr canvas { width: min(60vw, 260px) !important; height: min(60vw, 260px) !important; }
  .s-pin b { font-size: 13vw; }
  .s-mid { flex-wrap: wrap; justify-content: center; }
  .s-mid > .s-ans, .s-mid > .ord, .s-mid > .s-match, .s-mid > div[style*="flex:1"], .s-mid > .s-img, .s-mid > .s-col { flex-basis: 100%; order: 3; }
  .s-tiles { grid-template-columns: 1fr; }
  .s-board { width: 100%; }
  .podium { gap: 2vw; } .podium .p { width: 30vw; }
}
/* ---------- effekt qatlami ---------- */
#fxc { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
.banner { position: fixed; left: 0; right: 0; top: 40%; z-index: 31; pointer-events: none; display: flex; justify-content: center; }
.banner span { font-family: var(--fd); font-weight: 800; font-size: clamp(28px, 8vh, 96px); color: #fff; background: var(--pom); padding: 1.4vh 4vw; border-radius: 1.4vh; box-shadow: 0 2vh 5vh rgba(0,0,0,.35); animation: bannerIn 1.6s cubic-bezier(.2, .9, .3, 1) forwards; }
.banner.gold span { background: var(--saf); color: var(--lapis-2); }
.banner.tq span { background: var(--tq); }
@keyframes bannerIn { 0% { transform: translateX(-120vw) skewX(-12deg); } 25% { transform: none; } 75% { transform: none; opacity: 1; } 100% { transform: translateX(120vw) skewX(12deg); opacity: 0; } }
.edge { position: fixed; inset: 0; pointer-events: none; z-index: 29; box-shadow: inset 0 0 0 0 transparent; }
.edge.on { animation: edge 1s ease-in-out infinite; }
@keyframes edge { 50% { box-shadow: inset 0 0 12vh rgba(194,65,75,.55); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .podium .p, .rest { opacity: 1; }
}

/* ==========================================================================
   O'qituvchi bo'limi
   ========================================================================== */
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--hdr) var(--girih); color: #fff; position: sticky; top: 0; z-index: 5; }
.top .logo { display: flex; align-items: center; gap: 10px; font-family: var(--fd); font-weight: 700; font-size: 1.05rem; text-decoration: none; color: #fff; }
.logo .mark { width: 26px; height: 26px; }
.top .sp { flex: 1; }
.top .who { font-size: .85rem; opacity: .75; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .btn2 { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.page { max-width: 1000px; margin: 0 auto; padding: 22px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.page h1 { font-size: 1.6rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.btn2 { border: 1.5px solid var(--line); background: var(--card); color: var(--fg); border-radius: 10px; padding: 8px 13px; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn2:hover { border-color: var(--tq); }
.btn2.p { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.btn2.p:hover { background: var(--lapis-3); }
.btn2.d { color: var(--bad); }
.btn2:disabled { opacity: .45; cursor: not-allowed; }
.btn2.sm { padding: 5px 9px; font-size: .82rem; }
label.f, div.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
.inp, textarea.inp, select.inp { font: inherit; font-weight: 500; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--fg); width: 100%; }
textarea.inp { min-height: 72px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: var(--tq); outline: none; box-shadow: 0 0 0 3px rgba(23,162,160,.18); }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-weight: 600; font-size: .88rem; }
.okc { color: var(--ok); font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.qcard { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--tq); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
#gm .qcard { border-top-color: var(--saf); }
.qcard h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; font-family: var(--fd); font-weight: 600; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .75rem; font-weight: 700; background: #d9efee; color: #0d6c6b; }
.badge.g { background: #fbecd0; color: #7c4f0b; }
.badge.r { background: #f6dbde; color: #8d2832; }
.badge.c { background: #dde7fb; color: #1d3f8f; }
/* hammualliflar ro'yxati */
.edl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.edl li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; word-break: break-all; }
/* savol rasmlari */
.qimg { display: flex; justify-content: center; }
.qimg img { display: block; max-width: 100%; height: auto; border-radius: 12px; object-fit: contain; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.qimg img:not([src]) { width: 160px; height: 90px; opacity: .35; }
.qimg.ph img { max-height: 30vh; }
.qimg.th { justify-content: flex-start; margin: 4px 0; } .qimg.th img { max-height: 110px; box-shadow: none; border: 1px solid rgba(0,0,0,.12); }
.qimg.ed { justify-content: flex-start; } .qimg.ed img { max-height: 220px; box-shadow: none; border: 1px solid var(--line); }
.imgbox { display: flex; flex-direction: column; gap: 8px; }
.s-img { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; align-self: stretch; }
.s-img .qimg img { max-height: calc(46 * var(--u)); border-radius: calc(1.6 * var(--u)); }
.s-col { flex: 1; display: flex; flex-direction: column; gap: calc(1.6 * var(--u)); min-width: 0; min-height: 0; }
.s-col .qimg img { max-height: calc(24 * var(--u)); border-radius: calc(1.4 * var(--u)); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--lapis-2); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: 90vw; }
.modal { position: fixed; inset: 0; background: rgba(8,18,33,.55); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal .card { max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; }
.ed { display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .ed { grid-template-columns: 1fr; } }
.qlist { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.qlist button { text-align: left; border: 1.5px solid var(--line); background: var(--card); color: var(--fg); border-radius: 10px; padding: 8px 10px; font-size: .85rem; display: grid; grid-template-columns: 1.8em 1fr auto; gap: 6px; align-items: center; }
.qlist button.on { border-color: var(--tq); box-shadow: 0 0 0 2px var(--tq) inset; }
.qlist button .n { font-family: var(--fd); font-weight: 700; color: var(--tq); }
.qlist button .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qlist button .x { color: var(--bad); font-weight: 800; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.opt .sw { clip-path: var(--star); width: 34px; height: 34px; display: grid; place-items: center; color: #fff; font-family: var(--fd); font-weight: 700; font-size: .8rem; }
.opt input[type=radio], .opt input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--tq); }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; font-weight: 600; color: var(--muted); }
.drop.on { border-color: var(--tq); color: var(--tq); }
input.pin { font-family: var(--fd); font-size: 1.7rem; font-weight: 700; text-align: center; letter-spacing: .2em; }
.home-hero { background: var(--hdr) var(--girih); color: #fff; border-radius: 22px 8px 22px 8px; padding: 30px 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
table.rep { border-collapse: collapse; width: 100%; font-size: .88rem; }
table.rep th, table.rep td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.rep th { font-weight: 700; }
.hero-mark { width: 92px; height: 92px; }

/* ==========================================================================
   Tillar, kutubxona, jamoalar, Telegram, yangilanish xabari
   ========================================================================== */
select.lang { border: 1.5px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; padding: 7px 8px; font: 600 .85rem var(--fb); max-width: 9.5em; }
select.lang option { color: #1c2733; }
.top select.lang { padding: 6px 6px; }
.ltop { display: flex; justify-content: flex-end; }
.s-ctl select.lang.ctl { border: 0; border-radius: 999px; font-size: calc(2.1 * var(--u)); padding: .9vh 1vw; background: rgba(var(--on),.12); }
.btn2.tg, .s-ctl .tg { background: #229ed9; border-color: #229ed9; color: #fff; }
body.k .btn2.tg { border: 0; }
.libf .inp { width: auto; }
.libf input.inp { min-width: 200px; }
ol.qprev { margin: 0; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 10px; }
ol.qprev li { border-bottom: 1px solid var(--line); padding-bottom: 8px; }

/* jamoalar */
.tchip { display: inline-block; color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: .85rem; }
.teamopt { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.tpick button { border: 3px solid transparent; border-radius: 12px; background: var(--tc); color: #fff; font: 700 1rem var(--fb); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
.tpick button small { font-weight: 600; font-size: .75rem; opacity: .85; }
.tpick button.on { border-color: #fff; outline: 3px solid var(--tc); transform: translateY(-2px); }
.tbadge { display: inline-block; margin: 6px auto 0; background: var(--tc); color: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 700; }
.tdot { display: inline-block; width: .8em; height: .8em; clip-path: var(--star); background: var(--tc); margin-inline-end: .4em; vertical-align: -.05em; }
.s-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(18vw, 1fr)); gap: 1.2vw; width: 100%; }
.s-teams .tcol { display: flex; flex-direction: column; gap: calc(.8 * var(--u)); align-items: flex-start; border-top: calc(.8 * var(--u)) solid var(--tc); background: rgba(var(--on),.06); border-radius: calc(1.2 * var(--u)); padding: calc(1 * var(--u)) 1vw; }
.s-teams .th { font-family: var(--fd); font-weight: 700; font-size: calc(3 * var(--u)); color: var(--gfg); }
.s-teams .th b { background: var(--tc); color: #fff; border-radius: 999px; padding: 0 .6em; margin-inline-start: .3em; }
.s-teams .chip { font-size: calc(2.4 * var(--u)) !important; }
.s-board.teams li { border-inline-start: calc(1 * var(--u)) solid var(--tc); }
.s-board.teams small { font-family: var(--fb); font-weight: 600; opacity: .6; font-size: .7em; }
.podium.teams .blk { background: linear-gradient(var(--tc), color-mix(in srgb, var(--tc) 55%, #000)) !important; }
.podium .av.sm { font-size: calc(5 * var(--u)); letter-spacing: -.1em; }

/* «yangi versiya» xabari */
.upd { position: fixed; top: 12px; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 16px; background: var(--saf); color: var(--lapis-2);
  box-shadow: 0 10px 28px rgba(0,0,0,.25); animation: updIn .35s ease-out; }
.upd .ic { flex: none; font-size: 1.25rem; line-height: 1; }
.upd .tx { flex: 0 1 auto; min-width: 0; font-weight: 700; font-size: .95rem; line-height: 1.25; }
.upd button { flex: none; border: 0; border-radius: 999px; font: 700 .9rem var(--fb); padding: 9px 16px; cursor: pointer; white-space: nowrap; }
.upd .go { background: var(--lapis); color: #fff; }
.upd .x { width: 34px; height: 34px; padding: 0; background: rgba(0,0,0,.08); color: var(--lapis-2); font-size: .85rem; }
.upd button:focus-visible { outline: 3px solid var(--lapis-2); outline-offset: 2px; }
@keyframes updIn { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .upd { animation: none; } }

/* arabcha: o'ngdan chapga */
[dir=rtl] .tile { text-align: right; }
[dir=rtl] .qlist button, [dir=rtl] table.rep th, [dir=rtl] table.rep td { text-align: right; }
[dir=rtl] .s-ctl { left: auto; right: 1.4vw; }
[dir=rtl] body { font-family: var(--fb), "Amiri", serif; }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .top .sp { flex-basis: 100%; height: 0; order: 1; }
  .top .logo { order: 0; }
  .top > :not(.logo):not(.sp) { order: 2; }
  .top .who { display: none; }
}
@media (max-width: 640px) { #ttl { flex: 1 1 100%; order: -1; } }
.qlist button .tx, .qcard h3 { unicode-bidi: plaintext; }

body.k select.lang { border-color: rgba(var(--on),.25); background: rgba(var(--on),.1); color: var(--gfg); }
body.k .ltop a, body.k .res a:not(.btn) { color: inherit; }

/* ==========================================================================
   Mavzular (o'qituvchi o'yin ochganda tanlaydi): Koshin (qorong'i) · Tong · Osmon · Bog'
   ========================================================================== */
[data-gt="osmon"] {
  --gbg: #e2f0fb; --gfg: #0f2a47; --on: 15,42,71; --gpanel: #ffffff; --gpfg: #0f2a47; --gshade: rgba(15,42,71,.07);
  --gacc: #1f74d8; --gwarn: #c0392b; --gurg: #e0435a; --hdr: #1b63b5; --r-ok: #ccf0e4; --r-bad: #fde0e4; --r-none: #dbe7f2;
  --tq: #10b0ab; --saf: #ffb21e; --pom: #f2546b; --cob: #3b6cf0; --plum: #9a5cf0; --olive: #2fb06c; --blk1: #3b6cf0; --blk2: #2148b5;
  --gimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='150'%3E%3Cg fill='%23ffffff' fill-opacity='.6'%3E%3Cellipse cx='44' cy='42' rx='30' ry='11'/%3E%3Cellipse cx='64' cy='35' rx='19' ry='13'/%3E%3Cellipse cx='176' cy='112' rx='34' ry='12'/%3E%3Cellipse cx='196' cy='104' rx='20' ry='13'/%3E%3C/g%3E%3Cpath d='M120 66 l3 7 7 3 -7 3 -3 7 -3 -7 -7 -3 7 -3z' fill='%231b63b5' fill-opacity='.10'/%3E%3C/svg%3E"), linear-gradient(180deg, #c9e5fb 0%, #e6f3fe 55%, #f7fbff 100%); --gsz: 240px 150px, 100% 100%;
  --gpat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='150'%3E%3Cg fill='%23ffffff' fill-opacity='.6'%3E%3Cellipse cx='44' cy='42' rx='30' ry='11'/%3E%3Cellipse cx='64' cy='35' rx='19' ry='13'/%3E%3Cellipse cx='176' cy='112' rx='34' ry='12'/%3E%3Cellipse cx='196' cy='104' rx='20' ry='13'/%3E%3C/g%3E%3Cpath d='M120 66 l3 7 7 3 -7 3 -3 7 -3 -7 -7 -3 7 -3z' fill='%231b63b5' fill-opacity='.10'/%3E%3C/svg%3E"); --gpsz: 240px 150px;
}
[data-gt="tong"] {
  --gbg: #ffe2cf; --gfg: #2d2140; --on: 45,33,64; --gpanel: #fffaf5; --gpfg: #2d2140; --gshade: rgba(45,33,64,.07);
  --gacc: #d9480f; --gwarn: #b5452e; --gurg: #c2414b; --hdr: #8f2f52; --r-ok: #cdeee4; --r-bad: #f9d2d6; --r-none: #f0e1d6;
  --tq: #0fa3a3; --saf: #f59e0b; --pom: #e5484d; --cob: #4f63e8; --plum: #9d4edd; --olive: #5b9b2d; --blk1: #c2416b; --blk2: #8a2346;
  --gimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='108'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.6'%3E%3Cpath stroke-width='2' d='M10 108 V48 Q10 12 42 4 Q74 12 74 48 V108'/%3E%3Cpath stroke-width='1' d='M20 108 V52 Q20 22 42 15 Q64 22 64 52 V108'/%3E%3C/g%3E%3Ccircle cx='42' cy='60' r='3' fill='%23c2416b' fill-opacity='.18'/%3E%3C/svg%3E"), linear-gradient(165deg, #ffe6c4 0%, #ffcfc2 48%, #fff1e4 100%); --gsz: 84px 108px, 100% 100%;
  --gpat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='108'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.6'%3E%3Cpath stroke-width='2' d='M10 108 V48 Q10 12 42 4 Q74 12 74 48 V108'/%3E%3Cpath stroke-width='1' d='M20 108 V52 Q20 22 42 15 Q64 22 64 52 V108'/%3E%3C/g%3E%3Ccircle cx='42' cy='60' r='3' fill='%23c2416b' fill-opacity='.18'/%3E%3C/svg%3E"); --gpsz: 84px 108px;
}
[data-gt="bog"] {
  --gbg: #154c3d; --gfg: #ffffff; --on: 255,255,255; --gpanel: #fbf7ec; --gpfg: #1c2a24; --gshade: rgba(0,0,0,.22);
  --gacc: #f2b134; --gwarn: #ffd27a; --gurg: #ffb3b9; --hdr: #154c3d; --r-ok: #0f7d74; --r-bad: #8d2832; --r-none: #2c3f39;
  --tq: #19b39a; --saf: #f2b134; --pom: #e2555f; --cob: #4a7fe0; --plum: #a066c8; --olive: #8bb43a;
  --gimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.6'%3E%3Cpath d='M0 60 C30 20 90 100 120 60'/%3E%3Cpath d='M60 0 C20 30 100 90 60 120'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.07'%3E%3Cellipse cx='30' cy='38' rx='9' ry='4' transform='rotate(-35 30 38)'/%3E%3Cellipse cx='90' cy='82' rx='9' ry='4' transform='rotate(-35 90 82)'/%3E%3Cellipse cx='82' cy='28' rx='8' ry='3.5' transform='rotate(40 82 28)'/%3E%3Cellipse cx='38' cy='92' rx='8' ry='3.5' transform='rotate(40 38 92)'/%3E%3C/g%3E%3C/svg%3E"), radial-gradient(circle at 50% 25%, #1f6b53 0%, #154c3d 55%, #0f3a2e 100%); --gsz: 120px 120px, 100% 100%;
  --gpat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.6'%3E%3Cpath d='M0 60 C30 20 90 100 120 60'/%3E%3Cpath d='M60 0 C20 30 100 90 60 120'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.07'%3E%3Cellipse cx='30' cy='38' rx='9' ry='4' transform='rotate(-35 30 38)'/%3E%3Cellipse cx='90' cy='82' rx='9' ry='4' transform='rotate(-35 90 82)'/%3E%3Cellipse cx='82' cy='28' rx='8' ry='3.5' transform='rotate(40 82 28)'/%3E%3Cellipse cx='38' cy='92' rx='8' ry='3.5' transform='rotate(40 38 92)'/%3E%3C/g%3E%3C/svg%3E"); --gpsz: 120px 120px;
}
[data-gt="bog"] .podium .blk { background: linear-gradient(#1f7a5c, #0f3a2e); }
[data-gl] body.k .qt, [data-gl] body.k .s-q, [data-gl] body.k .s-ans, [data-gl] body.k .s-join, [data-gl] body.k .board li, [data-gl] body.k .s-board li,
[data-gl] body.k .ord li, [data-gl] body.k .mt .r, [data-gl] body.k .gtx, [data-gl] body.k .podium .nm, [data-gl] body.k .card {
  box-shadow: 0 1px 0 rgba(var(--on),.06), 0 8px 22px rgba(var(--on),.09);
}
[data-gl] body.k .card { box-shadow: 0 0 0 1px rgba(var(--on),.07), 0 10px 26px rgba(var(--on),.1); }
[data-gl] .podium .blk { background: linear-gradient(var(--blk1), var(--blk2)); color: #fff; border-color: transparent; }
[data-gl] .podium .p:nth-child(2) .blk { background: linear-gradient(#e4a43a, #b06f12); }
[data-gl] body.k .s-tiles.rev .tile:not(.right) { opacity: .3; }
[data-gl] body.k .tiles.done .tile { opacity: .4; }
[data-gl] body.k .res .ic { background: var(--gpanel); box-shadow: 0 8px 22px rgba(var(--on),.12); }
[data-gl] body.k.r-ok .res .ic { color: var(--tq); } [data-gl] body.k.r-bad .res .ic { color: var(--pom); }
[data-gl] body.k .gold { color: #3a2400; }
/* o'qituvchi oynasidagi mavzu tanlagich */
.thpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thpick label { cursor: pointer; border: 2px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; }
.thpick input { position: absolute; opacity: 0; pointer-events: none; }
.thpick label:has(input:checked) { border-color: var(--tq); box-shadow: 0 0 0 2px var(--tq) inset; }
.thpick i { display: block; width: 100%; height: 34px; border-radius: 8px; }
select.lang { width: auto; }
.s-ctl { align-items: center; }
/* mustaqil topshiriq */
.qcard.task { border-top-color: var(--plum); }
.taskcode { display: flex; flex-direction: column; align-items: center; }
.taskcode b { font-family: var(--fd); font-size: 2.6rem; letter-spacing: .1em; color: var(--lapis); }

/* ==========================================================================
   Sayt foni (o'qituvchi sahifalari va PIN sahifasi) — sarlavhadagi «🎨» tanlagichdan
   ========================================================================== */
body:not(.k) { background-color: var(--bg); background-image: var(--pimg, none); background-size: var(--psz, auto); background-attachment: fixed; }
:root[data-gt="osmon"] { --bg: #e9f4fd; --card: #ffffff; --fg: #0f2a47; --muted: #557089; --line: #cfe0ee; color-scheme: light;
  --pimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='150'%3E%3Cg fill='%23ffffff' fill-opacity='.6'%3E%3Cellipse cx='44' cy='42' rx='30' ry='11'/%3E%3Cellipse cx='64' cy='35' rx='19' ry='13'/%3E%3Cellipse cx='176' cy='112' rx='34' ry='12'/%3E%3Cellipse cx='196' cy='104' rx='20' ry='13'/%3E%3C/g%3E%3Cpath d='M120 66 l3 7 7 3 -7 3 -3 7 -3 -7 -7 -3 7 -3z' fill='%231b63b5' fill-opacity='.10'/%3E%3C/svg%3E"), linear-gradient(180deg, #d4eafb 0%, #eef6fe 60%, #f8fbff 100%); --psz: 240px 150px, 100% 100%; }
:root[data-gt="tong"] { --bg: #fff1e8; --card: #fffdfb; --fg: #2d2140; --muted: #7a6273; --line: #efd8cb; color-scheme: light;
  --pimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='108'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.6'%3E%3Cpath stroke-width='2' d='M10 108 V48 Q10 12 42 4 Q74 12 74 48 V108'/%3E%3Cpath stroke-width='1' d='M20 108 V52 Q20 22 42 15 Q64 22 64 52 V108'/%3E%3C/g%3E%3Ccircle cx='42' cy='60' r='3' fill='%23c2416b' fill-opacity='.18'/%3E%3C/svg%3E"), linear-gradient(165deg, #ffe8cc 0%, #ffe1d8 50%, #fff6ef 100%); --psz: 84px 108px, 100% 100%; }
:root[data-gt="koshin"] { --bg: #0e1a27; --card: #15263a; --fg: #e7eef3; --muted: #9db0bf; --line: #283c52; color-scheme: dark;
  --pimg: var(--girih); --psz: auto; }
:root[data-gt="bog"] { --bg: #0f3a2e; --card: #154a3b; --fg: #eef6f0; --muted: #a9c4b6; --line: #24604d; color-scheme: dark;
  --pimg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1.6'%3E%3Cpath d='M0 60 C30 20 90 100 120 60'/%3E%3Cpath d='M60 0 C20 30 100 90 60 120'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.07'%3E%3Cellipse cx='30' cy='38' rx='9' ry='4' transform='rotate(-35 30 38)'/%3E%3Cellipse cx='90' cy='82' rx='9' ry='4' transform='rotate(-35 90 82)'/%3E%3Cellipse cx='82' cy='28' rx='8' ry='3.5' transform='rotate(40 82 28)'/%3E%3Cellipse cx='38' cy='92' rx='8' ry='3.5' transform='rotate(40 38 92)'/%3E%3C/g%3E%3C/svg%3E"), radial-gradient(circle at 50% 20%, #17543f 0%, #0f3a2e 70%); --psz: 120px 120px, 100% 100%; }
.top select[data-theme] { max-width: 8.5em; }
/* ---------- o'quvchi profili ---------- */
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pstats div { background: var(--gpanel); color: var(--gpfg); border-radius: 14px 5px 14px 5px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.pstats b { font-family: var(--fd); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.pstats span { font-size: .74rem; opacity: .8; line-height: 1.2; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hist a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 12px; background: var(--bg); color: var(--fg); text-decoration: none; }
.hist a:hover, .hist a:focus-visible { outline: 2px solid var(--tq); }
.hist .hi { font-size: 1.4rem; }
.hist .ht, .hist .hr { display: flex; flex-direction: column; min-width: 0; }
.hist .ht b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .hr { align-items: flex-end; text-align: end; }
.hist small { font-size: .75rem; opacity: .75; }
@media (max-width: 380px) { .pstats { grid-template-columns: repeat(2, 1fr); } }
.pform summary { cursor: pointer; list-style: none; } .pform summary::-webkit-details-marker { display: none; }
.pform summary::after { content: "▾"; float: inline-end; opacity: .6; } .pform[open] summary::after { content: "▴"; }
.pf { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
a.btn { text-decoration: none; text-align: center; }
/* ---------- bosh sahifa tugmalari ---------- */
.hbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn2.hb { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 10px 12px; font-size: .95rem; font-weight: 700; text-decoration: none; border-radius: 14px; }
.btn.onl { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--gacc); color: #1d1406; text-decoration: none; padding: 16px 18px; font-size: 1.12rem; }
.btn.onl small { font-family: var(--fb, inherit); font-weight: 600; font-size: .8rem; opacity: .8; letter-spacing: 0; }
/* ---------- onlayn xona ---------- */
.rooms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.rooms li { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: var(--bg); color: var(--fg); }
.rooms li .grow { display: flex; flex-direction: column; min-width: 0; }
.rooms li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rooms li small { font-size: .75rem; opacity: .75; }
.pls { display: flex; flex-wrap: wrap; gap: 6px; }
.pls .chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 600; font-size: .9rem; animation: inZoom .4s both; }
.pls .chip.me { outline: 2px solid var(--tq); }
.board li.me { outline: 2px solid var(--gacc); }
:root[data-gt=osmon] .btn.onl, :root[data-gt=tong] .btn.onl { color: #fff; }
.oexit { position: fixed; top: 10px; left: 10px; z-index: 6; border: 0; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .85rem; font-weight: 700; background: rgba(var(--on), .14); color: inherit; backdrop-filter: blur(6px); }
[dir=rtl] .oexit { left: auto; right: 10px; }
body.k:has(.oexit) .wrap { padding-top: 52px; }
.otools { position: fixed; top: 10px; right: 10px; z-index: 6; display: flex; gap: 6px; align-items: center; }
[dir=rtl] .otools { right: auto; left: 10px; }
.omus select { font-size: .8rem; padding: 5px 8px; max-width: 46vw; }
.osnd { border: 0; border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .85rem; font-weight: 700; background: rgba(var(--on), .14); color: inherit; backdrop-filter: blur(6px); }
/* asosiy menyu: fon musiqasi tugmasi */
.mfab { position: absolute; left: 14px; top: 14px; z-index: 7; width: 38px; height: 38px; border: 0; border-radius: 50%; font-size: 1.1rem; line-height: 1;
  background: rgba(var(--on), .16); color: inherit; backdrop-filter: blur(6px); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.mfab.off { opacity: .6; }
.mfab:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
[dir=rtl] .mfab { left: auto; right: 14px; }
@media (max-width: 359px) { .upd { gap: 7px; padding: 7px 7px 7px 10px; } .upd .tx { font-size: .88rem; } .upd .go { padding: 8px 12px; } .upd .x { width: 30px; height: 30px; } }

/* ---------- yakuniy natijalar effekti (finale.js): prozhektor / poyga / kartalar ---------- */
.fin { position: relative; flex: 1; min-height: calc(40 * var(--u)); overflow: hidden; border-radius: calc(1.6 * var(--u)); isolation: isolate; }
.fin-ttl { position: absolute; left: 50%; top: calc(1.2 * var(--u)); transform: translateX(-50%); z-index: 9; white-space: nowrap; font: 800 calc(4.2 * var(--u))/1.1 var(--fd);
  background: var(--saf); color: #13294b; padding: calc(.8 * var(--u)) calc(2.6 * var(--u)); border-radius: 999px; box-shadow: 0 calc(.6 * var(--u)) calc(2 * var(--u)) rgba(0,0,0,.25); }
.fin .av { line-height: 1; } .fin .av.sm { letter-spacing: -.12em; }
.fin .pt { font-family: var(--fd); font-weight: 800; color: var(--saf); font-variant-numeric: tabular-nums; }
.fin-spot .dk { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.fin-spot .rays { position: absolute; left: 50%; top: 48%; width: min(110vw, calc(150 * var(--u))); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(rgba(245,192,74,.32) 0 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%); }
.fs-win { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.fs-win .av { font-size: calc(17 * var(--u)); } .fs-win .av.sm { font-size: calc(9 * var(--u)); }
.fs-win .nm { font: 800 calc(6.4 * var(--u))/1.1 var(--fd); margin-top: calc(1 * var(--u)); }
.fs-win .pt { font-size: calc(3.6 * var(--u)); margin-top: calc(.8 * var(--u)); }
.fs-side { position: absolute; top: 52%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: calc(.4 * var(--u)); z-index: 2; font-size: calc(2.6 * var(--u)); font-weight: 700; text-align: center; max-width: 22vw; }
.fs-side.l { left: 6vw; } .fs-side.r { right: 6vw; }
.fs-side .av { font-size: calc(9 * var(--u)); } .fs-side .av.sm { font-size: calc(5 * var(--u)); }
.fin-race .fr-rows { position: absolute; left: 3vw; right: 3vw; top: calc(9 * var(--u)); bottom: calc(1 * var(--u)); }
.fr-row { position: absolute; left: 0; right: 0; height: calc(100% / var(--n) - 1.2 * var(--u)); max-height: calc(11 * var(--u)); display: flex; align-items: center; gap: 1.4vw; font-size: calc(2.8 * var(--u)); font-weight: 700; }
.fr-row .rk { width: calc(4 * var(--u)); text-align: center; font-family: var(--fd); opacity: .8; }
.fr-row .av { font-size: calc(4.6 * var(--u)); } .fr-row .av.sm { font-size: calc(2.8 * var(--u)); }
.fr-row .barw { flex: 1; height: 80%; position: relative; min-width: 0; }
.fr-row .fbar { position: absolute; left: 0; top: 0; bottom: 0; width: 16%; border-radius: calc(1 * var(--u)); display: flex; align-items: center; overflow: hidden; }
.fr-row .fbar span { padding: 0 1.2vw; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); overflow: hidden; text-overflow: ellipsis; }
.fr-row .pt { width: 12vw; text-align: right; font-size: calc(3 * var(--u)); }
.fr-row.win .fbar { background: linear-gradient(90deg, #f5c04a, #ffe7a6) !important; box-shadow: 0 0 calc(3 * var(--u)) rgba(245,192,74,.7); }
.fr-row.win .fbar span { color: #3a2400; text-shadow: none; }
.fin-cards .fc-row { position: absolute; left: 6vw; right: 6vw; top: calc(10 * var(--u)); bottom: calc(3 * var(--u)); display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 3vw; align-items: center; justify-items: center; perspective: 1600px; }
.fc-card { position: relative; height: min(calc(52 * var(--u)), 100%); aspect-ratio: 3 / 4; max-width: 100%; transform-style: preserve-3d; }
.fc-card.g { height: min(calc(60 * var(--u)), 100%); }
.fc-card > div { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: calc(2 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(.8 * var(--u)); text-align: center; padding: 1vw; }
.fc-card .back { background: linear-gradient(145deg, #1f3d6b, #0f2240); border: calc(.5 * var(--u)) solid rgba(245,192,74,.75); }
.fc-card .back svg { width: 45%; }
.fc-card .face { transform: rotateY(180deg); color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--tc, #24497f) 85%, #fff), color-mix(in srgb, var(--tc, #142c52) 70%, #000)); border: calc(.4 * var(--u)) solid rgba(255,255,255,.25); }
.fc-card.g .face { background: linear-gradient(160deg, #f7cf6a, #d99a26); color: #3a2400; border-color: #fff3c4; }
.fc-card.g .face .pt { color: #3a2400; }
.fc-card .face .rk { font: 800 calc(8 * var(--u))/1 var(--fd); }
.fc-card .face .av { font-size: calc(9 * var(--u)); } .fc-card .face .av.sm { font-size: calc(5 * var(--u)); }
.fc-card .face .nm { font-size: calc(3 * var(--u)); font-weight: 700; overflow-wrap: anywhere; }
.fc-card .face .pt { font-size: calc(3 * var(--u)); }
.fc-card .face small { font-size: calc(2.2 * var(--u)); opacity: .85; }
.frest { display: flex; flex-wrap: wrap; gap: calc(1 * var(--u)) 2vw; justify-content: center; font-size: calc(2.3 * var(--u)); font-weight: 600; }

/* ---------- ilova ochilishi (index.html): A1 «yulduzlar yig'iladi» / A4 «javob tugmalari» ---------- */
#splash { position: fixed; inset: 0; z-index: 100; background: linear-gradient(#cfe6fb, #f1f8ff); color: #13294b; display: flex; align-items: center; justify-content: center; transition: opacity .35s; cursor: pointer; }
#splash.out { opacity: 0; pointer-events: none; }
#splash .sp { position: relative; width: min(70vw, 46vh); display: flex; flex-direction: column; align-items: center; gap: 3.2vh; }
#splash .lg { position: relative; width: 62%; aspect-ratio: 1; }
#splash .lg i { position: absolute; width: 42%; aspect-ratio: 1; }
#splash .lg i svg { width: 100%; height: 100%; display: block; }
#splash .nm { font: 800 min(12vw, 7.4vh)/1 var(--fd); letter-spacing: -.01em; direction: ltr; white-space: nowrap; }
#splash .nm span { display: inline-block; opacity: 0; animation: spDrop .38s cubic-bezier(.34,1.56,.64,1) forwards; }
#splash .tg { font: 600 min(4.2vw, 2.3vh)/1.3 var(--fb); opacity: 0; text-align: center; animation: spFade .4s 1.45s forwards; }
@keyframes spDrop { from { opacity: 0; transform: translateY(-70%); } to { opacity: 1; transform: none; } }
@keyframes spFade { to { opacity: .75; } }
@keyframes spPulse { 50% { transform: scale(1.1); } }
/* A1: yulduzlar burchaklardan uchib keladi */
#splash.a1 .lg { animation: spPulse .42s 1s ease-in-out; }
#splash.a1 .lg i { opacity: 0; animation: spFly .75s cubic-bezier(.34,1.56,.64,1) forwards; }
#splash.a1 .lg i:nth-child(1) { --fx: -160%; --fy: -220%; } #splash.a1 .lg i:nth-child(2) { --fx: 160%; --fy: -220%; animation-delay: .11s; }
#splash.a1 .lg i:nth-child(3) { --fx: -160%; --fy: 220%; animation-delay: .22s; } #splash.a1 .lg i:nth-child(4) { --fx: 160%; --fy: 220%; animation-delay: .33s; }
@keyframes spFly { from { opacity: 0; transform: translate(var(--fx), var(--fy)) rotate(-360deg) scale(.3); } to { opacity: 1; transform: none; } }
/* A4: javob tugmalari ag'dariladi */
#splash .tl { position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; grid-template-columns: 1fr 1fr; gap: 6%; perspective: 500px; }
#splash.a4 .tl { animation: spGap .4s 1.45s ease-in-out forwards; }
@keyframes spGap { to { width: 100%; gap: 0%; } }
#splash .tl b { position: relative; transform-style: preserve-3d; animation: spTile 1.3s ease-in-out both; }
#splash .tl b:nth-child(1) { --fx: -260%; } #splash .tl b:nth-child(2) { --fx: 260%; animation-delay: .09s; } #splash .tl b:nth-child(3) { --fx: -260%; animation-delay: .18s; } #splash .tl b:nth-child(4) { --fx: 260%; animation-delay: .27s; }
@keyframes spTile { 0% { transform: translateX(var(--fx)); } 45%, 60% { transform: none; } 100% { transform: rotateY(180deg); } }
#splash .tl b > span { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 12%; display: flex; align-items: center; justify-content: center; }
#splash .tl .fr { color: #fff; font-size: 2.6em; box-shadow: 0 .35em 0 rgba(0,0,0,.22); }
#splash .tl .bk { transform: rotateY(180deg); }
#splash .tl .bk svg { width: 100%; height: 100%; }
#splash.a4 .nm span { animation-name: spPop; animation-duration: .3s; }
#splash.a4 .tg { animation-delay: 1.9s; }
@keyframes spPop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #splash { display: none; } }

/* ---------- 3D: katta sarlavhalar va asosiy tugmalar (o'quvchi sahifalari, o'yin ekranlari) ---------- */
:root { --h3a: #ffffff; --h3b: #ffe2a0; --h3e: #0b1b33; }
:root[data-gl] { --h3a: #3466c4; --h3b: #13294b; --h3e: #091430; }
body.k h1, body.k div.big { background: linear-gradient(180deg, var(--h3a) 10%, var(--h3b) 95%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 .03em 0 var(--h3e)) drop-shadow(0 .03em 0 var(--h3e)) drop-shadow(0 .09em .1em rgba(0,0,0,.25)); padding-bottom: .06em; }
.btn:not(.g) { box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -3px 0 rgba(0,0,0,.12), 0 5px 0 rgba(0,0,0,.28), 0 9px 16px rgba(0,0,0,.18);
  background-image: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0) 60%); text-shadow: 0 2px 0 rgba(0,0,0,.2); margin-bottom: 5px; transition: transform .08s, box-shadow .08s; }
.btn.w:not(.g) { text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn:not(.g):active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.12), 0 1px 0 rgba(0,0,0,.28), 0 3px 6px rgba(0,0,0,.15); }
body.k .btn2.hb { box-shadow: 0 4px 0 rgba(0,0,0,.12), 0 6px 12px rgba(0,0,0,.08); margin-bottom: 4px; }
body.k .btn2.hb:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
@media (prefers-reduced-motion: reduce) { .btn:not(.g):active:not(:disabled), body.k .btn2.hb:active { transform: none; } }

/* ---------- o'qituvchi sahifalari: jonli sarlavha va test kartalari ---------- */
.page h1 .t3, .home-hero h1 { background: linear-gradient(180deg, var(--h3a) 10%, var(--h3b) 95%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 .03em 0 var(--h3e)) drop-shadow(0 .08em .09em rgba(0,0,0,.2)); padding-bottom: .06em; }
.qcard { position: relative; overflow: hidden; border-top: 4px solid var(--tc, var(--tq)); transition: transform .15s ease, box-shadow .15s ease; }
.qcard:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(19,41,75,.13); }
.qcard.lc { background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 9%, var(--card)), var(--card) 55%); }
.qcard .qic { position: absolute; right: -4px; bottom: -16px; font-size: 5.4rem; line-height: 1; opacity: .11; transform: rotate(-12deg); pointer-events: none; user-select: none; }
.qcard > *:not(.qic) { position: relative; }
.qcard.lc h3 { font-weight: 700; color: color-mix(in srgb, var(--tc) 30%, var(--fg)); }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; }
.tchip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; background: color-mix(in srgb, var(--tc) 16%, var(--card)); color: color-mix(in srgb, var(--tc) 72%, var(--fg)); }
.lchip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 1px 9px; font-weight: 600; color: var(--muted); }
.qmeta .auth { color: var(--muted); font-weight: 600; }
.qcard .btn2.p, .qcard .btn2.tg { box-shadow: 0 3px 0 rgba(0,0,0,.22); transition: transform .08s, box-shadow .08s; }
.qcard .btn2.p { background: linear-gradient(180deg, var(--lapis-3), var(--lapis)); }
.qcard .btn2.p:active, .qcard .btn2.tg:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.22); }
@media (prefers-reduced-motion: reduce) { .qcard, .qcard:hover { transition: none; transform: none; } }

/* ---------- avatarlar: 1–3 qism (qahramon + bosh kiyim + yuzga), yengil «tirik» harakat ---------- */
.ava { position: relative; display: inline-block; width: 1.12em; height: 1.12em; line-height: 1; vertical-align: -.22em; transform-origin: 50% 90%; animation: avBob 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
/* «tirik» harakatlar: hayvon sakraydi, qush cho'qiydi, baliq suzadi, yulduz yiltillaydi, olov lipillaydi, yurak uradi... */
.ava.an-hop { animation: avHop 3.2s ease-in-out infinite var(--d, 0s); }
.ava.an-peck { animation: avPeck 2.8s ease-in-out infinite var(--d, 0s); transform-origin: 40% 95%; }
.ava.an-swim { animation: avSwim 3.4s ease-in-out infinite var(--d, 0s); transform-origin: 50% 50%; }
.ava.an-sway { animation: avSway 3s ease-in-out infinite var(--d, 0s); }
.ava.an-wob { animation: avWob 2.4s ease-in-out infinite var(--d, 0s); }
.ava.an-twk { animation: avTwk 2.2s ease-in-out infinite var(--d, 0s); transform-origin: 50% 50%; }
.ava.an-flk { animation: avFlk 1.1s ease-in-out infinite var(--d, 0s); transform-origin: 50% 100%; }
.ava.an-bnc { animation: avBnc 1.6s cubic-bezier(.4, 0, .6, 1) infinite var(--d, 0s); transform-origin: 50% 100%; }
.ava.an-flt { animation: avFlt 4s ease-in-out infinite var(--d, 0s); transform-origin: 50% 20%; }
.ava.an-flap { animation: avFlap 1.8s ease-in-out infinite var(--d, 0s); transform-origin: 50% 50%; }
.ava.an-beat { animation: avBeat 1.4s ease-in-out infinite var(--d, 0s); transform-origin: 50% 55%; }
.ava.an-spin { animation: avSpin 6s linear infinite var(--d, 0s); transform-origin: 50% 50%; }
@keyframes avHop { 0%, 55%, 100% { transform: none; } 62% { transform: scale(1.06, .9); } 72% { transform: translateY(-16%) scale(.96, 1.06) rotate(-4deg); } 82% { transform: translateY(0) scale(1.05, .93); } 90% { transform: rotate(3deg); } }
@keyframes avPeck { 0%, 40%, 100% { transform: none; } 48% { transform: rotate(14deg); } 54% { transform: rotate(2deg); } 60% { transform: rotate(14deg); } 70% { transform: none; } 82% { transform: translateY(-8%) rotate(-5deg); } }
@keyframes avSwim { 0%, 100% { transform: translateX(-5%) rotate(-5deg); } 50% { transform: translateX(5%) translateY(-6%) rotate(5deg); } }
@keyframes avSway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg) translateY(-3%); } }
@keyframes avWob { 0%, 100% { transform: none; } 25% { transform: scale(1.06, .94) rotate(-3deg); } 50% { transform: translateY(-6%); } 75% { transform: scale(.95, 1.05) rotate(3deg); } }
@keyframes avTwk { 0%, 100% { transform: scale(1) rotate(0); filter: brightness(1); } 50% { transform: scale(1.12) rotate(12deg); filter: brightness(1.25); } }
@keyframes avFlk { 0%, 100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(.96, 1.08) skewX(-4deg); } 50% { transform: scale(1.03, .95) skewX(2deg); } 75% { transform: scale(.98, 1.06) skewX(4deg); } }
@keyframes avBnc { 0%, 100% { transform: translateY(0) scale(1.08, .9); } 15% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22%) rotate(180deg); } 85% { transform: translateY(0) rotate(360deg); } }
@keyframes avFlt { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-12%) rotate(5deg); } }
@keyframes avFlap { 0%, 100% { transform: scaleX(1) translateY(0); } 25% { transform: scaleX(.82) translateY(-6%); } 50% { transform: scaleX(1) translateY(-10%); } 75% { transform: scaleX(.85) translateY(-4%); } }
@keyframes avBeat { 0%, 40%, 100% { transform: scale(1); } 15% { transform: scale(1.16); } 28% { transform: scale(1.04); } 34% { transform: scale(1.12); } }
@keyframes avSpin { to { transform: rotate(360deg); } }
.ava.hh { margin-top: .22em; }
.ava i { position: absolute; font-style: normal; line-height: 1; pointer-events: none; }
.ava .b { inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1em; }
.ava .h { transform: translateX(-50%) rotate(-9deg); transform-origin: 50% 100%; animation: avHat 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ava .f { transform: translate(-50%, -50%); }
@keyframes avBob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-3%) rotate(-4deg); } 50% { transform: translateY(-6%) rotate(0); } 75% { transform: translateY(-3%) rotate(4deg); } }
@keyframes avHat { 0%, 100% { transform: translateX(-50%) rotate(-9deg); } 50% { transform: translateX(-50%) translateY(-6%) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .ava, .ava[class*="an-"], .ava .h { animation: none !important; } }
/* kattaroq avatarlar */
.avbig { font-size: 5.2rem; line-height: 1.15; }
.avbig .ava.hh { margin-top: .2em; }
.avpick .avbig { font-size: 4.4rem; min-width: 1.3em; }
.board .ava, .pls .chip .ava { font-size: 1.45em; }
.res p .ava { font-size: 1.5em; }
.s-names .chip .ava { font-size: 1.6em; vertical-align: -.32em; }
.s-board .ava { font-size: 1.5em; }
.fs-win .av { font-size: calc(20 * var(--u)); } .fs-side .av { font-size: calc(11 * var(--u)); }
.fr-row .av { font-size: calc(5.8 * var(--u)); } .fc-card .face .av { font-size: calc(11 * var(--u)); }
.frest .ava { font-size: 1.3em; }
/* tanlagich */
.avp { display: flex; flex-direction: column; gap: 8px; }
.avrow { display: flex; flex-direction: column; gap: 4px; }
.avrow > b { font-size: .85rem; }
.avgrid.sm { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); max-height: none; }
.avgrid.sm button { font-size: 1.45rem; padding: 5px 0; }
/* onlayn o'yin: avatarni shu yerda o'zgartirish */
.avbig.onb { background: none; border: 0; padding: 0; cursor: pointer; position: relative; color: inherit; }
.avbig.onb::after { content: "✏️"; position: absolute; right: -.08em; bottom: .02em; font-size: .24em; background: var(--card, #fff); border-radius: 50%; padding: .18em; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.avbig.onb:focus-visible { outline: 3px solid var(--saf); outline-offset: 4px; border-radius: 16px; }
#avp { margin-top: 8px; }
