/* ===== Asosiy ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f2f4ff;
  --card: #ffffff;
  --ink: #1f2440;
  --muted: #6b7194;
  --primary: #5b5bd6;
  --primary-dark: #4747b8;
  --accent: #ff8a3d;
  --green: #2eb872;
  --red: #e5484d;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(31, 36, 64, 0.08);
}

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
.container.narrow { max-width: 560px; }

a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }

/* ===== Yuqori panel ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card); box-shadow: var(--shadow);
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.userchip { display: flex; align-items: center; gap: 10px; }
.userchip-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.userchip-link:hover .userchip-name { color: var(--primary); }
.userchip-emoji { font-size: 1.6rem; }
.userchip-name { line-height: 1.15; font-weight: 600; font-size: 0.95rem; }
.userchip-name small { display: block; color: var(--muted); font-weight: 400; }

/* Telefonda sarlavha paneli ekrandan chiqib ketardi: ism, uch tugma va
   chiqish tugmasi bir qatorga sig'may, BUTUN sahifani yon tomonga
   siljitardi (Android — saytning eng katta auditoriyasi). Endi panel
   qatorga bo'linadi, ism qisqaradi, tugmalar zichlashadi. */
@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .brand { font-size: 1rem; }
  .userchip { gap: 7px; min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
  .userchip .btn-sm { padding: 6px 10px; font-size: 0.8rem; }
  .userchip-link { gap: 7px; min-width: 0; }
  .userchip-emoji { font-size: 1.45rem; }
  /* Ism yashiriladi — belgi profilga havola bo'lib qoladi. 375px enda ism,
     uch tugma va chiqish tugmasi baribir sig'masdi. */
  .userchip-name { display: none; }
}

/* ===== Tugmalar ===== */
.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit;
  font-weight: 700; border-radius: 10px; padding: 10px 18px;
  transition: transform 0.06s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #eceef8; color: var(--ink); }
.btn-ghost:hover { background: #dfe2f2; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Kartalar ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}

/* ===== Bosh sahifa ===== */
.hero { text-align: center; margin: 40px 0 32px; }
.hero h1 { font-size: 2.2rem; }
.tagline { color: var(--muted); font-size: 1.1rem; margin-top: 8px; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.role-card { text-align: center; padding: 32px 20px; }
.role-emoji { font-size: 3rem; margin-bottom: 10px; }
.role-card h2 { margin-bottom: 6px; }
.role-card p { color: var(--muted); margin-bottom: 18px; min-height: 44px; }
@media (max-width: 640px) { .role-cards { grid-template-columns: 1fr; } }

/* O'qituvchi bosh sahifasi: eski kartalar o'zgarmaydi, lekin hammasi BITTA ekranga sig'adi —
   pastga aylantirmasdan. Kartalar ekranning butun kengligi bo'ylab 4 ustunda (kam bo'lsa 3) turadi
   va ekranning bo'sh balandligini to'liq egallaydi. O'lchamlar NISBIY: --o ekran kengligi va
   balandligidan hisoblanadi — katta doskada hammasi kattaroq, kichik ekranda kichikroq.
   Faqat shu sahifaga tegishli. */
body:has(.bosh-oqituvchi) { display: flex; flex-direction: column; min-height: 100vh; }
.bosh-oqituvchi {
  --o: clamp(14px, calc(0.55vw + 0.9vh), 23px);
  flex: 1; width: 100%; display: flex; flex-direction: column;
  max-width: min(1840px, 96vw); padding: calc(var(--o) * 0.55) 16px calc(var(--o) * 1.1);
}
.bosh-oqituvchi .hero { margin: 0 0 calc(var(--o) * 0.9); }
.bosh-oqituvchi .hero h1 { font-size: calc(var(--o) * 1.75); }
.bosh-kartalar {
  flex: 1; font-size: var(--o); grid-auto-rows: 1fr;
  grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--o) * 0.9);
}
.bosh-kartalar:not(:has(> :nth-child(7))) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bosh-kartalar .role-card {
  padding: calc(var(--o) * 1.1) calc(var(--o) * 1.2); min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.bosh-kartalar .role-emoji { font-size: 2.5em; margin-bottom: .3em; line-height: 1; }
.bosh-kartalar .role-card h2 { font-size: 1.28em; margin-bottom: .25em; }
.bosh-kartalar .role-card p { margin-bottom: 0; min-height: 0; font-size: .95em; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bosh-kartalar .role-card p.muted { -webkit-line-clamp: 1; margin-top: .35em !important; font-size: .85em !important; }
@media (max-width: 1100px) { .bosh-kartalar, .bosh-kartalar:not(:has(> :nth-child(7))) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .bosh-kartalar, .bosh-kartalar:not(:has(> :nth-child(7))) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .bosh-kartalar, .bosh-kartalar:not(:has(> :nth-child(7))) { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .bosh-oqituvchi { --o: 15px; }
}

/* ===== Formalar ===== */
.form-card h1 { font-size: 1.4rem; margin-bottom: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.form input, .form select {
  font: inherit; padding: 10px 12px; border: 2px solid #dfe2f2;
  border-radius: 10px; background: #fafbff;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-weight: 500; font-size: 0.82rem; color: var(--muted); }
.form-alt { margin-top: 16px; text-align: center; color: var(--muted); }
.alert {
  background: #fdecec; color: var(--red); border-radius: 10px;
  padding: 10px 14px; font-weight: 600; margin-bottom: 12px;
}

/* ===== O'qituvchi: mavzular ===== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.backlink { display: inline-block; margin-top: 8px; font-weight: 600; }
.grade-section { margin-bottom: 26px; }
.grade-title {
  font-size: 1.05rem; color: var(--primary-dark);
  border-bottom: 2px solid #dfe2f2; padding-bottom: 6px; margin-bottom: 12px;
}
.topic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.topic-card { display: block; color: var(--ink); transition: transform 0.08s; }
.topic-card:hover { transform: translateY(-2px); }
.topic-name { font-weight: 700; margin-bottom: 6px; }
.topic-meta { color: var(--muted); font-size: 0.9rem; }
.badge {
  display: inline-block; background: #fff1e6; color: var(--accent);
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  vertical-align: middle; margin-left: 6px;
}

/* ===== Savollar ro'yxati ===== */
.question-list { display: flex; flex-direction: column; gap: 12px; }
.q-text { margin-bottom: 10px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-option { background: #f4f5fb; border-radius: 8px; padding: 8px 12px; font-size: 0.95rem; }
.q-option.correct { background: #e3f6ec; color: var(--green); font-weight: 700; }
@media (max-width: 560px) { .q-options { grid-template-columns: 1fr; } }

/* ===== O'yin tanlash ===== */
.game-choice { border: 0; display: flex; flex-direction: column; gap: 10px; }
.game-choice legend { font-weight: 600; margin-bottom: 8px; }
.game-option {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 12px;
  border: 2px solid #dfe2f2; border-radius: 12px; padding: 12px; cursor: pointer;
}
.game-option:has(input:checked) { border-color: var(--primary); background: #f4f4ff; }
.game-option.disabled { opacity: 0.55; cursor: not-allowed; }
.game-emoji { font-size: 1.8rem; }
.game-info { display: flex; flex-direction: column; min-width: 0; }
.game-info small { color: var(--muted); font-weight: 400; }
/* Nom va baho bir qatorda: baho o'ngga tortiladi */
.gi-bosh { display: flex; align-items: center; gap: 8px; }
.gi-bosh strong { flex: 1; min-width: 0; }
.gi-yulduz { display: inline-flex; gap: 1px; flex: none; line-height: 1; }
.gi-yulduz i { font-style: normal; font-size: 0.78rem; color: #d7dbea; }
.gi-yulduz i.is-yonik { color: #f0b429; }

/* O'yin tanlash sahifasi — uch ustun sig'ishi uchun kengroq */
.container.oyin-tanlov { max-width: 1360px; }
/* Sozlamalar bo'limi ikki ustun ostida — o'qishga qulay kenglikda qoladi */
.oyin-tanlov .form > label,
.oyin-tanlov .form > .form-row,
.oyin-tanlov .form > #board-settings,
.oyin-tanlov .form > button { max-width: 620px; }

/* O'yinlar uch bo'limga ajratilgan: shaxsiy qurilmada, doskada va klassik.
   Keng ekranda uchalasi yonma-yon, tor ekranda ustma-ust turadi. */
.game-ustunlar { display: grid; gap: 18px; align-items: start; }
.game-group { margin: 0; padding: 0; min-width: 0; }
.game-group.gg-oddiy { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .game-ustunlar { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1080px) {
  .game-ustunlar { grid-template-columns: 1fr 1fr 1fr; }
}
/* Klassik bo'limda o'yin ko'p — ustun cheksiz cho'zilib ketmasin.
   Har ustun o'z ichida aylanadi, sarlavha tepada qotib turadi. */
.gg-royxat {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 480px; overflow-y: auto; padding: 2px 8px 2px 2px;
  overscroll-behavior: contain;
}
.gg-royxat::-webkit-scrollbar { width: 8px; }
.gg-royxat::-webkit-scrollbar-thumb { background: #ccd2ea; border-radius: 999px; }
.gg-royxat::-webkit-scrollbar-thumb:hover { background: #b3bce0; }
.gg-royxat::-webkit-scrollbar-track { background: transparent; }
.game-group legend {
  display: flex; align-items: center; gap: 11px; width: 100%;
  margin-bottom: 12px; padding: 11px 14px;
  background: linear-gradient(140deg, #eef1ff, #e4e9ff);
  border-radius: 12px;
}
.gg-belgi { font-size: 1.4rem; line-height: 1; }
.gg-matn { display: flex; flex-direction: column; flex: 1; }
.gg-matn strong { font-size: 1rem; }
.gg-matn small { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.gg-soni {
  font-size: 0.75rem; font-weight: 700; color: var(--primary-dark);
  background: #fff; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* ===== Lobbi ===== */
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 18px 0; flex-wrap: wrap; }
.lobby-game { display: flex; align-items: center; gap: 14px; }
.game-emoji-big { font-size: 3rem; }
.lobby-code { text-align: center; }
.code-label { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.code-value {
  font-size: 3rem; font-weight: 800; letter-spacing: 6px; color: var(--primary);
  background: #f4f4ff; border-radius: 12px; padding: 4px 18px; margin: 4px 0;
}
.code-hint { color: var(--muted); font-size: 0.8rem; max-width: 240px; }
.lobby-players { margin-bottom: 18px; }
.lobby-players h2 { margin-bottom: 12px; }
.players-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.player-chip {
  display: flex; align-items: center; gap: 8px; background: #f4f5fb;
  border-radius: 24px; padding: 8px 16px 8px 10px; font-weight: 600;
  animation: pop 0.25s ease;
}
.player-emoji { font-size: 1.4rem; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lobby-actions { text-align: center; }
.lobby-actions .alert { margin-top: 14px; display: inline-block; }

/* ===== O'quvchi ===== */
.join-card { text-align: center; margin-bottom: 18px; }
.join-card h1 { margin-bottom: 14px; font-size: 1.4rem; }
.join-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.code-input {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 6px; text-align: center;
  width: 220px; padding: 8px 12px; border: 2px solid #dfe2f2; border-radius: 12px;
}
.code-input:focus { outline: none; border-color: var(--primary); }
.profile-card h2 { margin-bottom: 12px; }
.profile-card h3 { margin: 18px 0 10px; font-size: 0.95rem; color: var(--muted); }
.profile-row { display: flex; align-items: center; gap: 14px; }
.profile-emoji { font-size: 2.6rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.emoji-btn {
  font-size: 1.6rem; padding: 8px 0; border: 2px solid transparent; border-radius: 10px;
  background: #f4f5fb; cursor: pointer; transition: transform 0.06s;
}
.emoji-btn:hover { transform: scale(1.1); }
.emoji-btn.selected { border-color: var(--primary); background: #f4f4ff; }

.student-lobby { text-align: center; margin-top: 24px; }
.student-lobby h3 { margin: 18px 0 10px; color: var(--muted); }
.you-joined { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; font-size: 1.2rem; }
.players-grid.small { justify-content: center; }
.pulse { animation: pulse 1.6s infinite; color: var(--green); font-weight: 600; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ===== O'yin ekrani (Raketa poygasi) ===== */
#game-root { position: relative; margin-top: 16px; }

/* --- Raketa poygasi: 2.5D asteroid maydoni (games/raketa.js) --- */
.rk-world {
  position: relative; border-radius: 16px; overflow: hidden; padding: 0;
  background: #07051a; box-shadow: 0 10px 34px rgba(10, 8, 40, 0.55);
}
.rk-stage {
  position: relative; width: 100%; height: 480px; overflow: hidden;
  background: #07051a; user-select: none; touch-action: none;
}
.rk-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .rk-stage { height: 360px; } }

.rk-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 14px; font-family: 'Segoe UI', sans-serif;
}
.rk-hud-chap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rk-hud-ong { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rk-yoq, .rk-orin, .rk-masofa, .rk-peshqadam, .rk-nitro {
  background: rgba(8, 10, 32, 0.72); border-radius: 10px; padding: 5px 12px;
  font-weight: 800; color: #e7ecff; border: 1px solid rgba(160, 190, 255, 0.22);
}
.rk-yoq { display: flex; align-items: center; gap: 8px; }
.rk-yoq-bar { width: 130px; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.rk-yoq-ich { height: 100%; width: 70%; background: linear-gradient(90deg, #f76707, #ffd43b); transition: width 0.25s; }
.rk-yoq.kam { border-color: rgba(255, 80, 80, 0.8); animation: ammoWarn 0.9s ease-in-out infinite; }
.rk-yoq.kam .rk-yoq-ich { background: #fa5252; }
.rk-nitro {
  pointer-events: auto; cursor: pointer; font-size: 1.05rem; color: #8c9ab8; font-family: inherit;
}
.rk-nitro.bor { color: #9ee7ff; border-color: rgba(120, 210, 255, 0.8); box-shadow: 0 0 12px rgba(90, 180, 255, 0.45); }
.rk-nitro.yonmoqda { color: #fff; background: rgba(40, 110, 220, 0.85); }
.rk-orin { font-size: 1.35rem; color: #ffe08a; }
.rk-masofa { font-size: 0.95rem; }
.rk-peshqadam { font-size: 0.82rem; font-weight: 700; white-space: pre-line; text-align: left; line-height: 1.45; }
.rk-peshqadam:empty { display: none; }

/* Mini-trassa: har raketa — rangli nuqta */
.rk-yol {
  position: absolute; left: 16px; right: 16px; bottom: 12px; height: 18px; z-index: 4; pointer-events: none;
}
.rk-yol-chiziq {
  position: absolute; left: 0; right: 26px; top: 8px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(120, 170, 255, 0.25), rgba(255, 210, 120, 0.6));
}
.rk-yol-marra { position: absolute; right: 0; top: -2px; font-size: 16px; }
.rk-nuqta {
  position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5); transition: left 0.3s linear;
}
.rk-nuqta.men { top: -6px; width: 14px; height: 14px; margin-left: -7px; border: 2px solid #fff; z-index: 2; }

.rk-ishora {
  position: absolute; left: 50%; bottom: 38px; transform: translateX(-50%); z-index: 4;
  pointer-events: none; font-size: 0.85rem; font-weight: 600; color: rgba(220, 230, 255, 0.9);
  background: rgba(8, 10, 32, 0.6); border-radius: 8px; padding: 4px 12px; white-space: nowrap;
  transition: opacity 0.6s;
}
.rk-ishora.yashir, .rk-ishora:empty { opacity: 0; }
.rk-toast {
  position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(0.9);
  z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(8, 10, 32, 0.82); border-radius: 10px; padding: 8px 18px;
  font-weight: 900; font-size: 1.15rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.rk-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rk-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.rk-toast.bad { color: #ff8a7a; border: 1px solid rgba(255, 110, 90, 0.6); }
.rk-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }
.rk-banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.6);
  z-index: 7; pointer-events: none; opacity: 0; text-align: center;
  transition: opacity 0.35s, transform 0.35s;
}
.rk-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rk-banner-bosh {
  font-size: 2.4rem; font-weight: 900; color: #ffe08a; white-space: nowrap;
  text-shadow: 0 0 24px rgba(255, 200, 80, 0.8);
}
.rk-banner-top { margin-top: 8px; font-size: 1.2rem; font-weight: 800; color: #fff; white-space: nowrap; }
.rk-stage.rk-tugadi .rk-ishora, .rk-stage.rk-tugadi .rk-nitro { display: none; }

@media (max-width: 600px) {
  .rk-hud { padding: 6px 8px; gap: 6px; }
  .rk-yoq, .rk-orin, .rk-masofa, .rk-peshqadam, .rk-nitro { font-size: 0.74rem; padding: 3px 8px; }
  .rk-yoq-bar { width: 70px; }
  .rk-orin { font-size: 1rem; }
  .rk-peshqadam { display: none; }
  .rk-ishora { font-size: 0.72rem; white-space: normal; width: 88%; text-align: center; }
  .rk-banner-bosh { font-size: 1.6rem; }
  .rk-banner-top { font-size: 0.9rem; }
}

/* Qorong'u kosmos uchun savol paneli */
.rk-world .g-qarea { padding: 14px 16px 18px; background: #0b0a1f; }
.rk-world .g-question {
  background: #151433; color: #f3f5ff; font-size: 1.15rem; padding: 16px 18px;
  border: 1px solid rgba(120, 160, 255, 0.25);
}
.rk-world .g-status { color: #cfd6f2; }
.rk-world .g-status.right { color: #7dffb0; }
.rk-world .g-status.wrong { color: #ff8a7a; }
.rk-world .g-countdown { background: rgba(8, 8, 30, 0.9); color: #9ee7ff; }
.rk-world .g-final-title, .rk-world .finale-title { color: #ffe08a; text-shadow: 0 0 22px rgba(255, 200, 80, 0.6); }
.rk-world .g-ans { padding: 13px 15px; font-size: 1rem; }

/* --- Savol paneli --- */
.g-qarea { position: relative; z-index: 2; }

.g-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.g-counter { font-weight: 800; white-space: nowrap; color: #fff; }
.g-score { font-weight: 800; white-space: nowrap; color: #ffd166; }
.g-timebar-wrap { flex: 1; height: 12px; background: rgba(255,255,255,0.18); border-radius: 8px; overflow: hidden; }
.g-timebar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #ffd166); border-radius: 8px; }

.g-question { font-size: 1.35rem; font-weight: 700; text-align: center; padding: 26px 20px; margin-bottom: 14px; }

.g-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .g-answers { grid-template-columns: 1fr; } }
.g-ans {
  position: relative; display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 12px; padding: 18px 16px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1.05rem; color: #fff; text-align: left;
  transition: transform 0.08s, opacity 0.2s, box-shadow 0.15s;
}
.g-ans:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(31,36,64,0.2); }
.g-ans:disabled { cursor: default; }
.g-ans-0 { background: #e21b3c; }
.g-ans-1 { background: #1368ce; }
.g-ans-2 { background: #d89e00; }
.g-ans-3 { background: #26890c; }
.g-shape { font-size: 1.2rem; }
.g-ans-text { flex: 1; }
.g-ans.dimmed { opacity: 0.35; }
.g-ans.correct { outline: 4px solid #fff; box-shadow: 0 0 0 8px rgba(46,184,114,0.45); }
.g-ans.chosen { outline: 3px dashed #fff; }
.g-count-badge {
  background: rgba(255,255,255,0.9); color: var(--ink); border-radius: 20px;
  padding: 2px 10px; font-size: 0.9rem; font-weight: 800;
}

.g-status { text-align: center; font-size: 1.15rem; font-weight: 800; margin: 14px 0; min-height: 28px; color: #cfd6f5; }
.g-status.right { color: #7dffb0; }
.g-status.wrong { color: #ff9a9a; }

.g-countdown {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 13, 38, 0.78); border-radius: 18px;
  font-size: 5rem; font-weight: 900; color: #fff; z-index: 10;
}

/* Podium va natijalar */
.g-final-title { text-align: center; font-size: 2rem; margin: 20px 0; color: #fff; }
.g-podium { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.g-podium-col { text-align: center; animation: rise 0.7s ease; }
.g-podium-emoji { font-size: 3rem; }
.g-podium-name { font-weight: 800; margin: 4px 0; color: #fff; }
.g-podium-score { color: #ffd166; font-weight: 800; margin-bottom: 8px; }
.g-podium-base {
  background: var(--card); border-radius: 12px 12px 0 0; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.place-1 .g-podium-base { height: 130px; width: 120px; }
.place-2 .g-podium-base { height: 95px; width: 110px; }
.place-3 .g-podium-base { height: 70px; width: 110px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.g-standings { max-width: 560px; margin: 0 auto 20px; }
.g-standings h3 { margin-bottom: 12px; }
.g-standing-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid #eef0f8; }
.g-standing-place { font-weight: 900; width: 26px; color: var(--muted); }
.g-standing-emoji { font-size: 1.3rem; }
.g-standing-name { flex: 1; font-weight: 600; }
.g-standing-score { font-weight: 800; color: var(--primary-dark); }
.g-actions { text-align: center; margin: 20px 0; }

/* O'quvchining shaxsiy xulosasi */
.g-summary { max-width: 560px; margin: 20px auto; text-align: center; }
.g-summary h1 { margin-bottom: 10px; }
.g-summary-place { font-size: 2rem; font-weight: 900; color: var(--accent); }
.g-summary-score { font-size: 1.2rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 12px; }
.g-summary-stats { display: flex; justify-content: center; gap: 16px; margin-bottom: 16px; }
.g-stat { font-weight: 700; padding: 8px 14px; border-radius: 10px; background: #f4f5fb; }
.g-stat.right { color: var(--green); }
.g-stat.wrong { color: var(--red); }
.g-all-correct { font-size: 1.1rem; font-weight: 700; color: var(--green); margin: 14px 0; }
.g-mistakes-title { margin: 10px 0; color: var(--muted); }
.g-mistake { text-align: left; background: #f9fafd; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.g-mistake-q { font-weight: 700; margin-bottom: 6px; }
.g-mistake-your { color: var(--red); font-size: 0.95rem; }
.g-mistake-ans { color: var(--green); font-weight: 700; font-size: 0.95rem; }
.g-summary .btn { margin-top: 14px; }

/* ===== G'alaba sahnasi (finale) ===== */
.finale-title {
  position: relative; z-index: 3; text-align: center;
  font-size: 2.4rem; font-weight: 900; color: #ffd166;
  text-shadow: 0 0 20px rgba(255, 209, 102, 0.65);
  margin: 8px 0 18px; animation: titlePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes titlePop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Portlash */
.boom { position: absolute; z-index: 15; pointer-events: none; }
.boom-flash {
  position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd166 30%, #ff5400 60%, rgba(255, 84, 0, 0) 72%);
  animation: boomFlash 0.55s ease-out forwards;
}
@keyframes boomFlash {
  from { transform: scale(0.2); opacity: 1; }
  to { transform: scale(1.7); opacity: 0; }
}
.burst-p { position: absolute; width: 7px; height: 7px; border-radius: 50%; }


/* ===== Minora ustasi (Canvas: games/minora.js) ===== */
.mn-world { position: relative; border-radius: 16px; overflow: hidden; background: #dff1ff; box-shadow: 0 10px 30px rgba(20, 60, 110, 0.25); }
.mn-stage { position: relative; width: 100%; height: 480px; overflow: hidden; background: #cfe8ff; user-select: none; }
.mn-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .mn-stage { height: 380px; } }
.mn-hud {
  position: absolute; right: 12px; top: 10px; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-family: 'Segoe UI', sans-serif;
}
.mn-balandlik, .mn-rekord {
  background: rgba(20, 30, 55, 0.72); color: #fff; border-radius: 10px; padding: 5px 12px; font-weight: 800;
}
.mn-balandlik { font-size: 1.25rem; }
.mn-rekord { font-size: 0.85rem; color: #ffe08a; }
.mn-balandlik:empty, .mn-rekord:empty { display: none; }
.mn-xabar {
  position: absolute; left: 50%; top: 16%; transform: translate(-50%, -50%) scale(0.85); z-index: 4;
  pointer-events: none; opacity: 0; padding: 8px 20px; border-radius: 12px;
  font-weight: 900; font-size: 1.2rem; white-space: nowrap; transition: opacity 0.2s, transform 0.2s;
}
.mn-xabar.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.mn-xabar.good { background: #7cff4f; color: #14400a; }
.mn-xabar.warn { background: #ffd166; color: #5c3a00; }
.mn-xabar.bad { background: #e5484d; color: #fff; box-shadow: 0 6px 20px rgba(180, 30, 30, 0.5); }

.mn-world .g-qarea { background: #eef6fb; padding: 14px 16px 18px; }
.mn-world .g-counter { color: #1c3b5a; }
.mn-world .g-score { color: #b45309; }
.mn-world .g-timebar-wrap { background: rgba(28, 59, 90, 0.15); }
.mn-world .g-status { color: #35507a; }
.mn-world .g-status.right { color: #17703f; }
.mn-world .g-status.wrong { color: #c0392b; }
.mn-world .g-countdown { background: rgba(225, 242, 252, 0.9); color: #1c3b5a; }
.mn-world .g-final-title, .mn-world .finale-title {
  color: #1c3b5a; text-shadow: 0 2px 8px rgba(255,255,255,0.9);
}
.mn-world .g-podium-name { color: #1c3b5a; }
.mn-world .g-podium-score { color: #b45309; }

/* ===== Virus quvg'ini: mikrosxema labirinti (games/virus.js) ===== */
.vr-world { position: relative; border-radius: 16px; overflow: hidden; background: #071d17; box-shadow: 0 10px 30px rgba(0, 40, 20, 0.45); }
.vr-stage { position: relative; width: 100%; height: 480px; overflow: hidden; background: #071d17; user-select: none; touch-action: none; }
.vr-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .vr-stage { height: 380px; } }
.vr-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 14px; font-family: 'Segoe UI', sans-serif;
}
.vr-hud-chap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vr-ball, .vr-orin, .vr-pesh, .vr-fw {
  background: rgba(4, 20, 16, 0.78); border-radius: 10px; padding: 5px 12px;
  font-weight: 800; color: #d3f9d8; border: 1px solid rgba(120, 220, 170, 0.25);
}
.vr-ball { font-size: 1.2rem; color: #99e9f2; }
.vr-orin { font-size: 1.2rem; color: #ffe08a; }
.vr-pesh { font-size: 0.8rem; font-weight: 700; white-space: pre-line; line-height: 1.45; }
.vr-pesh:empty { display: none; }
.vr-fw { display: flex; align-items: center; gap: 8px; color: #66d9ff; border-color: rgba(102, 217, 255, 0.7); }
.vr-fw-ich { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #22b8cf, #99e9f2); transition: width 0.2s linear; }
.vr-ishora {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4;
  pointer-events: none; font-size: 0.85rem; font-weight: 600; color: rgba(220, 255, 235, 0.9);
  background: rgba(4, 20, 16, 0.65); border-radius: 8px; padding: 4px 12px; white-space: nowrap; transition: opacity 0.6s;
}
.vr-ishora.yashir, .vr-ishora:empty { opacity: 0; }
.vr-toast {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%) scale(0.9);
  z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(4, 20, 16, 0.85); border-radius: 10px; padding: 8px 18px;
  font-weight: 900; font-size: 1.15rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.vr-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vr-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.vr-toast.bad { color: #ff8a7a; border: 1px solid rgba(255, 110, 90, 0.6); }
.vr-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }
/* Sensorli ekranda yo'nalish tugmalari (faqat o'quvchida) */
.vr-pad { position: absolute; left: 12px; bottom: 12px; z-index: 5; display: none; width: 138px; height: 138px; }
@media (hover: none) and (pointer: coarse) { .vr-stage.vr-oyinchi .vr-pad { display: block; } }
.vr-stage.vr-tugadi .vr-pad { display: none !important; }
.vr-pad-t {
  position: absolute; width: 46px; height: 46px; border-radius: 12px; border: 2px solid rgba(120, 220, 170, 0.6);
  background: rgba(4, 30, 22, 0.75); color: #b2f2bb; font-size: 1.2rem; font-weight: 900; touch-action: none;
}
.vr-pad-t:active { background: rgba(30, 110, 70, 0.9); }
.vr-pad-tepa { left: 46px; top: 0; }
.vr-pad-past { left: 46px; bottom: 0; }
.vr-pad-chap { left: 0; top: 46px; }
.vr-pad-ong { right: 0; top: 46px; }
@media (max-width: 600px) {
  .vr-hud { padding: 6px 8px; }
  .vr-ball, .vr-orin, .vr-fw { font-size: 0.8rem; padding: 3px 8px; }
  .vr-fw-ich { width: 50px; }
  .vr-pesh { display: none; }
  .vr-ishora { font-size: 0.72rem; white-space: normal; width: 88%; text-align: center; }
}
.vr-world .g-qarea { padding: 14px 16px 18px; background: #0a1f19; }
.vr-world .g-question { background: #10302a; color: #eafff4; font-size: 1.15rem; padding: 16px 18px; border: 1px solid rgba(120, 220, 170, 0.25); }
.vr-world .g-status { color: #c3e6d3; }
.vr-world .g-status.right { color: #7dffb0; }
.vr-world .g-status.wrong { color: #ff8a7a; }
.vr-world .g-countdown { background: rgba(4, 20, 16, 0.9); color: #99e9f2; }
.vr-world .g-final-title, .vr-world .finale-title { color: #b2f2bb; text-shadow: 0 0 22px rgba(80, 220, 140, 0.6); }
.vr-world .g-ans { padding: 13px 15px; font-size: 1rem; }

/* ===== Muzlagan ko'l: olti burchakli maydon (games/muz.js) ===== */
.mz-world { position: relative; border-radius: 16px; overflow: hidden; background: #06243d; box-shadow: 0 10px 30px rgba(0, 30, 60, 0.45); }
.mz-stage { position: relative; width: 100%; height: 480px; overflow: hidden; background: #06243d; user-select: none; touch-action: none; }
.mz-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .mz-stage { height: 380px; } }
.mz-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 14px; font-family: 'Segoe UI', sans-serif;
}
.mz-hud-chap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mz-ball, .mz-orin, .mz-pesh {
  background: rgba(4, 24, 44, 0.78); border-radius: 10px; padding: 5px 12px;
  font-weight: 800; color: #e7f5ff; border: 1px solid rgba(160, 210, 255, 0.25);
}
.mz-ball { font-size: 1.2rem; color: #ffe08a; }
.mz-orin { font-size: 1.2rem; color: #a5d8ff; }
.mz-pesh { font-size: 0.8rem; font-weight: 700; white-space: pre-line; line-height: 1.45; }
.mz-pesh:empty { display: none; }
.mz-amallar { display: none; gap: 6px; pointer-events: auto; }
.mz-stage.mz-oyinchi .mz-amallar { display: flex; }
.mz-stage.mz-tugadi .mz-amallar { display: none; }
.mz-amal {
  border-radius: 10px; padding: 5px 10px; font-weight: 900; font-size: 1rem; cursor: pointer; font-family: inherit;
  background: rgba(4, 24, 44, 0.78); color: #7a8ea3; border: 1px solid rgba(160, 210, 255, 0.2);
}
.mz-amal.bor { color: #fff; border-color: rgba(160, 220, 255, 0.8); box-shadow: 0 0 10px rgba(120, 200, 255, 0.35); }
.mz-muzlat.bor { background: rgba(28, 126, 214, 0.75); }
.mz-zarba.bor { background: rgba(230, 110, 20, 0.75); }
.mz-sakra.bor { background: rgba(55, 160, 90, 0.75); }
.mz-ishora {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4;
  pointer-events: none; font-size: 0.85rem; font-weight: 600; color: rgba(230, 245, 255, 0.92);
  background: rgba(4, 24, 44, 0.65); border-radius: 8px; padding: 4px 12px; white-space: nowrap; transition: opacity 0.6s;
}
.mz-ishora.yashir, .mz-ishora:empty { opacity: 0; }
.mz-toast {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%) scale(0.9);
  z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(4, 24, 44, 0.85); border-radius: 10px; padding: 8px 18px;
  font-weight: 900; font-size: 1.15rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.mz-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.mz-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.mz-toast.bad { color: #ff8a7a; border: 1px solid rgba(255, 110, 90, 0.6); }
.mz-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }
@media (max-width: 600px) {
  .mz-hud { padding: 6px 8px; }
  .mz-ball, .mz-orin { font-size: 0.8rem; padding: 3px 8px; }
  .mz-amal { font-size: 0.85rem; padding: 6px 9px; }
  .mz-pesh { display: none; }
  .mz-ishora { font-size: 0.72rem; white-space: normal; width: 88%; text-align: center; }
}
.mz-world .g-qarea { padding: 14px 16px 18px; background: #081c2f; }
.mz-world .g-question { background: #0e2b45; color: #eef7ff; font-size: 1.15rem; padding: 16px 18px; border: 1px solid rgba(160, 210, 255, 0.25); }
.mz-world .g-status { color: #c5dcef; }
.mz-world .g-status.right { color: #7dffb0; }
.mz-world .g-status.wrong { color: #ff8a7a; }
.mz-world .g-countdown { background: rgba(4, 24, 44, 0.9); color: #a5d8ff; }
.mz-world .g-final-title, .mz-world .finale-title { color: #d0ebff; text-shadow: 0 0 22px rgba(120, 200, 255, 0.6); }
.mz-world .g-ans { padding: 13px 15px; font-size: 1rem; }

/* ===== Ilonlar jangi (games/ilon.js) ===== */
.il-world { position: relative; border-radius: 18px; overflow: hidden; background: #040614; box-shadow: 0 14px 40px rgba(10, 10, 60, 0.55); }
.il-stage { position: relative; width: 100%; height: 600px; overflow: hidden; background: #040614; user-select: none; touch-action: none; }
@media (max-width: 900px) { .il-stage { height: 520px; } }
.il-canvas { display: block; width: 100%; height: 100%; }
/* Savol — sahna ustida, tepada; ostida 4 rang = 4 javob */
.il-world .il-savol {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5; padding: 12px 16px 18px;
  background: linear-gradient(180deg, rgba(4, 6, 20, 0.94) 0%, rgba(4, 6, 20, 0.82) 72%, rgba(4, 6, 20, 0) 100%);
}
.il-world .g-top { margin-bottom: 6px; }
.il-world .g-counter { color: #cfd8ff; }
.il-world .g-timebar-wrap { background: rgba(255, 255, 255, 0.12); }
.il-world .g-timebar { background: linear-gradient(90deg, #3bf58c, #ffd84a, #ff5470); }
.il-world .g-question {
  background: transparent; box-shadow: none; border: 0; color: #fff; margin: 0; padding: 2px 8px 10px;
  font-size: 1.28rem; font-weight: 800; text-align: center; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.il-world .g-status, .il-world .g-score { display: none; }
.il-ranglar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.il-rang {
  display: flex; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 12px; min-width: 0;
  background: rgba(255, 255, 255, 0.07); border: 2px solid transparent; color: #fff; font-weight: 700; font-size: 0.92rem;
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s, background 0.3s;
}
.il-rang-matn { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.il-doira { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; }
.il-rang-1 { border-color: rgba(59, 245, 140, 0.55); }
.il-rang-2 { border-color: rgba(255, 84, 112, 0.55); }
.il-rang-3 { border-color: rgba(255, 216, 74, 0.55); }
.il-rang-4 { border-color: rgba(77, 178, 255, 0.55); }
.il-rang-1 .il-doira { background: radial-gradient(circle at 35% 32%, #fff 0, #3bf58c 40%, #0f9d58 100%); box-shadow: 0 0 14px #3bf58c; }
.il-rang-2 .il-doira { background: radial-gradient(circle at 35% 32%, #fff 0, #ff5470 40%, #c21c3a 100%); box-shadow: 0 0 14px #ff5470; }
.il-rang-3 .il-doira { background: radial-gradient(circle at 35% 32%, #fff 0, #ffd84a 40%, #d19a00 100%); box-shadow: 0 0 14px #ffd84a; }
.il-rang-4 .il-doira { background: radial-gradient(circle at 35% 32%, #fff 0, #4db2ff 40%, #1466d6 100%); box-shadow: 0 0 14px #4db2ff; }
.il-ranglar.faol .il-doira { animation: ilPuls 1.2s ease-in-out infinite; }
@keyframes ilPuls { 50% { transform: scale(1.18); } }
.il-rang.togri { background: rgba(59, 245, 140, 0.2); box-shadow: 0 0 0 3px #3bf58c, 0 0 26px rgba(59, 245, 140, 0.55); transform: scale(1.04); }
.il-rang.togri::after { content: '✓'; margin-left: auto; font-weight: 900; color: #3bf58c; font-size: 1.25rem; }
.il-rang.xato { opacity: 0.32; }
/* HUD */
.il-men { position: absolute; left: 14px; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.il-uzun {
  background: rgba(4, 8, 30, 0.8); border: 1px solid rgba(120, 170, 255, 0.35); border-radius: 12px;
  padding: 6px 14px; color: #fff; font-weight: 900; font-size: 1.25rem;
}
.il-uzun:empty { display: none; }
.il-kutish { display: flex; gap: 6px; }
.il-kut { padding: 3px 10px; border-radius: 999px; font-weight: 900; font-size: 0.9rem; color: #0b0f1f; animation: ilPuls 1s ease-in-out infinite; }
.il-kut-1 { background: #3bf58c; }
.il-kut-2 { background: #ff5470; color: #fff; }
.il-kut-3 { background: #ffd84a; }
.il-kut-4 { background: #4db2ff; }
.il-pesh {
  position: absolute; right: 12px; bottom: 138px; z-index: 4; pointer-events: none; min-width: 180px;
  background: rgba(4, 8, 30, 0.72); border: 1px solid rgba(120, 170, 255, 0.25); border-radius: 12px; padding: 6px 4px;
}
.il-pesh:empty { display: none; }
.il-p { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; color: #dfe6ff; padding: 2px 8px; }
.il-p b { width: 14px; color: #8fa3d8; }
.il-p i { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.il-p span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.il-p em { margin-left: auto; font-style: normal; font-weight: 900; color: #fff; padding-left: 8px; }
.il-p.men { background: rgba(255, 212, 59, 0.18); border-radius: 8px; }
.il-ishora {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; pointer-events: none;
  font-size: 0.85rem; font-weight: 600; color: rgba(220, 230, 255, 0.92); white-space: nowrap;
  background: rgba(4, 8, 30, 0.65); border-radius: 8px; padding: 4px 12px; transition: opacity 0.6s;
}
.il-ishora.yashir, .il-ishora:empty { opacity: 0; }
.il-toast {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(0.9); z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(4, 8, 30, 0.88); border-radius: 12px; padding: 9px 20px; font-weight: 900; font-size: 1.2rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.il-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.il-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.il-toast.bad { color: #ff8a9a; border: 1px solid rgba(255, 110, 130, 0.6); }
.il-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }
.il-olim {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(60, 0, 20, 0.2), rgba(40, 0, 10, 0.55)); opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.il-olim.show { opacity: 1; }
.il-olim-bosh { font-size: 1.9rem; font-weight: 900; color: #ff8a9a; text-shadow: 0 0 22px rgba(255, 60, 90, 0.8); text-align: center; padding: 0 16px; }
.il-olim-iz { margin-top: 8px; color: #fff; font-weight: 700; }
.il-banner {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0.6); z-index: 7;
  pointer-events: none; opacity: 0; text-align: center; transition: opacity 0.35s, transform 0.35s;
}
.il-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.il-banner-bosh { font-size: 2.1rem; font-weight: 900; color: #ffe08a; white-space: nowrap; text-shadow: 0 0 24px rgba(255, 200, 80, 0.85); }
.il-banner-top { margin-top: 10px; font-size: 1.1rem; font-weight: 800; color: #fff; white-space: nowrap; }
.il-tez-t {
  display: none; position: absolute; left: 14px; bottom: 96px; z-index: 5; width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid rgba(255, 216, 74, 0.8); background: rgba(40, 30, 0, 0.6); color: #ffd84a; font-size: 1.6rem; touch-action: none;
}
@media (hover: none) and (pointer: coarse) { .il-stage.il-oyinchi .il-tez-t { display: block; } }
/* Yakun: savol paneli (shohsupa/xulosa) sahna ostiga chiqariladi */
.il-world.il-tugadi .il-savol { position: static; background: #0a0f2e; padding: 16px; }
.il-world.il-tugadi .il-men, .il-world.il-tugadi .il-pesh, .il-world.il-tugadi .il-ishora,
.il-world.il-tugadi .il-tez-t { display: none; }
.il-world .g-final-title, .il-world .finale-title { color: #ffe08a; text-shadow: 0 0 22px rgba(255, 200, 80, 0.6); }
@media (max-width: 600px) {
  .il-ranglar { grid-template-columns: 1fr 1fr; }
  .il-world .g-question { font-size: 1rem; }
  .il-rang { font-size: 0.8rem; padding: 5px 8px; }
  .il-pesh { display: none; }
  .il-ishora { display: none; } /* sichqoncha haqidagi maslahat telefonda kerak emas, HUD ni to'sadi */
  .il-banner-bosh { font-size: 1.4rem; white-space: normal; }
  .il-banner-top { font-size: 0.85rem; white-space: normal; }
}

/* ===== Oddiy test — Kahoot kabi (games/test.js) ===== */
.kt-world {
  position: relative; border-radius: 18px; overflow: hidden; padding: 18px 18px 22px; min-height: 480px;
  background: radial-gradient(1200px 600px at 20% -10%, #6a2bd8 0%, #46178f 45%, #2a0e62 100%);
  box-shadow: 0 14px 40px rgba(40, 10, 90, 0.45);
}
.kt-fon { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.kt-sh { position: absolute; bottom: -120px; color: rgba(255, 255, 255, 0.07); font-weight: 900; animation: ktSuz 22s linear infinite; }
@keyframes ktSuz { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-900px) rotate(200deg); } }
.kt-qarea { position: relative; z-index: 1; }
.kt-world .g-top { margin-bottom: 14px; }
.kt-world .g-counter { color: #fff; background: rgba(0, 0, 0, 0.25); padding: 4px 12px; border-radius: 999px; }
.kt-world .g-score { color: #fff; background: rgba(0, 0, 0, 0.25); padding: 4px 12px; border-radius: 999px; }
.kt-world .g-timebar-wrap { height: 14px; background: rgba(255, 255, 255, 0.18); }
.kt-world .g-timebar { background: linear-gradient(90deg, #ffffff, #d3c4ff); }
.kt-world .g-question {
  background: #fff; color: #1b1340; font-size: 1.55rem; font-weight: 800; text-align: center;
  padding: 26px 22px; border-radius: 14px; margin: 0 0 16px; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
}
.kt-world .g-status { color: #fff; font-weight: 800; text-align: center; margin-top: 12px; min-height: 1.2em; font-size: 1.1rem; }
.kt-javoblar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kt-tile {
  display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 14px 20px; border: 0; border-radius: 12px;
  color: #fff; font-family: inherit; font-size: 1.2rem; font-weight: 800; text-align: left; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); transition: transform 0.12s, opacity 0.3s, filter 0.3s, box-shadow 0.12s;
}
.kt-tile:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.kt-tile:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.kt-tile:disabled { cursor: default; }
.kt-t0 { background: #e21b3c; }
.kt-t1 { background: #1368ce; }
.kt-t2 { background: #d89e00; }
.kt-t3 { background: #26890c; }
.kt-shakl { font-size: 2rem; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); }
.kt-matn { flex: 1; }
.kt-tile.sonik { opacity: 0.25; }
.kt-tile.tanlandi { box-shadow: 0 0 0 4px #fff, 0 6px 0 rgba(0, 0, 0, 0.25); }
.kt-tile.xato { opacity: 0.3; }
.kt-tile.togri { box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 255, 255, 0.6); transform: scale(1.02); }
.kt-tile.togri .kt-matn::after { content: '  ✓'; }
/* Javoblar taqsimoti (ochilgach) */
.kt-taqsimot { display: none; justify-content: center; gap: 18px; height: 150px; margin-top: 16px; }
.kt-taqsimot.show { display: flex; }
.kt-ust { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 70px; height: 100%; }
.kt-bar { position: relative; width: 100%; height: 0; border-radius: 8px 8px 0 0; transition: height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.kt-u0 .kt-bar { background: #e21b3c; }
.kt-u1 .kt-bar { background: #1368ce; }
.kt-u2 .kt-bar { background: #d89e00; }
.kt-u3 .kt-bar { background: #26890c; }
.kt-ust:not(.togri) .kt-bar { opacity: 0.45; }
.kt-son { position: absolute; top: -26px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 900; }
.kt-ust-shakl { margin-top: 6px; color: #fff; font-weight: 900; font-size: 1.1rem; }
/* O'quvchi natijasi */
.kt-natija {
  position: absolute; left: 50%; top: 42%; z-index: 5; transform: translate(-50%, -50%) scale(0.7); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 42px; border-radius: 18px; color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); transition: opacity 0.3s, transform 0.3s;
}
.kt-natija.show { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: ktYoq 2.6s forwards; }
@keyframes ktYoq { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.kt-natija.togri { background: #26890c; }
.kt-natija.xato { background: #e21b3c; }
.kt-natija.bosh { background: #5a4a8a; }
.kt-nat-belgi { font-size: 3rem; font-weight: 900; line-height: 1; }
.kt-nat-matn { font-size: 1.5rem; font-weight: 900; }
.kt-nat-ball { font-size: 1.2rem; font-weight: 800; background: rgba(0, 0, 0, 0.2); padding: 3px 14px; border-radius: 999px; }
/* Reyting (ochilgach, top-5) */
.kt-reyting { display: none; position: relative; z-index: 1; margin-top: 16px; background: rgba(0, 0, 0, 0.22); border-radius: 14px; padding: 12px 14px; }
.kt-reyting.show { display: block; }
.kt-reyting-bosh { color: #fff; font-weight: 900; font-size: 1.1rem; margin-bottom: 8px; text-align: center; }
.kt-q {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 800; overflow: hidden;
}
.kt-q.men { background: rgba(255, 255, 255, 0.24); }
.kt-qbar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 255, 255, 0.12); transition: width 0.8s ease; z-index: 0; }
.kt-q > span { position: relative; z-index: 1; }
.kt-o { width: 22px; text-align: center; color: #d3c4ff; }
.kt-i { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-plus { color: #9dffb0; font-size: 0.9rem; }
.kt-b { min-width: 60px; text-align: right; }
.kt-men-orin { color: #fff; text-align: center; margin-top: 8px; font-weight: 800; }
.kt-world .g-final-title, .kt-world .finale-title { color: #fff; text-shadow: 0 0 22px rgba(255, 255, 255, 0.4); }
@media (max-width: 600px) {
  .kt-world { padding: 12px; }
  .kt-world .g-question { font-size: 1.15rem; padding: 18px 14px; }
  .kt-tile { min-height: 70px; font-size: 1rem; padding: 10px 12px; gap: 10px; }
  .kt-javoblar { gap: 8px; }
}

/* ===== Eshkak eshish (3D daryo) ===== */
.row-world { position: relative; border-radius: 16px; overflow: hidden; background: #0d2f4a; }
.row-stage { position: relative; width: 100%; height: 440px; overflow: hidden; }
/* Girdob qayiqni tortib olganda — ekran silkinadi */
.row-stage.quake { animation: rowQuake 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes rowQuake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  12% { transform: translate(-7px, 4px) rotate(-0.6deg); }
  28% { transform: translate(6px, -3px) rotate(0.5deg); }
  45% { transform: translate(-5px, 3px) rotate(-0.4deg); }
  62% { transform: translate(4px, -2px) rotate(0.3deg); }
  80% { transform: translate(-2px, 1px) rotate(-0.15deg); }
}
.row-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .row-stage { height: 330px; } }

.row-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; padding: 12px 16px;
}
.row-pos, .row-rhythm {
  display: flex; align-items: baseline; gap: 5px;
  background: rgba(6, 28, 46, 0.62); border-radius: 12px; padding: 5px 14px;
  font-weight: 900; color: #fff;
}
.row-pos { border: 1px solid rgba(255, 209, 102, 0.6); color: #ffd166; }
.row-rhythm { border: 1px solid rgba(122, 242, 255, 0.55); color: #7af2ff; }
.row-pos .rp-n, .row-rhythm .rr-n { font-size: 1.5rem; line-height: 1; }
.rp-u { font-size: 0.7rem; opacity: 0.85; font-weight: 700; }

/* Qorong'i suv foni uchun yadro matn ranglari */
.row-world .g-qarea { background: #0f2b40; }
.row-world .g-counter { color: #cfe6f5; }
.row-world .g-score { color: #ffd166; }
.row-world .g-timebar-wrap { background: rgba(255,255,255,0.14); }
.row-world .g-timebar { background: linear-gradient(90deg, #00acc1, #7af2ff); }
.row-world .g-question {
  background: #14384f; color: #eaf6ff; border: 1px solid rgba(122, 242, 255, 0.25);
}
.row-world .g-status { color: #c3dcea; }
.row-world .g-status.right { color: #7dffb0; }
.row-world .g-status.wrong { color: #ff8f8f; }
.row-world .g-countdown { background: rgba(8, 30, 48, 0.9); color: #7af2ff; }
.row-world .g-final-title, .row-world .finale-title {
  color: #7af2ff; text-shadow: 0 0 20px rgba(0, 190, 255, 0.7);
}
.row-world .g-podium-name { color: #eaf6ff; }
.row-world .g-podium-score { color: #ffd166; }

/* Eski DOM-versiya uslublari (ishlatilmaydi) */
.row-river {
  position: relative; padding: 12px 10px; min-height: 170px;
  background: linear-gradient(180deg, #7cc4e8, #4a95c4);
}
.row-finish {
  position: absolute; right: 4%; top: 0; bottom: 0; width: 6px; z-index: 3;
  background: repeating-linear-gradient(180deg, #fff 0 8px, #e5484d 8px 16px);
}
.row-lane {
  position: relative; height: 38px; margin-bottom: 4px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
}
.row-lane.me { background: rgba(255, 220, 120, 0.28); }
.row-lane.winner { background: rgba(120, 255, 170, 0.3); }
.row-label {
  position: absolute; left: 6px; top: 3px; z-index: 1;
  background: rgba(10, 40, 60, 0.55); color: #fff; border-radius: 8px;
  padding: 1px 8px; font-size: 0.72rem; font-weight: 800; white-space: nowrap;
}
.row-boat {
  position: absolute; bottom: 4px; left: 0; z-index: 2;
  width: 30px; height: 13px; border-radius: 3px 10px 10px 3px;
  transition: left 0.7s ease;
}
.row-boat.whirl { animation: rowSpin 1.1s linear infinite; }
@keyframes rowSpin { to { transform: rotate(360deg); } }
.row-boat.boost { box-shadow: 0 0 0 3px rgba(255, 220, 100, 0.8); }
.row-tag {
  position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 900; color: #fff; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.row-msg {
  position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(0.75);
  z-index: 8; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 8px 22px; border-radius: 12px; font-weight: 900; font-size: 1.15rem;
  letter-spacing: 1px; box-shadow: 0 6px 20px rgba(0, 20, 40, 0.45);
  transition: opacity 0.25s, transform 0.25s;
}
.row-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.row-msg.good { background: #ffd166; color: #5c3a00; }
.row-msg.bad { background: #e5484d; color: #fff; }

/* ===== Marafon (2.5D oval stadion) ===== */
.mar-world {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #0d2a44; box-shadow: 0 8px 26px rgba(20, 60, 100, 0.32);
}
.mar-stage { position: relative; width: 100%; height: 440px; overflow: hidden; }
.mar-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .mar-stage { height: 330px; } }

/* HUD: o'rin va seriya */
.mar-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; padding: 12px 16px;
}
.mar-pos, .mar-streak {
  display: flex; align-items: baseline; gap: 5px;
  background: rgba(10, 26, 42, 0.62); border-radius: 12px; padding: 5px 14px;
  font-weight: 900; color: #fff;
}
.mar-pos { border: 1px solid rgba(255, 209, 102, 0.6); color: #ffd166; }
.mar-streak { border: 1px solid rgba(255, 138, 61, 0.55); color: #ffb07a; }
.mar-pos .mp-n, .mar-streak .ms-n { font-size: 1.5rem; line-height: 1; }
.mp-u { font-size: 0.7rem; opacity: 0.85; font-weight: 700; }

/* Eski DOM-versiyadan qolgan uslublar (endi ishlatilmaydi) */
/* Osmon va quyosh */
.mar-sky {
  position: absolute; left: 0; right: 0; top: 0; height: 74px; pointer-events: none;
  background:
    radial-gradient(circle at 88% 30%, rgba(255, 240, 170, 0.95) 0 14px, rgba(255, 235, 150, 0) 46px),
    linear-gradient(180deg, #6cbdf0, #a9def9);
}
.mar-sky::after {
  content: ''; position: absolute; left: 6%; top: 16px; width: 90px; height: 22px;
  border-radius: 20px; background: rgba(255,255,255,0.9);
  box-shadow: 34px -8px 0 -2px rgba(255,255,255,0.85), 200px 6px 0 -4px rgba(255,255,255,0.7);
  animation: marCloud 40s linear infinite;
}
@keyframes marCloud { to { transform: translateX(560px); } }
/* Tribunalar — tomoshabinlar */
.mar-stands {
  position: absolute; left: 0; right: 0; top: 42px; height: 40px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.16) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, #3d4b7a, #2b3560);
  border-bottom: 3px solid #1e2545;
}
.mar-stands::before {
  content: ''; position: absolute; top: 4px; right: 0; bottom: 6px; left: 0; inset: 4px 0 6px;
  background-image:
    radial-gradient(2.6px 2.6px at 8px 6px, #ffd166, transparent 60%),
    radial-gradient(2.6px 2.6px at 22px 14px, #ff6b8a, transparent 60%),
    radial-gradient(2.6px 2.6px at 36px 5px, #7af2ff, transparent 60%),
    radial-gradient(2.6px 2.6px at 50px 15px, #b6ff96, transparent 60%),
    radial-gradient(2.6px 2.6px at 64px 7px, #ffffff, transparent 60%);
  background-size: 78px 22px;
  animation: marCrowd 1.6s steps(2) infinite;
}
@keyframes marCrowd { 50% { transform: translateY(-2px); } }

/* Yugurish yo'lagi */
.mar-track {
  position: relative; margin-top: 82px; padding: 10px 10px 12px;
  background: linear-gradient(180deg, #c4573f, #a8422e);
  border-top: 4px solid #f4f6fa;
  max-height: 430px; overflow-y: auto; overflow-x: hidden;
}
.mar-track::-webkit-scrollbar { width: 8px; }
.mar-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }
.mar-finish { position: absolute; right: 3.5%; top: 0; bottom: 0; width: 10px; z-index: 3; }
.mar-finish::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  background:
    repeating-conic-gradient(#fff 0% 25%, #1f2440 0% 50%) 0 0 / 10px 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.35);
}
.mar-finish-flag {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 10px solid #ffd166;
}

.mar-lane {
  position: relative; height: var(--lane-h, 58px); margin-bottom: 3px; border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(0,0,0,0.07));
  border-top: 2px dashed rgba(255, 255, 255, 0.55);
}
.mar-lane:last-child { border-bottom: 2px dashed rgba(255, 255, 255, 0.55); }
.mar-lane.me { background: linear-gradient(180deg, rgba(255, 220, 120, 0.32), rgba(255, 190, 60, 0.14)); }
.mar-lane.winner { background: linear-gradient(180deg, rgba(120, 255, 170, 0.34), rgba(40, 200, 120, 0.16)); }

/* Ism yorlig'i yo'lakning chap chekkasida — yuguruvchi uning ustidan o'tadi */
.mar-label {
  position: absolute; left: 6px; top: 3px; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  background: rgba(15, 22, 40, 0.55); border-radius: 9px; padding: 1px 8px;
  font-size: 0.7rem; font-weight: 800; color: #fff; white-space: nowrap;
  pointer-events: none;
}
.mar-score { color: #ffd166; }

.mar-runner {
  position: absolute; bottom: 0; left: 0; z-index: 3;
  transform-origin: bottom center;
  transition: left 0.9s cubic-bezier(0.3, 0.9, 0.4, 1);
}
.mar-body {
  line-height: 0; position: relative; z-index: 2;
  transform: scale(var(--runner-scale, 1)); transform-origin: bottom center;
}
/* Yugurish animatsiyasi: oyoq va qo'llar almashinadi */
.rn-leg-f, .rn-leg-b, .rn-arm-f, .rn-arm-b {
  transform-box: fill-box; transform-origin: top center;
}
.rn-leg-f { animation: marLegF 0.42s ease-in-out infinite alternate; }
.rn-leg-b { animation: marLegB 0.42s ease-in-out infinite alternate; }
.rn-arm-f { animation: marArmF 0.42s ease-in-out infinite alternate; }
.rn-arm-b { animation: marArmB 0.42s ease-in-out infinite alternate; }
@keyframes marLegF { to { transform: rotate(-38deg); } }
@keyframes marLegB { to { transform: rotate(34deg); } }
@keyframes marArmF { to { transform: rotate(42deg); } }
@keyframes marArmB { to { transform: rotate(-40deg); } }
.mar-body svg { animation: marBob 0.42s ease-in-out infinite alternate; }
@keyframes marBob { to { transform: translateY(-3px); } }

/* Ikkinchi nafas — oltin nur, tezlik, oyoqlar yerdan uzilgan */
.mar-aura {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px;
  transform: translate(-50%, -50%); border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255,225,120,0.85) 0%, rgba(255,190,60,0.35) 45%, rgba(255,170,0,0) 72%);
  transition: opacity 0.3s;
}
.mar-runner.wind .mar-aura { opacity: 1; animation: marAura 0.9s ease-in-out infinite; }
@keyframes marAura { 50% { transform: translate(-50%, -50%) scale(1.22); } }
.mar-runner.wind .mar-body svg { animation: marFly 0.3s ease-in-out infinite alternate; }
@keyframes marFly { to { transform: translateY(-9px); } }
.mar-runner.wind .rn-leg-f, .mar-runner.wind .rn-leg-b,
.mar-runner.wind .rn-arm-f, .mar-runner.wind .rn-arm-b { animation-duration: 0.2s; }
/* Chang izlari */
.mar-dust { position: absolute; left: -6px; bottom: 2px; width: 40px; height: 12px; pointer-events: none; }
.mar-runner.wind .mar-dust::before,
.mar-runner.wind .mar-dust::after {
  content: ''; position: absolute; bottom: 0; width: 12px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75); animation: marDust 0.55s linear infinite;
}
.mar-runner.wind .mar-dust::after { animation-delay: 0.27s; }
@keyframes marDust {
  0% { transform: translateX(6px) scale(0.5); opacity: 0.9; }
  100% { transform: translateX(-26px) scale(1.5); opacity: 0; }
}
/* Charchagan — sekin, egilgan, ter */
.mar-runner.tired .mar-body svg { animation-duration: 1.1s; filter: saturate(0.65) brightness(0.9); }
.mar-runner.tired .rn-leg-f, .mar-runner.tired .rn-leg-b,
.mar-runner.tired .rn-arm-f, .mar-runner.tired .rn-arm-b { animation-duration: 1.1s; }
.mar-runner.tired::after {
  content: '💧'; position: absolute; right: -2px; top: -4px; font-size: 0.7rem;
  animation: marSweat 1.4s ease-in-out infinite;
}
@keyframes marSweat {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

.mar-tag {
  position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 3;
  font-size: 0.72rem; font-weight: 900; color: #fff; white-space: nowrap;
  text-shadow: 0 0 8px rgba(255, 90, 20, 0.95), 0 1px 2px rgba(0,0,0,0.5);
}

.mar-wind-msg {
  position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(0.7);
  z-index: 9; background: linear-gradient(180deg, #ffe27a, #ffb300);
  color: #5c3a00; font-weight: 900; font-size: 1.2rem; letter-spacing: 1px;
  padding: 8px 24px; border-radius: 12px; white-space: nowrap; opacity: 0;
  box-shadow: 0 6px 22px rgba(180, 120, 0, 0.5); pointer-events: none;
}
.mar-wind-msg.go { animation: marWindPop 1.7s cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }

/* Bosqich e'lonlari: START / SO'NGGI SPURT */
.mar-banner {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.7);
  z-index: 8; pointer-events: none; opacity: 0; white-space: nowrap;
  font-size: 1.9rem; font-weight: 900; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 18px rgba(255, 180, 40, 0.95), 0 3px 10px rgba(0, 0, 0, 0.55);
}
.mar-banner.go { animation: marBanner 1.6s cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }
@keyframes marBanner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(0.95); }
}
@keyframes marWindPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.95); }
}

/* Yorug' fon uchun yadro matn ranglari */
.mar-world .g-qarea { background: #f3f7fc; }
.mar-world .g-counter { color: #24405e; }
.mar-world .g-score { color: #b45309; }
.mar-world .g-timebar-wrap { background: rgba(255,255,255,0.6); }
.mar-world .g-status { color: #35507a; }
.mar-world .g-status.right { color: #17703f; }
.mar-world .g-status.wrong { color: #c0392b; }
.mar-world .g-countdown { background: rgba(230, 244, 255, 0.9); color: #24405e; }
.mar-world .g-final-title, .mar-world .finale-title {
  color: #1c3b5a; text-shadow: 0 2px 8px rgba(255,255,255,0.9);
}
.mar-world .g-podium-name { color: #1c3b5a; }
.mar-world .g-podium-score { color: #b45309; }

/* ===== Tezlik trassasi (synthwave poyga) ===== */
.race-world {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #0a0118; box-shadow: 0 10px 34px rgba(20, 0, 40, 0.6);
}
.race-stage { position: relative; width: 100%; height: 440px; overflow: hidden; }
.race-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .race-stage { height: 320px; } }

.race-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; padding: 12px 18px;
}
.race-speed, .race-dist {
  display: flex; align-items: baseline; gap: 5px;
  background: rgba(12, 2, 26, 0.68); border-radius: 12px; padding: 5px 16px;
  font-weight: 900; letter-spacing: 0.5px;
}
.race-speed { border: 1px solid rgba(0, 229, 255, 0.55); color: #7af2ff; text-shadow: 0 0 12px rgba(0, 229, 255, 0.85); }
.race-dist { border: 1px solid rgba(255, 45, 122, 0.55); color: #ff8dc0; text-shadow: 0 0 12px rgba(255, 45, 122, 0.8); }
.race-speed .rs-n, .race-dist .rd-n { font-size: 1.7rem; line-height: 1; }
.rs-u { font-size: 0.72rem; opacity: 0.85; font-weight: 700; }

.race-boost {
  position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(0.6);
  z-index: 6; pointer-events: none; opacity: 0;
  font-size: 3rem; font-weight: 900; font-style: italic; letter-spacing: 3px;
  color: #fff; text-shadow: 0 0 18px #00e5ff, 0 0 40px #ff2d7a, 0 4px 10px rgba(0,0,0,0.6);
}
.race-boost.go { animation: boostPop 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes boostPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) skewX(-14deg); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) skewX(-14deg); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1) skewX(-14deg); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.95) skewX(-14deg); }
}

/* Qorong'u neon dunyo uchun savol paneli */
.race-world .g-qarea { padding: 14px 16px 18px; background: #0d0322; }
.race-world .g-counter { color: #dcd0ff; }
.race-world .g-score { color: #7af2ff; }
.race-world .g-timebar-wrap { background: rgba(255, 255, 255, 0.12); }
.race-world .g-timebar { background: linear-gradient(90deg, #ff2d7a, #ffd23f); }
.race-world .g-question {
  background: #170a33; color: #f4eeff; border: 1px solid rgba(255, 45, 122, 0.3);
  box-shadow: 0 0 22px rgba(120, 0, 200, 0.25);
}
.race-world .g-status { color: #cfc2f0; }
.race-world .g-status.right { color: #7cff4f; }
.race-world .g-status.wrong { color: #ff6b8a; }
.race-world .g-countdown { background: rgba(10, 1, 24, 0.9); color: #00e5ff; }
.race-world .g-final-title, .race-world .finale-title {
  color: #fff; text-shadow: 0 0 20px #00e5ff, 0 0 44px #ff2d7a;
}
.race-world .g-podium-name { color: #f4eeff; }
.race-world .g-podium-score { color: #ffd23f; }

/* ===== Zombi apokalipsis (3D FPS) ===== */
.zomb-world {
  position: relative; border-radius: 16px; overflow: hidden; padding: 0;
  background: #05070d; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
}
.zomb-stage {
  position: relative; width: 100%; height: 460px; overflow: hidden;
  cursor: none; background: #05070d; user-select: none;
}
.zomb-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .zomb-stage { height: 340px; } }

/* HUD */
.zomb-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; padding: 12px 16px;
  font-family: 'Segoe UI', sans-serif;
}
.zomb-ammo, .zomb-kills {
  display: flex; align-items: center; gap: 8px;
  background: rgba(6, 10, 18, 0.72); border: 1px solid rgba(255, 60, 60, 0.35);
  border-radius: 10px; padding: 6px 14px;
  font-weight: 900; font-size: 1.25rem; color: #ffd9d9;
  text-shadow: 0 0 10px rgba(255, 60, 60, 0.6);
}
.zomb-ammo .za-ico, .zomb-kills .za-ico { font-size: 1.1rem; filter: grayscale(0.2); }
.zomb-stage.no-ammo .zomb-ammo {
  border-color: rgba(255, 60, 60, 0.9); color: #ff6b6b;
  animation: ammoWarn 0.9s ease-in-out infinite;
}
@keyframes ammoWarn { 50% { background: rgba(90, 12, 12, 0.85); } }

/* Zarba effekti (zombi yetib kelganda) */
.zomb-dmg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 55%, rgba(180,0,0,0) 35%, rgba(190,0,0,0.6) 100%);
  transition: opacity 0.15s;
}
.zomb-dmg.go { opacity: 1; animation: dmgPulse 0.42s ease-out; }
@keyframes dmgPulse { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.zomb-toast {
  position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(0.9);
  z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(6, 10, 18, 0.8); border-radius: 10px; padding: 8px 18px;
  font-weight: 900; font-size: 1.15rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.zomb-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.zomb-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.zomb-toast.bad { color: #ff7a7a; border: 1px solid rgba(255, 90, 90, 0.6); }
.zomb-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }

/* Qorong'u dunyo uchun savol paneli */
.zomb-world .g-qarea { padding: 14px 16px 18px; background: #0a0e16; }
.zomb-world .g-counter { color: #cfd8ef; }
.zomb-world .g-score { color: #ff9a9a; }
.zomb-world .g-timebar-wrap { background: rgba(255, 255, 255, 0.12); }
.zomb-world .g-timebar { background: linear-gradient(90deg, #b3261e, #ff6b3d); }
.zomb-world .g-question {
  background: #131a28; color: #eef3ff; font-size: 1.15rem; padding: 16px 18px;
  border: 1px solid rgba(255, 90, 90, 0.22);
}
.zomb-world .g-status { color: #c3cee6; }
.zomb-world .g-status.right { color: #7dffb0; }
.zomb-world .g-status.wrong { color: #ff7a7a; }
.zomb-world .g-countdown { background: rgba(5, 7, 13, 0.9); color: #ff5252; }
.zomb-world .g-final-title, .zomb-world .finale-title {
  color: #ff5252; text-shadow: 0 0 22px rgba(255, 40, 40, 0.7);
}
.zomb-world .g-podium-name { color: #eef3ff; }
.zomb-world .g-podium-score { color: #ffd166; }
.zomb-world .g-ans { padding: 13px 15px; font-size: 1rem; }

/* ===== Muzlagan ko'l ===== */
.ice-world {
  position: relative; overflow: hidden; border-radius: 18px; padding: 18px;
  background: linear-gradient(180deg, #bfe3f7 0%, #ddf1fc 55%, #eaf7ff 100%);
  box-shadow: 0 8px 26px rgba(30, 80, 120, 0.32);
}
.ice-far { position: absolute; left: 0; right: 0; top: 6px; opacity: 0.9; pointer-events: none; }
.ice-snow {
  position: absolute; top: -20px; right: -20px; bottom: -20px; left: -20px; inset: -20px; pointer-events: none;
  background-image:
    radial-gradient(2.4px 2.4px at 30px 40px, #fff, transparent 60%),
    radial-gradient(1.8px 1.8px at 130px 100px, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(2px 2px at 210px 60px, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1.6px 1.6px at 90px 160px, rgba(255,255,255,0.7), transparent 60%);
  background-size: 260px 220px;
  animation: snowFall linear infinite;
}
.ice-snow-1 { animation-duration: 11s; opacity: 0.9; }
.ice-snow-2 { animation-duration: 17s; background-position: 80px 0; opacity: 0.6; }
.ice-snow-3 { animation-duration: 24s; background-position: 160px 0; opacity: 0.4; }
@keyframes snowFall { to { background-position-y: 220px; } }

.ice-lake {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 18px 22px; padding: 116px 4px 56px; margin-bottom: 14px;
}
/* Ko'l suvi — muzlar shu suvda suzadi */
.ice-lake::before {
  content: ''; position: absolute; left: -18px; right: -18px; top: 132px; bottom: -8px; z-index: 0;
  background:
    linear-gradient(180deg, #9fd4ef 0%, #6cb0da 22%, #3f86bb 62%, #2a6797 100%);
  border-top: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 8px 22px rgba(255, 255, 255, 0.35);
}
/* Suv to'lqinlari */
.ice-lake::after {
  content: ''; position: absolute; left: -18px; right: -18px; top: 132px; bottom: -8px; z-index: 1;
  background-image:
    radial-gradient(38px 6px at 60px 26px, rgba(255,255,255,0.45), transparent 70%),
    radial-gradient(46px 7px at 220px 62px, rgba(255,255,255,0.3), transparent 70%),
    radial-gradient(32px 5px at 350px 34px, rgba(255,255,255,0.38), transparent 70%),
    radial-gradient(40px 6px at 140px 110px, rgba(255,255,255,0.22), transparent 70%);
  background-size: 420px 150px;
  animation: waveDrift 11s linear infinite; pointer-events: none;
}
@keyframes waveDrift { to { background-position: 420px 0; } }
.ice-cell {
  position: relative; z-index: 2; width: 152px; height: 168px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  transition: transform 0.5s ease;
}
/* muz atrofidagi suv halqasi */
.ice-cell::after {
  content: ''; position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: 132px; height: 20px; border-radius: 50%; z-index: 0;
  background: radial-gradient(ellipse, rgba(255,255,255,0.55), rgba(255,255,255,0) 70%);
  animation: ripple 3.2s ease-in-out infinite;
}
@keyframes ripple {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
  50% { transform: translateX(-50%) scale(1.12); opacity: 0.35; }
}
.ice-cell.shaky { animation: floeWobble 1.6s ease-in-out infinite; }
@keyframes floeWobble {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-2.2deg); }
  70% { transform: rotate(2.2deg); }
}
.ice-peng { position: relative; z-index: 3; line-height: 0; margin-bottom: -34px; }
.ice-peng svg { animation: pengIdle 2.6s ease-in-out infinite; }
@keyframes pengIdle { 50% { transform: translateY(-3px); } }
.pg-wing-l { transform-box: fill-box; transform-origin: 50% 10%; animation: wingL 2.2s ease-in-out infinite; }
.pg-wing-r { transform-box: fill-box; transform-origin: 50% 10%; animation: wingR 2.2s ease-in-out infinite; }
@keyframes wingL { 50% { transform: rotate(-13deg); } }
@keyframes wingR { 50% { transform: rotate(13deg); } }
.pg-scarf-tail { transform-box: fill-box; transform-origin: 0% 0%; animation: scarfWave 1.9s ease-in-out infinite; }
@keyframes scarfWave { 50% { transform: rotate(-16deg); } }

.ice-floe {
  position: relative; z-index: 2; line-height: 0;
  transform: scale(var(--floe-scale, 1)) rotate(var(--floe-tilt, 0deg));
}
.ice-svg { filter: drop-shadow(0 6px 8px rgba(15, 60, 95, 0.4)); }
/* Muz suvda sekin chayqaladi */
.ice-cell:not(.sinking):not(.shaky) {
  animation: floeBob var(--bob-dur, 3.8s) ease-in-out infinite alternate;
  animation-delay: var(--bob-delay, 0s);
}
@keyframes floeBob { to { transform: translateY(-6px); } }
/* Darzlar bosqichma-bosqich ochiladi */
.ice-cracks .crk { opacity: 0; transition: opacity 0.35s; }
.ice-cell[data-cracks="1"] .crk-1,
.ice-cell[data-cracks="2"] .crk-1, .ice-cell[data-cracks="2"] .crk-2,
.ice-cell[data-cracks="3"] .crk-1, .ice-cell[data-cracks="3"] .crk-2, .ice-cell[data-cracks="3"] .crk-3 { opacity: 1; }
.ice-cell[data-cracks="2"] .ice-body { filter: saturate(1.35) brightness(0.96); }
.ice-cell[data-cracks="3"] .ice-body { filter: saturate(1.6) brightness(0.9); }
.ice-floe.crack-hit { animation: crackHit 0.55s ease; }
@keyframes crackHit {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-5px) scale(1.03); }
  55% { transform: translateX(4px); }
}
.ice-floe.freeze { animation: freezeGlow 0.9s ease; }
@keyframes freezeGlow {
  0%, 100% { filter: drop-shadow(0 4px 5px rgba(20, 70, 110, 0.35)); }
  40% { filter: drop-shadow(0 0 14px rgba(130, 230, 255, 1)) brightness(1.25); }
}

.ice-label {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88); color: #14456b; border-radius: 12px;
  padding: 2px 9px; font-size: 0.74rem; font-weight: 800; white-space: nowrap;
  max-width: 138px; overflow: hidden; text-overflow: ellipsis; z-index: 4;
}

/* Cho'kish */
.ice-cell.sinking .ice-peng,
.ice-cell.sinking .ice-floe { transition: transform 0.5s cubic-bezier(0.6, 0, 0.9, 0.5), opacity 0.5s; }
.ice-cell.sinking .ice-floe { transform: translateY(34px) rotate(9deg); opacity: 0.35; }
.ice-cell.sinking .ice-peng { transform: translateY(46px) rotate(-14deg); }
.ice-cell.under .ice-peng, .ice-cell.under .ice-floe { opacity: 0; }
.ice-cell.resurface .ice-peng, .ice-cell.resurface .ice-floe {
  animation: resurface 0.9s cubic-bezier(0.34, 1.4, 0.5, 1) both;
}
@keyframes resurface {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ice-splash {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5; pointer-events: none;
}
.ice-splash.go::before, .ice-splash.go::after {
  content: ''; position: absolute; bottom: 0; width: 14px; height: 34px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(140, 210, 245, 0.2));
  animation: splashUp 0.75s ease-out forwards;
}
.ice-splash.go::before { left: -20px; }
.ice-splash.go::after { left: 6px; animation-delay: 0.09s; }
@keyframes splashUp {
  0% { transform: translateY(10px) scaleY(0.3); opacity: 0; }
  35% { transform: translateY(-26px) scaleY(1.15); opacity: 1; }
  100% { transform: translateY(-46px) scaleY(0.7); opacity: 0; }
}

/* Finalda cho'kib qolgan o'yinchi: faqat suv yuzasidagi pufakchalar qoladi */
.ice-cell.drowned .ice-peng, .ice-cell.drowned .ice-floe { opacity: 0; }
.ice-cell.drowned .ice-label { opacity: 0.5; }
.ice-cell.drowned::before {
  content: '💧'; position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  font-size: 1.5rem; opacity: 0.75; animation: bubbleUp 2.4s ease-in-out infinite;
}
@keyframes bubbleUp {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.65; }
  50% { transform: translateX(-50%) translateY(-12px); opacity: 0.35; }
}

.ice-cell.champ .ice-peng svg { animation: champHop 0.5s ease-in-out infinite alternate; }
@keyframes champHop { to { transform: translateY(-18px); } }
.ice-cell.champ .ice-floe { filter: drop-shadow(0 0 16px rgba(255, 214, 90, 0.95)); }
.ice-burst { position: absolute; left: 50%; top: 40%; z-index: 8; pointer-events: none; }
.ice-burst .burst-p { position: absolute; left: -4px; top: -4px; }

/* Yorug' fon uchun yadro matn ranglari */
.ice-world .g-counter { color: #0f3c5c; }
.ice-world .g-score { color: #b45309; }
.ice-world .g-timebar-wrap { background: rgba(255, 255, 255, 0.6); }
.ice-world .g-status { color: #1c4a6e; }
.ice-world .g-status.right { color: #0f6b3d; }
.ice-world .g-status.wrong { color: #b3261e; }
.ice-world .g-countdown { background: rgba(220, 242, 255, 0.88); color: #0f3c5c; }
.ice-world .g-final-title,
.ice-world .finale-title { color: #0f3c5c; text-shadow: 0 2px 8px rgba(255, 255, 255, 0.85); }
.ice-world .g-podium-name { color: #0f3c5c; }
.ice-world .g-podium-score { color: #b45309; }
@media (max-width: 720px) {
  .ice-cell { width: 108px; height: 112px; }
  .ice-lake { padding-top: 76px; gap: 8px 10px; }
}

/* ===== Sharlar jangi (jamoaviy: ovchilar va pufaklar, 2.5D) ===== */
.sj-world {
  position: relative; border-radius: 16px; overflow: hidden; padding: 0;
  background: #140b1c; box-shadow: 0 10px 34px rgba(40, 0, 0, 0.55);
}
.sj-stage {
  position: relative; width: 100%; height: 480px; overflow: hidden;
  background: #140b1c; user-select: none; touch-action: none;
}
.sj-stage.sj-ovchi { cursor: none; }
.sj-canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 900px) { .sj-stage { height: 360px; } }


.sj-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 14px; font-family: 'Segoe UI', sans-serif;
}
.sj-hud-chap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sj-jamoa, .sj-resurs, .sj-holat, .sj-korinish {
  background: rgba(14, 8, 22, 0.72); border-radius: 10px; padding: 5px 12px;
  font-weight: 800; color: #f3e9ff; border: 1px solid rgba(255, 255, 255, 0.14);
}
.sj-korinish:empty, .sj-resurs:empty { display: none; }
.sj-jamoa.ovchi { color: #ffb070; border-color: rgba(255, 140, 60, 0.6); }
.sj-jamoa.pufak { color: #8fd0ff; border-color: rgba(90, 170, 255, 0.6); }
.sj-resurs { font-size: 1.3rem; color: #fff3c4; }
.sj-resurs.bosh { color: #ff6b6b; border-color: rgba(255, 80, 80, 0.8); animation: ammoWarn 0.9s ease-in-out infinite; }
.sj-holat { font-size: 0.95rem; }
.sj-h-ovchi { color: #ffb070; }
.sj-h-pufak { color: #8fd0ff; }

.sj-ishora {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4;
  pointer-events: none; font-size: 0.85rem; font-weight: 600; color: rgba(255, 236, 214, 0.85);
  background: rgba(14, 8, 22, 0.55); border-radius: 8px; padding: 4px 12px; white-space: nowrap;
}
.sj-ishora { transition: opacity 0.6s; }
.sj-ishora.yashir, .sj-ishora:empty { opacity: 0; }
.sj-toast {
  position: absolute; left: 50%; top: 24%; transform: translate(-50%, -50%) scale(0.9);
  z-index: 6; pointer-events: none; opacity: 0;
  background: rgba(14, 8, 22, 0.82); border-radius: 10px; padding: 8px 18px;
  font-weight: 900; font-size: 1.15rem; color: #fff; white-space: nowrap;
  transition: opacity 0.2s, transform 0.2s;
}
.sj-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sj-toast.good { color: #7dffb0; border: 1px solid rgba(125, 255, 176, 0.5); }
.sj-toast.bad { color: #ff8a7a; border: 1px solid rgba(255, 110, 90, 0.6); }
.sj-toast.warn { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.5); }

.sj-banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.6);
  z-index: 7; pointer-events: none; opacity: 0; white-space: nowrap;
  font-size: 2.4rem; font-weight: 900; letter-spacing: 1px; color: #fff;
  transition: opacity 0.35s, transform 0.35s;
}
.sj-banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sj-banner.pufak { color: #8fd0ff; text-shadow: 0 0 24px rgba(80, 170, 255, 0.9); }
.sj-banner.ovchi { color: #ffb070; text-shadow: 0 0 24px rgba(255, 120, 40, 0.9); }

/* Sensorli ekran: qutini suzish tugmalari (faqat pufak o'yinchisida) */
.sj-tugmalar {
  position: absolute; right: 12px; bottom: 44px; z-index: 5; display: none; gap: 10px;
}
.sj-stage.sj-pufak .sj-tugmalar { display: flex; }
.sj-stage.sj-yondi .sj-tugmalar, .sj-stage.sj-tugadi .sj-tugmalar, .sj-stage.sj-tugadi .sj-ishora { display: none; }
.sj-tugma {
  width: 58px; height: 58px; border-radius: 14px; border: 2px solid rgba(143, 208, 255, 0.7);
  background: rgba(14, 30, 60, 0.7); color: #cfe9ff; font-size: 1.6rem; font-weight: 900;
  touch-action: none; cursor: pointer;
}
.sj-tugma:active { background: rgba(40, 90, 160, 0.85); }

@media (max-width: 600px) {
  .sj-hud { padding: 6px 8px; gap: 6px; }
  .sj-jamoa, .sj-resurs, .sj-holat, .sj-korinish { font-size: 0.74rem; padding: 3px 8px; white-space: nowrap; }
  .sj-resurs { font-size: 0.95rem; }
  .sj-holat { white-space: normal; text-align: right; }
  .sj-holat .sj-vs { display: none; }
  .sj-h-ovchi, .sj-h-pufak { display: block; }
  .sj-ishora { font-size: 0.72rem; white-space: normal; width: 88%; text-align: center; }
  .sj-tugma { width: 50px; height: 50px; }
  .sj-banner { font-size: 1.6rem; }
}

/* Qorong'u dunyo uchun savol paneli */
.sj-world .g-qarea { padding: 14px 16px 18px; background: #120a18; }
.sj-world .g-counter { color: #e6d8f2; }
.sj-world .g-score { color: #ffb070; }
.sj-world .g-timebar-wrap { background: rgba(255, 255, 255, 0.12); }
.sj-world .g-timebar { background: linear-gradient(90deg, #d9480f, #ffb703); }
.sj-world .g-question {
  background: #1d1226; color: #fbf3ff; font-size: 1.15rem; padding: 16px 18px;
  border: 1px solid rgba(255, 140, 60, 0.25);
}
.sj-world .g-status { color: #d9c9e8; }
.sj-world .g-status.right { color: #7dffb0; }
.sj-world .g-status.wrong { color: #ff8a7a; }
.sj-world .g-countdown { background: rgba(20, 11, 28, 0.9); color: #ffb070; }
.sj-world .g-final-title, .sj-world .finale-title { color: #ffd6a8; text-shadow: 0 0 22px rgba(255, 120, 40, 0.7); }
.sj-world .g-ans { padding: 13px 15px; font-size: 1rem; }

/* Jamoa natijasi (yadro — renderJamoa) */
.tj-jamoalar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .tj-jamoalar { grid-template-columns: 1fr; } }
.tj-jamoa h3 { margin-top: 0; }
.tj-jamoa.tj-ovchi { border-top: 4px solid #e8590c; }
.tj-jamoa.tj-pufak { border-top: 4px solid #1c7ed6; }
.tj-jamoa.tj-golib { box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.8), 0 8px 24px rgba(0, 0, 0, 0.25); }
.tj-jamoa .g-standing-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 90px; }
.tj-hissa { font-size: 0.88rem; font-weight: 700; color: #495057; text-align: right; }
.tj-hissa.tj-tirik { color: #2b8a3e; }
.tj-hissa.tj-yondi { color: #c92a2a; }
.tj-natija.right { color: #2b8a3e; }
.tj-natija.wrong { color: #c92a2a; }

/* ===== Virus quvg'ini ===== */
.virus-world {
  position: relative; overflow: hidden; border-radius: 18px; padding: 18px;
  background: radial-gradient(900px 400px at 70% -10%, #0d3b4a 0%, #07202c 50%, #04121a 100%);
  box-shadow: 0 8px 26px rgba(4, 18, 26, 0.5);
}
/* Mikrosxema yo'llari */
.circuit {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(90deg, rgba(60, 220, 200, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(60, 220, 200, 0.1) 1px, transparent 1px);
  background-size: 54px 54px;
}
.circuit-2 {
  opacity: 0.35;
  background-image:
    radial-gradient(2.5px 2.5px at 27px 27px, rgba(90, 255, 220, 0.75), transparent 60%),
    radial-gradient(2px 2px at 135px 81px, rgba(90, 255, 220, 0.5), transparent 60%);
  background-size: 162px 162px;
  animation: circuitPulse 3.2s ease-in-out infinite;
}
@keyframes circuitPulse { 50% { opacity: 0.12; } }
/* Ma'lumot bitlari oqimi */
.databits {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; opacity: 0.22;
  background-image:
    linear-gradient(90deg, transparent 0%, rgba(90, 255, 220, 0.7) 45%, transparent 50%);
  background-size: 240px 100%;
  animation: bitFlow 3.4s linear infinite;
}
@keyframes bitFlow { to { background-position: 240px 0; } }

.v-track { position: relative; z-index: 2; margin-bottom: 16px; padding-right: 54px; }
.v-safe {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 1; line-height: 0;
  animation: safeGlow 2.4s ease-in-out infinite;
}
@keyframes safeGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(90, 220, 160, 0.5)); transform: translateY(-50%) scale(1); }
  50% { filter: drop-shadow(0 0 16px rgba(90, 220, 160, 0.95)); transform: translateY(-50%) scale(1.07); }
}

.v-lane {
  position: relative; height: 62px; border-radius: 10px; margin-bottom: 4px;
  border-bottom: 1px dashed rgba(90, 255, 220, 0.14);
  transition: background 0.4s;
}
.v-lane.danger { background: linear-gradient(90deg, rgba(255, 138, 61, 0.16), transparent 70%); }
.v-lane.critical { background: linear-gradient(90deg, rgba(229, 72, 77, 0.3), transparent 75%); }
.v-lane.critical::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 10px;
  border: 1.5px solid rgba(229, 72, 77, 0.55); animation: dangerBlink 0.7s ease-in-out infinite;
}
@keyframes dangerBlink { 50% { opacity: 0.25; } }
.v-lane.saved { background: linear-gradient(90deg, transparent, rgba(90, 220, 160, 0.28) 80%); }

.v-file {
  position: absolute; left: 58%; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; align-items: center; gap: 8px; line-height: 0; white-space: nowrap;
}
.v-file svg { animation: fileRun 0.42s ease-in-out infinite alternate; }
@keyframes fileRun { to { transform: translateY(-4px); } }
.f-legs .f-leg1 { animation: legA 0.3s linear infinite alternate; transform-origin: 16px 54px; transform-box: fill-box; }
.f-legs .f-leg2 { animation: legB 0.3s linear infinite alternate; transform-origin: 31px 54px; transform-box: fill-box; }
@keyframes legA { to { transform: rotate(34deg); } }
@keyframes legB { to { transform: rotate(-34deg); } }
.v-label {
  background: rgba(255, 255, 255, 0.14); color: #dff7ff; border-radius: 14px;
  padding: 3px 10px; font-size: 0.78rem; font-weight: 700; line-height: 1.4;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
.v-file.hop svg { animation: fileHop 0.65s cubic-bezier(0.34, 1.4, 0.5, 1); }
@keyframes fileHop {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-22px) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}
.v-file.hit svg { animation: fileHit 0.4s linear 2; }
@keyframes fileHit {
  0%, 100% { transform: translateX(0); filter: none; }
  50% { transform: translateX(-7px); filter: hue-rotate(-40deg) brightness(1.4); }
}
.v-file.escape svg { animation: fileRun 0.18s ease-in-out infinite alternate; }
.v-file.escape .v-label { opacity: 0; transition: opacity 0.3s; }
.v-file { transition: opacity 0.4s, transform 0.3s; }

.v-virus {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 2; line-height: 0;
  transition: left 1s cubic-bezier(0.4, 0, 0.5, 1);
  filter: drop-shadow(0 0 8px rgba(63, 190, 85, 0.55));
}
.v-virus svg { animation: virusBob 0.5s ease-in-out infinite alternate; }
@keyframes virusBob { to { transform: translateY(-5px) rotate(-7deg); } }
.v-spin { transform-box: fill-box; transform-origin: 50% 50%; animation: spikeSpin 6s linear infinite; }
@keyframes spikeSpin { to { transform: rotate(360deg); } }
.v-virus.grow { transition: transform 0.5s ease; transform: translateY(-50%) scale(1.45); }

.v-infect {
  position: absolute; left: 58%; top: 50%; transform: translate(-50%, -50%); z-index: 6;
  font-size: 2.2rem; pointer-events: none; animation: infectPop 0.9s ease-out forwards;
}
@keyframes infectPop {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; }
}
.v-lane.shake-lane { animation: laneShake 0.4s linear; }
@keyframes laneShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(4px); }
}
.v-saved-badge {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 7;
  font-size: 1.5rem; animation: titlePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Arqon tortish (doskaviy o'yin) ===== */
.board-main { max-width: 1200px; margin: 0 auto; padding: 14px 16px 40px; }

.b-top { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.b-team { flex: 1; text-align: center; }
.b-team-name {
  display: inline-block; font-weight: 900; font-size: 1.25rem; padding: 8px 22px; border-radius: 14px; color: #fff;
}
.b-team-left .b-team-name { background: #1368ce; }
.b-team-right .b-team-name { background: #ff8a3d; }
.b-mid { flex: 2; text-align: center; }
.b-counter { font-weight: 800; color: var(--muted); margin-bottom: 4px; min-height: 20px; }
.b-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.b-dot { width: 12px; height: 12px; border-radius: 50%; background: #d9ddf0; }
.b-dot.center { background: var(--red); width: 8px; height: 16px; border-radius: 4px; }
.b-dot.knot { background: #ffd166; box-shadow: 0 0 8px rgba(255, 190, 60, 0.9); transform: scale(1.25); }
.b-timebar-wrap { height: 10px; background: #e2e5f5; border-radius: 8px; overflow: hidden; }
.b-timebar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #ffd166); }

/* Sahna: osmon, quyosh, bulutlar, maysazor */
.b-scene {
  position: relative; height: 240px; border-radius: 18px; overflow: hidden; margin-bottom: 12px;
  background: linear-gradient(180deg, #8ecdf5 0%, #bfe4fb 55%, #dff2ff 100%);
  box-shadow: var(--shadow);
}
.b-sun {
  position: absolute; top: 16px; right: 28px; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6c9, #ffd93b 60%, #ffb703);
  box-shadow: 0 0 34px rgba(255, 217, 59, 0.85);
  animation: sunPulse 5s ease-in-out infinite;
}
@keyframes sunPulse { 50% { box-shadow: 0 0 48px rgba(255, 217, 59, 1); } }
.b-cloud {
  position: absolute; width: 110px; height: 32px; border-radius: 20px; background: rgba(255, 255, 255, 0.92);
  box-shadow: 18px -12px 0 -2px rgba(255, 255, 255, 0.92), 44px -6px 0 0 rgba(255, 255, 255, 0.85);
  animation: cloudDrift 26s linear infinite;
}
.b-cloud-1 { top: 34px; left: -140px; }
.b-cloud-2 { top: 78px; left: -260px; transform: scale(0.7); animation-duration: 34s; }
@keyframes cloudDrift { to { transform: translateX(1500px); } }
.b-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: linear-gradient(180deg, #7ec850, #58a832);
}
.b-ground::before {
  content: ''; position: absolute; top: -6px; left: 0; right: 0; height: 10px;
  background: radial-gradient(6px 6px at 10px 6px, #6dbb42 60%, transparent 61%);
  background-size: 26px 10px;
}
.b-centerline {
  position: absolute; bottom: 0; left: 50%; width: 5px; height: 44px; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, #e5484d 0 9px, #fff 9px 18px);
  border-radius: 3px; box-shadow: 0 0 10px rgba(229, 72, 77, 0.35);
}

/* Qushlar, tepaliklar, gullar */
.b-bird { position: absolute; top: 34px; left: -40px; animation: birdFly 26s linear infinite; }
.b-bird-2 { top: 66px; animation-duration: 36s; animation-delay: 9s; }
@keyframes birdFly {
  0% { transform: translate(0, 0); }
  25% { transform: translate(320px, -10px); }
  50% { transform: translate(640px, 5px); }
  75% { transform: translate(960px, -7px); }
  100% { transform: translate(1340px, 0); }
}
.b-hill {
  position: absolute; bottom: 34px; left: -70px; width: 360px; height: 100px;
  border-radius: 50%; background: #8fd06a; opacity: 0.45;
}
.b-hill-2 { left: auto; right: -90px; width: 320px; height: 76px; opacity: 0.35; }
.b-ground::after {
  content: ''; position: absolute; top: 8px; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(3px 3px at 22px 12px, #fff 60%, transparent 61%),
    radial-gradient(2px 2px at 22px 11px, #ffd166 70%, transparent 71%),
    radial-gradient(3px 3px at 96px 24px, #fff 60%, transparent 61%),
    radial-gradient(2px 2px at 96px 23px, #ff8a3d 70%, transparent 71%),
    radial-gradient(2.5px 2.5px at 150px 14px, #ffe9f0 60%, transparent 61%);
  background-size: 190px 36px; opacity: 0.85;
}

/* Robotlar va arqon — bitta SVG rig */
.b-rig {
  position: absolute; left: 50%; bottom: 24px; line-height: 0;
  width: 46%; max-width: 520px;
  transform: translateX(-50%);
  transition: transform 0.8s cubic-bezier(0.34, 1.3, 0.5, 1);
}
.b-rigsvg {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 5px 5px rgba(20, 60, 10, 0.25)); overflow: visible;
}
.b-rigsvg .bot {
  transform-box: fill-box; transform-origin: 50% 100%;
  animation: strain 2.4s ease-in-out infinite;
}
#botR { animation-delay: 1.2s; }
@keyframes strain {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(-10.5deg); }
}
.b-rigsvg .bot.heave { animation: heaveBot 0.75s ease; }
@keyframes heaveBot {
  35% { transform: rotate(-19deg) translateY(3px); }
  70% { transform: rotate(-3deg); }
  100% { transform: rotate(-8deg); }
}
.b-rigsvg .bot.win { animation: hopBot 0.55s ease infinite alternate; }
@keyframes hopBot {
  from { transform: rotate(0deg) translateY(0); }
  to { transform: rotate(0deg) translateY(-20px); }
}
.b-rigsvg .bot.fall { animation: fallBot 0.9s ease forwards; }
@keyframes fallBot { to { transform: rotate(72deg) translateY(2px); } }
.b-rope-main, .b-rope-tex { transition: d 0.7s ease; }
.antled { animation: ledBlink 1.6s ease-in-out infinite; }
@keyframes ledBlink { 50% { opacity: 0.25; } }
.b-knotg { transform-box: fill-box; transform-origin: 50% 0; }
.b-knotg.swing { animation: knotSwing 0.8s ease; }
@keyframes knotSwing {
  25% { transform: rotate(9deg); }
  60% { transform: rotate(-7deg); }
  100% { transform: rotate(0deg); }
}

/* Tortish effektlari: chang va tomon yorug'ligi */
.b-puff {
  position: absolute; width: 16px; height: 16px; border-radius: 50%; z-index: 4; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(198, 205, 218, 0.55) 65%, transparent);
  animation: puffUp 0.8s ease-out forwards;
}
@keyframes puffUp {
  0% { opacity: 0.9; transform: scale(0.4) translateY(0); }
  100% { opacity: 0; transform: scale(1.7) translateY(-20px); }
}
.b-scene { transition: box-shadow 0.3s; }
.b-scene.glow-left { box-shadow: inset 16px 0 36px -6px rgba(19, 104, 206, 0.55), var(--shadow); }
.b-scene.glow-right { box-shadow: inset -16px 0 36px -6px rgba(255, 138, 61, 0.6), var(--shadow); }

/* Savol va variantlar */
.board-page .b-question {
  font-size: 1.3rem; font-weight: 700; text-align: center; padding: 18px 20px; margin-bottom: 8px;
}
.b-status { text-align: center; font-weight: 900; font-size: 1.2rem; min-height: 30px; margin-bottom: 8px; }
.b-status.left { color: #1368ce; }
.b-status.right { color: #ff8a3d; }
.b-status.neutral { color: var(--muted); }

.b-options { display: flex; justify-content: space-between; gap: 20px; }
.b-col { display: flex; flex-direction: column; gap: 10px; width: 42%; position: relative; }
.b-col-mid { width: 60%; margin: 0 auto; }
.b-opt {
  display: flex; align-items: center; gap: 10px; border: 0; border-radius: 12px; padding: 14px 16px;
  font: inherit; font-weight: 700; font-size: 1.02rem; color: #fff; cursor: pointer; text-align: left;
  transition: transform 0.07s, opacity 0.2s;
}
.b-opt:not(:disabled):not(.readonly):hover { transform: translateY(-2px); }
.b-opt.readonly { cursor: default; }
.b-opt-0 { background: #e21b3c; }
.b-opt-1 { background: #1368ce; }
.b-opt-2 { background: #d89e00; }
.b-opt-3 { background: #26890c; }
.b-shape { font-size: 1.1rem; }
.b-opt-text { flex: 1; }
.b-opt.correct { outline: 4px solid #fff; box-shadow: 0 0 0 7px rgba(46, 184, 114, 0.5); }
.b-opt.dimmed { opacity: 0.32; }
.b-col.locked .b-opt { opacity: 0.3; pointer-events: none; }
.b-lock-msg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 900; color: var(--red);
}

.b-countdown {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.55); font-size: 4.4rem; font-weight: 900; color: var(--primary); z-index: 6;
}

.b-judge { display: flex; justify-content: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.b-judge-btn { color: #fff; font-size: 1.05rem; padding: 14px 22px; }
.b-judge-l { background: #1368ce; }
.b-judge-r { background: #ff8a3d; }

.b-banner {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 16px; padding: 14px 30px; white-space: nowrap;
  font-size: 1.7rem; font-weight: 900; color: var(--ink); box-shadow: var(--shadow);
  animation: titlePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 7;
}
.b-burst { position: absolute; z-index: 8; pointer-events: none; }
.b-burst .burst-p { left: -5px; top: -5px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

/* Konfetti yomg'iri */
.b-conf {
  position: absolute; z-index: 8; pointer-events: none; border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* G'olib atrofidagi nur */
.b-aura {
  position: absolute; z-index: 3; width: 190px; height: 190px; margin: -95px 0 0 -95px;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 235, 150, 0.55) 0%, rgba(255, 214, 90, 0.25) 45%, transparent 70%);
  animation: auraPulse 1.6s ease-in-out infinite;
}
@keyframes auraPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.75; }
  50% { transform: scale(1.15); opacity: 1; }
}
.b-star {
  position: absolute; z-index: 9; pointer-events: none; color: #ffdf5e; font-size: 2rem; line-height: 1;
  margin: -16px 0 0 -12px;
  text-shadow: 0 0 14px rgba(255, 209, 102, 1), 0 0 4px #fff;
  animation: starOrbit 2.6s linear infinite;
}
@keyframes starOrbit {
  from { transform: rotate(var(--ang)) translateX(72px) rotate(calc(-1 * var(--ang))) scale(0.7); opacity: 0.4; }
  50% { transform: rotate(calc(var(--ang) + 180deg)) translateX(72px) rotate(calc(-1 * var(--ang) - 180deg)) scale(1.15); opacity: 1; }
  to { transform: rotate(calc(var(--ang) + 360deg)) translateX(72px) rotate(calc(-1 * var(--ang) - 360deg)) scale(0.7); opacity: 0.4; }
}

/* G'alaba paytida osmon yorishadi */
.b-scene.victory { background: linear-gradient(180deg, #a5dcff 0%, #d4f0ff 50%, #eafaff 100%); }
.b-scene.victory .b-sun { animation: sunParty 1.2s ease-in-out infinite; }
@keyframes sunParty {
  0%, 100% { transform: scale(1) rotate(0deg); box-shadow: 0 0 34px rgba(255, 217, 59, 0.85); }
  50% { transform: scale(1.2) rotate(18deg); box-shadow: 0 0 60px rgba(255, 217, 59, 1); }
}
.b-end { text-align: center; margin-top: 16px; display: flex; gap: 12px; justify-content: center; }

/* ===================================================================
   DARS O'TISH BO'LIMI
   =================================================================== */

/* ---- Chorak va dars ro'yxatlari ---- */
.lead-note { margin: -6px 0 22px; max-width: 720px; line-height: 1.6; }
.source-note {
  color: var(--muted); font-size: 0.85rem; margin: -8px 0 20px;
  padding-left: 12px; border-left: 3px solid #dfe2f2;
}

.quarter-card { display: flex; align-items: center; gap: 16px; }
.quarter-num {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 900; color: #fff;
  background: linear-gradient(145deg, #6c6cf0, #4747b8);
  box-shadow: 0 4px 10px rgba(71, 71, 184, 0.35);
}
.quarter-body { min-width: 0; }
.quarter-module { color: var(--ink); opacity: 0.75; font-size: 0.95rem; margin: 2px 0 4px; }

.lesson-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-card {
  display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31, 36, 64, 0.13); }
.lesson-num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 900; font-size: 1.15rem;
  background: #eceef8; color: var(--primary);
}
.lesson-body { flex: 1; min-width: 0; }
.lesson-title { font-weight: 800; font-size: 1.08rem; color: var(--ink); }
.lesson-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 7px 0 8px; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  background: #eef1ff; color: var(--primary); font-size: 0.78rem; font-weight: 700;
}
.chip-soft { background: #f3f4f9; color: var(--muted); }
.lesson-goal { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.lesson-go { flex: 0 0 auto; color: var(--primary); font-size: 1.3rem; align-self: center; }

/* ---- Slaydlar (elektron doska) ---- */
.deck-body { background: #eef1fa; overflow: hidden; }
.deck {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; flex-direction: column;
  background: linear-gradient(165deg, #f7f9ff 0%, #eaeffb 55%, #e3e9f8 100%);
}

.deck-top {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #dde2f0;
}
.deck-exit {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #eceef8; color: var(--muted); font-size: 1.1rem; font-weight: 700; flex: 0 0 auto;
}
.deck-exit:hover { background: #e0e3f2; color: var(--ink); }
.deck-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.deck-lesson-no {
  flex: 0 0 auto; padding: 3px 11px; border-radius: 20px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 0.82rem;
}
.deck-lesson-name {
  font-weight: 800; font-size: 1.05rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deck-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.deck-pages { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.deck-btn {
  width: 38px; height: 38px; border: 0; border-radius: 10px; cursor: pointer;
  background: #eceef8; color: var(--muted); font-size: 1.05rem;
}
.deck-btn:hover { background: #e0e3f2; color: var(--ink); }

.deck-progress { flex: 0 0 auto; height: 4px; background: #dde2f0; }
.deck-progress-fill {
  height: 100%; width: 0; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #6c6cf0, #ff8a3d);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.deck-stage { flex: 1; position: relative; overflow: hidden; cursor: pointer; }

.slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; padding: 40px clamp(24px, 6vw, 88px);
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateX(46px);
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s;
  overflow-y: auto;
}
.slide.is-past { transform: translateX(-46px); }
.slide.is-on { opacity: 1; visibility: visible; transform: translateX(0); }

/* Slayd sarlavhasi */
.s-h {
  font-size: clamp(1.5rem, 3.1vw, 2.9rem); font-weight: 900; color: var(--ink);
  margin-bottom: clamp(18px, 3vh, 34px); line-height: 1.2;
  position: relative; padding-bottom: 14px;
}
.s-h::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 74px; height: 5px;
  border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Sarlavha slaydi */
.s-hero { text-align: center; }
.s-hero-mark {
  width: 84px; height: 84px; margin: 0 auto 28px; border-radius: 24px;
  background: linear-gradient(145deg, #6c6cf0, #4747b8);
  box-shadow: 0 12px 30px rgba(71, 71, 184, 0.4);
  position: relative; animation: heroFloat 3.4s ease-in-out infinite;
}
/* chizilgan hujjat belgisi */
.s-hero-mark::before {
  content: ''; position: absolute; top: 22px; right: 26px; bottom: 22px; left: 26px; inset: 22px 26px;
  background: #fff; border-radius: 4px;
}
.s-hero-mark::after {
  content: ''; position: absolute; left: 32px; right: 32px; top: 30px; height: 3px;
  border-radius: 2px; background: #6c6cf0;
  box-shadow: 0 8px 0 #6c6cf0, 0 16px 0 rgba(108, 108, 240, 0.5);
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
.s-hero-title {
  font-size: clamp(2rem, 5.2vw, 4rem); font-weight: 900; line-height: 1.12;
  background: linear-gradient(120deg, #4747b8, #6c6cf0 45%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.s-hero-sub { margin-top: 16px; font-size: clamp(1rem, 1.9vw, 1.4rem); color: var(--muted); font-weight: 600; }

/* Maqsadlar */
.s-goals { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.s-goals li {
  display: flex; align-items: flex-start; gap: 16px;
  font-size: clamp(1rem, 1.85vw, 1.5rem); line-height: 1.45; font-weight: 600;
}
.s-check {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; margin-top: 2px;
  background: linear-gradient(145deg, #3ecf8e, #2eb872); position: relative;
  box-shadow: 0 3px 8px rgba(46, 184, 114, 0.35);
}
/* chizilgan tasdiq belgisi */
.s-check::after {
  content: ''; position: absolute; left: 10px; top: 6px; width: 8px; height: 14px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(42deg);
}

/* Oddiy matn */
.s-text { max-width: 1100px; }
.s-text p {
  font-size: clamp(1rem, 1.9vw, 1.55rem); line-height: 1.6; margin-bottom: 18px; color: #2b3050;
}
.s-text p:last-child { margin-bottom: 0; }
.s-text strong, .s-goals strong, .s-card-p strong, .s-step-t strong,
.s-note-p strong, .s-note-list strong, .s-sum strong, .s-key-d strong {
  color: var(--primary-dark); font-weight: 900;
}
kbd {
  display: inline-block; font: inherit; font-weight: 800; font-size: 0.92em;
  padding: 1px 9px; margin: 0 1px; border-radius: 7px;
  background: #fff; color: #33386b;
  border: 1px solid #cfd5ea; border-bottom-width: 3px;
}

/* Kartalar ro'yxati */
.s-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.s-card {
  background: #fff; border-radius: 16px; padding: 20px 22px;
  border-left: 6px solid var(--primary);
  box-shadow: 0 6px 18px rgba(31, 36, 64, 0.08);
  animation: slideIn 0.45s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.07s);
}
.s-card:nth-child(4n+2) { border-left-color: var(--accent); }
.s-card:nth-child(4n+3) { border-left-color: var(--green); }
.s-card:nth-child(4n+4) { border-left-color: #e5a33d; }
.s-card-b { font-weight: 900; font-size: clamp(1rem, 1.6vw, 1.3rem); margin-bottom: 6px; color: var(--ink); }
.s-card-p { font-size: clamp(0.95rem, 1.45vw, 1.45rem); line-height: 1.5; color: #4a5070; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Kalit so'zlar */
.s-keys { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.s-key {
  background: #fff; border-radius: 14px; padding: 16px 20px;
  box-shadow: 0 5px 16px rgba(31, 36, 64, 0.08);
  animation: slideIn 0.45s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.07s);
}
.s-key-w {
  display: inline-block; font-weight: 900; font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  color: #fff; background: linear-gradient(135deg, #6c6cf0, #4747b8);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 9px;
}
.s-key-d { font-size: clamp(0.92rem, 1.4vw, 1.4rem); line-height: 1.5; color: #4a5070; }

/* Qadamlar */
.s-steps { list-style: none; display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.s-steps li {
  display: flex; align-items: flex-start; gap: 16px;
  background: #fff; border-radius: 13px; padding: 14px 20px;
  box-shadow: 0 4px 12px rgba(31, 36, 64, 0.07);
  animation: slideIn 0.4s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.06s);
}
.s-step-n {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: 1rem;
  background: linear-gradient(145deg, #6c6cf0, #4747b8); color: #fff;
}
.s-step-t { font-size: clamp(1rem, 1.6vw, 1.55rem); line-height: 1.5; padding-top: 4px; }
.s-steps-task .s-step-n { background: linear-gradient(145deg, #ffa45c, #ff8a3d); }

.s-h-task { display: flex; align-items: center; gap: 14px; }
/* chizilgan qalam belgisi */
.s-task-mark {
  width: 34px; height: 34px; flex: 0 0 auto; position: relative;
  background: linear-gradient(145deg, #ffa45c, #ff8a3d); border-radius: 9px;
}
.s-task-mark::before {
  content: ''; position: absolute; left: 15px; top: 7px; width: 4px; height: 15px;
  background: #fff; border-radius: 2px; transform: rotate(38deg);
}
.s-task-mark::after {
  content: ''; position: absolute; left: 14px; top: 21px; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 6px solid #fff; transform: rotate(38deg);
}

/* Klaviatura tugmalari */
.s-keyboard { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.s-kb-row {
  display: flex; align-items: center; gap: 22px;
  background: #fff; border-radius: 14px; padding: 16px 22px;
  box-shadow: 0 5px 16px rgba(31, 36, 64, 0.08);
  animation: slideIn 0.45s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.07s);
}
.s-kb-key {
  flex: 0 0 auto; min-width: 118px; text-align: center;
  padding: 12px 18px; border-radius: 11px;
  font-weight: 900; font-size: clamp(0.95rem, 1.5vw, 1.2rem); color: #33386b;
  background: linear-gradient(180deg, #ffffff, #eef0f8);
  border: 2px solid #ccd2e8; border-bottom-width: 6px;
  box-shadow: 0 3px 6px rgba(31, 36, 64, 0.12);
}
.s-kb-d { font-size: clamp(0.95rem, 1.45vw, 1.45rem); line-height: 1.5; color: #4a5070; }

/* Eslatma bloklari */
.s-note {
  max-width: 1000px; margin: 0 auto; background: #fff; border-radius: 20px;
  padding: clamp(24px, 4vw, 42px); position: relative;
  box-shadow: 0 12px 34px rgba(31, 36, 64, 0.12);
  border-top: 7px solid var(--primary);
}
.s-note-bilasizmi { border-top-color: #3aa7e0; }
.s-note-maslahat { border-top-color: var(--green); }
.s-note-diqqat { border-top-color: var(--red); }
.s-note-badge {
  position: absolute; top: -16px; left: clamp(24px, 4vw, 42px);
  padding: 5px 18px; border-radius: 20px; color: #fff;
  font-weight: 900; font-size: 0.85rem; letter-spacing: 0.3px;
  background: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.s-note-bilasizmi .s-note-badge { background: #3aa7e0; }
.s-note-maslahat .s-note-badge { background: var(--green); }
.s-note-diqqat .s-note-badge { background: var(--red); }
.s-note-h { font-size: clamp(1.3rem, 2.6vw, 2.5rem); font-weight: 900; margin: 8px 0 16px; }
.s-note-p { font-size: clamp(1rem, 1.8vw, 1.45rem); line-height: 1.6; color: #2b3050; }
.s-note-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.s-note-list li {
  position: relative; padding-left: 30px;
  font-size: clamp(1rem, 1.7vw, 1.6rem); line-height: 1.55; color: #2b3050;
}
.s-note-list li::before {
  content: ''; position: absolute; left: 0; top: 0.52em; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary);
}
.s-note-diqqat .s-note-list li::before { background: var(--red); }
.s-note-maslahat .s-note-list li::before { background: var(--green); }

/* Savol slaydi */
.s-quiz { max-width: 1000px; margin: 0 auto; width: 100%; }
.s-quiz-badge {
  display: inline-block; padding: 5px 18px; border-radius: 20px; margin-bottom: 16px;
  background: var(--accent); color: #fff; font-weight: 900; font-size: 0.85rem;
}
.s-quiz-q {
  font-size: clamp(1.3rem, 2.7vw, 2.5rem); font-weight: 900; line-height: 1.28;
  margin-bottom: clamp(18px, 3vh, 30px);
}
.s-quiz-opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.s-opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  font: inherit; font-size: clamp(1rem, 1.55vw, 1.5rem); font-weight: 600;
  border: 3px solid transparent; border-radius: 14px; padding: 15px 18px; cursor: pointer;
  background: #fff; color: var(--ink);
  box-shadow: 0 5px 15px rgba(31, 36, 64, 0.08);
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
}
.s-opt:hover { transform: translateY(-2px); }
.s-opt-l {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 900;
  background: #eceef8; color: var(--primary);
}
.s-quiz.revealed .s-opt.is-correct {
  border-color: var(--green); background: #eafaf2;
  animation: quizPop 0.4s cubic-bezier(0.34, 1.5, 0.5, 1);
}
.s-quiz.revealed .s-opt.is-correct .s-opt-l { background: var(--green); color: #fff; }
.s-quiz.revealed .s-opt.is-picked:not(.is-correct) {
  border-color: var(--red); background: #fdeded; opacity: 0.85;
}
.s-quiz.revealed .s-opt.is-picked:not(.is-correct) .s-opt-l { background: var(--red); color: #fff; }
@keyframes quizPop {
  0% { transform: scale(1); }
  55% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
.s-quiz-why {
  margin-top: 18px; padding: 15px 20px; border-radius: 13px;
  background: #eafaf2; border-left: 5px solid var(--green);
  font-size: clamp(0.95rem, 1.45vw, 1.35rem); line-height: 1.55; color: #1f5c40;
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s;
}
.s-quiz.revealed .s-quiz-why { opacity: 1; transform: translateY(0); }

/* Xulosa */
.s-sum { list-style: none; display: flex; flex-direction: column; gap: 13px; max-width: 1000px; }
.s-sum li {
  position: relative; padding: 15px 20px 15px 56px; border-radius: 13px; background: #fff;
  font-size: clamp(1rem, 1.65vw, 1.6rem); line-height: 1.5;
  box-shadow: 0 4px 12px rgba(31, 36, 64, 0.07);
  animation: slideIn 0.4s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.07s);
}
.s-sum li::before {
  content: ''; position: absolute; left: 20px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; border-radius: 5px;
  background: linear-gradient(145deg, #6c6cf0, #4747b8);
}

/* Pastki boshqaruv */
.deck-bottom {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid #dde2f0;
}
.deck-nav {
  width: 46px; height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  font-size: 1.7rem; line-height: 1; font-weight: 700;
  background: var(--primary); color: #fff; flex: 0 0 auto;
  transition: background 0.15s, transform 0.08s;
}
.deck-nav:hover { background: var(--primary-dark); }
.deck-nav:active { transform: scale(0.94); }
.deck-dots { flex: 1; display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.deck-dot {
  width: 10px; height: 10px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: #ccd2e8; transition: background 0.2s, transform 0.2s;
}
.deck-dot:hover { background: #a9b2d6; }
.deck-dot.is-on { background: var(--primary); transform: scale(1.45); }
.deck-count { flex: 0 0 auto; color: var(--muted); font-weight: 700; font-size: 0.9rem; }

.deck-neighbours {
  position: absolute; bottom: 78px; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 20px; pointer-events: none;
}
.deck-neighbour {
  pointer-events: auto; padding: 7px 15px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.9); color: var(--muted);
  font-size: 0.85rem; font-weight: 700; box-shadow: var(--shadow);
}
.deck-neighbour:hover { color: var(--primary); }
.deck-neighbour-r { margin-left: auto; }

@media (max-width: 720px) {
  .deck-lesson-name { font-size: 0.95rem; }
  .deck-pages { display: none; }
  .deck-neighbours { display: none; }
  .slide { padding: 24px 18px; }
}

/* Past ekran (yotiq telefon, kichik planshet) — panellar siqiladi.
   Slayd 16:9 nisbatda va ekranga sig'diriladi, ya'ni uning kattaligi
   BALANDLIKKA bog'liq. Yotiq telefonda (812x375) yuqori va quyi panel
   138px, ya'ni balandlikning 37% ini yeb qo'yardi va slayd 33% gacha
   kichrayardi — matn 9px. Panellar siqilgach slaydga 60px ortiq
   balandlik qoladi. Nuqtalar qatori ham yashiriladi: sahifa ko'p bo'lsa
   u ikki-uch qatorga yoyilib, yana balandlik yeyardi. */
@media (max-height: 560px) {
  .deck-top { padding: 5px 12px; gap: 10px; }
  .deck-exit, .deck-btn { width: 30px; height: 30px; font-size: 0.95rem; }
  .deck-lesson-no { padding: 2px 8px; font-size: 0.72rem; }
  .deck-lesson-name { font-size: 0.85rem; }
  .deck-pages { display: none; }
  .deck-neighbours { display: none; }
  .deck-bottom { padding: 5px 12px; gap: 10px; }
  .deck-nav { width: 34px; height: 34px; font-size: 1.25rem; border-radius: 9px; }
  .deck-dots { display: none; }
  .deck-count { margin: 0 auto; }
}

/* Past ekranlarda (masalan, 1024x768 eski kompyuterlar) slayd zichlashtiriladi —
   ko'p qadamli va ko'p kalit so'zli slaydlar ham aylantirmasdan sig'adi. */
@media (max-height: 950px) {
  .slide { padding: 20px clamp(20px, 5vw, 60px); }
  .s-h { margin-bottom: 16px; padding-bottom: 10px; }
  .s-steps, .s-keyboard, .s-sum, .s-goals, .s-note-list { gap: 8px; }
  .s-cards, .s-keys, .s-quiz-opts { gap: 9px; }
  .s-steps li { padding: 9px 16px; }
  .s-key { padding: 11px 16px; }
  .s-key-w { margin-bottom: 5px; }
  .s-card { padding: 13px 17px; }
  .s-kb-row { padding: 11px 17px; }
  .s-sum li { padding: 10px 18px 10px 50px; }
  .s-text p { margin-bottom: 12px; }
  .s-note { padding: 20px 26px; }
  .s-note-h { margin: 4px 0 10px; }
  .s-quiz-q { margin-bottom: 16px; }
  .s-opt { padding: 11px 15px; }
  .s-quiz-why { margin-top: 12px; padding: 11px 16px; }
}


/* ===================================================================
   SCRATCH BLOKLARI
   Rasmdan kesilmagan — hammasi CSS bilan chizilgan, shu bois doskada
   istalgan o'lchamda aniq ko'rinadi. Ranglar Scratch 3.0 ning aynan o'zi.
   =================================================================== */

/* Turkum ranglari (Scratch 3.0) */
.sb-motion    { --c: #4c97ff; }
.sb-looks     { --c: #9966ff; }
.sb-sound     { --c: #cf63cf; }
.sb-events    { --c: #ffbf00; }
.sb-control   { --c: #ffab19; }
.sb-sensing   { --c: #5cb1d6; }
.sb-operators { --c: #59c059; }
.sb-variables { --c: #ff8c1a; }
.sb-list      { --c: #ff661a; }
.sb-pen       { --c: #0fbd8c; }  /* Pen kengaytmasi */
.sb-myblocks  { --c: #ff6680; }  /* My Blocks — protseduralar */

/* Kod maydoni — Scratch muharriridagi nuqtali fon */
.sb-script {
  --canvas: #f7f7f9;
  /* --u ni ota element (kod hajmiga qarab) belgilashi mumkin */
  font-size: var(--u, clamp(12px, 1.15vw, 19px));
  display: inline-flex; flex-direction: column; align-items: flex-start;
  background-color: var(--canvas);
  background-image: radial-gradient(circle, #d8d9e0 1.1px, transparent 1.5px);
  background-size: 1.6em 1.6em;
  border: 1px solid #e3e4ea; border-radius: 0.7em;
  padding: 1.2em 1.5em 1.6em;
  box-shadow: 0 6px 18px rgba(31, 36, 64, 0.09);
}

/* Yolg'iz blok (izoh yonida turadigan slaydlar uchun) */
.sb-one {
  --canvas: #fff;
  --u: clamp(12px, 1.1vw, 18px);
  font-size: var(--u);
  display: inline-block;
}

/* ---- Oddiy (stack) blok ---- */
.sb {
  position: relative;
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.42em;
  min-height: 2.15em; padding: 0.36em 0.75em;
  background: var(--c); color: #fff;
  font-weight: 700; line-height: 1.2; letter-spacing: 0.1px;
  border-radius: 0.3em;
  box-shadow: inset 0 -0.1em 0 rgba(0, 0, 0, 0.13);
}
/* pastki chiqiq — keyingi blok o'yig'iga tushadi */
.sb::after {
  content: ''; position: absolute; left: 0.9em; bottom: -0.26em;
  width: 1.4em; height: 0.27em; background: var(--c);
  border-radius: 0 0 0.17em 0.17em;
}
/* ustki o'yiq — ustida blok bo'lmaganda ko'rinadi */
.sb-top::before {
  content: ''; position: absolute; left: 0.9em; top: 0; z-index: 2;
  width: 1.4em; height: 0.27em; background: var(--canvas);
  border-radius: 0 0 0.17em 0.17em;
}
/* shlyapa blok (Events) — tepasi gumbaz */
.sb-hat {
  padding-top: 1em;
  border-top-left-radius: 2.4em 1.15em;
  border-top-right-radius: 2.4em 1.15em;
}
/* yakunlovchi blok — pastki chiqiq yo'q */
.sb-cap::after { display: none; }

/* ---- C-blok (forever, repeat, if) ---- */
.sb-cw { display: inline-flex; flex-direction: column; align-items: stretch; }
.sb-c-head { border-radius: 0.3em 0.3em 0 0; }
.sb-c-head::after, .sb-c-mid::after { left: 1.9em; }
.sb-c-body {
  border-left: 1em solid var(--c);
  min-height: 1.2em;
  display: flex; flex-direction: column; align-items: flex-start;
}
.sb-c-mid { border-radius: 0; }
.sb-c-foot {
  position: relative; height: 1em; background: var(--c);
  border-radius: 0 0 0.3em 0.3em;
  box-shadow: inset 0 -0.1em 0 rgba(0, 0, 0, 0.13);
}
.sb-c-foot::after {
  content: ''; position: absolute; left: 0.9em; bottom: -0.26em;
  width: 1.4em; height: 0.27em; background: var(--c);
  border-radius: 0 0 0.17em 0.17em;
}

/* ---- Blok ichidagi elementlar ---- */
.sb-l { white-space: pre; }

/* oq kiritish maydoni */
.sb-i {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7em; padding: 0.12em 0.62em;
  background: #fff; color: #575e75;
  border-radius: 999px; font-weight: 700;
}
.sb-i-empty { min-width: 2.5em; min-height: 1.4em; }

/* ochiluvchi ro'yxat */
.sb-m {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.14em 0.55em 0.14em 0.65em;
  background: rgba(0, 0, 0, 0.16); color: #fff;
  border-radius: 999px; font-weight: 700;
}
.sb-ar {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 0.3em solid transparent;
  border-right: 0.3em solid transparent;
  border-top: 0.32em solid #fff;
}

/* reporter (oval blok): o'zgaruvchi, operator natijasi */
.sb-r {
  display: inline-flex; align-items: center; gap: 0.34em;
  padding: 0.14em 0.68em;
  background: var(--c); color: #fff;
  border-radius: 999px; font-weight: 700; line-height: 1.2;
  box-shadow: inset 0 -0.09em 0 rgba(0, 0, 0, 0.14);
}
.sb-r .sb-i { padding: 0.06em 0.5em; min-width: 1.5em; }

/* mantiqiy (boolean) blok — olti burchak */
.sb-b {
  display: inline-flex; align-items: center; gap: 0.34em;
  padding: 0.16em 0.85em; min-height: 1.6em;
  background: var(--c); color: #fff; font-weight: 700; line-height: 1.2;
  clip-path: polygon(0.55em 0, calc(100% - 0.55em) 0, 100% 50%,
                     calc(100% - 0.55em) 100%, 0.55em 100%, 0 50%);
}
.sb-b-empty { background: rgba(0, 0, 0, 0.16); min-width: 3.4em; }
.sb-ph { opacity: 0.85; font-style: italic; }
.sb-b .sb-i { padding: 0.06em 0.5em; min-width: 1.5em; }

/* yolg'iz turgan reporter/boolean o'lchami kattaroq */
.sb-solo { font-size: 1.05em; }

/* ---- "blok" slaydi: blok + izoh ---- */
.s-blocks { display: flex; flex-direction: column; gap: 12px; max-width: 1200px; }
.s-block-row {
  display: flex; align-items: center; gap: 22px;
  background: #fff; border-radius: 14px; padding: 13px 20px;
  box-shadow: 0 5px 16px rgba(31, 36, 64, 0.08);
  animation: slideIn 0.45s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.07s);
}
.s-block-vis { flex: 0 0 auto; }
.s-block-d { font-size: clamp(0.9rem, 1.4vw, 1.4rem); line-height: 1.5; color: #4a5070; }

/* ---- "dastur" slaydi: to'liq skript + izoh ---- */
.s-prog { display: flex; gap: clamp(20px, 3vw, 44px); align-items: flex-start; flex-wrap: wrap; }
.s-prog-code { flex: 0 0 auto; display: flex; gap: clamp(12px, 1.6vw, 26px); flex-wrap: wrap; align-items: flex-start; }
.s-prog-one { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.s-prog-cap {
  font-size: clamp(0.72rem, 1vw, 0.95rem); font-weight: 800; color: var(--primary);
  background: #eef1ff; padding: 3px 12px; border-radius: 20px;
}
/* Yechim slaydining sarlavhasi yashil chiziq bilan ajratiladi */
.s-h-sol::after { background: linear-gradient(90deg, var(--green), #7fd6a8); }
.s-prog-note { flex: 1 1 260px; min-width: 230px; }
.s-prog-note p {
  font-size: clamp(0.92rem, 1.4vw, 1.32rem); line-height: 1.55;
  color: #4a5070; margin-bottom: 0.75em;
}
.s-prog-note p:last-child { margin-bottom: 0; }
/* Dastur natijasi — nima chiqishini aniq ko'rsatuvchi maydon */
.s-prog-res {
  margin-top: 14px; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: #eafaf2; border-left: 5px solid var(--green);
  font-size: clamp(0.92rem, 1.4vw, 1.32rem); line-height: 1.5; color: #1f5c40;
}
.s-prog-res-l {
  flex: 0 0 auto; font-weight: 900; text-transform: uppercase;
  font-size: 0.72em; letter-spacing: 0.5px; padding-top: 0.22em;
}
@media (max-height: 950px) { .s-prog-res { margin-top: 10px; padding: 9px 13px; } }

@media (max-height: 950px) {
  .sb-script { padding: 0.9em 1.1em 1.2em; }
  .s-blocks { gap: 8px; }
  .s-block-row { padding: 9px 16px; gap: 16px; }
}

/* Juda past ekranlar (1280x720 va shunga o'xshash) uchun qo'shimcha zichlashtirish */
@media (max-height: 780px) {
  .slide { padding: 14px clamp(18px, 4.5vw, 52px); }
  .s-h { margin-bottom: 12px; padding-bottom: 8px; }
  .s-steps, .s-keyboard, .s-sum, .s-goals, .s-note-list, .s-blocks { gap: 6px; }
  .s-cards, .s-keys, .s-quiz-opts, .s-blocks { gap: 7px; }
  .s-steps li { padding: 7px 14px; }
  .s-block-row { padding: 7px 14px; }
  .s-prog-code { gap: 10px; }
  .sb-script { padding: 0.7em 0.9em 1em; }
  .s-prog-cap { padding: 2px 9px; }
  .s-prog-res { margin-top: 8px; padding: 8px 12px; }
  .s-text p { margin-bottom: 9px; }
  .s-prog-note p { margin-bottom: 0.5em; }
}
/* ---- Taqqoslash jadvali (9-11-sinf uchun) ---- */
.s-tbl-wrap { max-width: 100%; overflow-x: auto; }
.s-tbl {
  border-collapse: separate; border-spacing: 0;
  width: 100%; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(31, 36, 64, 0.09);
  font-size: clamp(0.82rem, 1.25vw, 1.2rem);
}
.s-tbl th {
  background: linear-gradient(145deg, #6c6cf0, #4747b8); color: #fff;
  font-weight: 800; text-align: left; padding: 12px 16px;
  font-size: 0.95em; letter-spacing: 0.2px;
}
.s-tbl td {
  padding: 11px 16px; line-height: 1.45; color: #3a4062;
  border-top: 1px solid #eceef6; vertical-align: top;
}
.s-tbl tbody tr {
  animation: slideIn 0.4s backwards cubic-bezier(0.22, 1, 0.36, 1);
  animation-delay: calc(var(--k, 0) * 0.06s);
}
.s-tbl tbody tr:nth-child(even) td { background: #fafbff; }
.s-tbl-first { font-weight: 800; color: var(--ink); white-space: nowrap; }
.s-tbl strong { color: var(--primary-dark); font-weight: 900; }

@media (max-height: 950px) {
  .s-tbl th { padding: 9px 13px; }
  .s-tbl td { padding: 8px 13px; }
}
@media (max-height: 780px) {
  .s-tbl th { padding: 7px 11px; }
  .s-tbl td { padding: 6px 11px; }
}

/* ---- Admin o'zgarishi haqidagi oynacha ---- */
.xb-qatlam {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 2000;
  background: rgba(31, 36, 64, 0.38);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 22px; pointer-events: none;
}
.xb-qatlam[hidden] { display: none; }
.xb-oyna {
  pointer-events: auto;
  width: min(430px, 100%);
  background: var(--card); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(31, 36, 64, 0.28);
  overflow: hidden;
  animation: xbKirish 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes xbKirish {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.xb-bosh {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 18px 18px 12px;
  background: linear-gradient(140deg, #eef1ff, #e3e8ff);
}
.xb-belgi { font-size: 1.5rem; line-height: 1.2; }
.xb-bosh h3 { margin: 0; font-size: 1.02rem; }
.xb-hisob { margin: 3px 0 0; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.xb-yop {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  font-size: 1rem; color: var(--muted); padding: 2px 6px; border-radius: 8px;
}
.xb-yop:hover { background: rgba(31, 36, 64, 0.08); color: var(--ink); }

.xb-tan { padding: 16px 18px 6px; }
.xb-joy {
  display: inline-block; font-size: 0.76rem; font-weight: 800;
  color: var(--primary-dark); background: #eef1ff;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 9px;
}
.xb-matn { margin: 0; font-size: 0.95rem; line-height: 1.45; }
.xb-savol { margin: 13px 0 0; font-weight: 700; font-size: 0.93rem; }

.xb-tugmalar { display: flex; gap: 9px; padding: 14px 18px 6px; }
.xb-tugmalar .btn { flex: 1; justify-content: center; font-size: 0.88rem; }

.xb-pastki { display: flex; gap: 14px; padding: 4px 18px 15px; }
.xb-link {
  border: 0; background: transparent; cursor: pointer; padding: 0;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.xb-link[hidden] { display: none; }
.xb-link:hover { color: var(--primary); }

@media (max-width: 560px) {
  .xb-qatlam { align-items: flex-end; justify-content: center; padding: 12px; }
  .xb-tugmalar { flex-direction: column-reverse; }
}

/* ---- Darsdan ochilgan doskaviy o'yin: pastdagi dars navigatsiyasi ---- */
.board-page { display: flex; flex-direction: column; min-height: 100vh; }
.board-page .board-main { flex: 1; width: 100%; }
.b-pastki {
  position: sticky; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(6px);
}
.b-pastki .deck-nav { text-decoration: none; display: grid; place-items: center; }
.b-pastki-matn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; text-align: center;
}
.b-pastki-no { font-size: 0.78rem; font-weight: 800; color: var(--primary); }
.b-pastki-nom {
  font-size: 0.92rem; font-weight: 600; color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Qo'shni darslar — pastki panel ustida, deckdagidek */
.b-qoshni { position: sticky; bottom: 78px; margin-bottom: -34px; z-index: 21; }

/* ---- O'yinlar: sinf → chorak → mavzu ---- */
.sinf-panjara {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.sinf-tugma {
  display: flex; align-items: center; gap: 15px;
  background: var(--card); border: 2px solid #e3e7f6; border-radius: 16px;
  padding: 16px 18px; color: var(--ink);
  box-shadow: var(--shadow); transition: transform 0.1s, border-color 0.15s;
}
.sinf-tugma:hover { transform: translateY(-3px); border-color: var(--primary); }
.sinf-raqam {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(145deg, #5b5bd6, #7b6ce8);
  color: #fff; font-size: 1.55rem; font-weight: 800;
}
.sinf-matn { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sinf-matn strong { font-size: 1.05rem; }
.sinf-matn small { color: var(--muted); font-size: 0.83rem; font-weight: 500; }

.chorak-panjara {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px;
}
.chorak-tugma {
  display: flex; align-items: center; gap: 15px;
  background: var(--card); border: 2px solid #e3e7f6; border-radius: 16px;
  padding: 16px 18px; color: var(--ink);
  box-shadow: var(--shadow); transition: transform 0.1s, border-color 0.15s;
}
.chorak-tugma:hover { transform: translateY(-3px); border-color: var(--primary); }
.chorak-raqam {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 14px;
  color: #fff; font-size: 1.45rem; font-weight: 800;
}
/* Har chorak o'z rangida — o'qituvchi ko'z bilan tez ajratadi */
.chorak-1 .chorak-raqam { background: linear-gradient(145deg, #4c97ff, #6aa9ff); }
.chorak-2 .chorak-raqam { background: linear-gradient(145deg, #2eb872, #4ecf8c); }
.chorak-3 .chorak-raqam { background: linear-gradient(145deg, #f59e0b, #ffb23d); }
.chorak-4 .chorak-raqam { background: linear-gradient(145deg, #a855f7, #c07dff); }
/* 0-chorak — o'quv rejasidan tashqaridagi «Mantiqiy masalalar» to'plami.
   Raqam o'rniga belgi chiqadi, shuning uchun shrifti biroz kattaroq. */
.chorak-0 .chorak-raqam {
  background: linear-gradient(145deg, #ff8a3d, #ffab6b);
  font-size: 1.35rem;
}
.chorak-matn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chorak-matn strong { font-size: 1.05rem; }
.chorak-matn small { color: var(--muted); font-size: 0.83rem; font-weight: 500; }

/* ---- Qurilmalar chegarasi sahifasi ---- */
.qc-karta { text-align: center; padding: 30px 26px; }
.qc-belgi { font-size: 3.2rem; line-height: 1; }
.qc-karta h1 { font-size: 1.45rem; margin: 12px 0 16px; }
.qc-matn { color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.qc-sar {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 24px 0 10px; text-align: left;
}
.qc-royxat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qc-q {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 2px solid #e3e7f6; border-radius: 12px; padding: 11px 14px;
}
.qc-q.is-joriy { border-color: var(--primary); background: #f4f4ff; }
.qc-q-belgi { font-size: 1.5rem; }
.qc-q-matn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qc-q-matn strong { font-size: 0.95rem; }
.qc-q-matn small { color: var(--muted); font-size: 0.8rem; }
.qc-tugmalar { display: flex; flex-direction: column; gap: 9px; margin-top: 22px; }
.qc-tugmalar form { display: flex; }
.qc-tugmalar .btn { flex: 1; justify-content: center; }
.qc-izoh { margin: 16px 0 0; font-size: 0.83rem; color: var(--muted); }

/* ===== BAYT JANGI (doskaviy o'yin) =====
   Kiber-terminal ko'rinishi: ikki tomonda bayt paneli, o'rtada sindiriladigan
   qulf. Fonda ikkilik yomg'iri va skanerlash chizig'i — hammasi CSS
   animatsiyasi bilan (rAF fondagi oynada muzlaydi). */

.by-page { --by-kok: #4cc2ff; --by-sariq: #ffd166; --by-qizil: #ff4d6d; }

.by-scene {
  display: flex; align-items: stretch; gap: 12px; padding: 13px 14px;
  background: radial-gradient(120% 130% at 50% 0%, #1b2145 0%, #12162c 55%, #0c0f1e 100%);
  border-radius: 16px; position: relative; overflow: hidden; min-height: 244px;
  border: 2px solid rgba(120, 160, 255, 0.14);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.by-scene.is-glitch {
  border-color: rgba(255, 77, 109, 0.6);
  box-shadow: inset 0 0 60px rgba(255, 77, 109, 0.18);
}

/* Fon: ikkilik yomg'iri */
.by-yomgir { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; overflow: hidden; }
.by-tomchi {
  position: absolute; top: -120%; white-space: pre; line-height: 1.12;
  font-family: Consolas, ui-monospace, monospace; font-size: 13px; color: #7ef0c0;
  animation: byYomgir linear infinite;
}
@keyframes byYomgir { from { transform: translateY(0); } to { transform: translateY(260%); } }

/* Fon: skaner chizig'i */
.by-skan {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg,
    rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
}

/* ---- tomon paneli ---- */
.by-yon {
  flex: 1; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; border-radius: 14px; padding: 10px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 2px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.by-yorliq {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: #7b84b4;
}
.by-chap.is-faol { border-color: var(--by-kok); box-shadow: 0 0 26px rgba(76, 194, 255, 0.3); }
.by-ong.is-faol { border-color: #ff8a3d; box-shadow: 0 0 26px rgba(255, 138, 61, 0.3); }
.by-yon.is-nishonda {
  border-color: var(--by-qizil); box-shadow: 0 0 30px rgba(255, 77, 109, 0.42);
  animation: byOgoh 0.7s ease-in-out infinite alternate;
}
@keyframes byOgoh {
  from { background: rgba(255, 77, 109, 0.05); }
  to { background: rgba(255, 77, 109, 0.16); }
}
.by-yon.is-toshdi { border-color: var(--by-qizil); }
.by-yon.by-golib {
  border-color: var(--by-sariq); background: rgba(255, 209, 102, 0.13);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.35);
}

/* ---- bit lampalari ---- */
.by-bitlar { display: flex; gap: 5px; justify-content: center; }
.by-bit {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; cursor: default; font: inherit;
}
.by-bit-lamp {
  width: 40px; height: 46px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 900; font-family: Consolas, ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.05); color: #565f8c;
  border: 2px solid rgba(255, 255, 255, 0.09);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.by-bit-joy {
  font-size: 0.64rem; font-weight: 800; color: #666e97;
  font-family: Consolas, ui-monospace, monospace;
}
.by-bit.is-on .by-bit-lamp {
  background: linear-gradient(160deg, #ffe27a, #ffb020);
  color: #3a2a05; border-color: var(--by-sariq);
  box-shadow: 0 0 18px rgba(255, 200, 80, 0.55), inset 0 -3px 8px rgba(0, 0, 0, 0.12);
}
.by-bit.is-on .by-bit-joy { color: var(--by-sariq); }

/* Bosiladigan holat — faqat navbat kelgan panelda */
.by-bit:not(:disabled) { cursor: pointer; }
.by-bit:not(:disabled) .by-bit-lamp {
  border-color: rgba(255, 255, 255, 0.35);
  animation: byChorla 1.1s ease-in-out infinite alternate;
}
@keyframes byChorla {
  from { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  to { box-shadow: 0 0 16px rgba(255, 255, 255, 0.34); }
}
.by-bit:not(:disabled):hover .by-bit-lamp { transform: translateY(-3px) scale(1.06); }
.by-bit.is-taqiq .by-bit-lamp { opacity: 0.32; }

.by-yondi .by-bit-lamp { animation: byYonish 0.5s ease; }
@keyframes byYonish {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); box-shadow: 0 0 34px rgba(255, 210, 90, 0.95); }
  100% { transform: scale(1); }
}

/* ---- qiymat va farq ---- */
.by-panel { display: flex; align-items: center; gap: 14px; }
.by-qiymat { display: flex; flex-direction: column; align-items: center; gap: 0; }
.by-q-son {
  font-size: 2rem; font-weight: 900; line-height: 1.12; color: #fff;
  font-family: Consolas, ui-monospace, monospace; font-variant-numeric: tabular-nums;
}
.by-q-l {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: #767ea8;
}
.by-farq {
  font-family: Consolas, ui-monospace, monospace; font-weight: 800; font-size: 0.95rem;
  padding: 5px 11px; border-radius: 999px; color: #9aa3d0;
  background: rgba(255, 255, 255, 0.06); white-space: nowrap;
}
.by-farq.is-oshdi { color: #fff; background: rgba(255, 77, 109, 0.35); }
.by-farq.is-tayyor { color: #0c2a18; background: #3ddc84; }

/* ---- o'rtadagi qulf ---- */
.by-orta {
  position: relative; z-index: 1; flex: 0 0 auto; width: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.by-nishon-l {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: #7b84b4;
}
.by-qulf { position: relative; display: grid; place-items: center; }
.by-qulf-svg { width: 88px; height: 106px; }
.by-qulf-dast {
  stroke: #8f9ad6; transition: transform 0.5s ease, stroke 0.3s;
  transform-origin: 45px 44px;
}
.by-qulf-tan { fill: #2b3266; stroke: #8f9ad6; stroke-width: 3; transition: fill 0.3s, stroke 0.3s; }
.by-qulf-teshik { fill: #12162c; }
.by-qulf.is-sindi .by-qulf-dast { transform: rotate(-32deg) translate(-6px, -4px); stroke: var(--by-sariq); }
.by-qulf.is-sindi .by-qulf-tan { fill: #6d5b12; stroke: var(--by-sariq); }
.by-qulf.is-sindi { animation: byQalt 0.5s ease; }
@keyframes byQalt {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
.by-nishon-son {
  position: absolute; top: 52%; font-size: 1.8rem; font-weight: 900; color: #fff;
  font-family: Consolas, ui-monospace, monospace; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.by-nishon-bin {
  min-height: 18px; font-family: Consolas, ui-monospace, monospace; font-weight: 800;
  font-size: 0.95rem; letter-spacing: 0.12em; color: transparent;
  transition: color 0.4s;
}
.by-nishon-bin.is-ochiq { color: #3ddc84; }
.by-qadam { font-size: 0.68rem; font-weight: 700; color: #767ea8; text-align: center; }

/* ---- qulf hisobchisi (tepada) ---- */
.by-qulflar { display: flex; justify-content: center; gap: 4px; margin-top: 5px; font-size: 1rem; }
.by-qulf-pip { filter: grayscale(1) brightness(0.7); transition: filter 0.3s, transform 0.3s; }
.by-qulf-pip.is-on { filter: none; transform: scale(1.2); }

/* ---- bit tanlash chaqirig'i ---- */
.by-chaqiriq {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-radius: 999px;
  background: rgba(10, 14, 30, 0.92); border: 2px solid rgba(255, 255, 255, 0.22);
  color: #fff; font-weight: 800; font-size: 1.02rem; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: byKirish 0.3s ease;
}
.by-chaqiriq.is-glitch { border-color: var(--by-qizil); background: rgba(60, 8, 22, 0.94); }
@keyframes byKirish {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.by-ch-vaqt {
  min-width: 30px; text-align: center; font-family: Consolas, ui-monospace, monospace;
  background: rgba(255, 255, 255, 0.14); border-radius: 8px; padding: 2px 7px;
}

/* ---- glitch savoli ---- */
.by-glitch-q { border: 2px solid var(--by-qizil) !important; color: #ff4d6d; }
.by-glitch-hisob { color: #ff4d6d !important; }
.by-t-tez { color: #ffd166; }
.by-t-glitch { color: #ff4d6d; }

/* ---- zarrachalar ---- */
.by-uchqun {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; z-index: 4;
  background: var(--by-sariq); pointer-events: none;
  animation: byUchqun 0.8s ease-out forwards;
}
@keyframes byUchqun {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.by-konfet { position: absolute; top: -20px; border-radius: 2px; pointer-events: none; z-index: 4; }

/* ---- ovoz tugmasi ---- */
.by-ovoz {
  position: fixed; right: 16px; bottom: 84px; z-index: 20;
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(20, 25, 50, 0.85); color: #fff; font-size: 1.15rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.by-ovoz.is-off { opacity: 0.5; }

@media (max-width: 1100px) {
  .by-bit-lamp { width: 34px; height: 42px; font-size: 1.1rem; }
  .by-q-son { font-size: 1.8rem; }
  .by-orta { width: 118px; }
  .by-qulf-svg { width: 84px; height: 100px; }
  .by-nishon-son { font-size: 1.6rem; }
  .by-scene { padding: 14px 10px; gap: 9px; }
  .by-panel { flex-direction: column; gap: 5px; }
}

/* ===== QO'LLANMA (/qollanma) va o'yin ichidagi yordam ===== */

.ql-page .container { max-width: 1160px; }

.ql-bosh {
  display: flex; align-items: center; gap: 20px; margin: 18px 0 20px;
}
.ql-bosh-belgi { font-size: 3rem; line-height: 1; flex: 0 0 auto; }
.ql-bosh h1 { margin: 0 0 5px; }
.ql-bosh p { margin: 0; color: var(--muted); max-width: 62ch; }

.ql-tana { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }

/* ---- chapdagi mundarija ---- */
.ql-menyu { position: sticky; top: 76px; }
.ql-menyu-ich {
  display: flex; flex-direction: column; gap: 1px;
  max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px;
}
.ql-menyu-l {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); padding: 14px 10px 6px;
}
.ql-menyu-l:first-child { padding-top: 2px; }
.ql-menyu a {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 9px;
  color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  border-left: 3px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.ql-menyu a span { flex: 0 0 auto; width: 20px; text-align: center; }
.ql-menyu a:hover { background: rgba(91, 91, 214, 0.07); }
.ql-menyu a.is-on {
  background: rgba(91, 91, 214, 0.12); border-left-color: var(--primary); color: var(--primary);
}
.ql-menyu-oyin { font-size: 0.85rem !important; padding-left: 18px !important; }

/* ---- matn ustuni ---- */
.ql-matn { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ql-bolim { scroll-margin-top: 76px; }
.ql-bolim h2 {
  display: flex; align-items: center; gap: 11px; margin: 0 0 14px;
  font-size: 1.4rem;
}
.ql-b-belgi {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: rgba(91, 91, 214, 0.1);
}
.ql-bolim h4 {
  margin: 18px 0 7px; font-size: 1rem; color: var(--primary);
}
.ql-bolim p { margin: 0 0 10px; line-height: 1.65; }
.ql-bolim ul, .ql-bolim ol { margin: 0 0 10px; padding-left: 22px; line-height: 1.65; }
.ql-bolim li { margin-bottom: 5px; }
.ql-bolim code {
  background: rgba(91, 91, 214, 0.09); padding: 1px 6px; border-radius: 5px;
  font-family: Consolas, ui-monospace, monospace; font-size: 0.88em;
}

.ql-qadam { counter-reset: ql; list-style: none; padding-left: 0 !important; }
.ql-qadam li {
  counter-increment: ql; position: relative; padding-left: 38px; margin-bottom: 10px;
  line-height: 1.6;
}
.ql-qadam li::before {
  content: counter(ql); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 0.82rem;
}

.ql-eslatma {
  background: rgba(46, 184, 114, 0.1); border-left: 4px solid #2eb872;
  padding: 11px 14px; border-radius: 0 9px 9px 0; margin: 12px 0 0 !important;
  font-size: 0.93rem;
}

.ql-jadval { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 0.93rem; }
.ql-jadval th, .ql-jadval td {
  padding: 9px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid rgba(120, 130, 180, 0.2); line-height: 1.55;
}
.ql-jadval th { font-weight: 800; background: rgba(91, 91, 214, 0.07); }
.ql-jadval td:first-child { white-space: nowrap; }

.ql-ikki { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
.ql-ikki-k {
  padding: 14px 16px; border-radius: 12px; background: rgba(91, 91, 214, 0.06);
  border: 2px solid rgba(91, 91, 214, 0.14);
}
.ql-ikki-k h4 { margin-top: 0 !important; }
.ql-ikki-k p:last-child { margin-bottom: 0; }

/* ---- o'yin plitkalari ---- */
.ql-oyin-plitka {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px;
  margin-top: 14px;
}
.ql-plitka {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  background: rgba(91, 91, 214, 0.06); border: 2px solid transparent;
  text-decoration: none; color: var(--ink); transition: border-color 0.15s, transform 0.15s;
}
.ql-plitka:hover { border-color: var(--primary); transform: translateY(-2px); }
.ql-p-belgi { font-size: 1.6rem; flex: 0 0 auto; }
.ql-p-matn { display: flex; flex-direction: column; min-width: 0; }
.ql-p-matn strong { font-size: 0.95rem; }
.ql-p-matn small { color: var(--muted); font-size: 0.76rem; }

/* ---- bitta o'yin bo'limi ---- */
.ql-oyin-bosh { display: flex; align-items: center; gap: 15px; margin-bottom: 14px; }
.ql-oyin-belgi {
  flex: 0 0 auto; width: 60px; height: 60px; border-radius: 15px;
  display: grid; place-items: center; font-size: 2rem;
  background: rgba(91, 91, 214, 0.1);
}
.ql-oyin-bosh h2 { margin: 0 0 4px !important; display: block !important; }
.ql-tur {
  display: inline-block; font-size: 0.75rem; font-weight: 800; padding: 3px 10px;
  border-radius: 999px; background: rgba(91, 91, 214, 0.13); color: var(--primary);
}
.ql-tur.is-doska { background: rgba(255, 138, 61, 0.16); color: #d9701f; }

.ql-bir {
  font-size: 1.06rem; font-weight: 600; line-height: 1.6;
  padding: 12px 15px; border-radius: 11px; background: rgba(91, 91, 214, 0.07);
  margin: 0 0 4px !important;
}
.ql-golib, .ql-fan {
  margin-top: 12px; padding: 11px 14px; border-radius: 10px; line-height: 1.6;
  font-size: 0.95rem;
}
.ql-golib { background: rgba(255, 200, 80, 0.16); }
.ql-fan { background: rgba(46, 184, 114, 0.11); }
.ql-golib span, .ql-fan span { font-weight: 800; }
.ql-sir li { margin-bottom: 7px; }

.ql-tepaga { text-align: center; padding: 6px 0 30px; }
.ql-tepaga a { color: var(--muted); text-decoration: none; font-weight: 700; }

@media (max-width: 900px) {
  .ql-tana { grid-template-columns: 1fr; }
  .ql-menyu { position: static; }
  .ql-menyu-ich {
    flex-direction: row; flex-wrap: wrap; max-height: none; overflow: visible;
  }
  .ql-menyu-l { width: 100%; padding: 8px 0 2px; }
  .ql-menyu a { border-left: 0; border-bottom: 3px solid transparent; }
  .ql-menyu a.is-on { border-left: 0; border-bottom-color: var(--primary); }
  .ql-ikki { grid-template-columns: 1fr; }
  .ql-jadval td:first-child { white-space: normal; }
}

/* ===== O'yin ichidagi "Qanday o'ynaladi?" ===== */

.oy-tugma {
  position: fixed; left: 16px; bottom: 84px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: #5b5bd6; color: #fff; font-size: 1.25rem; font-weight: 800;
  box-shadow: 0 6px 20px rgba(40, 40, 90, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.oy-tugma:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(40, 40, 90, 0.45); }

.oy-fon {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 20px; background: rgba(12, 15, 32, 0.72); backdrop-filter: blur(3px);
  animation: oyKirish 0.2s ease;
  overflow-y: auto;
}
@keyframes oyKirish { from { opacity: 0; } to { opacity: 1; } }
body.oy-ochiq { overflow: hidden; }

.oy-karta {
  width: min(760px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--card, #fff); color: var(--ink);
  border-radius: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  animation: oyKota 0.24s ease;
}
@keyframes oyKota { from { transform: translateY(18px) scale(0.98); } to { transform: none; } }

.oy-bosh {
  display: flex; align-items: center; gap: 15px; padding: 20px 24px 0;
}
.oy-belgi {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.9rem;
  background: rgba(91, 91, 214, 0.11);
}
.oy-sarl h2 { margin: 0 0 4px; font-size: 1.35rem; }
.oy-tur {
  display: inline-block; font-size: 0.73rem; font-weight: 800; padding: 3px 10px;
  border-radius: 999px; background: rgba(91, 91, 214, 0.13); color: #5b5bd6;
}
.oy-tur.is-doska { background: rgba(255, 138, 61, 0.16); color: #d9701f; }
.oy-tur-yakka { margin-left: 6px; }

.oy-bir {
  margin: 14px 24px 0; padding: 12px 15px; border-radius: 11px;
  background: rgba(91, 91, 214, 0.08); font-weight: 600; line-height: 1.6;
}
.oy-ich { padding: 4px 24px 8px; overflow-y: auto; }
.oy-ich h4 { margin: 16px 0 6px; font-size: 0.97rem; color: #5b5bd6; }
.oy-ich p { margin: 0; line-height: 1.62; }
.oy-ich ul { margin: 0; padding-left: 20px; line-height: 1.62; }
.oy-ich li { margin-bottom: 6px; }

.oy-qadam { counter-reset: oy; list-style: none; padding-left: 0 !important; margin: 0; }
.oy-qadam li {
  counter-increment: oy; position: relative; padding-left: 36px; margin-bottom: 9px;
  line-height: 1.58;
}
.oy-qadam li::before {
  content: counter(oy); position: absolute; left: 0; top: 1px;
  width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center;
  background: #5b5bd6; color: #fff; font-weight: 800; font-size: 0.8rem;
}
.oy-golib, .oy-fan {
  margin-top: 13px; padding: 10px 14px; border-radius: 10px; line-height: 1.58;
  font-size: 0.94rem;
}
.oy-golib { background: rgba(255, 200, 80, 0.18); }
.oy-fan { background: rgba(46, 184, 114, 0.12); }
.oy-yorliq { font-weight: 800; }

.oy-pas {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 24px 20px; border-top: 1px solid rgba(120, 130, 180, 0.18); margin-top: 12px;
}
.oy-havola { color: var(--muted); font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.oy-havola:hover { color: #5b5bd6; }

@media (max-width: 700px) {
  .oy-bosh { padding: 16px 16px 0; }
  .oy-bir { margin: 12px 16px 0; }
  .oy-ich { padding: 4px 16px 8px; }
  .oy-pas { padding: 12px 16px 16px; flex-direction: column-reverse; }
  .oy-pas .btn { width: 100%; }
  .oy-tugma { left: 12px; bottom: 74px; width: 42px; height: 42px; }
}

/* ===== SAYT QOIDALARI (/shartlar) ===== */

.sh-page .container { max-width: 880px; }

.sh-bosh { display: flex; align-items: center; gap: 20px; margin: 18px 0 16px; }
.sh-bosh-belgi { font-size: 3rem; line-height: 1; flex: 0 0 auto; }
.sh-bosh h1 { margin: 0 0 5px; }
.sh-bosh p { margin: 0; color: var(--muted); }

.sh-allaqachon {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.sh-allaqachon p { margin: 0; font-weight: 700; }

.sh-matn { margin-bottom: 16px; }
.sh-bolim + .sh-bolim {
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid rgba(120, 130, 180, 0.18);
}
.sh-bolim h2 {
  display: flex; align-items: center; gap: 11px; margin: 0 0 12px; font-size: 1.22rem;
}
.sh-b-belgi {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.15rem;
  background: rgba(91, 91, 214, 0.1);
}
.sh-band { counter-reset: sh; list-style: none; padding-left: 0; margin: 0; }
.sh-band li {
  counter-increment: sh; position: relative; padding-left: 36px; margin-bottom: 11px;
  line-height: 1.65;
}
.sh-band li::before {
  content: counter(sh); position: absolute; left: 0; top: 1px;
  width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(91, 91, 214, 0.13); color: var(--primary);
  font-weight: 800; font-size: 0.8rem;
}
.sh-mayda {
  margin: 12px 0 0; padding: 10px 13px; border-radius: 0 9px 9px 0;
  background: rgba(46, 184, 114, 0.1); border-left: 4px solid var(--green);
  font-size: 0.92rem; line-height: 1.55;
}

/* ---- rozilik ---- */
.sh-rozilik {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; padding: 26px 22px 24px;
  border: 3px solid rgba(91, 91, 214, 0.22);
}

.sh-qator {
  display: flex; align-items: center; gap: 15px; cursor: pointer;
  padding: 12px 18px; border-radius: 13px; background: rgba(91, 91, 214, 0.06);
  border: 2px solid transparent; transition: background 0.2s, border-color 0.2s;
  max-width: 100%;
}
.sh-qator:hover { background: rgba(91, 91, 214, 0.1); }

/* Haqiqiy checkbox ko'rinmaydi, lekin klaviatura uchun joyida qoladi */
.sh-checkbox {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* To'rtburchak ON/OFF tugmasi */
.sh-switch {
  position: relative; flex: 0 0 auto; width: 104px; height: 44px;
  border-radius: 10px; background: #c9cee4;
  border: 2px solid #b3b9d4;
  transition: background 0.22s, border-color 0.22s;
  display: block;
}
.sh-switch-off, .sh-switch-on {
  position: absolute; top: 0; height: 100%; width: 52px;
  display: grid; place-items: center;
  font-size: 0.76rem; font-weight: 900; letter-spacing: 0.08em;
  transition: opacity 0.22s;
}
.sh-switch-off { right: 0; color: #6b7194; opacity: 1; }
.sh-switch-on { left: 0; color: #fff; opacity: 0; }
.sh-switch-tutqich {
  position: absolute; top: 3px; left: 3px; width: 46px; height: 34px;
  border-radius: 7px; background: #fff;
  box-shadow: 0 2px 6px rgba(31, 36, 64, 0.28);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.sh-checkbox:checked + .sh-switch { background: var(--green); border-color: #26a163; }
.sh-checkbox:checked + .sh-switch .sh-switch-tutqich { transform: translateX(51px); }
.sh-checkbox:checked + .sh-switch .sh-switch-on { opacity: 1; }
.sh-checkbox:checked + .sh-switch .sh-switch-off { opacity: 0; }
.sh-checkbox:focus-visible + .sh-switch {
  outline: 3px solid var(--primary); outline-offset: 3px;
}
.sh-checkbox:checked ~ .sh-matn-rozi { color: var(--ink); }

.sh-matn-rozi { text-align: left; line-height: 1.5; font-size: 1.02rem; }

.sh-boshla { min-width: 240px; }
.sh-boshla:disabled {
  background: #c9cee4; border-color: #c9cee4; color: #8189ad;
  cursor: not-allowed; box-shadow: none;
}
.sh-boshla:disabled:hover { background: #c9cee4; transform: none; }

.sh-izoh { margin: 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 620px) {
  .sh-bosh { flex-direction: column; text-align: center; gap: 10px; }
  .sh-qator { flex-direction: column; gap: 12px; }
  .sh-matn-rozi { text-align: center; }
  .sh-boshla { width: 100%; min-width: 0; }
}


/* ===== QAL'A TO'PI (doskaviy o'yin) =====
   SVG sahna: ikki qal'a, o'rtada daryoli dara. Javoblar esa sahna ostida
   turadigan 4 tadan zambarak o'qi ichida yozilgan. */

.qq-scene {
  /* .b-scene balandligi 240px — bu sahna uchun kamlik qiladi. SVG shu qutiga
     sig'adigan darajada kichrayadi (preserveAspectRatio=meet), yon tomondagi
     bo'sh yo'laklar esa fon gradienti bilan qoplanadi. */
  position: relative; overflow: hidden; border-radius: 16px;
  height: 300px; padding: 0;
  background: linear-gradient(180deg, #4a9fdc 0%, #8ecdf5 45%, #dff0fb 100%);
}
.qq-svg { display: block; width: 100%; height: 100%; }

.qq-scene.qq-silkin { animation: qqSilkin 0.4s ease; }
@keyframes qqSilkin {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  45% { transform: translate(6px, -2px); }
  70% { transform: translate(-3px, 2px); }
}

/* ---- fon jonlantirish ---- */
.qq-bulut { animation: qqBulut linear infinite; }
.qq-bulut-1 { animation-duration: 64s; }
.qq-bulut-2 { animation-duration: 92s; animation-delay: -34s; }
.qq-bulut-3 { animation-duration: 120s; animation-delay: -70s; }
@keyframes qqBulut {
  from { transform: translateX(-90px); }
  to { transform: translateX(1095px); }
}
.qq-tolqin { animation: qqTolqin 3.6s ease-in-out infinite alternate; }
@keyframes qqTolqin {
  from { transform: translateX(-9px); }
  to { transform: translateX(9px); }
}
.qq-daraxt { transform-box: fill-box; transform-origin: bottom center;
  animation: qqShamol 5s ease-in-out infinite alternate; }
@keyframes qqShamol {
  from { transform: skewX(-1.6deg); }
  to { transform: skewX(1.6deg); }
}
.qq-alanga { transform-box: fill-box; transform-origin: bottom center;
  animation: qqAlanga 0.42s ease-in-out infinite alternate; }
@keyframes qqAlanga {
  from { transform: scale(0.82, 0.9); opacity: 0.85; }
  to { transform: scale(1.12, 1.15); opacity: 1; }
}

.qq-bayroq { transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1); }
.qq-mato { animation: qqHilpirash 2.2s ease-in-out infinite alternate;
  transform-box: fill-box; transform-origin: left center; }
@keyframes qqHilpirash {
  from { transform: skewY(-3.5deg) scaleX(0.93); }
  to { transform: skewY(4.5deg) scaleX(1); }
}
.qq-bayroq.qq-yiqildi { animation: qqYiqil 0.9s ease-in forwards; }
@keyframes qqYiqil { from { opacity: 1; } to { opacity: 0.3; } }

/* ---- yadro va effektlar ---- */
.qq-yadro { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45)); }
.qq-yadro.qq-qaytdi { animation: qqAylan 0.5s linear infinite; }
@keyframes qqAylan { to { rotate: 360deg; } }

.qq-iz { animation: qqIz 0.7s ease-out forwards; pointer-events: none; }
@keyframes qqIz {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 0; transform: scale(2.1); }
}
.qq-chang { animation: qqChang 0.78s ease-out forwards; pointer-events: none; }
@keyframes qqChang {
  from { transform: translate(0, 0) scale(1); opacity: 0.92; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.15); opacity: 0; }
}
.qq-yalt { animation: qqYalt 0.26s ease-out forwards; pointer-events: none; }
@keyframes qqYalt {
  from { opacity: 0.9; transform-box: fill-box; transform-origin: center; transform: scale(0.3); }
  to { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(1.5); }
}
.qq-halqa { animation: qqHalqa 0.65s ease-out forwards; pointer-events: none;
  transform-box: fill-box; transform-origin: center; }
@keyframes qqHalqa {
  from { opacity: 1; transform: scale(0.3); }
  to { opacity: 0; transform: scale(3.4); }
}

.qq-qulaydi {
  animation: qqQula 1s cubic-bezier(0.5, 0, 0.9, 0.6) forwards;
  transform-box: fill-box; transform-origin: center;
}
@keyframes qqQula {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ---- devor hisobchisi (tepada) ---- */
.qq-devor { display: flex; justify-content: center; gap: 3px; margin-top: 6px; }
.qq-tosh-pip {
  width: 15px; height: 9px; border-radius: 2px;
  background: rgba(120, 130, 180, 0.26); transition: background 0.3s;
}
.qq-tosh-pip.is-on { background: #8f95ad; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }

/* ---- kuch shkalasi ---- */
.qq-shkala {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5;
  width: min(620px, 92%); display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 12px 18px 14px; border-radius: 15px;
  background: rgba(14, 18, 36, 0.9); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  border: 3px solid rgba(255, 255, 255, 0.2);
  animation: qqKirish 0.25s ease;
}
.qq-shkala.is-left { border-color: #1368ce; }
.qq-shkala.is-right { border-color: #ff8a3d; }
@keyframes qqKirish {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.qq-sh-yorliq { color: #fff; font-weight: 800; font-size: 1rem; text-align: center; }
.qq-sh-yorliq b { color: #3ddc84; }

.qq-sh-yol {
  position: relative; width: 100%; height: 34px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(90deg, #7d3b3b, #8a6b2f 30%, #8a6b2f 70%, #7d3b3b);
  border: 2px solid rgba(255, 255, 255, 0.18); overflow: hidden;
}
.qq-sh-yashil {
  position: absolute; top: 0; height: 100%;
  background: linear-gradient(180deg, #4ade80, #22a45d);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  transition: filter 0.15s;
}
.qq-sh-yashil.is-tegdi { filter: brightness(1.55); }
.qq-sh-markaz {
  position: absolute; left: 50%; top: 0; width: 4px; height: 100%; margin-left: -2px;
  background: rgba(255, 255, 255, 0.85);
}
.qq-sh-belgi {
  position: absolute; top: -4px; width: 6px; height: calc(100% + 8px); margin-left: -3px;
  background: #fff; border-radius: 3px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}
.qq-sh-belgi.is-qotdi { background: #ffd166; box-shadow: 0 0 16px rgba(255, 209, 102, 1); }

.qq-ot {
  border: 0; cursor: pointer; padding: 10px 34px; border-radius: 11px;
  background: linear-gradient(180deg, #ff6b3d, #e5482d); color: #fff;
  font-size: 1.05rem; font-weight: 900;
  box-shadow: 0 5px 0 #b8341c; transition: transform 0.1s, box-shadow 0.1s;
}
.qq-ot:active { transform: translateY(4px); box-shadow: 0 1px 0 #b8341c; }
.qq-ot:disabled { opacity: 0.5; cursor: default; }

/* ---- javoblar: 4 ta zambarak o'qi ---- */
.qq-oqlar { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; }
.qq-rack {
  flex: 1; display: flex; justify-content: center; gap: clamp(6px, 1vw, 14px);
  padding: 12px 10px 10px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(120, 88, 52, 0.14), rgba(90, 64, 40, 0.2));
  border: 2px solid transparent; transition: border-color 0.2s, background 0.2s;
}
.qq-rack.is-faol { border-color: rgba(91, 91, 214, 0.3); }
.qq-rack-left.is-faol { border-color: #1368ce; background: rgba(19, 104, 206, 0.09); }
.qq-rack-right.is-faol { border-color: #ff8a3d; background: rgba(255, 138, 61, 0.1); }

.qq-oq {
  position: relative; flex: 0 0 auto;
  width: clamp(84px, 9.6vw, 128px); height: clamp(84px, 9.6vw, 128px);
  border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 33% 28%, #6e7488 0%, #3a3f52 45%, #171a26 100%);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.32), 0 12px 22px rgba(20, 24, 44, 0.35),
              inset 0 -8px 16px rgba(0, 0, 0, 0.45);
  display: grid; place-items: center;
  transition: transform 0.14s, box-shadow 0.14s, filter 0.25s;
}
.qq-oq:not(:disabled):hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.3), 0 18px 30px rgba(20, 24, 44, 0.42),
              inset 0 -8px 16px rgba(0, 0, 0, 0.45);
}
.qq-oq:not(:disabled):active { transform: translateY(2px); }
.qq-oq:disabled { cursor: default; }

/* Pilik — yadroning tepasidagi cho'g'i */
.qq-oq-pilik {
  position: absolute; top: -13px; left: 50%; width: 4px; height: 15px; margin-left: -2px;
  background: #6b5233; border-radius: 2px;
}
.qq-oq-pilik::after {
  content: ''; position: absolute; top: -7px; left: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff3b0 0%, #ff9d2e 55%, transparent 75%);
  animation: qqCho 0.4s ease-in-out infinite alternate;
}
@keyframes qqCho {
  from { transform: scale(0.75); opacity: 0.75; }
  to { transform: scale(1.25); opacity: 1; }
}
.qq-oq-yaltir {
  position: absolute; top: 15%; left: 20%; width: 26%; height: 20%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.28); filter: blur(3px);
}
.qq-oq-matn {
  position: relative; z-index: 2; color: #fff; font-weight: 800; line-height: 1.2;
  font-size: clamp(0.66rem, 1.05vw, 0.92rem);
  padding: 0 8%; text-align: center; overflow-wrap: anywhere; hyphens: auto;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-height: 84%; overflow: hidden;
}

.qq-oq.is-tanlangan {
  animation: qqTanlandi 0.5s ease;
  box-shadow: 0 0 0 4px #ffd166, 0 12px 26px rgba(20, 24, 44, 0.45),
              inset 0 -8px 16px rgba(0, 0, 0, 0.45);
}
@keyframes qqTanlandi {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.qq-oq.is-xira { filter: grayscale(0.7) brightness(0.55); opacity: 0.5; }
.qq-oq.is-xira .qq-oq-pilik { display: none; }
.qq-oq.is-togri { box-shadow: 0 0 0 4px #3ddc84, 0 10px 22px rgba(20, 24, 44, 0.4); }

.b-status.qq-bumerang { color: #e5484d; }

@media (max-width: 1000px) {
  .qq-shkala { padding: 9px 12px 11px; bottom: 8px; }
  .qq-sh-yorliq { font-size: 0.86rem; }
  .qq-sh-yol { height: 28px; }
  .qq-ot { padding: 8px 24px; font-size: 0.95rem; }
  .qq-oqlar { gap: 12px; }
  .qq-rack { flex-wrap: wrap; gap: 8px; padding: 9px 7px 8px; }
  .qq-oq { width: clamp(70px, 20vw, 96px); height: clamp(70px, 20vw, 96px); }
}

/* ===== XAZINA QO'RG'ONI (doskaviy o'yin) =====
   2D blokli dunyo: SVG to'r, ostida ikki tomonning inventar kataklari. */

.qg-scene {
  position: relative; overflow: hidden; border-radius: 16px;
  height: 240px; padding: 0; margin-bottom: 6px;
  background: linear-gradient(180deg, #3d7fb8 0%, #7bb7e0 60%, #c6e2f2 100%);
  transition: background 1.2s;
}
.qg-scene.qg-tun {
  background: linear-gradient(180deg, #1a1030 0%, #3c2050 60%, #6b3550 100%);
}
.qg-svg { display: block; width: 100%; height: 100%; }

.qg-scene.qg-silkin { animation: qgSilkin 0.36s ease; }
@keyframes qgSilkin {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-5px, 3px); }
  55% { transform: translate(5px, -2px); }
  80% { transform: translate(-3px, 1px); }
}

.qg-b { animation: qgBulut linear infinite; }
.qg-b1 { animation-duration: 78s; }
.qg-b2 { animation-duration: 108s; animation-delay: -40s; }
@keyframes qgBulut {
  from { transform: translateX(-60px); }
  to { transform: translateX(1060px); }
}
#qg-yulduz rect { transition: opacity 1.4s; }

/* ---- bloklar ---- */
.qg-blok { shape-rendering: crispEdges; }
.qg-blok.qg-paydo { animation: qgPaydo 0.28s cubic-bezier(0.34, 1.5, 0.64, 1);
  transform-box: fill-box; transform-origin: center; }
@keyframes qgPaydo {
  from { transform: scale(0.4); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}

.qg-xaz { transition: transform 0.5s; transform-box: fill-box; transform-origin: bottom center; }
.qg-xaz.qg-golib { animation: qgGolib 0.9s ease-in-out infinite alternate; }
@keyframes qgGolib {
  from { transform: scale(1) translateY(0); filter: drop-shadow(0 0 6px #ffd166); }
  to { transform: scale(1.5) translateY(-6px); filter: drop-shadow(0 0 28px #ffd166); }
}

/* ---- qo'yish/sindirish nishonlari ---- */
.qg-nishon {
  fill: #3ddc84; fill-opacity: 0.28; stroke: #3ddc84; stroke-width: 2;
  cursor: pointer; animation: qgNishon 1.1s ease-in-out infinite alternate;
}
.qg-nishon:hover { fill-opacity: 0.6; }
@keyframes qgNishon {
  from { fill-opacity: 0.16; }
  to { fill-opacity: 0.38; }
}
.qg-nishon-kirka {
  fill: #ff4d6d; fill-opacity: 0.24; stroke: #ff4d6d; stroke-width: 2.5;
}
.qg-nishon-kirka:hover { fill-opacity: 0.55; }

/* ---- meteorit ---- */
.qg-meteor { filter: drop-shadow(0 0 10px rgba(255, 138, 61, 0.9)); }
/* Meteorit qiya tushadi — ogohlantirish uning kelish YO'LINI ko'rsatadi */
.qg-ogoh-yol {
  stroke: #ff4d6d; stroke-width: 2; stroke-dasharray: 5 6; pointer-events: none;
  animation: qgOgohYol 0.3s linear infinite;
}
@keyframes qgOgohYol {
  from { stroke-dashoffset: 11; opacity: 0.75; }
  to { stroke-dashoffset: 0; opacity: 0.35; }
}
.qg-parcha {
  animation: qgParcha 0.75s ease-out forwards; pointer-events: none;
  transform-box: fill-box; transform-origin: center;
}
@keyframes qgParcha {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; }
}

/* ---- bosqich belgisi ---- */
.qg-fazabelgi {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 5;
  padding: 7px 18px; border-radius: 999px; white-space: nowrap;
  background: rgba(12, 16, 34, 0.88); color: #fff; font-weight: 800; font-size: 0.98rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.qg-fazabelgi.is-left { border-color: #1368ce; }
.qg-fazabelgi.is-right { border-color: #ff8a3d; }
.qg-fazabelgi.is-tayyorlov { border-color: #ffd166; }
.qg-fazabelgi.is-meteor {
  border-color: #ff4d6d; background: rgba(70, 8, 26, 0.92);
  animation: qgOgohBelgi 0.7s ease-in-out infinite alternate;
}
@keyframes qgOgohBelgi {
  from { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
  to { box-shadow: 0 8px 30px rgba(255, 77, 109, 0.7); }
}
.qg-vaqt {
  display: inline-block; min-width: 24px; text-align: center; margin-left: 6px;
  background: rgba(255, 255, 255, 0.16); border-radius: 7px; padding: 1px 7px;
  font-family: Consolas, ui-monospace, monospace;
}

/* ---- tepadagi holat ---- */
.qg-holat { display: block; margin-top: 5px; font-size: 0.82rem; color: var(--muted); }
.qg-holat b { color: var(--ink); }

/* ---- inventar paneli ---- */
.qg-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
}
.qg-inv { display: flex; gap: 6px; }
.qg-slot {
  position: relative; width: 50px; height: 50px; border-radius: 9px; padding: 0;
  border: 3px solid #8a8fa8; cursor: pointer;
  background: linear-gradient(180deg, #dfe2ee, #b9bece);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
  display: grid; place-items: center;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.qg-slot.is-bosh { background: rgba(120, 130, 180, 0.14); border-color: rgba(120, 130, 180, 0.3); }
.qg-slot:not(:disabled):hover { transform: translateY(-3px); }
.qg-slot:disabled { cursor: default; }
.qg-slot.is-on {
  border-color: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.14);
  transform: translateY(-3px);
}
.qg-slot-belgi { font-size: 1.45rem; line-height: 1; }
.qg-slot-son {
  position: absolute; right: 3px; bottom: 1px;
  font-size: 0.78rem; font-weight: 900; color: #fff;
  text-shadow: 0 1px 0 #000, 0 0 3px #000;
  font-family: Consolas, ui-monospace, monospace;
}
.qg-slot.is-kirka { background: linear-gradient(180deg, #ffe9a8, #e8c24d); border-color: #b7902a; }

.qg-orta {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  min-width: 0;
}
.qg-mukofot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-size: 0.9rem;
}
.qg-m-l { color: var(--muted); font-weight: 700; }
.qg-m-blok {
  font-weight: 900; padding: 5px 14px; border-radius: 999px; font-size: 1rem;
  background: rgba(120, 130, 180, 0.16); white-space: nowrap;
}
.qg-m-blok.is-loy { background: rgba(169, 113, 63, 0.22); color: #7d4f26; }
.qg-m-blok.is-tosh { background: rgba(154, 160, 180, 0.28); color: #5a5f74; }
.qg-m-blok.is-qattiq { background: rgba(92, 100, 128, 0.26); color: #3c4257; }
.qg-m-blok.is-kirka { background: rgba(201, 162, 39, 0.26); color: #8a6f14; }
.qg-m-izoh { color: var(--muted); font-size: 0.78rem; }
.qg-tayyor { padding: 7px 22px; }

@media (max-width: 1000px) {
  .qg-slot { width: 46px; height: 46px; }
  .qg-slot-belgi { font-size: 1.3rem; }
  .qg-panel { gap: 8px; }
  .qg-m-izoh { display: none; }
  .qg-fazabelgi { font-size: 0.85rem; padding: 5px 12px; }
}

/* ===== DOSKAVIY O'YINLARDA JAVOB VARIANTLARI =====
   Har o'yinning javoblari o'z dunyosidan olingan: arqonda yog'och taxta,
   Bayt jangida terminal qatori, Qo'rg'onda esa blok. Umumiy .b-opt
   uslublari (rangli to'rtburchak) shu yerda bekor qilinadi. */

/* ---------- ARQON TORTISH: yog'och taxta ---------- */
.board-page .b-opt.ar-taxta {
  position: relative; overflow: visible;
  background: linear-gradient(180deg, #d9a35f 0%, #c08543 45%, #a86d31 100%);
  color: #4a2f12; border: 0; border-radius: 6px;
  padding: 13px 16px 13px 20px; margin-top: 10px;
  font-weight: 800; text-align: left;
  box-shadow: 0 4px 0 #7d4f26, 0 8px 14px rgba(70, 45, 15, 0.28),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.14s, box-shadow 0.14s, filter 0.25s;
}
/* Mixlar — taxtaning to'rt burchagida */
.ar-taxta::before, .ar-taxta::after {
  content: ''; position: absolute; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #eceef5, #7c8299 60%, #4d5266);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}
.ar-taxta::before { left: 7px; }
.ar-taxta::after { right: 7px; }
/* Yog'och tolalari */
.ar-tola {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; border-radius: 6px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(120, 76, 30, 0.14) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(180deg, rgba(120, 76, 30, 0.1) 0 1px, transparent 1px 9px);
}
/* Osilgan ip */
.ar-ip {
  position: absolute; left: 50%; top: -11px; width: 26px; height: 12px; margin-left: -13px;
  border: 3px solid #8a5a2b; border-bottom: 0; border-radius: 13px 13px 0 0;
}
.b-opt.ar-taxta .b-opt-text { position: relative; z-index: 2; flex: 1; }
.board-page .b-opt.ar-taxta:not(:disabled):not(.readonly):hover {
  transform: translateY(-3px) rotate(-0.7deg);
  box-shadow: 0 7px 0 #7d4f26, 0 12px 20px rgba(70, 45, 15, 0.34),
              inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.board-page .b-opt.ar-taxta.correct {
  background: linear-gradient(180deg, #86e0a8 0%, #4cc47c 45%, #2ea15f 100%);
  color: #0d3a22; box-shadow: 0 4px 0 #1d7345, 0 0 0 4px rgba(46, 184, 114, 0.45);
  outline: 0;
}
.board-page .b-opt.ar-taxta.dimmed { filter: grayscale(0.75) brightness(0.72); opacity: 0.55; }

/* ---------- BAYT JANGI: terminal qatori ---------- */
.board-page .b-opt.by-qator {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, rgba(18, 24, 46, 0.96), rgba(26, 34, 62, 0.96));
  color: #d6f5e8; border: 2px solid rgba(90, 230, 180, 0.35); border-radius: 8px;
  padding: 11px 14px; text-align: left; font-weight: 700;
  font-family: Consolas, ui-monospace, monospace;
  box-shadow: inset 0 0 22px rgba(76, 194, 255, 0.09);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s, filter 0.25s;
}
/* Skaner chiziqlari — terminal ekrani taassuroti */
.by-qator::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
}
.by-uch { color: #3ddc84; font-weight: 900; margin-right: 2px; }
.by-idx {
  flex: 0 0 auto; min-width: 34px; text-align: center; margin-right: 4px;
  padding: 2px 6px; border-radius: 5px; font-size: 0.86em; font-weight: 900;
  background: rgba(76, 194, 255, 0.16); color: #7fdcff; letter-spacing: 0.1em;
}
.b-opt.by-qator .b-opt-text { position: relative; z-index: 2; flex: 1; }
.by-kursor {
  flex: 0 0 auto; width: 9px; height: 1.1em; background: #3ddc84; border-radius: 1px;
  animation: byKursor 1s steps(2) infinite;
}
@keyframes byKursor { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.board-page .b-opt.by-qator:not(:disabled):not(.readonly):hover {
  border-color: #3ddc84; transform: translateX(4px);
  box-shadow: inset 0 0 26px rgba(61, 220, 132, 0.16), 0 0 18px rgba(61, 220, 132, 0.32);
}
.board-page .b-opt.by-qator.correct {
  border-color: #3ddc84; color: #eafff4;
  background: linear-gradient(90deg, rgba(14, 60, 40, 0.96), rgba(20, 84, 56, 0.96));
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.4), inset 0 0 26px rgba(61, 220, 132, 0.2);
  outline: 0;
}
.board-page .b-opt.by-qator.dimmed { opacity: 0.34; filter: saturate(0.4); }
.board-page .b-opt.by-qator.dimmed .by-kursor { display: none; }

/* ---------- XAZINA QO'RG'ONI: blok ---------- */
.b-opt.qg-javob {
  position: relative; overflow: hidden;
  border: 0; border-radius: 4px; padding: 13px 16px; text-align: left;
  font-weight: 800; color: #fff; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.25s;
  image-rendering: pixelated;
}
/* Blok turlari — dunyodagi bloklar bilan bir xil ranglarda */
.b-opt-0.qg-javob { background: #a9713f; box-shadow: 0 5px 0 #7d4f26, inset 0 4px 0 rgba(255, 255, 255, 0.24); }
.b-opt-1.qg-javob { background: #9aa0b4; box-shadow: 0 5px 0 #6f7488, inset 0 4px 0 rgba(255, 255, 255, 0.28); }
.b-opt-2.qg-javob { background: #5c8f4a; box-shadow: 0 5px 0 #3f6b32, inset 0 4px 0 rgba(255, 255, 255, 0.24); }
.b-opt-3.qg-javob { background: #5c6480; box-shadow: 0 5px 0 #3c4257, inset 0 4px 0 rgba(255, 255, 255, 0.24); }
/* Blok yuzasidagi naqsh */
.qg-j-yuz {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    linear-gradient(180deg, transparent 0 62%, rgba(0, 0, 0, 0.28) 62% 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 3px, transparent 3px 22px);
}
.qg-j-taxta {
  position: absolute; left: 8px; top: 9px; width: 14px; height: 8px; border-radius: 2px;
  background: rgba(0, 0, 0, 0.18); pointer-events: none;
  box-shadow: 26px 13px 0 rgba(0, 0, 0, 0.14), 62px 4px 0 rgba(0, 0, 0, 0.12),
              96px 15px 0 rgba(0, 0, 0, 0.1);
}
.b-opt.qg-javob .b-opt-text { position: relative; z-index: 2; flex: 1; }
.b-opt.qg-javob:not(:disabled):not(.readonly):hover {
  transform: translateY(-4px);
  filter: brightness(1.1);
}
.b-opt.qg-javob:not(:disabled):not(.readonly):active { transform: translateY(2px); }
.b-opt.qg-javob.correct {
  outline: 0; box-shadow: 0 5px 0 #1d7345, 0 0 0 4px #3ddc84;
  background: #3ea86a;
}
.b-opt.qg-javob.dimmed { filter: grayscale(0.8) brightness(0.6); opacity: 0.55; }

/* Uch o'yinda ham eski "shakl" belgisi ishlatilmaydi */
.ar-taxta .b-shape, .by-qator .b-shape, .qg-javob .b-shape { display: none; }

/* ===== QO'RG'ON: G'ALABA SANDIG'I =====
   Butun ekranni egallaydigan alohida qatlam — sandiq o'yin oynasiga
   sig'masligi kerak emas. G'olib sandig'i o'z joyidan uchib kelib
   o'rtada kattalashadi, ochiladi va ichidan boylik ko'rinadi.

   Diqqat: ko'rinadigan qismlar JS orqali AYNAN KERAKLI LAHZADA qo'shiladi
   yoki display bilan almashtiriladi. Oyna fonda tursa brauzer barcha
   animatsiyani muzlatadi — shu bois hech narsaning KO'RINISHI animatsiyaga
   bog'lanmagan, animatsiyalar faqat bezak. */

.qg-galaba-fon {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 46%, rgba(90, 55, 130, 0.55) 0%, rgba(12, 8, 26, 0.93) 62%),
    rgba(10, 7, 22, 0.9);
}

.qg-sandiq {
  position: relative;
  display: flex; flex-direction: column-reverse; align-items: center;
  transition: transform 1s cubic-bezier(0.22, 0.9, 0.28, 1.16);
}
.qg-s-svg {
  width: min(620px, 82vw); height: auto; display: block;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
}

.qg-nur { transform-box: fill-box; transform-origin: center; animation: qgNurAyl 18s linear infinite; }
@keyframes qgNurAyl { to { rotate: 360deg; } }

.qg-javohir {
  transform-box: fill-box; transform-origin: center;
  animation: qgYalt 1.5s ease-in-out infinite alternate;
}
@keyframes qgYalt {
  from { opacity: 0.78; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1.16); }
}

.qg-uchqun-z {
  transform-box: fill-box; transform-origin: center;
  animation: qgUchqun 2.4s ease-out infinite;
}
@keyframes qgUchqun {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; }
}

/* ---- eski, sarg'aygan qog'ozdagi xat ---- */
.qg-qogoz {
  position: relative;
  width: min(660px, 88vw);
  margin-bottom: -18px;          /* sandiq og'zidan chiqib turgandek */
  padding: 26px 44px 30px;
  /* Qog'oz aynan kerakli lahzada DOM ga qo'shiladi, shu bois bu yerda
     yashirin holat yo'q: oyna fonda tursa animatsiya muzlaydi va yashirin
     holat qotib qolardi. */
  transform: rotate(-1.6deg);
  transform-origin: center bottom;
  /* Sarg'aygan qog'oz: asosiy sarg'ish rang ustiga eskirgan dog'lar */
  background:
    radial-gradient(ellipse at 18% 24%, rgba(150, 106, 46, 0.22) 0%, transparent 42%),
    radial-gradient(ellipse at 82% 72%, rgba(133, 92, 38, 0.24) 0%, transparent 40%),
    radial-gradient(ellipse at 62% 12%, rgba(120, 84, 32, 0.16) 0%, transparent 34%),
    radial-gradient(ellipse at 30% 88%, rgba(120, 84, 32, 0.18) 0%, transparent 36%),
    linear-gradient(168deg, #f6e7c1 0%, #eddaa8 42%, #dfc689 78%, #cdae6f 100%);
  box-shadow:
    inset 0 0 46px rgba(122, 84, 30, 0.45),
    inset 0 0 8px rgba(90, 60, 20, 0.5),
    0 14px 34px rgba(0, 0, 0, 0.5);
  /* Yirtilgan chetlar */
  clip-path: polygon(
    0.6% 6%, 4% 1%, 11% 5%, 19% 0.5%, 27% 4%, 35% 1%, 44% 5%, 52% 1.5%,
    61% 5%, 69% 1%, 78% 4.5%, 86% 1%, 94% 5%, 99.4% 2%,
    98.6% 12%, 100% 24%, 98.4% 38%, 99.6% 52%, 98.4% 66%, 100% 80%, 98.8% 94%,
    93% 99%, 85% 95%, 76% 99.5%, 67% 96%, 58% 99.5%, 49% 95.5%, 40% 99%,
    31% 95%, 22% 99.5%, 13% 96%, 5% 99%, 1% 93%,
    1.6% 80%, 0.2% 66%, 1.6% 52%, 0.4% 38%, 1.8% 24%
  );
}

.qg-qogoz-matn {
  display: block; text-align: center;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem); font-weight: 900;
  color: #5a3a12; letter-spacing: 0.02em; line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 5px rgba(120, 84, 32, 0.35);
}
/* Qog'ozdagi tutash chiziq — qo'lda yozilgandek */
.qg-qogoz::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: 16px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(120, 84, 32, 0.45), transparent);
}

.qg-galaba-fon .b-end {
  display: flex !important; gap: 12px; justify-content: center; margin: 0;
  position: relative; z-index: 2;
}

@media (max-width: 700px) {
  .qg-qogoz { padding: 18px 26px 22px; margin-bottom: -10px; }
}
/* ===== QO'RG'ON USTASI (ko'p o'yinchili) =====
   Ko'rinish doskaviy 'Xazina qo'rg'oni' bilan BIR XIL: chizish ham, CSS
   sinflari ham (qg-*) o'sha yerdan. Bu yerda faqat uchta farq bor:
   maydon keng (ekran chetidan chetigacha), sandiqlar ustidagi ismlar,
   va o'g'irlik haqidagi xabar. */

body.xq-keng .container { max-width: 100%; padding-left: 10px; padding-right: 10px; }

.xq-world { position: relative; }
.xq-kutish { padding: 60px 0; text-align: center; color: var(--muted); font-weight: 700; }

/* Maydon ENI bo'yicha to'liq cho'ziladi. Kataklar kvadrat qolishi uchun
   balandlik nisbatdan kelib chiqadi — doskaviydagidek ko'rinish. */
.xq-sahna.qg-scene { height: auto; max-height: 46vh; }
.xq-sahna .qg-svg { width: 100%; height: auto; max-height: 46vh; }

/* Sandiq egalarining ismi — maydon ustida */
.xq-nomlar { position: absolute; left: 0; right: 0; top: 4px; height: 0; pointer-events: none; }
.xq-nom {
  position: absolute; transform: translateX(-50%); white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 800; color: #fff;
  background: rgba(12, 18, 40, 0.6); padding: 2px 8px; border-radius: 999px;
}
.xq-nom b { font-size: 0.88rem; }
.xq-nom.is-men { background: rgba(19, 104, 206, 0.9); }
.xq-nom.is-omon { background: rgba(61, 220, 132, 0.9); color: #0c2a18; }
.xq-nom.is-yiqildi { background: rgba(255, 77, 109, 0.85); text-decoration: line-through; opacity: 0.8; }
/* 15 kishidan ko'p — yorliqlar bir-biriga tegib ketmasligi uchun emoji */
.xq-nomlar.is-zich .xq-nom { font-size: 0; gap: 0; padding: 2px 4px; }
.xq-nomlar.is-zich .xq-nom b { font-size: 0.8rem; }
.xq-nomlar.is-zich .xq-nom.is-men,
.xq-nomlar.is-zich .xq-nom.is-omon { font-size: 0.62rem; gap: 3px; padding: 2px 7px; z-index: 2; }

.xq-panel { flex-wrap: wrap; justify-content: center; }
.xq-maslahat { width: 100%; text-align: center; color: var(--muted); font-size: 0.78rem; margin: 0; }

.xq-xabar {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 5;
  padding: 6px 16px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: rgba(12, 18, 40, 0.88); color: #ffd166; font-weight: 900;
  animation: xqXabar 2.2s ease-out forwards;
}
@keyframes xqXabar {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -22px); }
}

/* Javoblar doskaviy variantdagi blok ko'rinishida (qg-javob) — ikki ustunda */
.xq-javoblar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .xq-javoblar { grid-template-columns: 1fr; } }
.qg-j-son {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(0, 0, 0, 0.4); border-radius: 999px; padding: 2px 10px;
  font-size: 0.85rem; font-weight: 900;
}
.qg-scene.qg-tun { filter: none; }


/* ============ Ko'p o'yinchili o'yinlarning doskaviy varianti ============ */
/* Dunyo o'zining CSS'i bilan chiziladi (style.css dagi mavjud qoidalar).
   Bu yerda faqat doska qobig'i: o'lchamga moslash va savol paneli. */
.dm-page { height: 100vh; overflow: hidden; }
.dm-page .board-main {
  display: flex; flex-direction: column; min-height: 0;
  padding-top: 10px; padding-bottom: 12px;
}
.dm-page .b-scene {
  flex: 1 1 auto; height: auto; min-height: 160px;
  background: transparent; box-shadow: none; margin-bottom: 10px;
}
.dm-dunyo { width: 100%; height: 100%; position: relative; border-radius: 18px; overflow: hidden; }
.dm-dunyo > * { width: 100%; height: 100%; }

/* O'yin moduli o'z savol maydonini ham yaratadi — doskada u kerak emas,
   savol pastda alohida turadi. Faqat yakuniy animatsiyada ochiladi. */
.dm-qarea { display: none; }
.dm-qarea.is-yakun {
  display: block; position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  z-index: 6; pointer-events: none; overflow: hidden;
}

/* Qadam hisobi — arqon tortishdagi kabi */
.dm-qadam { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.1; margin-top: 2px; }
.b-team-left .dm-qadam { color: #1368ce; }
.b-team-right .dm-qadam { color: #ff8a3d; }

/* Javob varianti — raqamli yorliq bilan sodda taxta */
.b-opt.dm-javob {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; color: #16203c;
  border: 2px solid #d5deef; border-radius: 12px; padding: 9px 14px;
  box-shadow: 0 3px 0 rgba(12, 20, 46, 0.12);
}
.b-opt.dm-javob .dm-j-raqam {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 900;
  background: #eef2fb; color: #4a5a85;
}
.b-opt.dm-javob .b-opt-text { font-weight: 700; }
.b-opt.dm-javob.correct { background: #e6faee; border-color: #3ddc84; }
.b-opt.dm-javob.correct .dm-j-raqam { background: #3ddc84; color: #06331b; }
.b-opt.dm-javob.dimmed { opacity: 0.42; }
.b-opt.dm-javob:not([disabled]):active { transform: translateY(3px); box-shadow: none; }

.dm-page .b-question { font-size: 1.22rem; padding: 11px 18px; margin-bottom: 6px; }
.dm-page .b-status { min-height: 26px; margin-bottom: 6px; font-size: 1.1rem; }

/* ---- Past ekranli doska: hamma narsa 100% masshtabda sig'sin ----
   Muammo: sahna `flex: 1` bilan qisqarardi, lekin `min-height: 160px` da
   to'xtardi. Qolgan qismlar (jamoa paneli, savol, variantlar, dars
   paneli) esa umuman kichraymasdi, shu bois oxirgi javob variantlari
   ekrandan chiqib ketardi va `overflow: hidden` ularni YASHIRARDI —
   o'qituvchi ularni ko'rish uchun brauzerni 75% ga tushirishga majbur
   bo'lardi, bu esa o'yin maydonini ham kichraytirardi.
   Endi past ekranda qolgan qismlar zichlashadi va bo'shagan joy
   sahnaga beriladi. */
@media (max-height: 780px) {
  .dm-page .b-top { gap: 10px; margin-bottom: 6px; }
  .dm-page .b-team-name { font-size: 1.05rem; padding: 5px 16px; }
  .dm-page .b-question { font-size: 1.08rem; padding: 8px 16px; margin-bottom: 5px; }
  .dm-page .b-status { min-height: 20px; font-size: 0.98rem; margin-bottom: 5px; }
  .dm-page .b-opt { padding: 9px 14px; font-size: 0.95rem; border-radius: 10px; }
  .dm-page .b-col { gap: 7px; }
  .dm-page .b-scene { min-height: 150px; margin-bottom: 7px; }
  .dm-page .board-main { padding-top: 7px; padding-bottom: 8px; }
  .dm-page .b-pastki { padding: 5px 14px; }
  .dm-page .b-pastki .deck-nav { width: 34px; height: 34px; font-size: 1.25rem; }
  .dm-page .b-qoshni { display: none; }
}

@media (max-height: 640px) {
  .dm-page .b-team-name { font-size: 0.95rem; padding: 4px 13px; }
  .dm-page .b-question { font-size: 1rem; padding: 6px 14px; margin-bottom: 4px; }
  .dm-page .b-status { min-height: 0; font-size: 0.9rem; margin-bottom: 4px; }
  .dm-page .b-opt { padding: 7px 12px; font-size: 0.9rem; }
  .dm-page .b-col { gap: 6px; }
  .dm-page .b-scene { min-height: 120px; }
  .dm-page .b-pastki-nom { display: none; }
}

/* Zichlashtirishdan keyin ham sig'masa (juda past ekran, uzun savol) —
   kontent KESILMASIN. Aylantirish yomon, lekin ko'rinmaydigan javobdan
   yaxshiroq. Sig'sa, aylantirgich umuman chiqmaydi. */
.dm-page { overflow-y: auto; }

/* ---- Qolgan doskaviy o'yinlar (arqon, bayt, qal'a, qo'rg'on) ----
   Bular `.dm-page` kabi 100vh ga qulflanmagan, shu bois kontentni
   kesmaydi — lekin past ekranda AYLANTIRISHNI talab qiladi. Doskada
   o'yin o'rtasida javoblarni ko'rish uchun aylantirish ham yomon:
   625px ekranda «Qal'a to'pi» 199px aylanardi.
   Umumiy qismlar bir xil sinflarda, shu bois bitta qoida hammasiga
   yetadi. Har o'yinning O'Z sahnasi ham biroz pasaytiriladi. */
@media (max-height: 780px) {
  .board-page .b-top { gap: 10px; margin-bottom: 6px; }
  .board-page .b-team-name { font-size: 1.05rem; padding: 5px 16px; }
  .board-page .b-question { font-size: 1.08rem; padding: 9px 16px; margin-bottom: 5px; }
  .board-page .b-status { min-height: 20px; font-size: 0.98rem; margin-bottom: 5px; }
  .board-page .b-opt { padding: 9px 14px; font-size: 0.95rem; border-radius: 10px; }
  .board-page .b-col { gap: 7px; }
  .board-page .board-main { padding-top: 8px; padding-bottom: 10px; }
  .board-page .b-pastki { padding: 5px 14px; }
  .board-page .b-pastki .deck-nav { width: 34px; height: 34px; font-size: 1.25rem; }
  .board-page .b-qoshni { display: none; }

  /* Umumiy sahna (arqon va boshqalar) — `.dm-page` niki moslashuvchan,
     unga tegilmaydi. */
  .board-page:not(.dm-page) .b-scene { height: 190px; }
  .qq-scene { height: 230px; }
  .qg-scene { height: 190px; }
  .by-scene { min-height: 195px; }
}

@media (max-height: 640px) {
  .board-page .b-team-name { font-size: 0.95rem; padding: 4px 13px; }
  .board-page .b-question { font-size: 1rem; padding: 7px 14px; margin-bottom: 4px; }
  .board-page .b-status { min-height: 0; font-size: 0.9rem; margin-bottom: 4px; }
  .board-page .b-opt { padding: 7px 12px; font-size: 0.9rem; }
  .board-page .b-col { gap: 6px; }
  .board-page .b-pastki-nom { display: none; }

  .board-page:not(.dm-page) .b-scene { height: 158px; }
  .qq-scene { height: 195px; }
  .qg-scene { height: 165px; }
  .by-scene { min-height: 170px; }

  /* Bu ikki o'yinning javob tugmalari o'z uslubiga ega — umumiy
     `.b-opt` qoidasi ularga yetib bormaydi, alohida siqiladi. */
  .board-page .b-opt.ar-taxta { padding: 8px 14px 8px 18px; margin-top: 7px; }
  .board-page .b-opt.by-qator { padding: 7px 12px; }
}

/* ---- Raketa poygasi: doskaviy variantning kuchaytirilgan dunyosi ---- */
.dr-olam { position: relative; width: 100%; height: 100%; border-radius: 18px; overflow: hidden; background: #070b22; }
.dr-svg { display: block; width: 100%; height: 100%; }

/* Yulduz qatlamlari — parallaks siljish */
.dr-yulduz { will-change: transform; }
.dr-y1 { animation: drSurish 42s linear infinite; }
.dr-y2 { animation: drSurish 26s linear infinite; }
.dr-y3 { animation: drSurish 15s linear infinite; }
@keyframes drSurish {
  from { transform: translateX(0); }
  to { transform: translateX(-120px); }
}
.dr-galaktika { animation: drAylan 90s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes drAylan { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.dr-sayyora .dr-bant { animation: drBant 14s ease-in-out infinite alternate; }
@keyframes drBant { from { transform: translateY(-4px); } to { transform: translateY(4px); } }
.dr-oy1 { animation: drOy1 18s linear infinite; transform-box: fill-box; transform-origin: 50% 138px; }
.dr-oy2 { animation: drOy2 26s linear infinite reverse; transform-box: fill-box; transform-origin: 50% -152px; }
@keyframes drOy1 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes drOy2 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.dr-sayyora.is-bayram { animation: drBayram 0.7s ease-in-out 4; }
@keyframes drBayram {
  0%, 100% { transform: translate(918px, 250px) scale(1); }
  50% { transform: translate(918px, 250px) scale(1.06); }
}

.dr-asteroid { transform-box: fill-box; transform-origin: center; }
.dr-a1 { animation: drTumble 22s linear infinite; }
.dr-a2 { animation: drTumble 15s linear infinite reverse; }
.dr-a3 { animation: drTumble 30s linear infinite; }
@keyframes drTumble { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Raketa: joyi transform bilan beriladi, o'tish silliq */
.dr-raketa { transition: transform 1.1s cubic-bezier(0.22, 0.7, 0.3, 1); }
.dr-raketa .dr-alanga { animation: drAlanga 0.18s steps(2) infinite; transform-box: fill-box; transform-origin: right center; }
@keyframes drAlanga { from { transform: scaleX(0.86) scaleY(0.94); } to { transform: scaleX(1.1) scaleY(1.06); } }
.dr-raketa .dr-chiroq { animation: drChiroq 1.1s ease-in-out infinite alternate; }
@keyframes drChiroq { from { opacity: 0.35; } to { opacity: 1; } }

/* Tezlik chiziqlari va qalqon — faqat kerakli holatda */
.dr-raketa .dr-tezlik { opacity: 0; transition: opacity 0.3s; }
.dr-raketa.is-turbo .dr-tezlik { opacity: 1; animation: drTezlik 0.25s linear infinite; }
@keyframes drTezlik { from { transform: translateX(0); } to { transform: translateX(-22px); } }
.dr-raketa .dr-qalqon { opacity: 0; transition: opacity 0.3s; }
.dr-raketa.is-xavf .dr-qalqon { opacity: 1; animation: drQalqon 1s ease-in-out infinite alternate; }
@keyframes drQalqon { from { opacity: 0.5; } to { opacity: 1; } }

.dr-raketa.is-yetakchi .dr-alanga { filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.9)); }
.dr-raketa.is-uchdi { transition: transform 1.3s cubic-bezier(0.5, 0, 0.7, 1), opacity 0.4s 1.2s; opacity: 0; }
.dr-raketa.is-portladi { opacity: 0; transition: opacity 0.2s; }
.dr-kometa { transition: transform 0.78s cubic-bezier(0.35, 0, 0.85, 0.5); }
.dr-olam.dr-silkin { animation: drSilkin 0.42s ease; }
@keyframes drSilkin {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-7px, 4px); }
  60% { transform: translate(6px, -3px); }
}

/* Jamoa yorliqlari — SVG ustidagi HTML */
.dr-yorliqlar { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; }
.dr-yorliq {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 12px; border-radius: 12px; white-space: nowrap;
  background: rgba(8, 12, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.14);
  transition: left 1.1s cubic-bezier(0.22, 0.7, 0.3, 1);
}
.dr-yorliq b { font-size: 0.95rem; font-weight: 900; color: #fff; }
.dr-yorliq i { font-style: normal; font-size: 0.82rem; font-weight: 800; color: #ffd166; }
.dr-yorliq u { text-decoration: none; font-size: 0.7rem; font-weight: 800; color: #8fe9ff; }
.dr-yorliq-0 { border-color: rgba(77, 163, 255, 0.6); }
.dr-yorliq-1 { border-color: rgba(255, 178, 107, 0.6); }

/* TURBO tanlovi */
.dm-turbo .dm-turbo-ustun { display: flex; flex-direction: column; gap: 8px; }
.dm-katta {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 12px; border-radius: 16px; cursor: pointer; border: none;
  color: #fff; font-family: inherit; line-height: 1.2;
}
.dm-katta b { font-size: 1.6rem; font-weight: 900; letter-spacing: 0.5px; }
.dm-katta i { font-style: normal; font-size: 0.8rem; opacity: 0.9; }
.dm-katta-xavfsiz { background: linear-gradient(180deg, #6fb3ff, #1368ce); box-shadow: 0 5px 0 #0d4a93; }
.dm-katta-turbo { background: linear-gradient(180deg, #ffd166, #f5761a); color: #3d1f02; box-shadow: 0 5px 0 #b4500f; }
.dm-katta:active { transform: translateY(5px); box-shadow: none; }
.dm-kut {
  display: grid; place-items: center; height: 100%; min-height: 90px;
  border-radius: 16px; background: #eef2fb; color: #6b7896; font-weight: 800;
}

/* Ikki oynali doskaviy o'yin: har jamoaga alohida kamera */
.dm-dunyo.dm-ikki { display: flex; gap: 10px; background: transparent; }
.dm-yarim {
  position: relative; flex: 1 1 50%; min-width: 0;
  border-radius: 16px; overflow: hidden; background: #0d1533;
  border: 3px solid transparent;
}
.dm-yarim-0 { border-color: rgba(19, 104, 206, 0.75); }
.dm-yarim-1 { border-color: rgba(255, 138, 61, 0.75); }
.dm-yarim-nom {
  position: absolute; left: 10px; top: 8px; z-index: 3;
  padding: 3px 12px; border-radius: 999px; font-weight: 900; font-size: 0.85rem;
  color: #fff; background: rgba(8, 12, 32, 0.7); pointer-events: none;
}
.dm-yarim-0 .dm-yarim-nom { background: rgba(19, 104, 206, 0.85); }
.dm-yarim-1 .dm-yarim-nom { background: rgba(255, 138, 61, 0.9); }
.dm-yarim-oyna { display: block; width: 100%; height: 100%; border: 0; }

/* iframe ichidagi yarim sahifa */
.yarim-body { margin: 0; overflow: hidden; background: #0d1533; }
.yarim-ildiz { width: 100vw; height: 100vh; position: relative; }
.yarim-ildiz > * { width: 100%; height: 100%; }
.yarim-qarea { display: none; }

/* Turbo xavfi: gologramma qalqon */
.dr-gologramma { pointer-events: none; }
.dr-gologramma .dr-halqa { animation: drHalqa 1.6s linear infinite; transform-box: fill-box; transform-origin: center; }
.dr-gologramma .dr-halqa1 { animation-duration: 2.2s; animation-direction: reverse; }
.dr-gologramma .dr-halqa2 { animation-duration: 2.9s; }
@keyframes drHalqa { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 64; } }

/* Turbo xavfi: qalqon zarbasi va himoyasiz raketa */
.dr-gologramma.is-zarba ellipse { stroke: #fff !important; opacity: 1 !important; }
.dr-raketa.is-ochiq { animation: drOchiq 0.55s ease-in-out infinite alternate; }
@keyframes drOchiq { from { filter: none; } to { filter: drop-shadow(0 0 12px rgba(255, 84, 112, 0.9)); } }
.dr-raketa.is-urildi { animation: drUrildi 0.4s steps(2) 3; }
@keyframes drUrildi { from { opacity: 1; } to { opacity: 0.25; } }

/* Minora dunyosi doskada balandroq idishda turadi. Kompyuterli variantda
   dunyo balandligi = maydon + yer, shu bois uzoqdagi shahar (`bottom:96px`)
   aynan yer ustiga tushardi. Doskada esa idish baland bo'lgani uchun
   shahar yerdan PASTDA, bo'sh havoda qolib ketgan edi. Maydonni cho'zib
   yerni pastga tushiramiz — shahar yana o'z joyiga qaytadi. */
.dm-dunyo .mn-world { display: flex; flex-direction: column; }
.dm-dunyo .mn-stage { flex: 1 1 auto; height: auto; min-height: 0; }

/* Poyga ko'rinishini tanlash (marafon / eshkak / trassa) */
.korinish-tanlov { margin-bottom: 12px; }
.korinish-sarlavha { font-weight: 800; margin-bottom: 6px; color: var(--muted); font-size: 0.9rem; }
.korinish-royxat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.korinish-katak {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border-radius: 12px; cursor: pointer;
  border: 2px solid #d5deef; background: #fff; text-align: center;
}
.korinish-katak input { display: none; }
.korinish-katak .korinish-emoji { font-size: 1.6rem; }
.korinish-katak .korinish-nom { font-weight: 800; font-size: 0.86rem; }
.korinish-katak:has(input:checked) { border-color: var(--primary, #4f46e5); background: #eef2ff; }

/* Hujum / himoya tanlovi */
.dm-tanlov .dm-tanlov-ustun { display: flex; flex-direction: column; gap: 8px; }
.dm-katta-himoya { background: linear-gradient(180deg, #6fb3ff, #1368ce); box-shadow: 0 5px 0 #0d4a93; }
.dm-katta-hujum { background: linear-gradient(180deg, #ff8a8a, #e5484d); box-shadow: 0 5px 0 #a82c30; }

/* ---- Sharlar jangi: doskaviy dunyo ---- */
.sh-olam { position: relative; width: 100%; height: 100%; border-radius: 18px; overflow: hidden; background: #67b6ec; }
.sh-svg { display: block; width: 100%; height: 100%; }
.sh-savat-guruh { transition: transform 1.1s cubic-bezier(0.22, 0.7, 0.3, 1); }
.sh-savat-guruh .sh-sharlar { animation: shTebran 3.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom center; }
@keyframes shTebran { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.sh-savat-guruh .sh-savat { animation: shSavat 3.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: top center; }
@keyframes shSavat { from { transform: rotate(2deg); } to { transform: rotate(-2deg); } }
.sh-savat-guruh.is-teshildi { animation: shTeshildi 0.5s ease; }
@keyframes shTeshildi {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-6px, 8px) rotate(-3deg); }
  60% { transform: translate(5px, 5px) rotate(2deg); }
}
.sh-savat-guruh.is-tushdi { transition: transform 0.7s cubic-bezier(0.5, 0, 0.75, 1); }
.sh-savat-guruh.is-uchdi { transition: transform 1.6s cubic-bezier(0.4, 0, 0.6, 1); }
.sh-bulut { animation: shBulut 46s linear infinite; }
.sh-b2 { animation-duration: 62s; }
.sh-b3 { animation-duration: 34s; }
@keyframes shBulut { from { transform: translateX(-140px); } to { transform: translateX(1140px); } }
.sh-qush { animation: shQush 9s ease-in-out infinite; }
@keyframes shQush {
  0% { transform: translate(0, 0); }
  50% { transform: translate(340px, -34px); }
  100% { transform: translate(680px, 8px); opacity: 0; }
}
.sh-marra line { animation: shMarra 1.8s linear infinite; }
@keyframes shMarra { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 52; } }


/* ===== Obuna oynasi (yopib bo'lmaydi) =====
   Faqat obuna tizimi YOQILGAN va o'qituvchining obunasi tugagan holatda
   chiziladi. Standart holatda sayt bepul — bu blok umuman chizilmaydi. */
.ob-qatlam {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(12, 15, 32, 0.82); backdrop-filter: blur(5px);
  overflow-y: auto;
}
.ob-oyna {
  width: 100%; max-width: 720px; margin: auto; padding: 28px 30px 24px;
  border-radius: 20px; background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: obKirish 0.28s ease;
}
@keyframes obKirish { from { opacity: 0; transform: translateY(18px); } }
.ob-bosh { text-align: center; margin-bottom: 22px; }
.ob-belgi { font-size: 2.6rem; line-height: 1; }
.ob-bosh h2 { font-size: 1.42rem; margin: 8px 0 6px; }
.ob-izoh { color: var(--muted); font-size: 0.96rem; line-height: 1.5; }

.ob-tariflar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ob-tarif {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 22px 18px 18px; border-radius: 16px; text-align: center;
  border: 2px solid #e2e5f5; background: #fbfcff;
}
.ob-tarif.is-tavsiya { border-color: var(--primary); background: #f6f6ff; }
.ob-belgicha {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--primary); color: #fff; font-size: 0.72rem; font-weight: 800;
}
.ob-tarif h3 { font-size: 1.04rem; }
.ob-narx { display: flex; align-items: baseline; gap: 6px; }
.ob-narx b { font-size: 2rem; font-weight: 900; color: var(--ink); }
.ob-narx span { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.ob-tarif-izoh { color: var(--muted); font-size: 0.86rem; line-height: 1.4; min-height: 38px; }
.ob-sotib {
  display: block; width: 100%; padding: 11px 16px; border-radius: 12px;
  background: var(--primary); color: #fff; font-weight: 800; text-align: center;
  transition: transform 0.12s, background 0.2s;
}
.ob-sotib:hover { background: var(--primary-dark); transform: translateY(-2px); }

.ob-pastki {
  margin-top: 18px; color: var(--muted); font-size: 0.88rem;
  line-height: 1.5; text-align: center;
}
.ob-mayda { margin-top: 6px; font-size: 0.82rem; opacity: 0.85; }
.ob-chiqish { margin-top: 16px; text-align: center; }
.ob-chiqish-btn {
  border: 0; background: none; cursor: pointer; padding: 6px 10px;
  color: var(--muted); font: inherit; font-size: 0.86rem; text-decoration: underline;
}
.ob-chiqish-btn:hover { color: var(--ink); }

@media (max-width: 560px) {
  .ob-tariflar { grid-template-columns: 1fr; }
  .ob-oyna { padding: 22px 18px 18px; }
}


/* ---- Til tanlagich ----
   Sarlavhaning o'ng chekkasida, uch harfli tugma: UZ · RU · EN.
   Bayroq emas, KOD ishlatiladi — bayroq tilni emas, davlatni bildiradi
   (ruscha faqat Rossiyada, inglizcha faqat Angliyada gapirilmaydi). */
.tilchip { display: inline-flex; gap: 2px; padding: 3px; margin-left: 10px;
  background: #eceef8; border-radius: 999px; }
.tilchip-b {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.04em; color: #4d5477; text-decoration: none; line-height: 1;
  display: grid; place-items: center; transition: background 0.15s, color 0.15s;
}
.tilchip-b:hover { background: #dfe3f4; color: #2a2f52; }
.tilchip-b.is-faol { background: #5b5bd6; color: #fff; }
