/* ═══════════════════════════════════════════════════════════════════════
   academy/css/lesson.css — LESSON + shared page primitives
   Owned by the "pages" agent. Uses ONLY core tokens (tokens.css):
   --bg --bg-2 --bg-3 --text --text-2 --text-3 --border --primary
   --primary-bg --success --danger --warning --gold --streak --radius-*
   Dark-value fallbacks are a last resort — the real tokens win in BOTH
   light and dark, so nothing here is theme-locked.
   Prefix: acp-  (academy content pages) — avoids clashing with the shell.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page shell ── */
.acp-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  animation: acp-fade .35s ease both;
}
/* Ko'p-ustunli tarkib uchun (quickref.js'ning AI+Tez havolalar yonma-yon
   joylashuvi) — lesson/quiz o'zining o'qish-kengligida (720px) qoladi
   (uzun matn qatorlari o'qishga noqulay bo'lib qolmasin), faqat buni
   ATAYLAB ishlatgan sahifalar (hozircha faqat quickref) chetlarigacha
   to'ladi — 2026-07-29 aniq talab bo'yicha max-width butunlay olib
   tashlandi (avvalgi 1180px hali ham keng ekranda bo'sh joy qoldirardi). */
.acp-page-wide {
  max-width: 100%;
}
@keyframes acp-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes acp-pop  { 0% { opacity: 0; transform: scale(.9); } 70% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes acp-shimmer { 0% { background-position: -420px 0; } 100% { background-position: 420px 0; } }

.acp-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.acp-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #F5F4F7);
  margin: 0;
  letter-spacing: -.01em;
}
.acp-page-sub {
  font-size: 13px;
  color: var(--text-3, #9B9AA3);
  margin: 2px 0 0;
}

/* ── Card ── */
.acp-card {
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-lg, 20px);
  padding: 18px;
  box-shadow: none;
}

/* ── Buttons (Duolingo 3D) ── */
.acp-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 13px 20px;
  border-radius: var(--radius-md, 16px);
  border: 2px solid var(--border, rgba(255,255,255,.12));
  background: var(--bg-2, #141318);
  color: var(--text, #F5F4F7);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border);
  transition: transform .09s ease, box-shadow .09s ease, background-color .2s ease, filter .15s ease, opacity .2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.acp-btn:hover:not(:disabled) { filter: brightness(1.05); }
.acp-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--border); }
.acp-btn:disabled { opacity: .5; cursor: not-allowed; }
.acp-btn-primary {
  background: var(--success, #58CC02);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 0 var(--success-edge, #58A700);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.acp-btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--success-edge, #58A700); }
.acp-btn-primary:disabled { box-shadow: 0 4px 0 var(--success-edge, #58A700); }
.acp-btn-ghost {
  background: transparent;
  color: var(--text-2, #C9C8CF);
  box-shadow: none;
}
.acp-btn-ghost:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.acp-btn-danger { color: var(--danger, #F58B8B); }
.acp-btn-block { width: 100%; }
.acp-btn-lg { min-height: 56px; padding: 16px 22px; font-size: 15px; }
.acp-btn-sm { min-height: 30px; padding: 6px 12px; font-size: 12px; border-radius: 10px; box-shadow: none; }

/* ── Segmented control (chunky) ── */
.acp-seg {
  display: inline-flex;
  background: var(--bg-3, #29282F);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-md, 16px);
  padding: 4px;
  gap: 3px;
}
.acp-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-3, #9B9AA3);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 14px;
  border-radius: calc(var(--radius-md, 16px) - 5px);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .12s var(--bounce);
  white-space: nowrap;
}
.acp-seg-btn.active {
  background: var(--bg, #0D0C10);
  color: var(--primary, #DCF262);
  box-shadow: var(--shadow-sm);
}

/* ── Chips ── */
.acp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.acp-chip {
  border: 2px solid var(--border, rgba(255,255,255,.12));
  background: var(--bg-2, #141318);
  color: var(--text-2, #C9C8CF);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s var(--bounce);
}
.acp-chip:active { transform: scale(.95); }
.acp-chip.active {
  background: var(--primary-bg, rgba(220,242,98,.14));
  color: var(--primary, #DCF262);
  border-color: var(--primary, #DCF262);
}

/* ── Linear progress — baland, yumaloq, yashil ── */
.acp-progress {
  height: 16px;
  background: var(--bg-3, #29282F);
  border-radius: 999px;
  overflow: hidden;
}
.acp-progress-fill {
  height: 100%;
  background-color: var(--success, #58CC02);
  background-image: linear-gradient(180deg, rgba(255,255,255,.40) 0, rgba(255,255,255,0) 46%);
  border-radius: 999px;
  width: 0;
  transition: width .5s cubic-bezier(.2,.8,.3,1);
}

/* ── Skeleton loaders ── */
.acp-skel {
  border-radius: var(--radius-md, 14px);
  background: var(--bg-3, #29282F);
  background-image: linear-gradient(90deg,
    rgba(255,255,255,0) 0,
    rgba(255,255,255,.06) 50%,
    rgba(255,255,255,0) 100%);
  background-size: 420px 100%;
  background-repeat: no-repeat;
  animation: acp-shimmer 1.2s infinite linear;
}
:root[data-theme="light"] .acp-skel {
  background-image: linear-gradient(90deg,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,.05) 50%,
    rgba(0,0,0,0) 100%);
}
.acp-skel-line { height: 14px; margin-bottom: 10px; }
.acp-skel-title { height: 22px; width: 55%; margin-bottom: 16px; }
.acp-skel-block { height: 220px; margin-bottom: 16px; }

/* ── Empty / error states ── */
.acp-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3, #9B9AA3);
}
.acp-empty-ico { font-size: 44px; margin-bottom: 12px; opacity: .8; }
.acp-empty-msg { font-size: 15px; font-weight: 600; color: var(--text-2, #C9C8CF); }
.acp-empty-sub { font-size: 13px; margin-top: 6px; }

/* ═══════════════ LESSON ═══════════════ */
.acp-lesson-top {
  position: sticky;
  top: 0;
  z-index: 5;
  /* Sahifaning haqiqiy foni endi umumiy hb- qobiqdan keladi (--hb-bg) —
     akademiyaning o'z --bg tokeni bilan bir xil emas (masalan qorong'i
     rejimda #1E1D24 vs #0D0C10), shu farq shu sticky sarlavhani "quti"
     sifatida ko'rinishiga sabab bo'lgan edi. */
  background: var(--hb-bg, var(--bg, #0D0C10));
  padding: 12px 0 14px;
  margin-bottom: 4px;
}
.acp-lesson-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.acp-lesson-count { font-size: 13px; font-weight: 700; color: var(--text, #F5F4F7); }
.acp-lesson-timer {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3, #9B9AA3);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 5px;
}

.acp-block {
  animation: acp-fade .3s ease both;
  margin-bottom: 22px;
}
.acp-block-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--primary, #DCF262);
  background: var(--primary-bg, rgba(220,242,98,.12));
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* Media */
.acp-media {
  width: 100%;
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  background: #000;
  display: block;
}
video.acp-media { max-height: 62vh; }
.acp-audio { width: 100%; margin: 8px 0; }
.acp-speed {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 10px;
}
.acp-speed-btn {
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--bg-2, #141318);
  color: var(--text-3, #9B9AA3);
  font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.acp-speed-btn.active {
  background: var(--primary, #DCF262);
  color: var(--on-primary, #fff);
  border-color: transparent;
}

/* Rich text (markdown-ish) */
.acp-rt { color: var(--text, #F5F4F7); font-size: 15px; line-height: 1.7; }
.acp-rt h2 { font-size: 20px; font-weight: 800; margin: 4px 0 12px; letter-spacing: -.01em; }
.acp-rt h3 { font-size: 17px; font-weight: 700; margin: 18px 0 8px; }
.acp-rt h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.acp-rt p  { margin: 0 0 12px; }
.acp-rt ul, .acp-rt ol { margin: 0 0 12px; padding-left: 22px; }
.acp-rt li { margin-bottom: 6px; }
.acp-rt code {
  background: var(--bg-3, #29282F);
  border-radius: 6px; padding: 2px 6px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.acp-rt strong { font-weight: 800; }
.acp-rt a { color: var(--primary, #DCF262); text-decoration: underline; }

/* ── Urg'u/tekislash bloklari (":::TYPE ... :::" — mdToHtml, 2026-08-09) ──
   Matn ichida ta'kidlash uchun 5 blok turi. Kontekstdan mustaqil (.acp-rt
   ichida ham, admin.js live-preview'ning .acadm-md ichida ham) ishlashi
   uchun em-nisbiy o'lcham ishlatiladi — atrofdagi shriftga moslashadi.
   Faqat core tokenlar (--primary/--primary-bg/--radius-*) — department
   rangiga avtomatik moslanadi, xuddi .acp-scenario kabi. */
.acp-blk-center, .acp-blk-accent, .acp-blk-big, .acp-blk-callout, .acp-blk-right {
  margin: 0 0 12px;
}
.acp-blk-center > *:last-child, .acp-blk-accent > *:last-child, .acp-blk-big > *:last-child,
.acp-blk-callout > *:last-child, .acp-blk-right > *:last-child { margin-bottom: 0; }

.acp-blk-center { text-align: center; }
.acp-blk-right { text-align: right; }

.acp-blk-accent {
  color: var(--primary, #DCF262);
  font-size: 1.1em;
  font-weight: 800;
}

.acp-blk-big {
  font-size: 1.75em;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.01em;
}

.acp-blk-callout {
  background: var(--primary-bg, rgba(220,242,98,.1));
  border-left: 3px solid var(--primary, #DCF262);
  border-radius: 0 var(--radius-md, 14px) var(--radius-md, 14px) 0;
  padding: 14px 16px;
}

/* ── Inline accent — "==matn==" (2026-08-09) — bir yoki bir necha so'zni
   gap ICHIDA ranglash uchun (masalan kompaniya nomi), .acp-blk-accent bilan
   bir xil rang, lekin span/inline (butun paragraf emas). ── */
.acp-inline-accent {
  color: var(--primary, #DCF262);
  font-weight: 800;
}

/* Scenario block */
.acp-scenario {
  border-left: 3px solid var(--primary, #DCF262);
  background: var(--primary-bg, rgba(220,242,98,.08));
  padding: 14px 16px;
  border-radius: 0 var(--radius-md, 14px) var(--radius-md, 14px) 0;
}

/* Rasm + Matn — matn "Rasm + Matn" bloki uchun asosiy mazmun, bitta qatorli
   rasm izohi emas, shuning uchun .acp-rt bilan bir xil o'lchamda o'qish uchun
   qulay va CHAPGA tekislangan bo'lishi kerak (avval 13px+markazlashtirilgan
   edi — uzun matn uchun o'qib bo'lmas darajada kichik va noqulay ko'rinardi). */
.acp-imgwrap { cursor: zoom-in; }
.acp-caption {
  font-size: 15px; color: var(--text-2, #C7C6CC);
  margin-top: 10px; text-align: left; line-height: 1.7;
}

/* Checklist */
.acp-check-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.acp-check {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 15px;
  border: 2px solid var(--border, rgba(255,255,255,.1));
  border-radius: var(--radius-md, 16px);
  background: var(--bg-2, #141318);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .12s var(--bounce);
}
.acp-check:active { transform: scale(.99); }
.acp-check.checked {
  border-color: var(--success, #7DD87D);
  background: var(--success-bg, rgba(52,199,89,.12));
}
.acp-check-box {
  width: 26px; height: 26px; flex: none; border-radius: 9px;
  border: 2px solid var(--border, rgba(255,255,255,.25));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: transparent; margin-top: 1px;
  transition: background-color .18s ease, border-color .18s ease, transform .18s var(--bounce);
}
.acp-check.checked .acp-check-box {
  background: var(--success, #7DD87D);
  border-color: var(--success, #7DD87D);
  color: #fff;
  transform: scale(1.05);
}
.acp-check-label { font-size: 14px; line-height: 1.5; color: var(--text, #F5F4F7); font-weight: 700; }

/* Document */
.acp-doc {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: var(--radius-md, 14px); background: var(--bg-2, #141318);
}
.acp-doc-ico { font-size: 26px; }
.acp-doc iframe { width: 100%; height: 60vh; border: 0; border-radius: var(--radius-md,14px); margin-top: 12px; background: #fff; }

/* Lesson nav footer */
.acp-lesson-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 12px;
  margin-top: 8px;
  /* xuddi .acp-lesson-top'dagi kabi — haqiqiy sahifa foni --hb-bg, akademiyaning
     o'z --bg tokeni emas (aks holda quti ko'rinardi). */
  background: linear-gradient(to top, var(--hb-bg, var(--bg, #0D0C10)) 72%, transparent);
}
.acp-lesson-nav-row { display: flex; gap: 10px; }
.acp-lesson-nav-row .acp-btn { flex: 1; border-radius: var(--radius-full, 999px); }

/* Anti-skip gate hint — muted line above the Next button (accessible) */
.acp-gate-hint {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text-3, #9B9AA3);
  padding: 2px 6px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.acp-gate-hint[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .acp-gate-hint.counting { animation: acp-gate-pulse 1.4s ease-in-out infinite; }
}
@keyframes acp-gate-pulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* YT IFrame API replaces #acp-yt-host with its own <iframe> — keep it a
   16:9 fill of .acp-video-wrap (whose own sizing stays INLINE, untouched —
   see lesson.js blockBody, this rule only targets the injected iframe). */
.acp-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Expand ("fake fullscreen") toggle — small overlaid corner button, additive
   only (does not require .acp-video-wrap to have any class-based sizing —
   it stays absolutely positioned relative to the wrap's own inline
   position:relative). Kept top-left, away from YouTube's own control bar. */
.acp-video-expand {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 38px; height: 38px; border-radius: var(--radius-full, 999px);
  border: 2px solid rgba(255,255,255,.5); background: transparent; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.acp-video-expand:hover { border-color: rgba(255,255,255,.9); }
.acp-video-expand:active { transform: scale(.9); }
.acp-video-expand-ic { pointer-events: none; }

/* Fake fullscreen — CSS-only viewport fill, NEVER calls the real Fullscreen
   API (Telegram's in-app WebView is known to sandbox/block
   requestFullscreen() on nested iframes — this sidesteps that entirely).
   !important is required on every overridden property because the base
   sizing on .acp-video-wrap is set via an INLINE style attribute (higher
   specificity than any class selector) — this is deliberate, see
   lesson.js: the working inline sizing is left completely untouched, only
   this toggle state needs to beat it. The YT.Player/iframe inside is never
   destroyed/recreated while toggling, so setupYouTubeGate()'s anti-skip
   poll/timer keeps running uninterrupted. Respects the shell's Telegram
   safe-area inset (--tg-safe-top, see hb-ui.js hbTgSafeArea()). */
.acp-video-wrap.acp-video-fs {
  position: fixed !important;
  top: var(--tg-safe-top, 0px) !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100vw !important;
  height: calc(100vh - var(--tg-safe-top, 0px)) !important;
  padding-top: 0 !important;
  border-radius: 0 !important;
  z-index: 2000 !important;
  animation: acp-fade .15s ease both;
}
.acp-video-wrap.acp-video-fs .acp-video-expand { top: 12px; right: 12px; }

/* Zoom overlay */
.acp-zoom {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
  animation: acp-fade .2s ease both;
}
.acp-zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* ═══════════════ PROFILE ═══════════════ */
.acp-profile-head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.acp-avatar {
  width: 76px; height: 76px; border-radius: 50%; flex: none;
  background: var(--primary, #DCF262); color: var(--on-primary, #fff);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900; overflow: hidden;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--primary) 55%, #000);
}
.acp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acp-profile-name { font-size: 20px; font-weight: 800; color: var(--text, #F5F4F7); }
.acp-profile-role { font-size: 13px; color: var(--text-3, #9B9AA3); margin-top: 3px; }

.acp-level-card { margin-bottom: 18px; }
.acp-level-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.acp-level-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 800; color: var(--text, #F5F4F7);
}
.acp-level-lvl {
  background: var(--gold, #F2C94C); color: #6b4e00;
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 900;
  box-shadow: 0 2px 0 var(--gold-edge, #E0A800);
}
.acp-level-xp { font-size: 13px; color: var(--text-3, #9B9AA3); font-weight: 700; }
.acp-level-next { font-size: 12px; color: var(--text-3, #9B9AA3); margin-top: 8px; text-align: right; }

.acp-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.acp-stat {
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-md, 16px);
  padding: 15px 8px; text-align: center;
}
.acp-stat-ico { font-size: 24px; }
.acp-stat-num { font-size: 21px; font-weight: 900; color: var(--text, #F5F4F7); margin-top: 4px; }
.acp-stat-lbl { font-size: 11px; color: var(--text-3, #9B9AA3); margin-top: 2px; }
@media (max-width: 460px) { .acp-stats { grid-template-columns: repeat(2, 1fr); } }

.acp-ach { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.acp-ach-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 72px; text-align: center;
}
.acp-ach-ico {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-3, #29282F);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.acp-ach-name { font-size: 10px; color: var(--text-3, #9B9AA3); line-height: 1.2; }

.acp-section-title {
  font-size: 13px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3, #9B9AA3);
  margin: 22px 0 12px;
}

.acp-cert {
  display: flex; align-items: center; gap: 12px;
  padding: 15px; margin-bottom: 10px;
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-md, 16px);
}
.acp-cert-ico { font-size: 26px; }
.acp-cert-body { flex: 1; min-width: 0; }
.acp-cert-title { font-size: 14px; font-weight: 700; color: var(--text, #F5F4F7); }
.acp-cert-meta { font-size: 12px; color: var(--text-3, #9B9AA3); margin-top: 2px; }
.acp-cert-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acp-cert-actions .acp-btn { padding: 8px 12px; font-size: 12px; }

.acp-settings .acp-setrow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 0; border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.acp-settings .acp-setrow:last-child { border-bottom: none; }
.acp-setrow-label { font-size: 14px; font-weight: 600; color: var(--text, #F5F4F7); }
.acp-select {
  background: var(--bg-3, #29282F); color: var(--text, #F5F4F7);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600;
}

/* ═══════════════ LEADERBOARD ═══════════════
   Sahifa o'zi (.acp-page-wide) chetigacha to'ladi, lekin boshqaruv
   tugmalari va podium (3 kichik avatar) juda keng ekranda cho'zilib
   bo'sh joy hosil qilmasligi uchun o'rtada, o'ziga mos kenglikda
   qoladi — pastdagi reyting ro'yxati esa to'liq kenglikda. */
.acp-lb-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; max-width: 560px; margin-left: auto; margin-right: auto; }
.acp-lb-controls .acp-seg { width: 100%; justify-content: stretch; overflow-x: auto; }
.acp-lb-controls .acp-seg-btn { flex: 1; }

.acp-podium {
  display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px;
  align-items: end; margin: 0 auto 20px; max-width: 480px;
}
.acp-podium-col { text-align: center; }
.acp-podium-av {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px;
  background: var(--bg-3, #29282F); color: var(--text, #F5F4F7);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; overflow: hidden;
  border: 3px solid var(--border, rgba(255,255,255,.15));
}
.acp-podium-col.p1 .acp-podium-av { width: 68px; height: 68px; border-color: var(--gold, #F2C94C); }
.acp-podium-av img { width: 100%; height: 100%; object-fit: cover; }
.acp-podium-medal { font-size: 22px; }
.acp-podium-name { font-size: 12px; font-weight: 700; color: var(--text, #F5F4F7); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acp-podium-xp { font-size: 12px; color: var(--primary, #DCF262); font-weight: 800; }
.acp-podium-stand {
  border-radius: 12px 12px 0 0; margin-top: 8px;
  background: var(--bg-3, #29282F);
}
.acp-podium-col.p1 .acp-podium-stand { height: 60px; background: var(--gold, #F2C94C); }
.acp-podium-col.p2 .acp-podium-stand { height: 44px; }
.acp-podium-col.p3 .acp-podium-stand { height: 32px; }

.acp-lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; margin-bottom: 9px;
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-md, 16px);
}
.acp-lb-row.me { border-color: var(--primary, #DCF262); background: var(--primary-bg, rgba(220,242,98,.1)); }
.acp-lb-row-clickable { cursor: pointer; transition: border-color .15s ease, transform .1s ease; }
.acp-lb-row-clickable:hover { border-color: var(--primary, #DCF262); }
.acp-lb-row-clickable:active { transform: scale(.99); }
.acp-podium-col.acp-lb-row-clickable { cursor: pointer; border-radius: var(--radius-md, 16px); transition: background-color .15s ease; }
.acp-podium-col.acp-lb-row-clickable:hover { background: var(--bg-2, #141318); }
.acp-lb-rank { width: 26px; text-align: center; font-weight: 800; color: var(--text-3, #9B9AA3); font-size: 14px; }
.acp-lb-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--bg-3, #29282F); color: var(--text, #F5F4F7);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.acp-lb-av img { width: 100%; height: 100%; object-fit: cover; }
.acp-lb-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text, #F5F4F7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acp-lb-sub { font-size: 12px; color: var(--text-3, #9B9AA3); }
.acp-lb-xp { font-size: 14px; font-weight: 800; color: var(--primary, #DCF262); }
.acp-lb-xpwrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.acp-lb-xpcap { font-size: 10.5px; font-weight: 600; color: var(--text-3, #9B9AA3); }

/* ═══════════════ QUICK REFERENCE ═══════════════ */
.acp-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.1));
  border-radius: var(--radius-md, 16px);
  padding: 13px 16px; margin-bottom: 14px;
  transition: border-color .18s ease, background-color .18s ease;
}
.acp-search:focus-within { border-color: var(--info, #1CB0F6); background: var(--bg); }
.acp-search input {
  flex: 1; background: transparent; border: none; color: var(--text, #F5F4F7);
  font-size: 15px;
}
.acp-search-ico { font-size: 18px; color: var(--text-3, #9B9AA3); }

.acp-qr-card {
  padding: 16px; margin-bottom: 10px;
  background: var(--bg-2, #141318);
  border: 2px solid var(--border, rgba(255,255,255,.08));
  border-radius: var(--radius-md, 16px);
  cursor: pointer;
  transition: transform .16s var(--bounce), border-color .18s ease;
}
.acp-qr-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.acp-qr-card:active { transform: translateY(0) scale(.99); }
.acp-qr-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.acp-qr-title { font-size: 15px; font-weight: 800; color: var(--text, #F5F4F7); flex: 1; }
.acp-qr-type {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--primary, #DCF262); background: var(--primary-bg, rgba(220,242,98,.12));
  padding: 3px 8px; border-radius: 999px;
}
.acp-qr-pos { font-size: 12px; color: var(--text-3, #9B9AA3); margin-bottom: 6px; }
.acp-qr-snip { font-size: 13px; color: var(--text-2, #C9C8CF); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acp-qr-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.acp-qr-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.acp-qr-tag { font-size: 11px; color: var(--text-3, #9B9AA3); background: var(--bg-3, #29282F);
  padding: 2px 8px; border-radius: 999px; }

/* ── Modal (shared) ── */
.acp-modal-back {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; animation: acp-fade .2s ease both;
}
@media (min-width: 560px) { .acp-modal-back { align-items: center; padding: 20px; } }
.acp-modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--bg-2, #141318);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 22px 22px 0 0;
  padding: 22px; animation: acp-sheetup .3s cubic-bezier(.2,.8,.3,1) both;
}
@media (min-width: 560px) { .acp-modal { border-radius: 22px; animation: acp-pop .3s ease both; } }
@keyframes acp-sheetup { from { transform: translateY(100%); } to { transform: none; } }
.acp-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.acp-modal-title { font-size: 18px; font-weight: 800; color: var(--text, #F5F4F7); }
.acp-modal-x {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--bg-3, #29282F); color: var(--text-2, #C9C8CF);
  font-size: 18px; cursor: pointer; flex: none;
}
