/* Express Prava Mini App — short lessons in road-sign colours: sign blue for actions,
   yellow for rewards, red for mistakes, green for correct answers. */

:root {
  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Road-sign palette */
  --blue: #1f5fbf;   --blue-dark: #174a96;   --blue-ink: #1b56ae; --blue-line: #a9c5ee;
  --red: #e0262d;    --red-dark: #b51a21;    --red-ink: #c8202a;
  --yellow: #ffcc00; --yellow-dark: #d9a300; --yellow-ink: #a37800;
  --green: #17873f;  --green-dark: #106a30;  --green-ink: #137a39;
  --navy: #123d7a;   --black: #16191d;
  --on-yellow: #16191d; /* text and icons on yellow, like the black on a warning sign */

  --ink: #16191d; --text: #30353c; --muted: #69717c; --faint: #a2a9b2;
  --line: #e1e4e8; --soft: #f3f5f7; --bg: #fff;
  --green-soft: #e2f4e7; --blue-soft: #e6effb; --red-soft: #fde7e8; --yellow-soft: #fff4c2;
  --locked: #e3e6ea; --locked-edge: #c9ced5; --locked-icon: #a2a9b2;
  --scrim: rgba(0, 0, 0, .45);

  --r-sm: 12px; --r: 16px; --r-lg: 24px;
  --topbar-h: 60px; --tabbar-h: 70px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --vh: var(--tg-viewport-stable-height, 100dvh);
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #f2f4f7; --text: #d9dee4; --muted: #98a1ac; --faint: #5d6671;
  --line: #2c333c; --soft: #1a1f25; --bg: #111418;
  --green-ink: #4cc57a; --blue-ink: #6fa3f2; --red-ink: #ff7a7f; --yellow-ink: #ffd54a;
  --green-soft: #13301f; --blue-soft: #14243d; --red-soft: #3a1b1f; --yellow-soft: #3a3113; --blue-line: #2d5494;
  --locked: #2c333c; --locked-edge: #20262d; --locked-icon: #5d6671;
  --scrim: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: var(--vh);
  font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
/* app.js hides the access gate, panels and sheets with the .hidden class. */
[hidden], .hidden { display: none !important; }
.i { width: 24px; height: 24px; flex: none; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  --bg-c: var(--blue); --edge: var(--blue-dark); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: var(--r);
  background: var(--bg-c); color: var(--fg); box-shadow: 0 4px 0 var(--edge);
  font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; text-align: center;
  transition: transform .06s, box-shadow .06s, filter .15s; user-select: none;
}
.btn .i { width: 20px; height: 20px; }
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn:disabled { --bg-c: var(--line); --edge: var(--line); --fg: var(--faint); box-shadow: none; }
.btn-block { display: flex; width: 100%; }
.btn-secondary { --bg-c: var(--bg); --edge: var(--line); --fg: var(--blue-ink); border: 2px solid var(--line); }
.btn-danger { --bg-c: var(--red); --edge: var(--red-dark); }
.btn-success { --bg-c: var(--green); --edge: var(--green-dark); }
.btn-blue { --bg-c: var(--blue); --edge: var(--blue-dark); }
.btn-ghost { --bg-c: transparent; --edge: transparent; --fg: var(--blue-ink); box-shadow: none; }
.btn-ghost.danger { --fg: var(--red-ink); }
.btn-white { --bg-c: #fff; --edge: rgba(0, 0, 0, .2); --fg: var(--unit-accent, var(--blue)); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); color: var(--faint); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--soft); }
.icon-btn.on { color: var(--yellow); }
.icon-btn.on .i { fill: currentColor; }

/* ---------- Shell: top bar, screens, tab bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px 0 16px; background: var(--bg); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 900; font-size: 18px; color: var(--ink); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; }
.brand-mark svg { width: 36px; height: 36px; }
.topbar-stats { display: flex; align-items: center; gap: 2px; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px;
  border-radius: var(--r-sm); font-weight: 800; font-size: 16px; color: var(--faint);
}
.stat-chip:hover { background: var(--soft); }
.stat-chip .i { width: 24px; height: 24px; }
.stat-chip.streak { color: var(--red-ink); }
.stat-chip.streak.off { color: var(--faint); }
.stat-chip.xp { color: var(--yellow-ink); }
.stat-chip.xp .i { color: var(--yellow); }
.stat-chip.exam { color: var(--blue-ink); }
/* The tariff's chip: the lives left on the free one (grey once they are gone), a crown on a paid one. */
.stat-chip.lives { color: var(--red-ink); }
.stat-chip.lives.off { color: var(--faint); }
.stat-chip.premium { color: var(--yellow-ink); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.stat-chip.premium .i { color: var(--yellow); }

.app-shell { max-width: 600px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.screen { display: none; }
.screen.active { display: block; animation: screen-in .2s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.immersive .topbar, body.immersive .tabbar { display: none; }
body.immersive .app-shell { padding-bottom: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px 8px calc(6px + var(--safe-b)); background: var(--bg); border-top: 2px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 56px; border-radius: var(--r-sm); border: 2px solid transparent;
  color: var(--faint); font-weight: 800; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
}
.tab .i { width: 26px; height: 26px; }
.tab.active { color: var(--blue-ink); background: var(--blue-soft); border-color: var(--blue-line); }
.tab.active .i { color: var(--blue-ink); }
/* The videos are Premium's (the team, 2026-11-12): the tab's icon in the challenge's yellow with a crown. */
.tab-icon { position: relative; display: inline-grid; }
.tab-premium .tab-icon > .i { color: var(--yellow-ink); }
.tab-crown { position: absolute; top: -7px; right: -10px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 0 0 2px var(--bg); }
.tab-crown .i { width: 12px !important; height: 12px !important; color: var(--on-yellow) !important; }
.tab-premium { color: var(--yellow-ink); }
.tab-premium.active { color: var(--yellow-ink); background: var(--yellow-soft); border-color: var(--yellow); }
body.reels-mode .tab-crown { box-shadow: 0 0 0 2px #000; }

/* ---------- Reels: upright videos swiped one after another, black like Instagram's ---------- */
/* The feed is fixed between the top of the screen and the tab bar; the screen's own entrance only
   fades, since a transform on it would carry the fixed feed with it. */
body.reels-mode .topbar { display: none; }
body.reels-mode .app-shell { padding-bottom: 0; }
body.reels-mode { background: #000; }
body.reels-mode .tabbar { background: #000; border-top-color: #1d2127; }
body.reels-mode .tab { color: #8b929c; }
body.reels-mode .tab.active { color: #fff; background: rgba(255, 255, 255, .12); border-color: transparent; }
body.reels-mode .tab.active .i { color: #fff; }
#reels.active { animation: reels-in .2s ease-out; }
@keyframes reels-in { from { opacity: 0; } to { opacity: 1; } }
.reels-head, .reels-feed { position: fixed; left: 0; right: 0; max-width: 600px; margin: 0 auto; }
.reels-head {
  top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 16px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent); color: #fff; pointer-events: none;
}
.reels-head > * { pointer-events: auto; }
.reels-title { color: #fff; font-size: 20px; font-weight: 900; letter-spacing: .01em; }
.reels-quota { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 13px; font-weight: 800; white-space: nowrap; }
.reels-saved { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; font-weight: 800; white-space: nowrap; }
.reels-saved .i { width: 15px; height: 15px; }
.reels-saved.on { background: var(--yellow); color: var(--on-yellow); }
.reels-sound { margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.reels-sound .i { width: 24px; height: 24px; }
.reels-sound.hint { width: auto; height: 34px; padding: 0 14px 0 10px; gap: 6px; display: inline-flex; align-items: center; background: rgba(0, 0, 0, .55); filter: none; font-size: 13px; font-weight: 800; animation: hint-pulse 1.6s ease-in-out infinite; }
@keyframes hint-pulse { 50% { background: rgba(31, 95, 191, .85); } }
.reels-feed {
  top: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; background: #000;
}
.reels-feed::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: #000; color: #fff; }
.reel-poster, .reel-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.reel-video { background: transparent; }
.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: rgba(255, 255, 255, .2); }
.reel-progress span { display: block; height: 100%; width: 0; background: #fff; transition: width .25s linear; }
.reel-paused { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; pointer-events: none; }
.reel-paused .i { width: 72px; height: 72px; padding: 16px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; }
.reel.paused .reel-paused { display: grid; }
.reel-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: grid; gap: 8px;
  padding: 48px 72px 14px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .78) 45%);
}
/* Beside the video, Instagram's way: a column of round buttons at the right, above the question. */
.reel-actions { position: absolute; right: 8px; bottom: 18px; z-index: 5; display: grid; gap: 14px; justify-items: center; }
.reel-action { display: grid; justify-items: center; gap: 3px; width: 56px; color: #fff; font-size: 11.5px; font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.reel-action .i { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgba(0, 0, 0, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.reel-action.on .i { background: rgba(255, 255, 255, .92); color: var(--blue); }
.reel-action[data-reel-like].on .i { color: var(--red); }
.reel-action:active .i { transform: scale(.9); }
.reel-caption { font-weight: 800; font-size: 15px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* The question under the video, on a dark glass; its head folds it away. */
.reel-quiz {
  display: grid; gap: 8px; max-height: calc(var(--vh) * .48); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; border-radius: var(--r); background: rgba(17, 20, 24, .72); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.reel-quiz-head { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--yellow); font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.reel-quiz-head .i { width: 18px; height: 18px; margin-left: auto; color: #fff; transform: rotate(90deg); transition: transform .2s; }
.reel-quiz.collapsed .reel-quiz-head .i { transform: rotate(-90deg); }
.reel-quiz.collapsed > :not(.reel-quiz-head) { display: none; }
.reel-q { color: #fff; font-weight: 800; font-size: 15px; line-height: 1.35; }
.reel-options { display: grid; gap: 6px; }
.reel-option {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .16); color: #fff; font-size: 14px; font-weight: 700; line-height: 1.3;
  transition: background .15s, border-color .15s;
}
.reel-option .n { flex: none; display: grid; place-items: center; min-width: 26px; height: 22px; padding: 0 4px; border-radius: 7px; background: rgba(255, 255, 255, .18); font-size: 11.5px; font-weight: 900; white-space: nowrap; }
.reel-option.right { background: var(--green); border-color: var(--green); }
.reel-option.wrong { background: var(--red); border-color: var(--red); }
.reel-option.right .n, .reel-option.wrong .n { background: rgba(0, 0, 0, .2); }
.reel-options.done .reel-option:not(.right):not(.wrong) { opacity: .55; }
.reel-explain { color: rgba(255, 255, 255, .88); font-size: 13.5px; line-height: 1.45; }
.reel-explain b { color: #fff; }
/* The card at the end of the free reels: what Premium opens, over the posters of what is locked. */
.reel-end { display: grid; place-items: center; padding: 64px 24px 24px; text-align: center; }
.reel-end-posters { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; opacity: .45; filter: blur(14px) saturate(1.2); transform: scale(1.1); }
.reel-end-posters img { width: 100%; height: 100%; object-fit: cover; }
.reel-end-body { position: relative; display: grid; justify-items: center; gap: 12px; max-width: 340px; }
.reel-end-body h2 { color: #fff; font-size: 22px; }
.reel-end-body p { color: rgba(255, 255, 255, .82); }
.reel-end-body small { color: rgba(255, 255, 255, .6); font-weight: 700; }
.reel-end-tile { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 6px 0 var(--yellow-dark); }
.reel-end-tile .i { width: 36px; height: 36px; }
.reel-end-tile.blue { background: var(--blue); color: #fff; box-shadow: 0 6px 0 var(--blue-dark); }
@media (prefers-reduced-motion: reduce) { .reels-sound.hint { animation: none; } }

/* ---------- Access gate (loading, Telegram login, placement) ---------- */
body.access-pending > .topbar, body.access-pending > .app-shell, body.access-pending > .tabbar { display: none !important; }
.gate { min-height: var(--vh); display: grid; place-items: center; padding: 32px 20px calc(24px + var(--safe-b)); background: var(--bg); }
.gate-inner { width: 100%; max-width: 420px; display: grid; justify-items: center; gap: 14px; text-align: center; }
/* Signing in from a browser: the three steps, numbered. */
.web-steps { display: grid; gap: 8px; width: 100%; margin: 4px 0; padding: 14px 16px 14px 36px; border: 2px solid var(--line); border-radius: var(--r); background: var(--soft); text-align: left; font-weight: 700; color: var(--text); }
.web-steps li::marker { color: var(--blue-ink); font-weight: 900; }
.gate-actions a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
/* In a computer's browser (the team's 17.11 updates: «to'liq sayt formatida», Umar: «telefon format emas,
   kompyuter to'liq ekranga moslagin») the app fills the screen as a site does: the top bar across, the
   sections as a menu on the left, the content in the rest of the width — on the lessons' page the path in
   the middle and the banners in a column on the right. On a narrower window the tab bar stays at the foot,
   the content across the whole width. */
.learn-side { display: contents; }
@media (min-width: 700px) {
  body.web .topbar { padding: 0 24px; }
  body.web .units { padding: 20px 24px 32px; }
  body.web .page { padding: 24px 24px 12px; }
  body.web .exam-banner-wrap { padding: 16px 24px 0; }
}
@media (min-width: 900px) {
  body.web { --side-w: 248px; background: var(--bg); }
  body.web .topbar { padding: 0 28px 0 24px; }
  body.web .brand { width: calc(var(--side-w) - 24px); font-size: 20px; }
  body.web .tabbar {
    top: var(--topbar-h); right: auto; bottom: 0; width: var(--side-w);
    display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; border-top: 0; border-right: 2px solid var(--line);
  }
  body.web .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; height: 54px; padding: 0 16px; font-size: 15px; letter-spacing: .06em; }
  body.web .tab:hover:not(.active) { background: var(--soft); }
  body.web .app-shell { margin-left: var(--side-w); max-width: none; min-height: calc(100vh - var(--topbar-h)); padding-bottom: 40px; }
  body.web.immersive .app-shell { margin-left: 0; }
  body.web.immersive .tabbar, body.web.immersive .topbar { display: none; }
  body.web .question-text { font-size: 24px; }

  /* Lessons: the path with its units in the middle, the banners and the plans' button on the right. */
  body.web #learn.active { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 8px 32px; align-items: start; padding: 0 32px; }
  body.web #learn .learn-side { display: grid; gap: 16px; grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--topbar-h) + 20px); padding-top: 20px; }
  body.web #learn .learn-side .exam-banner-wrap { padding: 0; }
  body.web #learn .units { grid-column: 1; grid-row: 1; padding: 20px 0 32px; max-width: 760px; width: 100%; justify-self: center; }

  /* The other sections: as wide as the window lets them, in columns where there are many cards. */
  body.web .page { max-width: 1180px; margin: 0 auto; padding: 28px 32px 16px; gap: 18px; }
  body.web .page-title { font-size: 30px; }
  body.web #practice .page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.web #practice .page > * { grid-column: 1 / -1; }
  body.web #practice .page > .goal-card, body.web #practice .page > .duel-card { grid-column: auto; }
  body.web .mode-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.web .ticket-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  body.web #topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.web #practice .list, body.web #profile .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.web #practice .list .row, body.web #profile .list .row { border-top: 2px solid var(--line); }
  body.web #practice .list .row:nth-child(-n+2), body.web #profile .list .row:nth-child(-n+2) { border-top: 0; }
  body.web #practice .list .row:nth-child(odd), body.web #profile .list .row:nth-child(odd) { border-right: 2px solid var(--line); }
  body.web #leaderboard .page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px;
    grid-template-areas: "head head" "boards boards" "picker picker" "card card" "podium list" "rank list" "prev list" ". list";
    align-items: start;
  }
  body.web #leaderboard .page-head { grid-area: head; }
  body.web #lb-boards { grid-area: boards; max-width: 520px; }
  body.web #challenge-picker { grid-area: picker; }
  body.web #challenge-card { grid-area: card; }
  body.web #lb-podium { grid-area: podium; }
  body.web #my-rank { grid-area: rank; }
  body.web #leaderboard .page > .list { grid-area: list; }
  body.web #lb-previous { grid-area: prev; }
  body.web .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* A lesson, a result, a duel: the whole window, the question in a wide column. */
  body.web .lesson { max-width: 880px; }
  body.web .result { max-width: 720px; }
  /* The videos: an upright feed in the middle of the content, beside the menu. */
  body.web .reels-head, body.web .reels-feed { left: var(--side-w); max-width: 520px; }
  /* A sheet is a window in the middle, not a panel from the foot. */
  body.web .sheet { align-items: center; padding: 24px; }
  body.web .sheet-panel { max-width: 560px; border-radius: var(--r-lg); padding-bottom: 24px; }
  body.web .sheet-handle { display: none; }
}
.gate-inner h1 { font-size: 27px; font-weight: 900; }
.gate-inner > p { color: var(--muted); font-size: 17px; }
.gate-actions { width: 100%; display: grid; gap: 12px; margin-top: 10px; }
.gate-foot { font-size: 14px; color: var(--faint); }
.gate-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; }
.gate.lesson-mode { display: block; padding: 0; }
.gate.lesson-mode .gate-inner { max-width: 600px; margin: 0 auto; display: block; text-align: left; }
.mascot { display: block; height: auto; }
.form-error { color: var(--red-ink); font-weight: 700; min-height: 1em; }
.feature-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--line); font-size: 14px; font-weight: 800; color: var(--muted);
}
.pill .i { width: 18px; height: 18px; }
.gate-inner .pill { font-size: 13px; padding: 5px 10px; }
.gate-inner .pill .i { width: 16px; height: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.spinner.lg { width: 56px; height: 56px; border-width: 6px; border-top-color: var(--yellow); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Language choice (first visit and profile) and the placement result */
.lang-options { width: 100%; display: grid; gap: 10px; text-align: left; margin-top: 6px; }
.lang-option {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--line); background: var(--bg);
  transition: transform .06s, box-shadow .06s, background .15s, border-color .15s;
}
.lang-option:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.lang-option.selected { border-color: var(--blue-line); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue-line); }
.lang-badge {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px;
  background: var(--soft); border: 2px solid var(--line); font-weight: 900; font-size: 15px; color: var(--ink);
}
.lang-option.selected .lang-badge { background: var(--blue); border-color: var(--blue); color: #fff; }
.lang-check { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); opacity: 0; transform: scale(.6); transition: .15s; }
.lang-check .i { width: 16px; height: 16px; }
.lang-option.selected .lang-check { opacity: 1; transform: none; }
.place-score { font-size: 20px; font-weight: 900; color: var(--green-ink) !important; }

/* The documents agreed to on the first visit: one card, one button (the team's 24.11 picture) */
.consent-card { width: 100%; padding: 16px 18px; border: 2px solid var(--blue-line); border-radius: var(--r); background: var(--blue-soft); text-align: left; }
.consent-card-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--blue-ink); font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.consent-card-head .i { width: 20px; height: 20px; }
.consent-card-text { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.55; }
.consent-card-text a { color: var(--blue-ink); font-weight: 900; text-decoration: underline; text-decoration-color: var(--blue-line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.consent-foot { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; text-align: center; }
.consent-docs { width: 100%; }
.consent-check {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--r); text-align: left; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--ink);
}
.consent-check:has(input:checked) { border-color: var(--blue-line); background: var(--blue-soft); }
.consent-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--blue); }
.consent-check a { color: var(--blue-ink); text-decoration: underline; }
/* ...and in the payment window, under the plans */
.consent-check.attention { border-color: var(--red-ink); animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- Learn: units and the lesson path ---------- */
.units { padding: 16px 16px 24px; }
.unit {
  --unit: var(--blue); --unit-fg: #fff; --unit-accent: var(--unit);
  --unit-edge: rgba(0, 0, 0, .25); --unit-edge: color-mix(in srgb, var(--unit), #000 22%); margin-bottom: 40px;
}
.unit-banner {
  position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 10;
  display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px;
  border-radius: var(--r); background: var(--unit); color: var(--unit-fg); box-shadow: 0 4px 0 var(--unit-edge), 0 -12px 0 var(--bg);
}
.unit-text { flex: 1; min-width: 0; }
.unit-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.unit-title { color: inherit; font-size: 21px; font-weight: 900; margin-top: 2px; }
.unit-sub { font-size: 14px; font-weight: 700; opacity: .9; margin-top: 2px; }
/* Each unit wears a road sign as a sticker, slightly tilted like in a sign collage. */
.unit-icon {
  width: 58px; height: 58px; flex: none; display: grid; place-items: center; font-size: 30px;
  transform: rotate(-8deg); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .22));
}
.unit-icon svg, .sign-art { display: block; width: 100%; height: 100%; }
.unit-meter { height: 8px; margin-top: 10px; border-radius: 99px; background: rgba(0, 0, 0, .18); overflow: hidden; }
.unit-meter span { display: block; height: 100%; border-radius: 99px; background: var(--unit-fg); }

.path { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.path-divider {
  align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 6px 0 -4px;
  color: var(--muted); font-weight: 800; font-size: 14px; text-align: center;
}
.path-divider::before, .path-divider::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.path-divider span { max-width: 70%; }
.node-wrap { position: relative; z-index: 1; transform: translateX(var(--x, 0px)); }
.node-wrap.open { z-index: 30; }
.node-wrap.current { margin-top: 46px; }
.node {
  position: relative; width: 72px; height: 66px; display: grid; place-items: center;
  border-radius: 50%; background: var(--unit); color: var(--unit-fg);
  --ring: inset 0 0 0 4px var(--unit), inset 0 0 0 6.5px rgba(255, 255, 255, .9);
  box-shadow: var(--ring), 0 7px 0 var(--unit-edge);
  transition: transform .06s, box-shadow .06s;
}
.node .i { width: 34px; height: 34px; }
.node.completed .i { width: 36px; height: 36px; }
.node:active { transform: translateY(6px); box-shadow: var(--ring), 0 1px 0 var(--unit-edge); }
.node.locked { background: var(--locked); color: var(--locked-icon); box-shadow: 0 7px 0 var(--locked-edge); }
.node.premium { background: var(--locked); color: var(--yellow-ink); box-shadow: 0 7px 0 var(--locked-edge); }
.node.active::after {
  content: ""; position: absolute; inset: -11px -11px -18px; border-radius: 50%;
  border: 5px solid color-mix(in srgb, var(--unit) 35%, transparent);
}
.node-start {
  position: absolute; bottom: calc(100% + 18px); left: 50%; z-index: 2; transform: translateX(-50%);
  padding: 8px 14px; border-radius: var(--r-sm); background: var(--yellow); border: 2px solid var(--yellow-dark);
  color: var(--on-yellow); font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  animation: bob 1.8s ease-in-out infinite; pointer-events: none;
}
.node-start::after {
  content: ""; position: absolute; top: 100%; left: 50%; width: 12px; height: 12px; margin: -5px 0 0 -6px;
  background: var(--yellow); border: solid var(--yellow-dark); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
.node-pop {
  position: absolute; top: calc(100% + 20px); left: calc(50% - var(--x, 0px)); z-index: 12;
  width: min(300px, calc(100vw - 32px)); transform: translateX(-50%);
  padding: 16px; border-radius: var(--r); background: var(--unit); color: var(--unit-fg); text-align: left;
  animation: pop-in .16s ease-out; scroll-margin: calc(var(--topbar-h) + 170px) 0 calc(var(--tabbar-h) + 20px);
}
.node-pop::before {
  content: ""; position: absolute; bottom: 100%; left: calc(50% + var(--x, 0px)); margin-left: -9px;
  border: 9px solid transparent; border-bottom-color: var(--unit);
}
.node-pop h3 { color: inherit; font-size: 19px; font-weight: 900; }
.node-pop p { margin: 4px 0 14px; font-weight: 700; opacity: .92; }
.node-pop.locked { background: var(--soft); color: var(--muted); border: 2px solid var(--line); }
.node-pop.locked::before { border-bottom-color: var(--line); }
.node-pop.locked h3 { color: var(--ink); }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.path-end { display: grid; justify-items: center; gap: 8px; margin-top: 10px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- Pages (practice, leaderboard, profile) ---------- */
.page { padding: 20px 16px 8px; display: grid; gap: 16px; }
.page-head { display: grid; gap: 4px; }
.page-title { font-size: 27px; font-weight: 900; }
.page-sub { color: var(--muted); font-weight: 700; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 20px; font-weight: 900; }
.section-title small { font-size: 14px; font-weight: 800; color: var(--faint); }
.card { background: var(--bg); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; }
.tap { box-shadow: 0 4px 0 var(--line); transition: transform .06s, box-shadow .06s, background .15s; }
.tap:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
.tap:hover { background: var(--soft); }

.progress-track { position: relative; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill {
  position: relative; display: block; height: 100%; width: 0; border-radius: 99px; background: var(--blue);
  transition: width .45s cubic-bezier(.2, .9, .3, 1.15);
}
.progress-fill::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .3); }
.progress-track.thin { height: 12px; }
.progress-track.thin .progress-fill::after { top: 3px; height: 3px; }

.goal-card { display: flex; align-items: center; gap: 14px; cursor: pointer; }
/* What is coming (the team, 2026-11-12): a row each, its badge saying «Tez kunda». */
.soon-list { display: grid; gap: 12px; }
.soon-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; }
/* The video course (the team's 17.11 updates): its lessons in a sheet, «tez orada» until their videos are in. */
.course-list { display: grid; gap: 8px; margin-top: 12px; }
.course-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: var(--r); background: var(--bg); text-align: left; }
.course-row.ready { border-color: var(--blue-line); }
.course-n { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--soft); color: var(--muted); font-weight: 900; font-variant-numeric: tabular-nums; }
.course-row.ready .course-n { background: var(--blue-soft); color: var(--blue-ink); }
.course-title { flex: 1; min-width: 0; font-weight: 800; color: var(--ink); }
.course-row .soon-badge { margin: 0; flex: none; }
.course-play { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--blue-ink); font-weight: 900; font-size: 13px; text-transform: uppercase; }
.course-play .i { width: 16px; height: 16px; }
.course-player { margin-top: 12px; }
.course-player video { width: 100%; max-height: 60dvh; border-radius: var(--r); background: #000; }
.course-now { margin: 6px 0 0; font-weight: 800; color: var(--ink); }
.reels-course { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 900; font-size: 13px; }
.reels-course .i { width: 16px; height: 16px; }
.soon-card .row-text { flex: 1; min-width: 0; }
.soon-badge { justify-self: start; margin-bottom: 4px; padding: 2px 9px; border-radius: 99px; background: var(--yellow); color: var(--on-yellow); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.exam-banner-wrap { padding: 16px 16px 0; }
.exam-banner-wrap:empty { display: none; }
/* The way into the challenge, for a free player who has not joined: yellow, like the challenge's own cards. */
.exam-banner { display: grid; gap: 8px; width: 100%; text-align: left; }
.exam-banner-empty { display: flex; align-items: center; gap: 14px; }
.exam-banner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exam-banner-head .row-title { font-size: 18px; }
.exam-banner-row { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; color: var(--muted); font-size: 15px; }
.exam-banner-row strong { color: var(--ink); font-weight: 900; }
.exam-banner .link-row { width: 100%; margin-top: 4px; }
.progress-track.goal .progress-fill { background: var(--green); }
.goal-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 8px; margin-top: 14px; }
.chip-choice { display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: var(--r); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 900; font-size: 18px; color: var(--ink); background: var(--bg); }
.chip-choice.selected { border-color: var(--blue-line); color: var(--blue-ink); box-shadow: 0 4px 0 var(--blue-line); }
.chip-choice:active { transform: translateY(4px); box-shadow: none; }
.goal-card .goal-text { flex: 1; display: grid; gap: 8px; }
.goal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-weight: 800; color: var(--ink); }
.goal-head span { color: var(--muted); white-space: nowrap; }
.tile {
  --c: var(--blue); --c-fg: #fff;
  width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px;
  color: var(--c-fg); background: var(--c);
  box-shadow: inset 0 0 0 2px var(--c), inset 0 0 0 3.5px rgba(255, 255, 255, .92);
}
.tile .i { width: 24px; height: 24px; }
.tile.yellow { --c: var(--yellow); --c-fg: var(--on-yellow); }
/* Octagon plate for the duel, like the STOP sign. */
.tile.octagon, .duel-badge {
  border-radius: 0; box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M15.6 1h16.8L47 15.6v16.8L32.4 47H15.6L1 32.4V15.6z' fill='%23e0262d'/%3E%3Cpath d='M16.4 3.4h15.2l13 13v15.2l-13 13H16.4l-13-13V16.4z' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.tile.sign { background: none; box-shadow: none; }

/* The duel sits at the top of the practice page in STOP-sign red, so it is not missed. */
.duel-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border-color: var(--red); background: var(--red-soft); box-shadow: 0 4px 0 var(--red); }
.duel-card:hover { background: var(--red-soft); }
.duel-card:active { box-shadow: 0 0 0 var(--red); }
.duel-card .row-title { font-size: 18px; font-weight: 900; }
.duel-quota { color: var(--red-ink); }
.duel-quota:empty { display: none; }
.duel-cta { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }

.exam-card { display: grid; gap: 14px; }
.exam-card-head { display: flex; align-items: center; gap: 14px; }
.exam-card h2 { font-size: 20px; font-weight: 900; }
.exam-card p { color: var(--muted); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-card { display: grid; align-content: start; gap: 10px; width: 100%; padding: 14px; text-align: left; }
.mode-card h3 { font-size: 16px; font-weight: 800; }
.mode-card small { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
/* An odd card left alone in the last row takes the whole row, tile beside the text. */
.mode-card:last-child:nth-child(odd) { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; gap: 14px; }

/* Tickets as cards: the name, and the question count under it — or the last result, green when
   passed (two mistakes at most) and red when not. */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.ticket-grid .empty-note { grid-column: 1 / -1; }
.ticket {
  --edge: var(--line);
  display: grid; align-content: space-between; gap: 6px; min-height: 76px; padding: 12px; text-align: left;
  border-radius: var(--r-sm); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); background: var(--bg);
  transition: transform .06s, box-shadow .06s;
}
.ticket b { font-size: 16px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.ticket small { font-size: 13px; font-weight: 800; color: var(--muted); }
.ticket.passed { --edge: var(--green); background: var(--green-soft); }
.ticket.passed small { color: var(--green-ink); }
.ticket.failed { --edge: var(--red); background: var(--red-soft); }
.ticket.failed small { color: var(--red-ink); }
.ticket:active { transform: translateY(3px); box-shadow: none; }
.ticket:not(.passed, .failed):hover { background: var(--soft); }

.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--faint); pointer-events: none; }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--soft); color: var(--ink); font-weight: 700; font-size: 16px; outline: none;
}
.search .input { padding-left: 44px; }
.input:focus { border-color: var(--blue); background: var(--bg); }

.list { border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px; text-align: left; border-top: 2px solid var(--line); }
.row:first-child { border-top: 0; }
button.row:hover, a.row:hover { background: var(--soft); }
.row-text { flex: 1; min-width: 0; display: grid; }
.row-title { font-weight: 800; color: var(--ink); }
.row-sub { font-size: 14px; font-weight: 700; color: var(--muted); }
.row-end { color: var(--faint); }
.row .tile { width: 40px; height: 40px; border-radius: 12px; }
.row .tile .i { width: 20px; height: 20px; }
.topic-group { border-top: 2px solid var(--line); }
.topic-group:first-child { border-top: 0; }
.topic-group > summary { list-style: none; cursor: pointer; }
.topic-group > summary::-webkit-details-marker { display: none; }
.topic-group > summary:hover { background: var(--soft); }
.topic-group .chevron { transition: transform .2s; }
.topic-group[open] .chevron { transform: rotate(90deg); }
.topic-row { padding-left: 68px; }
.group-title { margin: 6px 4px -6px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.empty-note { padding: 20px; text-align: center; color: var(--muted); font-weight: 700; }

.switch { position: relative; width: 50px; height: 30px; flex: none; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); transition: transform .2s; }
[aria-checked="true"] .switch { background: var(--green); }
[aria-checked="true"] .switch::after { transform: translateX(20px); }

/* Leaderboard */
.segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--r); border: 2px solid var(--line); background: var(--soft); }
.segment button { min-height: 40px; border-radius: 10px; text-align: center; font-weight: 800; font-size: 15px; color: var(--muted); transition: background .15s, color .15s; }
.segment button[aria-selected="true"] { background: var(--bg); color: var(--blue-ink); box-shadow: 0 0 0 2px var(--blue-line); }
.segment.two { grid-template-columns: repeat(2, 1fr); }
.segment.four { grid-template-columns: repeat(4, 1fr); }
.duel-size-label { margin: 14px 0 6px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.duel-lobby .segment { width: 100%; margin-bottom: 16px; }
/* A link to pass on by hand: the field shows it whole, the buttons copy it or hand it to Telegram. */
.share-link { width: 100%; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--soft); font: inherit; font-size: 14px; color: var(--ink); text-overflow: ellipsis; }
.challenge-card { display: grid; gap: 6px; border-color: var(--yellow); }
.challenge-card .challenge-title { font-size: 18px; font-weight: 900; color: var(--ink); }
.challenge-card .challenge-dates { color: var(--muted); font-weight: 700; font-size: 14px; }
.challenge-card .challenge-status { font-weight: 800; color: var(--blue-ink); }
/* The prize as a gift voucher: a yellow ticket, its stub (the places it goes to) torn off along a dashed
   line with a notch at each end, the admin's words on the rest. */
.voucher {
  --notch: 11px;
  position: relative; display: grid; grid-template-columns: 84px 1fr; margin-top: 8px;
  border-radius: 14px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 5px 0 var(--yellow-dark);
  -webkit-mask: radial-gradient(circle var(--notch) at 84px 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at 84px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at 84px 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at 84px 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.voucher-stub {
  display: grid; place-content: center; justify-items: center; gap: 0; padding: 14px 6px;
  border-right: 2px dashed rgba(22, 25, 29, .35); text-align: center;
}
.voucher-stub small { font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; line-height: 1.2; }
.voucher-stub b { font-size: 40px; font-weight: 900; line-height: .95; }
.voucher-body { display: grid; align-content: center; gap: 4px; padding: 14px 16px 14px 18px; }
.voucher-label { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.voucher-body p { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.3; white-space: pre-line; }
/* On the challenge's board a free player gets the way in instead of a place. */
.rank-card.join { display: grid; gap: 12px; border-color: var(--yellow); background: var(--yellow-soft); }
.rank-card.join .row-text span:last-child { color: var(--text); }
.rank-card { display: flex; align-items: center; gap: 14px; }
.rank-card strong { font-size: 30px; font-weight: 900; color: var(--ink); line-height: 1; }
.rank-card .row-text span:last-child { color: var(--muted); font-weight: 700; }
.leader-list { list-style: none; margin: 0; padding: 0; }
.leader-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 2px solid var(--line); }
.leader-row:first-child { border-top: 0; }
.leader-row.me { background: var(--blue-soft); }
.leader-rank { width: 30px; flex: none; text-align: center; font-weight: 900; font-size: 17px; color: var(--muted); }
.leader-rank.medal { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 15px; }
.leader-rank.r1 { background: var(--yellow); box-shadow: 0 3px 0 var(--yellow-dark); color: var(--on-yellow); }
.leader-rank.r2 { background: #b8c5cc; box-shadow: 0 3px 0 #97a6ae; }
.leader-rank.r3 { background: #e8a06a; box-shadow: 0 3px 0 #c9804b; }
/* The shohsupa: the first three, gold in the middle, silver left, bronze right. */
.podium-card { padding: 18px 12px 0; overflow: hidden; background: linear-gradient(var(--yellow-soft), var(--bg) 70%); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; }
.podium-col { display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; }
.podium-crown { color: var(--yellow-dark); line-height: 0; }
.podium-crown .i { width: 30px; height: 30px; }
.podium .podium-av { width: 52px; height: 52px; font-size: 21px; box-shadow: 0 0 0 4px var(--podium, var(--line)); }
.podium .podium-av.xl { width: 72px; height: 72px; font-size: 30px; }
.podium-name { max-width: 100%; font-weight: 900; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-xp { font-size: 13px; font-weight: 800; color: var(--muted); }
.podium-paid { margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: var(--green); color: #fff; font-size: 11px; font-weight: 900; white-space: nowrap; }
.podium-step { width: 100%; display: grid; place-items: center; margin-top: 6px; border-radius: 14px 14px 0 0; background: var(--podium); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12); }
.podium-step b { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.podium-col.p1 { --podium: var(--yellow); }
.podium-col.p1 .podium-step { height: 96px; }
.podium-col.p1 .podium-step b { color: var(--on-yellow); text-shadow: none; }
.podium-col.p2 { --podium: #b8c5cc; }
.podium-col.p2 .podium-step { height: 70px; }
.podium-col.p3 { --podium: #e8a06a; }
.podium-col.p3 .podium-step { height: 52px; }
.podium-col.me .podium-name { color: var(--blue-ink); }
.podium-col.empty .podium-step { opacity: .35; }
.podium-prize { margin: 0 -12px; padding: 10px 14px; background: var(--yellow); color: var(--on-yellow); font-weight: 900; text-align: center; font-size: 14px; }
.podium-prize.paid { background: var(--green-soft); color: var(--green-ink); }
@media (prefers-reduced-motion: no-preference) {
  .podium-step { animation: podium-rise .5s cubic-bezier(.2, .9, .3, 1.2) both; transform-origin: bottom; }
  .podium-col.p2 .podium-step { animation-delay: .08s; }
  .podium-col.p3 .podium-step { animation-delay: .16s; }
}
@keyframes podium-rise { from { transform: scaleY(.2); } to { transform: none; } }
.leader-name { flex: 1; min-width: 0; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-xp { font-weight: 800; color: var(--muted); white-space: nowrap; }
/* Who is on a paid tariff wears its name next to their own. */
.plan-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; vertical-align: 2px; }
#lb-previous { display: grid; gap: 16px; }
.avatar {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--av, var(--blue)); color: #fff; font-weight: 900; font-size: 18px; text-transform: uppercase;
}
.avatar.xl { width: 76px; height: 76px; font-size: 32px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: 24px; font-weight: 900; }
.profile-head p { color: var(--muted); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-weight: 800; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.stat-card .i { width: 28px; height: 28px; }
.stat-card strong { display: block; font-size: 20px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.stat-card small { font-size: 13px; font-weight: 700; color: var(--muted); }
.plan-card { display: grid; gap: 12px; }
.plan-card .row-title { font-size: 18px; }
.row-sub.pending, .sheet-text.pending { color: var(--blue-ink); }
.result-row strong { font-weight: 900; color: var(--ink); }

/* ---------- Lesson ---------- */
.lesson { min-height: var(--vh); display: flex; flex-direction: column; max-width: 600px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.lesson-top .progress-track { flex: 1; }
/* The questions as the real exam shows them: numbered cells, green right, red wrong, the one on screen
   outlined; a row that scrolls in a long test. The result's grid wraps them all. */
.q-strip { flex: 1; min-width: 0; display: flex; gap: 6px; margin: 0; padding: 3px 2px 5px; list-style: none; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.q-strip::-webkit-scrollbar { display: none; }
.q-cell {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--soft); border: 2px solid var(--line); color: var(--muted);
  font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; scroll-snap-align: center;
  transition: background .2s, border-color .2s, color .2s;
}
.q-cell.now { border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); box-shadow: 0 0 0 2px var(--blue-soft); }
.q-cell.ok { background: var(--green); border-color: var(--green-dark); color: #fff; }
.q-cell.bad { background: var(--red); border-color: var(--red-dark); color: #fff; }
/* A tap on a number goes to that question, as at the exam (24.11); the one on screen keeps a ring when
   it has its colour already. */
.q-strip .q-cell { cursor: pointer; }
.q-cell.ok.here, .q-cell.bad.here { box-shadow: 0 0 0 3px var(--blue-line); }
.q-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 420px; margin: 4px auto 0; padding: 0; list-style: none; }
.q-grid .q-cell { width: auto; height: auto; aspect-ratio: 1; font-size: 13px; }
.q-grid .q-cell.skip { background: var(--soft); border-style: dashed; color: var(--faint); }
@media (max-width: 360px) { .q-grid { gap: 4px; } .q-grid .q-cell { font-size: 12px; border-radius: 8px; } }
.lesson-count { font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.timer {
  display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: var(--blue-ink);
  font-variant-numeric: tabular-nums;
}
.timer .i { width: 20px; height: 20px; }
.timer.urgent { color: var(--red-ink); }
.lesson-lives { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.lesson-lives .i { width: 22px; height: 22px; }
.lesson-lives.off { color: var(--faint); }
.lesson-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 24px; }
.lesson-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.eyebrow { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); }
.lesson-tools { display: flex; align-items: center; gap: 6px; }
/* The question's voice explanation, picked out as the videos' buttons are (the team's 24.11 list): a blue
   pill with its name, not a grey icon. «PRO» on it for whoever has no tariff — a tap offers one. */
.voice-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 900; box-shadow: 0 3px 0 var(--blue-dark);
  transition: transform .1s, box-shadow .1s;
}
.voice-btn { white-space: nowrap; flex: none; }
.voice-btn .i { width: 20px; height: 20px; }
.lesson-meta .eyebrow { min-width: 0; }
.voice-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-dark); }
.voice-btn.on { background: var(--green); box-shadow: 0 3px 0 var(--green-dark); }
.voice-lock { font-size: 10px; font-weight: 900; letter-spacing: .04em; padding: 2px 6px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); }
.question-text, .gate-inner .question-text { font-size: 21px; font-weight: 800; line-height: 1.35; color: var(--ink); }
.question-text.long, .gate-inner .question-text.long { font-size: 18px; }
.question-figure { margin: 0; overflow: hidden; border-radius: var(--r); border: 2px solid var(--line); background: var(--soft); }
/* Many road-sign images are about 100px wide: near their own size they stay sharp, stretched they blur. */
.question-figure img { width: auto; min-width: min(100%, 160px); margin: 0 auto; max-height: 36vh; object-fit: contain; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left;
  border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--line); background: var(--bg);
  color: var(--text); font-weight: 700; font-size: 16px; line-height: 1.35;
  transition: transform .06s, box-shadow .06s, background .15s, border-color .15s, color .15s, opacity .15s;
}
.option:hover:not(:disabled) { background: var(--soft); }
.option:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.option-key {
  min-width: 36px; height: 30px; padding: 0 5px; flex: none; display: grid; place-items: center; border-radius: 9px;
  border: 2px solid var(--line); font-size: 13.5px; font-weight: 900; color: var(--faint); white-space: nowrap;
}
.option-text { flex: 1; min-width: 0; }
.option.selected { border-color: var(--blue-line); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue-line); color: var(--blue-ink); }
.option.selected .option-key { border-color: var(--blue-line); color: var(--blue-ink); }
.option.correct { border-color: var(--green); background: var(--green-soft); box-shadow: 0 4px 0 var(--green); color: var(--green-ink); }
.option.correct .option-key { border-color: var(--green); background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-soft); box-shadow: 0 4px 0 var(--red); color: var(--red-ink); }
.option.wrong .option-key { border-color: var(--red); background: var(--red); color: #fff; }
.option.dim { opacity: .5; }
.option:disabled { cursor: default; }

.lesson-footer {
  position: sticky; bottom: 0; z-index: 5; display: grid; gap: 14px;
  padding: 16px 16px calc(16px + var(--safe-b)); background: var(--bg); border-top: 2px solid var(--line);
}
.lesson-footer[data-state="correct"] { background: var(--green-soft); border-top-color: transparent; }
.lesson-footer[data-state="wrong"] { background: var(--red-soft); border-top-color: transparent; }
.feedback { display: none; gap: 6px; }
[data-state="correct"] .feedback, [data-state="wrong"] .feedback { display: grid; animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.feedback-head { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; }
.feedback-badge { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--bg); }
.feedback-badge .i { width: 20px; height: 20px; }
[data-state="correct"] .feedback-head, [data-state="correct"] .feedback-links { color: var(--green-ink); }
[data-state="wrong"] .feedback-head, [data-state="wrong"] .feedback-links, [data-state="wrong"] .feedback-note { color: var(--red-ink); }
.feedback-note { font-weight: 700; color: var(--green-ink); }
.feedback-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 2px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font-weight: 900; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.link-btn .i { width: 18px; height: 18px; }

/* ---------- Result ---------- */
.result { min-height: var(--vh); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 32px 20px calc(20px + var(--safe-b)); }
.result-main { flex: 1; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; }
.result-main h1 { font-size: 30px; font-weight: 900; }
.result-main h1.win { color: var(--yellow-ink); }
.result-main > p { color: var(--muted); font-weight: 700; font-size: 17px; max-width: 34ch; }
.result-main > p.result-score { margin-top: 6px; color: var(--ink); font-size: 26px; font-weight: 900; max-width: none; }
.result-main > p.result-score.good { color: var(--green-ink); }
.result-stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.result-stat { --c: var(--yellow); --c-fg: var(--on-yellow); --c-text: var(--yellow-ink); border-radius: var(--r); background: var(--c); padding: 2px; overflow: hidden; }
.result-stat > span { display: block; padding: 5px 4px 6px; color: var(--c-fg); font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.result-stat strong { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 12px 4px; border-radius: 13px; background: var(--bg); color: var(--c-text); font-size: 20px; font-weight: 900; }
.result-stat strong .i { width: 20px; height: 20px; }
.result-stat.acc { --c: var(--green); --c-fg: #fff; --c-text: var(--green-ink); }
.result-stat.time { --c: var(--blue); --c-fg: #fff; --c-text: var(--blue-ink); }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Octagon duel ---------- */
.duel-lobby, .duel-search { display: grid; justify-items: center; gap: 14px; padding: 28px 20px; text-align: center; }
.duel-lobby h1, .duel-search h1 { font-size: 26px; font-weight: 900; }
.duel-lobby > p, .duel-search > p { color: var(--muted); font-weight: 700; max-width: 34ch; }
.duel-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
.duel-stats .card { display: grid; gap: 2px; }
.duel-stats strong { font-size: 24px; font-weight: 900; color: var(--ink); }
.duel-stats small { font-weight: 700; color: var(--muted); }
.duel-actions { width: 100%; display: grid; gap: 12px; }
.duel-badge { width: 96px; height: 96px; display: grid; place-items: center; color: #fff; }
.duel-badge .i { width: 50px; height: 50px; }
.duel-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 6px 16px 0; }
.duel-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.duel-player.opp { flex-direction: row-reverse; text-align: right; }
.duel-player .avatar { width: 40px; height: 40px; font-size: 16px; }
.duel-player b { display: block; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-player strong { display: block; font-size: 20px; font-weight: 900; color: var(--ink); line-height: 1.1; }
.duel-vs { font-weight: 900; color: var(--faint); }
.duel-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 12px; color: var(--muted); font-weight: 800; }

/* ---------- Bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s ease-out; }
.sheet-panel {
  position: relative; width: 100%; max-width: 600px; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(20px + var(--safe-b)); border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg);
  animation: sheet-up .26s cubic-bezier(.2, .9, .3, 1);
}
.sheet-handle { width: 40px; height: 5px; margin: 0 auto 16px; border-radius: 99px; background: var(--line); }
.sheet-panel h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.sheet-panel h2 .i { width: 26px; height: 26px; }
.sheet-text { color: var(--text); font-weight: 600; font-size: 16px; line-height: 1.55; }
.sheet-center { display: grid; justify-items: center; gap: 10px; text-align: center; }
.sheet-center h2 { justify-content: center; }
.sheet-actions { display: grid; gap: 12px; margin-top: 20px; }
.sheet-list { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.sheet-list li { padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); font-weight: 600; }
.sheet-list b { color: var(--ink); }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 10px -20px 12px; padding: 0 20px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); font-weight: 800; font-size: 14px; color: var(--muted); }
.tabs button.active { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
/* The challenges' months, in their order (the team, 2026-11-12): short names; the one on show outlined,
   the one running today in the sign blue with a dot, the finished ones quieter. */
.challenge-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px !important; padding: 8px 16px !important; }
.challenge-chip.is-past { color: var(--faint); border-style: dashed !important; }
.challenge-chip[aria-selected="true"] { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-ink); }
.challenge-chip.is-now { border-color: var(--blue) !important; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-dark); }
.challenge-chip.is-now[aria-selected="false"] { background: var(--bg); color: var(--blue-ink); box-shadow: none; }
.chip-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.challenge-chip.is-now[aria-selected="false"] .chip-dot { background: var(--blue); box-shadow: none; }
.sign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* Long Russian words (e.g. «Железнодорожный») must wrap inside the half-width cards. */
.sign-card { display: grid; gap: 4px; padding: 12px; min-width: 0; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.sign-card .sign-art { width: 46px; height: 46px; margin-bottom: 4px; }
.sign-card b { font-size: 12px; font-weight: 900; color: var(--muted); }
.sign-card strong { font-weight: 800; color: var(--ink); line-height: 1.25; }
.sign-card small { font-weight: 600; color: var(--muted); font-size: 13px; }
/* The tariffs sheet: the lives, the wait, what a paid tariff gives, and the plans to choose from. */
.hearts { display: flex; justify-content: center; gap: 4px; color: var(--red); }
.hearts .i { width: 26px; height: 26px; }
.hearts .i.lost { color: var(--locked); }
.countdown { display: grid; gap: 2px; margin-top: 4px; padding: 10px 18px; border-radius: var(--r); background: var(--soft); }
.countdown span { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.countdown strong { font-size: 28px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.perks { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; font-weight: 700; }
.perks li { display: flex; align-items: flex-start; gap: 10px; }
.perks .i { width: 20px; height: 20px; margin-top: 2px; color: var(--green-ink); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.plan {
  position: relative; display: grid; align-content: start; gap: 4px; padding: 16px 12px 14px; text-align: center;
  border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--line); background: var(--bg);
  transition: transform .06s, box-shadow .06s;
}
.plan:active { transform: translateY(4px); box-shadow: none; }
.plan.best { border-color: var(--yellow-dark); background: var(--yellow-soft); box-shadow: 0 4px 0 var(--yellow-dark); }
.plan-save { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; background: var(--yellow); color: var(--on-yellow); font-size: 12px; font-weight: 900; white-space: nowrap; }
.plan-name { font-size: 20px; font-weight: 900; color: var(--ink); }
.plan-price { font-weight: 900; font-size: 17px; color: var(--blue-ink); white-space: nowrap; }
.plan-old { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.discount-note { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r); background: var(--yellow-soft); border: 2px solid var(--yellow-dark); color: var(--ink); font-weight: 800; text-align: center; }
.plan-period { font-size: 14px; font-weight: 800; color: var(--text); }
.plan-note { font-size: 13px; font-weight: 700; color: var(--muted); }
.plan-buy { margin-top: 8px; padding: 8px 6px; border-radius: var(--r-sm); background: var(--blue); color: #fff; font-weight: 900; font-size: 15px; }
.plan.best .plan-buy { background: var(--yellow); color: var(--on-yellow); }
.premium-head h2 { margin-bottom: 0; }
.plans + .perks { margin-top: 18px; }

/* The tariffs window as the team's 24.11 picture draws it. */
.social-proof { display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-weight: 900; font-size: 14px; }
.sp-avatars { display: inline-flex; }
.sp-avatars i { width: 24px; height: 24px; display: grid; place-items: center; margin-left: -6px; border-radius: 50%; border: 2px solid var(--bg); background: var(--av); color: #fff; font-size: 11px; font-style: normal; font-weight: 900; }
.sp-avatars i:first-child { margin-left: 0; }
.premium-head h2 { font-size: 26px; line-height: 1.2; }
.plan-price { font-size: 26px; line-height: 1.15; }
.plan-price small { font-size: 15px; font-weight: 900; }
.plan-period { color: var(--ink); font-size: 15px; }
.plan.best .plan-note { color: var(--yellow-ink); font-weight: 800; }
.plan-buy { margin-top: 10px; padding: 10px 6px; background: var(--bg); color: var(--blue-ink); border: 3px solid var(--blue); border-radius: var(--r); font-size: 16px; }
.plan.best .plan-buy { border-color: var(--yellow); box-shadow: 0 4px 0 var(--yellow-dark); }
.plan-save { padding: 3px 12px; font-size: 13px; box-shadow: 0 2px 0 var(--yellow-dark); }
.perks-big { gap: 12px; font-size: 16px; font-weight: 600; }
.perks-big li { align-items: center; }
.perks-big .i { width: 30px; height: 30px; margin: 0; padding: 6px; border-radius: 50%; background: var(--green-soft); }
.perks-big b { font-weight: 900; color: var(--ink); }
.premium-challenge { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(135deg, var(--blue-dark), #4f86e8); color: #fff; }
.premium-challenge .pc-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(255, 255, 255, .18); font-size: 22px; }
.premium-challenge b { display: block; font-size: 16px; font-weight: 900; }
.premium-challenge small { display: block; font-size: 13.5px; font-weight: 700; opacity: .92; }
.soon-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.soon-tag { padding: 5px 12px; border-radius: var(--r-sm); background: var(--yellow-soft); color: var(--yellow-ink); font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.soon-chip { padding: 5px 12px; border-radius: 999px; border: 2px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 800; }
.once-pill { width: fit-content; margin: 14px auto 0; padding: 5px 12px; border-radius: 999px; border: 2px dashed #e58fb0; color: var(--muted); font-size: 13px; font-weight: 800; text-align: center; }
.premium-foot { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; color: var(--faint); }
.premium-foot .link-btn { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 4px; }
.premium-foot .link-btn.muted { color: var(--faint); text-decoration: none; }
.discount-note + .plans { margin-top: 14px; }
.discount-clock { font-variant-numeric: tabular-nums; color: var(--red-ink); }
.offer-gift { font-size: 52px; line-height: 1; }
/* The price test's list and its two closing offers, as the team's 25.11 pictures draw them: a plan is a
   row — a round mark, the name and the period on the left, the prices on the right, its tags above. */
.plans.plans-list { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.plan.plan-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 14px; padding: 20px 16px 16px; text-align: left; }
.plan-radio { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2.5px solid var(--locked-edge); color: var(--on-yellow); }
.plan-row.best .plan-radio { border-color: var(--yellow-dark); background: var(--yellow); }
.plan-radio .i { width: 16px; height: 16px; }
.plan-side { display: grid; gap: 2px; min-width: 0; }
.plan-side-end { justify-items: end; text-align: right; }
.plan-row .plan-name { font-size: 22px; line-height: 1.15; }
.plan-row .plan-period, .week-card .plan-period { color: var(--muted); font-size: 15px; }
.plan-row .plan-price { font-size: 24px; }
.plan-row .plan-note { font-size: 13.5px; font-weight: 800; }
.plan-tags { position: absolute; top: -13px; left: 16px; display: flex; gap: 6px; }
.plan-tags span { padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; }
.plan-tag-pop { background: var(--yellow); color: var(--on-yellow); box-shadow: 0 2px 0 var(--yellow-dark); }
.plan-tag-save, .plan-tag-off { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-dark); }
.plan-tag-low { background: var(--soft); color: var(--text); border: 2px solid var(--line); padding: 1px 10px; }
.test-head h2 { font-size: 28px; line-height: 1.2; }
.offer-pill { width: fit-content; margin: 0 auto 12px; padding: 6px 16px; border-radius: 999px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 14px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.offer-pill.last { background: var(--red-soft); color: var(--red-ink); }
.seg-clock { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.seg { width: 76px; display: grid; justify-items: center; gap: 2px; padding: 10px 0 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--soft); }
.seg b { font-size: 34px; font-weight: 900; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.seg small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg-colon { font-size: 28px; font-weight: 900; color: var(--yellow-dark); }
.test-head + .plans { margin-top: 26px; }
.plan.week-card { gap: 14px; margin-top: 22px; padding: 20px; text-align: left; border-color: var(--yellow-dark); background: var(--yellow-soft); box-shadow: 0 5px 0 var(--yellow-dark); }
.wk-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--yellow); }
.week-card .plan-name { font-size: 24px; }
.week-card .plan-price { font-size: 36px; }
.week-card .plan-note { font-size: 14px; font-weight: 800; }
.wk-perks { display: grid; gap: 8px; font-size: 16px; font-weight: 800; color: var(--ink); }
.test-once { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; font-weight: 800; }
.test-foot { display: flex; justify-content: center; margin-top: 10px; }
.test-foot .link-btn { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--faint); text-decoration: none; }
/* The admins' banners on the home screen: one card, or a row to swipe. */
.promo-banners { position: relative; display: grid; gap: 12px; }
.promo-banners.many { grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px; }
.promo-banners.many::-webkit-scrollbar { display: none; }
/* A banner is one low row (since 2026-10-28; the picture on top made it too tall): the picture a small
   square at the left, the title, a line of text and where it leads at the right of it. */
.promo-banner { display: flex; align-items: center; gap: 12px; text-align: left; overflow: hidden; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--bg); box-shadow: 0 4px 0 var(--line); scroll-snap-align: start; padding: 10px 12px; color: var(--ink); }
.promo-banner.payment { border-color: var(--yellow-dark); background: var(--yellow-soft); box-shadow: 0 4px 0 var(--yellow-dark); }
.promo-banner.challenge { border-color: var(--blue-line); background: var(--blue-soft); box-shadow: 0 4px 0 var(--blue-line); }
.promo-banner:active { transform: translateY(3px); box-shadow: none; }
.promo-banner-img { flex: none; display: block; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.promo-banner-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.promo-banner-body b { font-size: 15px; font-weight: 900; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.promo-banner-text { color: var(--text); font-weight: 600; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.promo-banner-cta { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; color: var(--blue-ink); font-weight: 900; font-size: 13px; }
.promo-banner.payment .promo-banner-cta { color: var(--red-ink); }
.promo-banner-cta .i { width: 14px; height: 14px; }
/* The challenge's banner: a trophy where an admin's banner has its picture; its prize line may take two. */
.promo-banner-tile { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 3px 0 var(--yellow-dark); }
.promo-banner-tile .i { width: 32px; height: 32px; }
.promo-banner-text.wrap { -webkit-line-clamp: 2; }
/* Under a row of banners: a dot for each, the one in view long and blue. */
.promo-dots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.promo-dots span { width: 6px; height: 6px; border-radius: 999px; background: var(--line); transition: width .2s, background .2s; }
.promo-dots span.on { width: 18px; background: var(--blue); }
.banner-sheet-img { display: block; width: 100%; border-radius: var(--r); margin-bottom: 14px; }
.banner-sheet-text { white-space: pre-line; text-align: left; }
.danger-row .row-title { color: var(--red-ink); }
/* The comments under a reel, in a sheet: the list, and the line to write one at the bottom. */
.comments-title span { color: var(--muted); font-weight: 800; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-height: calc(var(--vh) * .5); overflow-y: auto; overscroll-behavior: contain; }
.comments-empty { display: grid; place-items: center; padding: 24px 8px; color: var(--muted); font-weight: 700; text-align: center; }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.comment .avatar { width: 34px; height: 34px; font-size: 14px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.comment-head b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 14px; font-weight: 900; }
.comment-head .link-btn { font-size: 12.5px; color: var(--red-ink); }
.comment-body p { margin-top: 2px; color: var(--text); font-weight: 600; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.comment-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 14px; }
.comment-form textarea { width: 100%; min-height: 46px; max-height: 120px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; resize: none; }
.comment-form textarea:focus { outline: none; border-color: var(--blue); }
.comment-send { width: 48px; height: 48px; padding: 0; display: grid; place-items: center; }
.comment-send .i { width: 22px; height: 22px; }
/* A target user's way to Premium, on top of the lessons. */
.premium-cta { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--yellow); color: var(--on-yellow); box-shadow: 0 5px 0 var(--yellow-dark); font-size: 18px; }
.premium-cta .i { width: 22px; height: 22px; }
.premium-cta-badge { padding: 2px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 900; }
.ai-block { padding: 14px 0; border-top: 2px solid var(--line); }
.ai-block:first-child { border-top: 0; padding-top: 4px; }
.ai-block h3 { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: 6px; }
.ai-block p { font-weight: 600; line-height: 1.55; }
.skeleton { height: 14px; margin: 12px 0; border-radius: 99px; background: var(--line); animation: pulse 1.2s ease-in-out infinite; }
.skeleton.short { width: 60%; }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); font-weight: 800; font-size: 15px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.immersive .toast { bottom: calc(150px + var(--safe-b)); }

@media (max-width: 400px) {
  .brand-name { display: none; }
  .topbar-stats { gap: 6px; }
}
@media (min-width: 640px) {
  .page { padding-top: 28px; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* The payment screen: the price (the list price struck through above a discount's or a promo code's)
   and "Promokod bormi?", which opens the field. */
.pay-price { margin-top: 6px; font-size: 22px; font-weight: 900; color: var(--blue-ink); }
.pay-price s { font-size: 15px; font-weight: 800; color: var(--muted); margin-right: 4px; }
.pay-off { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-size: 14px; vertical-align: middle; }
.link-btn { padding: 4px 0; border: 0; background: none; color: var(--blue-ink); font: inherit; font-weight: 800; text-transform: none; letter-spacing: normal; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.promo { margin: 4px 0 6px; text-align: center; }
.promo-form { display: none; gap: 8px; margin-top: 8px; }
.promo.open .promo-form { display: flex; }
.promo.open #btn-promo-open { display: none; }
.promo-input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--soft); font: inherit; font-size: 16px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.promo-input:focus { outline: none; border-color: var(--blue-line); }
.promo .form-error { margin-top: 6px; }
.promo-applied { margin: 4px 0 6px; padding: 10px 12px; border-radius: var(--r); background: var(--green-soft); color: var(--ink); font-weight: 800; text-align: center; }
/* «Obuna sovg'a qilish» on the payment screen, and the gifts bought on the profile (lib/gift.js). */
.gift-toggle { margin: 0 0 6px; text-align: center; }
.gift-note { margin: 4px 0 8px; padding: 12px 14px; border-radius: var(--r); background: var(--blue-soft); color: var(--ink); }
.gift-note p { margin: 6px 0 10px; font-size: 14px; line-height: 1.45; }
.gift-confirm { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; font-weight: 800; font-size: 14px; cursor: pointer; }
.gift-confirm input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.gift-list { display: grid; gap: 6px; margin-top: 12px; }
.gift-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r); background: none; color: var(--ink); font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.gift-row code { font-size: 13px; letter-spacing: .04em; }
.gift-row:disabled { opacity: .6; cursor: default; }
.gift-state { color: var(--blue-ink); font-size: 13px; white-space: nowrap; }
.gift-row:disabled .gift-state { color: var(--green-ink, var(--ink)); }
/* The Oktagon's settings: the time the duel takes; the search's countdown to the bot; the bot's tag and face. */
.duel-total { margin: -6px 0 2px; font-weight: 800; color: var(--text); }
.duel-search > .duel-countdown { font-size: 34px; font-weight: 900; color: var(--blue-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.bot-tag { display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.duel-player .avatar.bot { background: var(--blue-soft); overflow: hidden; }
.duel-player .avatar.bot .mascot { width: 34px; height: auto; }
/* The first visit's questions: the skip at the top, "Bilmayman" quieter than the options, the verdict in one line. */
.onboarding .lesson-top { gap: 10px; }
.onboarding-skip { flex: none; font-size: 14px; color: var(--muted); }
.option.dont-know { border-style: dashed; color: var(--muted); justify-content: center; }
.onboarding-verdict { min-height: 1.5em; margin-top: 12px; font-weight: 800; color: var(--blue-ink); text-align: center; }
.onboarding-verdict.right { color: var(--green-ink); }
/* Under the top hundred: how many more are ranked below them. */
.leader-list .more-note { text-align: center; }

/* On top of the home screen without a paid tariff (the team's 24.11 list): the way into the challenge. */
.challenge-top {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  border-radius: var(--r); background: var(--yellow); color: var(--on-yellow); box-shadow: 0 4px 0 var(--yellow-dark);
  transition: transform .06s, box-shadow .06s;
}
.challenge-top:active { transform: translateY(4px); box-shadow: none; }
.challenge-top-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: rgba(255, 255, 255, .55); font-size: 22px; }
.challenge-top-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.challenge-top-body b { font-size: 17px; font-weight: 900; }
.challenge-top-body small { font-size: 13px; font-weight: 800; opacity: .8; }
.challenge-top .i { width: 20px; height: 20px; flex: none; }
