/* Ilmdosh Matematika — dizayn tizimi */

:root {
  --bg: #F6F4FF; --surface: #FFFFFF; --surface-2: #F1EEFF; --ink: #1E2140; --ink-2: #4A4F7A; --muted: #7A7FA6; --line: #E4E0F6;
  --brand: #6D4AFF; --brand-d: #4F32D6; --brand-l: #ECE6FF;
  --accent: #FF7A45; --gold: #FFB400;
  --ok: #1FB56B; --ok-d: #128A50; --ok-l: #DFF7EA;
  --bad: #EF4D5E; --bad-d: #C7303F; --bad-l: #FFE4E7;
  --shadow: 0 10px 28px -10px rgba(60, 40, 140, .22);
  --shadow-s: 0 2px 10px rgba(60, 40, 140, .10);
  --tf-bg: #EEF0FF; --tf-line: #C9CDF0;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-d: 'Fredoka', 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme:invalid) {
  :root:not([data-theme="light"]) {
    --bg: #12142B; --surface: #1B1E3E; --surface-2: #262A57; --ink: #F1F2FF; --ink-2: #C5C9F0; --muted: #8E93C4; --line: #313669;
    --brand: #8F75FF; --brand-d: #6F52F0; --brand-l: #2D2A66;
    --ok-l: #15402D; --bad-l: #4B1E29; --shadow: 0 10px 28px -10px rgba(0, 0, 0, .6); --shadow-s: 0 2px 10px rgba(0, 0, 0, .35);
    --tf-bg: #262A57; --tf-line: #3B4080; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12142B; --surface: #1B1E3E; --surface-2: #262A57; --ink: #F1F2FF; --ink-2: #C5C9F0; --muted: #8E93C4; --line: #313669;
  --brand: #8F75FF; --brand-d: #6F52F0; --brand-l: #2D2A66;
  --ok-l: #15402D; --bad-l: #4B1E29; --shadow: 0 10px 28px -10px rgba(0, 0, 0, .6); --shadow-s: 0 2px 10px rgba(0, 0, 0, .35);
  --tf-bg: #262A57; --tf-line: #3B4080; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 500 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh; display: flex; flex-direction: column;
}
#app { flex: 1; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: .1px; }
p { margin: 0 0 .8em; }
a { color: var(--brand); }
img, svg { max-width: 100%; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.scrollx { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; text-align: center; }
.scrollx > svg { display: inline-block; height: auto; max-width: none; }
.study-svg { width: 480px; max-width: 100%; height: auto; }
.visual-lab { border: 2px solid var(--line); border-radius: 20px; padding: 18px; background: var(--surface-2); margin-block: 12px; }
.lab-kicker, .pre-label { font-size: 13px; font-weight: 900; color: var(--brand); }
.pre-label { display: block; margin-bottom: 5px; }
.lab-plot { display: flex; justify-content: center; min-width: 0; }
.lab-plot > svg { max-height: 310px; }
.lab-controls { display: flex; align-items: center; gap: 15px; margin-block: 8px; }
.lab-controls input { flex: 1; min-width: 0; accent-color: var(--brand); height: 36px; }
.lab-controls output { min-width: 42px; padding: 3px 7px; border-radius: 8px; background: var(--surface); text-align: center; font-weight: 900; }
.lab-readout { font-size: 15px; line-height: 1.7; padding-top: 10px; border-top: 1px solid var(--line); }
.checkpoint { border: 2px solid var(--line); border-radius: 20px; padding: 20px; }
.checkpoint h3 { font-size: 21px; }
.checkpoint-options { display: grid; gap: 10px; }
.checkpoint-options .btn { justify-content: flex-start; text-align: left; line-height: 1.5; }
.checkpoint-options .selected { border-color: var(--brand); background: var(--brand-l); }
.checkpoint-result:not(:empty) { margin-top: 15px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.checkpoint-result.correct { background: var(--ok-l); }
.checkpoint-result.try-again { background: var(--bad-l); }
.course-tools { display: flex; flex-wrap: wrap; gap: 12px; padding-block: 22px 8px; align-items: center; }
.course-search { flex: 1 1 260px; border: 2px solid var(--line); border-radius: 14px; padding: 13px 16px; font: inherit; background: var(--surface); color: var(--ink); }
.subject-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-filters [aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: white; }
.search-status { width: 100%; font-size: 14px; color: var(--muted); }
@media(max-width:600px) { .visual-lab,.checkpoint { padding: 13px; } .lab-readout { font-size: 14px; } }
[hidden] { display: none !important; }

/* ---------- tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; text-decoration: none; cursor: pointer;
  font: 800 16px/1.1 var(--font); padding: 14px 22px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s, background .15s, filter .15s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--brand); border-color: var(--brand-d); color: #fff; box-shadow: 0 4px 0 var(--brand-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--brand-d); }
.btn.ok { background: var(--ok); border-color: var(--ok-d); color: #fff; box-shadow: 0 4px 0 var(--ok-d); }
.btn.ok:active { box-shadow: 0 1px 0 var(--ok-d); }
.btn.bad { background: var(--bad); border-color: var(--bad-d); color: #fff; box-shadow: 0 4px 0 var(--bad-d); }
.btn.bad:active { box-shadow: 0 1px 0 var(--bad-d); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:active { transform: translateY(1px); }
.btn.soft { background: var(--brand-l); border-color: transparent; color: var(--brand-d); box-shadow: none; }
:root[data-theme="dark"] .btn.soft { color: #CFC4FF; }
.btn.lg { padding: 16px 28px; font-size: 18px; border-radius: 18px; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 12px; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  font-size: 18px; cursor: pointer; flex: none; transition: background .15s, transform .08s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.chip-btn {
  border: 2px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; font: 800 14px var(--font); cursor: pointer; white-space: nowrap;
}
.chip-btn:hover { background: var(--surface-2); }

/* ---------- yuqori panel ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 2px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font: 600 22px var(--font-d); }
.brand-text small { font: 800 11px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.topnav { display: flex; gap: 6px; margin-left: 10px; }
.topnav a { padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 15px; }
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topstats { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { padding: 7px 12px; border-radius: 99px; background: var(--surface-2); font: 800 14px var(--font); white-space: nowrap; }
.sitefoot { padding: 26px 0 34px; color: var(--muted); font-size: 14px; }
.sitefoot .wrap { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; }
body.in-lesson .topbar, body.in-lesson .sitefoot { display: none; }
body.reader-open { overflow: hidden; }

/* ---------- bosh sahifa ---------- */
.hero {
  background: radial-gradient(1200px 500px at 85% -10%, rgba(255, 122, 69, .55), transparent 60%), linear-gradient(135deg, #5A3BEB 0%, #7B5BFF 55%, #9A7CFF 100%);
  color: #fff; border-radius: 0 0 44px 44px; overflow: hidden;
}
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: center; padding-block: 46px 52px; }
.kicker { display: inline-block; font: 800 13px var(--font); letter-spacing: .14em; text-transform: uppercase; opacity: .9; margin-bottom: 10px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: #FFD666; }
.hero .lead { font-size: 19px; opacity: .95; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 22px; }
.hero .btn.primary { background: #fff; color: #4F32D6; border-color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .55); }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 15px; opacity: .95; }
.hero-facts b { font: 600 24px var(--font-d); margin-right: 4px; color: #FFD666; }
.hero-art { position: relative; min-height: 300px; display: grid; place-items: center; }
.hero-m { width: min(300px, 70%); filter: drop-shadow(0 18px 24px rgba(20, 10, 80, .35)); animation: bob 4s ease-in-out infinite; }
.hero-m .mascot { width: 100%; height: auto; }
.fl { position: absolute; font: 600 44px var(--font-d); color: rgba(255, 255, 255, .85); animation: float 6s ease-in-out infinite; user-select: none; }
.fl0 { top: 6%; left: 8%; } .fl1 { top: 14%; right: 6%; animation-delay: -1s; color: #FFD666; } .fl2 { bottom: 12%; left: 4%; animation-delay: -2s; }
.fl3 { top: 46%; left: -2%; animation-delay: -3s; color: #FFB08F; } .fl4 { top: 4%; left: 48%; animation-delay: -4s; } .fl5 { bottom: 6%; right: 14%; animation-delay: -1.5s; }
.fl6 { top: 60%; right: 0; animation-delay: -2.5s; color: #FFD666; } .fl7 { bottom: 0; left: 40%; animation-delay: -3.5s; } .fl8 { top: 30%; right: 30%; animation-delay: -5s; opacity: .5; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(6deg); } }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: -26px; position: relative; }
.how-card { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); }
.how-card h3 { font-size: 22px; margin: 6px 0 4px; }
.how-card p { color: var(--ink-2); margin: 0; font-size: 15.5px; }
.how-ic { font-size: 30px; }
.sec-h { font-size: clamp(26px, 3.6vw, 36px); margin: 46px 0 6px; }
.sec-p { color: var(--ink-2); margin-bottom: 20px; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line);
  text-decoration: none; color: var(--ink); overflow: hidden; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.gcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--gc); }
.gcard.ready:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gc); }
.gcard.soon { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); border-style: dashed; color: var(--ink-2); }
.gnum { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: var(--gc); color: #fff; font: 600 32px var(--font-d); box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.gcard.soon .gnum { opacity: .55; }
.gnum.big { width: 84px; height: 84px; font-size: 48px; border-radius: 26px; margin: 0 auto 10px; }
.gmeta { display: flex; flex-direction: column; margin-top: 4px; }
.gmeta b { font: 600 22px var(--font-d); }
.gmeta span { font-size: 14px; color: var(--muted); font-weight: 700; }
.gblurb { font-size: 14.5px; color: var(--ink-2); margin: 2px 0 6px; min-height: 2.6em; }
.gprog { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gprog i { display: block; height: 100%; background: var(--gc); border-radius: 99px; }
.gsmall { color: var(--muted); font-weight: 700; }
.gbadge { position: absolute; top: 16px; right: 14px; font: 800 12px var(--font); padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.gbadge.live { background: var(--ok-l); color: var(--ok-d); }
:root[data-theme="dark"] .gbadge.live { color: #7CE5B0; }
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-2); font-weight: 800; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drill-cta { display: flex; gap: 16px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 28px; padding: 22px 26px; border: 2px solid var(--line); border-radius: 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%); }
.drill-cta h3 { font-size: 26px; margin-bottom: 2px; } .drill-cta p { margin: 0; color: var(--ink-2); max-width: 36em; }
.src { margin-top: 40px; }
.src-in { font-size: 14.5px; color: var(--ink-2); padding: 16px 18px; border-radius: 18px; background: var(--surface-2); }
.page { padding-bottom: 20px; }

/* ---------- sinf sahifasi ---------- */
.back { display: inline-block; margin: 20px 0 6px; text-decoration: none; font-weight: 800; color: var(--ink-2); }
.back:hover { color: var(--brand); }
.grade-head { background: color-mix(in srgb, var(--gc) 13%, var(--bg)); border-bottom: 2px solid color-mix(in srgb, var(--gc) 25%, var(--line)); }
.gh-in { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding-bottom: 30px; }
.grade-head h1 { font-size: clamp(30px, 4.6vw, 48px); margin-bottom: 8px; }
.grade-head .kicker { color: var(--gc); opacity: 1; }
.grade-head .lead { color: var(--ink-2); font-size: 18px; margin-bottom: 6px; }
.gh-book { font-size: 14.5px; color: var(--muted); }
.gh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gh-ring { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 2px solid var(--line); border-radius: 26px; padding: 16px 20px; box-shadow: var(--shadow-s); --gc: inherit; }
.grade-head .gh-ring { --gc: var(--gc); }
.ring { width: 110px; height: 110px; color: var(--ink); }
.gh-ring-t { display: flex; flex-direction: column; }
.gh-ring-t b { font: 600 28px var(--font-d); }
.gh-ring-t span { font-size: 14px; color: var(--muted); font-weight: 700; }
.gh-stars { color: var(--gold) !important; }
.chapters { display: flex; flex-direction: column; gap: 22px; padding-block: 28px 20px; }
.chapter { background: var(--surface); border: 2px solid var(--line); border-radius: 26px; overflow: hidden; }
.ch-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: color-mix(in srgb, var(--ch) 14%, var(--surface)); border-bottom: 2px solid color-mix(in srgb, var(--ch) 22%, var(--line)); }
.ch-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--ch); display: grid; place-items: center; font-size: 28px; flex: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .16); }
.ch-t { flex: 1; min-width: 0; }
.ch-t h2 { font-size: 22px; margin: 0; }
.ch-t small { color: var(--ink-2); font-weight: 700; }
.ch-prog { font: 700 16px var(--font); color: var(--ink-2); background: var(--surface); border: 2px solid var(--line); border-radius: 99px; padding: 6px 14px; white-space: nowrap; }
.ch-prog b { font: 600 20px var(--font-d); color: var(--ch); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; padding: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform .1s, box-shadow .1s, border-color .1s; min-height: 132px;
}
.tile:hover { transform: translateY(-2px); border-color: var(--ch); box-shadow: 0 6px 0 color-mix(in srgb, var(--ch) 40%, var(--line)); }
.tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tile-ic { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.tile-t { font: 800 16px/1.25 var(--font); }
.tile-m { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.tile-s { margin-top: auto; font: 800 14px var(--font); color: var(--ch); letter-spacing: .06em; }
.tile.done { background: color-mix(in srgb, var(--ch) 9%, var(--surface)); }
.tile.done .tile-s { color: var(--gold); font-size: 17px; }
.tile.next { border-color: var(--ch); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ch) 22%, transparent), 0 4px 0 color-mix(in srgb, var(--ch) 50%, var(--line)); }
.tile.test { border-style: dashed; background: var(--surface-2); }
.soon-page { padding-block: 10px 60px; }
.soon-card { max-width: 560px; margin: 30px auto; text-align: center; background: var(--surface); border: 2px dashed var(--line); border-radius: 28px; padding: 34px 26px; }
.soon-card .gnum { --gc: var(--gc); }
.soon-card .plist { display: inline-block; text-align: left; margin-bottom: 16px; }

/* ---------- pleyer ---------- */
.player { min-height: 100dvh; display: flex; flex-direction: column; }
.player-top { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 14px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--bg); }
.progress { flex: 1; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ch, var(--brand)); transition: width .4s cubic-bezier(.3, .9, .3, 1); position: relative; }
.progress i::after { content: ''; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); }
.player-body { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 6px 18px 30px; outline: none; }
.player-foot {
  position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 14px max(18px, calc((100vw - 780px) / 2 + 18px)) calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 2px solid var(--line);
}
.player-foot .btn { min-width: 150px; }
.player-foot.reading-foot { position: static; }
.player-foot.fb { justify-content: flex-start; flex-wrap: nowrap; animation: slideUp .25s ease-out; }
.player-foot.fb .btn { margin-left: auto; flex: none; }
.player-foot.fb.ok { background: var(--ok-l); border-color: var(--ok); }
.player-foot.fb.bad { background: var(--bad-l); border-color: var(--bad); }
.fb-ic { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 26px var(--font); background: var(--ok); }
.fb.bad .fb-ic { background: var(--bad); }
.fb-txt { min-width: 0; }
.fb-h { font: 800 20px/1.25 var(--font); color: var(--ok-d); }
.fb.bad .fb-h { color: var(--bad-d); }
:root[data-theme="dark"] .fb-h { color: #7CE5B0; } :root[data-theme="dark"] .fb.bad .fb-h { color: #FF9AA6; }
@media (prefers-color-scheme:invalid) { :root:not([data-theme="light"]) .fb-h { color: #7CE5B0; } :root:not([data-theme="light"]) .fb.bad .fb-h { color: #FF9AA6; } }
.fb-e { font-size: 15.5px; color: var(--ink-2); margin-top: 2px; }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: 28px; padding: 22px 22px 18px; box-shadow: var(--shadow); animation: cardIn .3s ease-out; }
@keyframes cardIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-title { font-size: clamp(24px, 4vw, 32px); color: var(--ch, var(--brand)); margin: 0 0 12px; }
.card-body { display: flex; flex-direction: column; gap: 14px; }
.qwrap { animation: cardIn .25s ease-out; }
.retry-tag { display: inline-block; font: 800 13px var(--font); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); padding: 4px 12px; border-radius: 99px; margin: 6px 0 4px; }

/* intro va natija */
.intro, .result { text-align: center; padding: 8px 0 20px; animation: cardIn .35s ease-out; }
.intro-m, .res-m { width: min(190px, 46%); margin: 6px auto 0; }
.res-m { animation: bob 3s ease-in-out infinite; }
.intro-kicker { font: 800 13px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ch, var(--brand)); margin-top: 8px; }
.intro-title { font-size: clamp(32px, 6vw, 46px); margin: 6px 0 10px; }
.intro-title .ic { display: inline-block; }
.intro-goal { font-size: 19px; color: var(--ink-2); max-width: 30em; margin: 0 auto 14px; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.meta { padding: 7px 14px; border-radius: 99px; background: var(--surface-2); font: 800 14px var(--font); color: var(--ink-2); }
.result h1 { font-size: clamp(34px, 6vw, 48px); margin-top: 6px; }
.res-msg { color: var(--ink-2); font-size: 18px; max-width: 28em; margin: 0 auto 8px; }
.res-stars { display: flex; justify-content: center; gap: 8px; margin: 10px 0 16px; }
.star { font-size: 64px; line-height: 1; color: var(--line); transform: scale(.6); opacity: .5; }
.star.on { color: var(--gold); animation: starPop .6s calc(var(--i) * .22s + .1s) both cubic-bezier(.2, 1.6, .4, 1); text-shadow: 0 6px 0 rgba(200, 130, 0, .25); }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; margin: 0 auto 18px; }
.rs { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 8px; display: flex; flex-direction: column; }
.rs b { font: 600 30px var(--font-d); color: var(--brand); }
.rs span { font-size: 12.5px; color: var(--muted); font-weight: 800; line-height: 1.25; }
.recap { text-align: left; max-width: 560px; margin: 0 auto; }
.res-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- dars kartalari: bloklar ---------- */
.say { font-size: 19px; margin: 0; }
.say b, .rule-b b { color: var(--ch, var(--brand-d)); }
.bigline { font: 600 clamp(32px, 6vw, 46px)/1.2 var(--font-d); text-align: center; }
.eqline { font: 600 clamp(28px, 5.2vw, 40px)/1.3 var(--font-d); text-align: center; letter-spacing: .5px; }
.eqline.sm { font-size: 26px; } .eqline.faded { color: var(--muted); }
.eqline b { color: var(--accent); }
.rule { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); border: 2px solid color-mix(in srgb, var(--gold) 55%, var(--line)); border-radius: 20px; padding: 14px 18px; }
.rule-h { font: 600 20px var(--font-d); margin-bottom: 4px; }
.rule-b { font-size: 18px; }
.rule-b p { margin: .3em 0; }
.recap.ok { background: var(--ok-l); border-color: var(--ok); text-align: center; font-weight: 800; padding: 16px; }
.tip { display: flex; gap: 12px; align-items: flex-end; }
.tip-m { flex: none; width: 74px; }
.tip-b { position: relative; background: var(--brand-l); border-radius: 20px 20px 20px 4px; padding: 12px 16px; font-size: 17.5px; color: var(--ink); }
.plist { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.plist li::marker { color: var(--ch, var(--brand)); font-weight: 800; }
.plist.ol { list-style: decimal; }
.figure { margin: 0; text-align: center; }
.figure figcaption { font-size: 15px; color: var(--muted); margin-top: 6px; font-weight: 700; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: flex-start; }
.cols > .col { flex: 1 1 200px; min-width: 0; }
.gap { height: 4px; }
.tbl { border-collapse: separate; border-spacing: 0; margin: 4px auto; font-size: 18px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.tbl th, .tbl td { padding: 9px 16px; border-bottom: 2px solid var(--line); border-right: 2px solid var(--line); text-align: center; }
.tbl th { background: var(--brand-l); font-weight: 800; }
.tbl tr:last-child td { border-bottom: 0; } .tbl th:last-child, .tbl td:last-child { border-right: 0; }
.tbl td.n, .tbl.nums td { font: 600 22px var(--font-d); }
.place { border-collapse: separate; border-spacing: 0; margin: 4px auto; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.place th, .place td { padding: 8px 20px; text-align: center; border-right: 2px solid var(--line); }
.place th { background: var(--brand-l); font-size: 15px; } .place td { font: 600 34px var(--font-d); }
.place th:last-child, .place td:last-child { border-right: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.facts[style*="--cols"] { grid-template-columns: repeat(var(--cols), 1fr); }
.fact { padding: 8px 10px; border-radius: 14px; font: 600 22px var(--font-d); text-align: center; background: var(--surface-2); white-space: nowrap; }
.fact.plus { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); }
.fact.minus { background: color-mix(in srgb, var(--accent) 17%, var(--surface)); }

/* emoji narsalar */
.objs { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: center; align-items: center; }
.objs .o { font-size: 34px; line-height: 1.1; position: relative; }
.objs.sm .o { font-size: 24px; } .objs.md .o { font-size: 32px; } .objs.lg .o { font-size: 44px; }
.objs .o.x { opacity: .5; }
.objs .o.x::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 4px; border-radius: 4px; background: var(--bad); transform: rotate(-35deg); }
.objs[style*="--cols"] { display: grid; grid-template-columns: repeat(var(--cols), auto); justify-content: center; }
.pics { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.pbox { padding: 8px 12px; border: 2px dashed var(--line); border-radius: 18px; }
.sign { font: 600 38px var(--font-d); color: var(--ink-2); }
.pbox.big { font: 600 44px var(--font-d); min-width: 66px; text-align: center; border-style: solid; }
.pbox.hide { color: var(--accent); }
.pbox.ok { color: var(--ok-d); border-color: var(--ok); background: var(--ok-l); animation: pop .35s; }
.eqpic-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.eqpic { width: 100%; }
.eqpic .eqline { margin-top: 8px; }

/* sanagich */
.counter { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.counter-box { padding: 6px; }
.o.tap { background: none; border: 2px dashed transparent; border-radius: 16px; padding: 4px 6px; cursor: pointer; position: relative; transition: transform .1s, background .15s; }
.o.tap:hover { background: var(--surface-2); transform: scale(1.06); }
.o.tap .em { font-size: 1em; display: block; }
.o.tap .num {
  position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font: 800 14px/24px var(--font);
  text-align: center; transform: scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.o.tap.counted { background: color-mix(in srgb, var(--brand) 9%, transparent); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.o.tap.counted .num { transform: scale(1); }
.counter-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.counter-total { font: 700 20px var(--font); color: var(--ink-2); min-width: 9em; text-align: center; }
.counter-total.done { color: var(--ok-d); } .counter-total b { font: 600 30px var(--font-d); }
.counter-total .word { color: var(--accent); font-weight: 800; }

/* qadam-baqadam */
.worked { display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border-radius: 20px; padding: 10px 14px; }
.wstep { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.wstep.on { display: flex; animation: cardIn .3s; }
.wnum { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 800 15px var(--font); margin-top: 2px; }
.wbody { flex: 1; min-width: 0; }
.wtext { font-size: 18.5px; } .wtext b { color: var(--accent); }
.wart { margin-top: 8px; text-align: center; }
.wfoot { text-align: center; padding-top: 4px; }
.reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.reveal-b { background: var(--ok-l); border: 2px solid var(--ok); border-radius: 16px; padding: 10px 16px; font-size: 18px; width: 100%; text-align: center; animation: cardIn .25s; }

/* juftlash orqali taqqoslash */
.pairing { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pcols { display: flex; gap: 8px; justify-content: center; flex-wrap: nowrap; max-width: 100%; }
.pcol { display: flex; flex-direction: column; align-items: center; }
.pcol .o { font-size: clamp(26px, 7vw, 40px); line-height: 1.15; }
.pcol .o.none { visibility: hidden; }
.pcol .link { width: 0; height: 18px; border-left: 3px dotted transparent; }
.pcol .link.on { border-left-color: var(--brand); }
.pcol.extra .o:not(.none) { filter: drop-shadow(0 0 7px var(--accent)) drop-shadow(0 0 2px var(--accent)); transform: scale(1.12); }
.pair-res { display: flex; align-items: center; gap: 14px; font: 600 40px var(--font-d); }
.pair-res .cmp { color: var(--accent); font-size: 48px; }
.pair-say { color: var(--ink-2); font-size: 17.5px; text-align: center; }

/* 100 jadvali */
.hundred-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hundred-info { min-height: 2.6em; font-size: 19px; text-align: center; color: var(--ink-2); }
.hundred-info b { font: 600 28px var(--font-d); color: var(--brand); }
.hundred { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: 100%; max-width: 560px; }
.hn { aspect-ratio: 1; border: 0; border-radius: 9px; font: 600 clamp(13px, 3.4vw, 19px) var(--font-d); cursor: pointer; color: #1E2140; padding: 0; transition: transform .1s; }
.hn:hover { transform: scale(1.1); }
.hn.sel { outline: 3px solid var(--brand); outline-offset: 1px; transform: scale(1.14); z-index: 1; }
.hn.hi { box-shadow: inset 0 0 0 3px var(--accent); }
.d0 { background: #FFD9CC; } .d1 { background: #FFE9B8; } .d2 { background: #DDF3BF; } .d3 { background: #BFEBD6; } .d4 { background: #BDE8F5; }
.d5 { background: #C8D9FF; } .d6 { background: #DCCFFF; } .d7 { background: #F3CDF0; } .d8 { background: #FFCCDD; } .d9 { background: #FFDCC0; }

/* galereya */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); gap: 12px; }
.gallery[style*="--gcols"] { grid-template-columns: repeat(var(--gcols), 1fr); }
.gitem { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 10px 8px 12px; cursor: pointer; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; transition: transform .1s, border-color .1s; }
.gitem:hover { transform: translateY(-2px); }
.gitem.on { border-color: var(--brand); background: var(--brand-l); }
.gart { width: 100%; display: grid; place-items: center; min-height: 84px; }
.gart .art { max-height: 88px; width: auto; max-width: 100%; }
.gname { font: 800 16px/1.2 var(--font); }
.gsub { font-size: 13px; color: var(--muted); font-weight: 700; }
.pairsrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pr { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 14px; background: var(--surface-2); }
.pr b { font: 600 24px var(--font-d); color: var(--brand); } .pr span { font-weight: 700; }
.week { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.week li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-weight: 800; }
.week b { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 600 16px var(--font-d); flex: none; }
.week .rest b { background: var(--accent); }
.terms { display: flex; justify-content: center; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.term { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.term .n { font: 600 clamp(38px, 8vw, 56px)/1 var(--font-d); }
.term .lab { font: 800 13.5px var(--font); padding: 3px 10px; border-radius: 10px; background: var(--brand-l); color: var(--brand-d); white-space: nowrap; }
.term.res .lab { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok-d); }
.term.res .n { color: var(--ok-d); }
.terms .op { font: 600 clamp(34px, 7vw, 48px)/1 var(--font-d); color: var(--ink-2); padding-top: 4px; }
.short-note { display: inline-block; text-align: left; border: 2px dashed var(--line); border-radius: 16px; padding: 8px 18px 10px; background: var(--surface); }
.short-note div { font-size: 17px; line-height: 1.5; } .short-note b { color: var(--brand-d); }
.short-note .sn-h { font: 800 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* rasmlar */
.art { max-width: 100%; height: auto; }
.art.mascot { width: 100%; }
.art.dice { width: 54px; } .art.bond { width: 150px; } .art.stairs { width: min(100%, 420px); }
.art.tenframe { width: min(100%, 262px); } .frames { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cross-add-frames { width: 100%; align-items: flex-start; }
.cross-add-key { flex-basis: 100%; margin: 0; text-align: center; font-size: 15px; line-height: 1.5; }
.cross-add-frame { flex: 0 1 262px; max-width: 100%; min-width: 0; }
.cross-add-frame .tenframe { display: block; margin: auto; }
.cross-add-frame .frame-note { margin: 5px 0 0; text-align: center; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.art.shape { width: 92px; } .art.angle { width: 150px; } .art.linekind { width: 150px; } .art.clock { width: 120px; }
.art.sym { width: 110px; } .art.mirror { width: min(100%, 300px); } .art.jar { width: 90px; } .art.balance { width: min(100%, 320px); }
.art.numline { max-width: none; } .art.ruler { max-width: none; }
.fig-art { display: flex; justify-content: center; }
.fig-art > .scrollx { width: 100%; }
.bt { display: flex; gap: 22px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.bt-tens { display: flex; gap: 7px; align-items: flex-end; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.rod { display: block; width: 16px; height: 96px; border-radius: 6px; background: repeating-linear-gradient(to bottom, #F8B93A 0 8.6px, #E29A12 8.6px 9.6px); box-shadow: inset 0 0 0 1.5px #C8830A; }
.bt-ones { display: grid; grid-template-columns: repeat(5, 16px); gap: 5px; }
.unit { display: block; width: 16px; height: 16px; border-radius: 4px; background: #F8B93A; box-shadow: inset 0 0 0 1.5px #C8830A; }

/* ---------- savollar ---------- */
.q-prompt { font: 700 clamp(20px, 3.6vw, 25px)/1.4 var(--font); margin: 10px 0 14px; }
.q-prompt.eq { font: 600 clamp(38px, 9vw, 54px)/1.25 var(--font-d); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin: 16px 0; }
.q-prompt.eq.long { font: 700 clamp(22px, 4.6vw, 30px)/1.6 var(--font); display: block; text-align: center; }
.q-prompt.eq.long .slot { vertical-align: middle; margin: 0 4px; }
.pt b { color: var(--brand); }
.q-visual { margin: 6px 0 14px; display: flex; justify-content: center; }
.q-visual > .scrollx { width: 100%; }
.q-answer { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.q-answer .lab { font-weight: 800; color: var(--ink-2); font-size: 20px; }
.unit-t { font: 700 22px var(--font); color: var(--ink-2); }
.slot {
  min-width: 68px; height: 62px; padding: 0 12px; border-radius: 16px; border: 3px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: 600 36px/1 var(--font-d); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s, box-shadow .15s;
}
.slot.active { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 22%, transparent); }
.slot.active:empty::after { content: ''; width: 3px; height: 34px; background: var(--brand); border-radius: 2px; animation: blink 1s steps(1) infinite; }
.slot.ok { border-color: var(--ok); background: var(--ok-l); color: var(--ok-d); animation: pop .3s; }
.slot.bad { border-color: var(--bad); background: var(--bad-l); color: var(--bad-d); animation: shake .35s; }
@keyframes blink { 50% { opacity: 0; } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 18px auto 4px; }
.keypad.off { opacity: .45; pointer-events: none; }
.key { height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font: 600 26px var(--font-d); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.key.fn { background: var(--surface-2); color: var(--ink-2); }
.opts { display: grid; gap: 12px; margin-top: 8px; }
.opts.cols-1 { grid-template-columns: 1fr; } .opts.cols-2 { grid-template-columns: repeat(2, 1fr); } .opts.cols-3 { grid-template-columns: repeat(3, 1fr); } .opts.cols-4 { grid-template-columns: repeat(4, 1fr); }
.opt {
  position: relative; padding: 16px 12px; min-height: 64px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line);
  font: 700 clamp(18px, 3.4vw, 22px)/1.25 var(--font); cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; transition: transform .08s, border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt-in { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; }
.opt .art { max-height: 96px; }
.opt .art.shape, .opt .art.sym { width: 84px; }
.key-hint { position: absolute; left: 9px; top: 5px; font: 800 11px var(--font); color: var(--muted); opacity: .75; }
@media (hover: none) { .key-hint { display: none; } }
.opt.sel { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 4px 0 var(--brand); }
.opt.ok { border-color: var(--ok); background: var(--ok-l); box-shadow: 0 4px 0 var(--ok-d); animation: pop .3s; }
.opt.bad { border-color: var(--bad); background: var(--bad-l); box-shadow: 0 4px 0 var(--bad-d); animation: shake .35s; }
.opt.miss { border-style: dashed; border-color: var(--ok); }
.opt.dim { opacity: .55; }
.opts .big { font-size: 26px; }
.cmp-top { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin: 8px 0 8px; }
.cmp-side { border: 2px solid var(--line); border-radius: 20px; padding: 14px 10px; background: var(--surface); text-align: center; min-height: 100px; display: grid; place-items: center; }
.cmp-mid { width: 66px; height: 66px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font: 600 38px var(--font-d); transition: background .15s; }
.cmp-mid.ok { background: var(--ok); color: #fff; } .cmp-mid.bad { background: var(--bad); color: #fff; }
.cmp-btns { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.opt.sym { width: 96px; min-height: 68px; font: 600 40px var(--font-d); }
.cn { font: 600 clamp(32px, 7vw, 46px) var(--font-d); }
.order-slots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.oslot { width: 56px; height: 58px; border: 3px dashed var(--line); border-radius: 16px; display: grid; place-items: center; font: 600 30px var(--font-d); }
.oslot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-l); color: var(--ok-d); animation: pop .25s; }
.order-pool { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.chip { min-width: 62px; height: 62px; padding: 0 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font: 600 30px var(--font-d); cursor: pointer; }
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip.used { visibility: hidden; }
.shake { animation: shake .35s; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.mcol { display: flex; flex-direction: column; gap: 10px; }
.mitem { padding: 12px; min-height: 60px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font: 700 20px var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; }
.mitem.l.sel { border-color: var(--brand); background: var(--brand-l); }
.mitem.done { border-color: var(--ok); background: var(--ok-l); color: var(--ok-d); box-shadow: 0 4px 0 var(--ok-d); cursor: default; }
.mitem .art { max-height: 70px; width: auto; }
.mitem .objs .o { font-size: 24px; }
@keyframes pop { 0% { transform: scale(.94); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
.q.pop { animation: pop .3s; }

/* ---------- dialog ---------- */
.modal-back { position: fixed; inset: 0; z-index: 120; background: rgba(15, 12, 45, .55); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: min(420px, 100%); background: var(--surface); border-radius: 26px; padding: 26px 24px 22px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); animation: cardIn .2s; }
.modal-ic { font-size: 54px; line-height: 1; } .modal h3 { font-size: 26px; margin: 8px 0 6px; } .modal p { color: var(--ink-2); }
.modal-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
canvas.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; }

/* ---------- darslik o‘quvchi ---------- */
.reader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: var(--bg); animation: fade .15s; }
.reader-top { display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: var(--surface); border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.reader-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1 1 200px; }
.reader-title b { font: 600 19px var(--font-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title small { color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-nav { display: flex; align-items: center; gap: 8px; }
.reader-num { width: 68px; height: 42px; text-align: center; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); color: var(--ink); font: 800 17px var(--font); }
.of { color: var(--muted); font-weight: 800; }
.reader-main { flex: 1; display: flex; min-height: 0; }
.reader-thumbs { width: 148px; flex: none; overflow-y: auto; padding: 10px; background: var(--surface); border-right: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.thumb { border: 3px solid transparent; background: none; padding: 0; border-radius: 10px; cursor: pointer; text-align: center; position: relative; }
.thumb img { width: 100%; height: auto; display: block; border-radius: 6px; background: var(--surface-2); box-shadow: var(--shadow-s); aspect-ratio: 411 / 609; object-fit: cover; }
.thumb span { display: block; font: 800 12px var(--font); color: var(--muted); margin-top: 2px; }
.thumb.inrange { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.thumb.cur { border-color: var(--brand); } .thumb.cur span { color: var(--brand); }
.reader-stage { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 16px; background: color-mix(in srgb, var(--ink) 9%, var(--bg)); }
.reader-img { max-width: 100%; max-height: calc(100dvh - 112px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .45); background: #fff; cursor: zoom-in; }
.reader-stage.zoom .reader-img { max-width: none; max-height: none; width: min(1100px, 170%); cursor: zoom-out; }
.reader-err { align-self: center; color: var(--muted); font-weight: 800; }
.thumbs-btn { display: none; }

/* ---------- tez hisoblash ---------- */
.drill-h { font-size: 26px; margin: 22px 0 10px; }
.drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 30px; }
.dcard { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: 0 4px 0 var(--line); transition: transform .1s; }
.dcard:hover { transform: translateY(-3px); border-color: var(--brand); }
.dic { font-size: 34px; } .dcard b { font: 600 20px/1.2 var(--font-d); } .dcard small { color: var(--muted); font-weight: 800; }
.drill-run { max-width: 640px; padding-top: 14px; }
.drill-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dtitle { flex: 1; font: 600 20px var(--font-d); } .dstat { font: 800 17px var(--font); }
.dt { font: 600 24px var(--font-d); color: var(--brand); }
.dprog { height: 12px; margin-bottom: 10px; }
.drill-score { display: flex; gap: 22px; justify-content: center; font: 800 18px var(--font); }
.drill-score b { font: 600 26px var(--font-d); }
.dflash { min-height: 1.8em; text-align: center; color: var(--bad-d); font-weight: 800; margin-top: 6px; }
.q-drill { transition: background .15s; border-radius: 24px; padding: 4px 8px 12px; }
.q-drill.okflash { background: var(--ok-l); } .q-drill.badflash { background: var(--bad-l); }

/* raqam kartasi, sonlar jadvali */
.digitcard { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.dg { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dg-n { font: 600 clamp(84px, 20vw, 128px)/1 var(--font-d); color: var(--ch, var(--brand)); background: color-mix(in srgb, var(--ch, var(--brand)) 11%, var(--surface)); border: 4px solid var(--ch, var(--brand)); border-radius: 30px; padding: 4px 34px 10px; min-width: 1.1em; text-align: center; box-shadow: 0 6px 0 color-mix(in srgb, var(--ch, var(--brand)) 40%, transparent); }
.dg-w { font: 700 26px var(--font-d); color: var(--ink-2); margin-top: 8px; }
.dg-pic { display: flex; align-items: center; }
.numgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.nc { border: 2px solid var(--line); border-radius: 18px; padding: 8px 6px 10px; text-align: center; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nc-d { font: 600 42px/1 var(--font-d); color: var(--ch, var(--brand)); }
.nc-dots { display: grid; grid-template-columns: repeat(5, 10px); gap: 3px; justify-content: center; min-height: 23px; }
.nc-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nc-w { font: 800 14px var(--font); color: var(--ink-2); }
.bonds { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; }
.bonds .art.bond { width: 120px; }
.qmark { color: var(--accent); display: inline-block; min-width: 1.1em; text-align: center; }
.pos-row .o.hl { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.croc { display: inline-block; color: var(--accent); font-size: 1.15em; transform: translateY(1px); }

.draw-btns { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.scrollx.draw { padding: 8px 0; }
.atab-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.atab-info { min-height: 2.4em; text-align: center; font-size: 18px; color: var(--ink-2); }
.atab-info b { font: 600 28px var(--font-d); color: var(--brand); }
.atab { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: 100%; max-width: 520px; }
.ac { aspect-ratio: 1; border: 0; border-radius: 8px; padding: 0; font: 600 clamp(12px, 3.2vw, 18px) var(--font-d); background: var(--surface-2); color: var(--ink); display: grid; place-items: center; }
button.ac { cursor: pointer; transition: transform .08s; } button.ac:hover { transform: scale(1.1); }
.ac.h { background: var(--brand); color: #fff; }
.ac.h.corner { background: var(--ink-2); }
.ac.over { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.ac.hl { outline: 2px solid var(--brand); outline-offset: -2px; }
.ac.sel { background: var(--brand); color: #fff; }
.atab-legend { font-size: 13.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.atab-legend i { width: 16px; height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 35%, var(--surface)); display: inline-block; }
/* ---- 2-sinf va undan yuqori: guruhlar, ustunli hisoblash, kasr, soat ---- */
.pseqrow { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pseq { width: 78px; } .pseq .art { width: 78px; } .pseq.q { font: 600 54px var(--font-d); color: var(--accent); text-align: center; }
.groups { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.grp { border: 2.5px dashed var(--brand); border-radius: 34px; padding: 6px 14px; background: color-mix(in srgb, var(--brand) 6%, transparent); }
.grp .objs { gap: 2px 4px; }
.col-wrap { display: flex; justify-content: center; }
.col-arith { border-collapse: collapse; font: 600 clamp(30px, 8vw, 42px)/1.15 var(--font-d); text-align: center; }
.col-arith th { font: 800 12.5px var(--font); color: var(--ink-2); padding: 0 10px 4px; text-transform: none; }
.col-arith td { padding: 2px 12px; min-width: 1.5em; }
.col-arith td.op { color: var(--accent); font-size: .9em; width: 1em; padding-right: 4px; }
.col-arith tr.second td:not(.op) { border-bottom: 3px solid var(--ink); }
.col-arith tr.res td.r { color: var(--ok-d); } .col-arith td.q { color: var(--accent); }
.col-arith tr.marks td { font: 800 15px var(--font); color: var(--accent); padding-bottom: 0; }
.digital { display: inline-block; font: 700 40px/1 'Courier New', monospace; letter-spacing: 3px; color: #7CFFB0; background: #10261C; border: 4px solid #2B4A3B; border-radius: 14px; padding: 10px 16px; box-shadow: inset 0 0 12px rgba(0,255,150,.15); }
.clocks { display: flex; flex-wrap: wrap; gap: 14px 18px; justify-content: center; }
.ck { display: flex; flex-direction: column; align-items: center; gap: 4px; } .ck .art.clock { width: 110px; }
.ck-t { font: 800 15px var(--font); color: var(--ink-2); background: var(--surface-2); padding: 2px 10px; border-radius: 99px; }
.mulcol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; max-width: 320px; margin: auto; }
.mulcol div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 12px; border-radius: 12px; background: var(--surface-2); font: 600 20px var(--font-d); }
.mulcol b { color: var(--brand); }
.fracrow { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; }
.fr { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; }
.fr span { font: 700 17px var(--font-d); color: var(--ink-2); text-align: center; }
.art.pie, .art.bar { width: 96px; } .art.bar { width: 150px; } .art.rectdims { width: min(100%, 250px); } .art.polysides { width: min(100%, 230px); }
.art.circleparts { width: 190px; } .art.chess { width: min(100%, 250px); } .art.gridcells { max-width: 100%; }
.opt .art.pie { width: 76px; } .opt .art.bar { width: 120px; }
.ac.dbl { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
.atab-legend i.dblc { background: transparent; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.mirror-q { display: flex; align-items: center; gap: 4px; justify-content: center; }
.mirror-q .art.shape { width: 110px; }
.mirror-q .glass { width: 24px; height: 108px; border-radius: 9px; background: linear-gradient(90deg, #CFEBFF, #A9D9F5); border: 2px solid #8CC7EE; display: inline-block; }
.sort-item .art { width: 58px; height: 58px; display: block; }
.sort-item:has(.art) { padding: 6px 8px; }
.qm2 { animation: blink 1.2s steps(1) infinite; }
.wtag { font: 800 18px var(--font); white-space: nowrap; }
.sort-item:has(.wtag) { padding: 10px 16px; font-size: 18px; }
.pbox.single { display: flex; flex-direction: column; align-items: center; border-color: var(--accent); }
.pbox.single small { font: 800 12px var(--font); color: var(--accent); }
.eo { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.eo span { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font: 600 28px var(--font-d); color: #fff; }
.eo .odd { background: #2C7BF2; box-shadow: 0 4px 0 #1D57B3; } .eo .even { background: #EF4D5E; box-shadow: 0 4px 0 #B8303F; }

/* qo‘shimcha savol elementlari */
.em-big { font-size: 46px; line-height: 1.1; display: block; }
.opt .em-big { font-size: 42px; }
.pos-row { display: flex; gap: 22px; justify-content: center; align-items: center; padding: 10px 18px; border: 2px dashed var(--line); border-radius: 20px; }
.pos-row .o { font-size: 52px; line-height: 1.1; }
.q-hint { text-align: center; color: var(--muted); font-weight: 700; font-size: 15px; margin: -8px 0 10px; }
.sort-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 72px; padding: 12px; border: 2px dashed var(--line); border-radius: 20px; margin-bottom: 14px; align-content: center; }
.sort-pool.empty { opacity: .45; }
.sort-item { font-size: 34px; line-height: 1.15; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 6px 12px; cursor: pointer; box-shadow: 0 3px 0 var(--line); transition: transform .08s, border-color .1s; }
.sort-item:hover { transform: translateY(-2px); }
.sort-item.sel { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); transform: translateY(-3px) scale(1.06); }
.sort-item.ok { border-color: var(--ok); background: var(--ok-l); } .sort-item.bad { border-color: var(--bad); background: var(--bad-l); animation: shake .35s; }
.sort-buckets { display: grid; gap: 12px; } .sort-buckets.cols-2 { grid-template-columns: 1fr 1fr; } .sort-buckets.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sort-bucket { border: 3px solid var(--line); border-radius: 22px; padding: 10px; min-height: 132px; background: var(--surface-2); cursor: pointer; transition: border-color .12s, background .12s; }
.sort-bucket:hover { border-color: var(--brand); }
.sort-h { font: 600 20px/1.2 var(--font-d); text-align: center; }
.sort-in { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 8px; min-height: 60px; }
.sets { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.setbox { border: 3px solid var(--sc, var(--ch, var(--brand))); background: color-mix(in srgb, var(--sc, var(--ch, var(--brand))) 10%, var(--surface)); border-radius: 30px; padding: 8px 16px 12px; text-align: center; min-width: 140px; }
.setbox .sh { font: 600 19px var(--font-d); color: var(--sc, var(--ch, var(--brand))); margin-bottom: 2px; }
.setbox .objs .o { font-size: 34px; }
.labeled-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.labeled { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.labeled .o { font-size: 52px; line-height: 1.1; } .labeled span.l { font: 800 14px var(--font); color: var(--ink-2); background: var(--surface-2); padding: 2px 10px; border-radius: 99px; }
.shelf { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.shelf-r { width: min(100%, 260px); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.shelf .row { display: flex; gap: 10px; padding: 6px 16px 10px; border-bottom: 6px solid #C99A64; border-radius: 4px; width: 100%; justify-content: center; }
.shelf .row .o { font-size: 44px; line-height: 1.1; }
.shelf .tag { font: 800 14px var(--font); color: var(--ink-2); background: var(--surface-2); padding: 2px 12px; border-radius: 99px; }
.compare-row { display: flex; gap: 26px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.compare-row .cr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compare-row .cr small { font: 800 14px var(--font); color: var(--ink-2); background: var(--surface-2); padding: 2px 12px; border-radius: 99px; }

/* ---------- moslashuvchanlik ---------- */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-block: 34px 44px; }
  .hero-art { min-height: 220px; order: -1; } .hero-m { width: min(210px, 56%); }
  .how { grid-template-columns: 1fr; margin-top: -20px; }
  .gh-in { grid-template-columns: 1fr; } .gh-ring { justify-self: start; }
}
@media (max-width: 700px) {
  .topnav { display: none; }
  .brand-text small { display: none; }
  .reader-thumbs { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 138px; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .reader.show-thumbs .reader-thumbs { transform: none; }
  .thumbs-btn { display: inline-grid; } .reader-main { position: relative; }
  .reader-title small { display: none; }
  .reader-top { gap: 8px; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.art.compass { width: 110px; }
.art.trishape { width: min(100%, 160px); } .opt .art.trishape { width: 120px; }
/* shaxmat, jadval, sanoq */
.chess-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.chessbd { display: grid; grid-template-columns: 24px repeat(8, 1fr); width: min(100%, 372px); border-radius: 10px; overflow: hidden; }
.cb-l { font: 800 14px var(--font); color: var(--ink-2); display: grid; place-items: center; min-height: 22px; }
.cb-c { aspect-ratio: 1; border: 0; padding: 0; cursor: pointer; }
.cb-c.lt { background: #F2D9A8; } .cb-c.dk { background: #8B5E34; }
.cb-c:hover { filter: brightness(1.08); }
.cb-c.sel { background-image: radial-gradient(circle, #EF4D5E 34%, transparent 37%); }
.art.tally { max-width: 100%; height: auto; }
.tbl td .art.tally { width: auto; max-height: 34px; }
.tbl.tbl-c td, .tbl.tbl-c th { text-align: center; }
.tbl td.q { color: var(--accent); font-weight: 800; }
.tbl td.tot, .tbl th.tot { background: var(--brand-l); font-weight: 800; }
.dtab td.hi { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); outline: 2px solid var(--brand); outline-offset: -2px; font-weight: 800; }
.rem-box { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 10px; padding: 8px 14px; border: 2px dashed var(--accent); border-radius: 16px; }
.rem-box span { font: 800 13px var(--font); color: var(--accent); }
/* interaktiv aylana va soat */
.circlelab-wrap, .clocklab { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.art.circlelab { width: min(100%, 330px); }
.cl-info { text-align: center; font-weight: 700; color: var(--ink-2); line-height: 1.5; }
.cl-info b { color: var(--brand); }
.cl-row { display: flex; align-items: center; gap: 12px; font-weight: 800; flex-wrap: wrap; justify-content: center; }
.cl-row b { min-width: 1.6em; text-align: center; color: var(--brand); font: 600 22px var(--font-d); }
.cl-range { width: min(100%, 260px); accent-color: var(--brand); }
.clocklab .cl-top { display: flex; gap: 18px 24px; align-items: center; justify-content: center; flex-wrap: wrap; }
.clocklab .art.clock { width: 200px; }
.cl-side { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.cl-words { font: 600 21px/1.3 var(--font-d); color: var(--brand); text-align: center; max-width: 16em; }
.opt .art.clock { width: 96px; } .mitem .art.clock { width: 88px; }
.art.segparts { width: min(100%, 340px); } .art.cubeblock { max-width: 100%; }

/* amallar tartibi va qadam-baqadam hisoblash */
.opord { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px 10px; padding: 6px 0; }
.opord .ot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.opord .ot b { font: 600 clamp(30px, 6.5vw, 44px)/1.1 var(--font-d); }
.opord .ot.op b { color: var(--accent); }
.opord .ob { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 800 14px/24px var(--font); text-align: center; font-style: normal; }
.opord .ob.gap { background: transparent; }
.calc { font: 600 clamp(24px, 5vw, 32px)/1.5 var(--font-d); letter-spacing: .5px; }
.calc b { color: var(--ok-d); }
.calc-hl { background: color-mix(in srgb, var(--accent) 26%, transparent); border-radius: 10px; padding: 0 8px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .digitcard { flex-direction: column; gap: 12px; }
  .wrap { padding-inline: 16px; }
  .player-body { padding-inline: 14px; }
  .card { padding: 16px 14px 14px; border-radius: 24px; }
  .opts.cols-4 { grid-template-columns: repeat(2, 1fr); } .opts.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .match { gap: 10px; }
  .player-foot { padding-inline: 14px; }
  .player-foot .btn { min-width: 0; flex: 1; }
  .player-foot.fb { flex-wrap: wrap; } .player-foot.fb .btn { width: 100%; margin-left: 0; flex-basis: 100%; }
  .fb-txt { flex: 1; }
  .res-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } .rs b { font-size: 24px; }
  .star { font-size: 54px; }
  .tiles { grid-template-columns: repeat(2, 1fr); padding: 12px; gap: 10px; }
  .ch-head { padding: 14px; } .ch-prog { display: none; }
  .tip-m { width: 58px; }
  .keypad { gap: 8px; } .key { height: 52px; }
  .hero-facts { gap: 6px 18px; }
  .topstats .pill.xp { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* Matematik yozuv: kasr va ildizlar, telefonlarda mahalliy gorizontal aylantirish. */
.math-panel { margin: 18px 0; padding: 16px; background: var(--surface-2, var(--bg)); border: 1px solid var(--line); border-radius: 16px; max-width: 100%; min-width: 0; }
.math-scroll { overflow-x: auto; overflow-y: hidden; padding: 6px 2px 12px; max-width: 100%; scrollbar-width: thin; }
.math-scroll:focus-visible { outline: 2px solid var(--primary, #6d4aff); outline-offset: 4px; border-radius: 5px; }
.formula-display { display: block; width: max-content; min-width: 100%; }
.formula-display .katex-display { margin: .45em 0; }
.formula-parts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 24px; }
.formula-parts > .formula-display { min-width: 0; width: auto; }
.formula-inline { white-space: nowrap; }
.math-panel .katex { font-size: 1.18em; }
.math-panel figcaption { text-align: center; font-size: .9em; margin-top: 10px; color: var(--ink-2); }
.symbol-table .katex { font-size: 1.08em; }
/* KaTeX ildiz/aksent SVGsi balandlikni o‘z formulasidan oladi. */
.katex svg { height:inherit; max-height:none; max-width:none; }
.symbol-table th:first-child, .symbol-table td:first-child { width: 25%; }
.player-body, .card-inner, .wbody, .col { min-width: 0; }
.say, .rule-b, .tip-b, .wtext { overflow-wrap: anywhere; }
@media (max-width: 480px) { .math-panel { padding: 10px; } .math-panel .katex { font-size: 1.05em; } }
/* Kichik ekranlarda rasmli guruhlar va uzun qoidalar sahifani kengaytirmasin. */
.fact { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.gitem { min-width: 0; overflow-wrap: anywhere; }
.gart { max-width: 100%; }
.fig-art > .pos-row { flex-wrap: wrap; max-width: 100%; }
.pairing { overflow-x: auto; max-width: 100%; }
.pcols { flex-shrink: 0; width: max-content; max-width: none; margin-inline: auto; align-self: flex-start; }
@media (max-width: 560px) {
  .gallery[style*="--gcols"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts[style*="--cols"] { grid-template-columns: 1fr; }
}
