/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:    #0d1117;
  --bg-card:    #161b27;
  --bg-card2:   #1c2235;
  --bg-input:   #1a2030;
  --accent:     #5b4ee8;
  --accent2:    #7c6ff0;
  --gold:       #f5a623;
  --text-1:     #e8eaf0;
  --text-2:     #8b92a8;
  --text-3:     #5a6078;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --danger:     #e05454;
  --success:    #3ecf8e;
  --nav-h:      64px;
  --header-h:   56px;
  --radius:     14px;
  --radius-sm:  8px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  color: var(--text-1);
  font-family: -apple-system, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  min-height: var(--header-h);
  height: auto;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 100;
  gap: 6px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  width: 100%;
}

.stat-chip {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 36px;
  padding: 0 10px;
  border-radius: 22px;
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--border2);
  white-space: nowrap;
  flex: 1;
  box-sizing: border-box;
  text-align: center;
}

.stat-chip.streak {
  background: rgba(245,129,58,0.15);
  color: #f5813a;
  border-color: rgba(245,129,58,0.3);
}

.streak-fire {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.streak-kun {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.stat-chip.coins {
  background: rgba(245,166,35,0.12);
  color: var(--gold);
  border-color: rgba(245,166,35,0.25);
}

.stat-chip.xp {
  background: rgba(167,139,250,0.12);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.25);
}

.freezer-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 8px;
  height: 36px;
  border-radius: 22px;
  border: 1px solid rgba(56,212,255,0.6);
  background: rgba(14,116,144,0.55);
  gap: 3px;
}
.freezer-chip-icon {
  font-size: 15px;
  line-height: 1;
}
.freezer-chip-count {
  font-size: 12px;
  font-weight: 800;
  color: #38d4ff;
}
.freezer-chip-date {
  display: none;
}
body.light .freezer-chip {
  border-color: rgba(14,165,201,0.4);
  background: rgba(14,165,201,0.1);
}
body.light .freezer-chip-count { color: #0ea5c9; }
body.light .freezer-chip-date  { color: rgba(14,165,201,0.8); }

.theme-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--bg-card);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
  flex: 0 0 36px;
}
.theme-btn:active { transform: scale(.9); }

/* ===== PAGES ===== */
.pages {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0; right: 0;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 14px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ===== PAGE TITLE ===== */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: center;
  color: var(--text-1);
  margin-bottom: 0;
}

.page-title-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(91,78,232,0.15);
  color: var(--accent2);
  border: 1px solid rgba(91,78,232,0.28);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.page-title-underline {
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 4px;
  margin: 0 auto 20px;
}

/* ===== COURSE CARDS ===== */
.courses-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  position: relative;
  overflow: hidden;
}

.course-card:active { transform: scale(0.98); }
.course-card:hover { background: var(--bg-card2); border-color: var(--border2); }

.course-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(91,78,232,0.35) 0%, rgba(124,111,240,0.15) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(91,78,232,0.25);
  position: relative;
  overflow: hidden;
  flex-direction: column;
  padding-bottom: 20px;
}

.course-thumb svg {
  color: #fff;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.25));
  margin-top: 4px;
}

.course-thumb-count {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(91,78,232,0.75);
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 3px 2px;
  letter-spacing: 0.1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light .course-thumb {
  background: linear-gradient(135deg, rgba(91,78,232,0.2) 0%, rgba(124,111,240,0.08) 100%);
}
body.light .course-thumb svg { color: var(--accent); filter: none; }
body.light .course-thumb-count { background: rgba(91,78,232,0.6); }

.course-info { flex: 1; min-width: 0; }

.course-name {
  font-size: 15px; font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.course-meta { display: flex; align-items: center; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-blue { background: rgba(91,78,232,0.18); color: #a89ef5; border: 1px solid rgba(91,78,232,0.25); }
.badge-gold { background: rgba(245,166,35,0.15); color: var(--gold); border: 1px solid rgba(245,166,35,0.25); }
.badge-green { background: rgba(62,207,142,0.15); color: var(--success); border: 1px solid rgba(62,207,142,0.25); }
.badge-gray { background: rgba(255,255,255,0.07); color: var(--text-2); border: 1px solid var(--border); }

.course-desc {
  font-size: 12px; color: var(--text-3);
  margin-top: 8px; line-height: 1.5;
}

.course-arrow {
  color: var(--text-3);
  flex-shrink: 0;
}

/* ===== VIDEO LIST (inside course modal) ===== */
.video-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.video-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.video-item:active { transform: scale(0.985); }
.video-item:hover { background: rgba(91,78,232,0.1); border-color: rgba(91,78,232,0.25); }

.video-num {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(91,78,232,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent2);
  flex-shrink: 0;
}

.video-locked .video-num { background: rgba(255,255,255,0.06); color: var(--text-3); }

.video-name { flex: 1; font-size: 13px; color: var(--text-1); line-height: 1.4; }
.video-locked .video-name { color: var(--text-3); }

.video-code { font-size: 11px; color: var(--text-3); font-family: monospace; }

.lock-icon { color: var(--text-3); flex-shrink: 0; }

/* ===== TEST CARDS ===== */
.tests-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}

.test-card:active { transform: scale(0.98); }
.test-card:hover { background: var(--bg-card2); }

.test-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(62,207,142,0.12);
  border: 1px solid rgba(62,207,142,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--success);
}

.test-info { flex: 1; }
.test-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.test-meta { font-size: 12px; color: var(--text-2); }

.test-arrow { color: var(--text-3); }

/* ===== LEADERBOARD ===== */
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

.lb-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: background 0.15s;
}

.lb-item.me {
  background: rgba(91,78,232,0.12);
  border-color: rgba(91,78,232,0.3);
}

.lb-rank {
  width: 26px; text-align: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.lb-rank.top1 { color: #ffd700; font-size: 16px; }
.lb-rank.top2 { color: #c0c0c0; font-size: 15px; }
.lb-rank.top3 { color: #cd7f32; font-size: 15px; }

.lb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}

.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-group { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.lb-xp { font-size: 13px; font-weight: 700; color: var(--accent2); white-space: nowrap; }

.lb-streak { display: flex; align-items: center; gap: 3px; font-size: 11px; color: #f5813a; margin-left: 4px; }

/* ===== ACCOUNT ===== */
.account-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 20px;
}

.account-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin-bottom: 12px;
  border: 3px solid rgba(91,78,232,0.4);
}

.account-name { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.account-id { font-size: 12px; color: var(--text-3); font-family: monospace; }

.account-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 0 0 16px;
}

.acc-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}

.acc-stat-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.acc-stat-val { font-size: 22px; font-weight: 800; color: var(--text-1); }
.acc-stat-sm { font-size: 15px; }

.acc-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  color: var(--text-1);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%; text-align: center;
}

.btn-secondary:active { transform: scale(0.98); background: var(--bg-card2); }

.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--radius);
  padding: 15px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.btn-primary:active { transform: scale(0.98); background: var(--accent2); }

.section-label {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 10px;
}

.inventory-list { display: flex; flex-direction: column; gap: 8px; }

.inv-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
}

.inv-name { color: var(--text-1); font-weight: 600; }
.inv-meta { color: var(--text-3); font-size: 11px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  background: none; border: none;
  color: var(--text-3);
  font-size: 10px; font-weight: 600;
  cursor: pointer;
  transition: color 0.18s;
  padding: 8px 0;
  letter-spacing: 0.3px;
}

.nav-btn.active { color: var(--accent2); }
.nav-btn.active svg { stroke: var(--accent2); }

.nav-btn svg { transition: stroke 0.18s; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex; align-items: flex-end;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.2s;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 12px 16px 28px;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-drag-handle {
  width: 40px; height: 4px;
  background: var(--border2);
  border-radius: 4px;
  margin: 0 auto 16px;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title { font-size: 17px; font-weight: 700; color: var(--text-1); }

.modal-close {
  background: rgba(255,255,255,0.08);
  border: none; color: var(--text-2);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.modal-body { display: flex; flex-direction: column; gap: 12px; }

/* ===== SKELETON ===== */
.skeleton-card {
  height: 76px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  animation: pulse 1.4s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  color: var(--text-1);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px; font-weight: 600;
  z-index: 300;
  white-space: nowrap;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(6px); }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; color: var(--text-3); text-align: center; gap: 10px;
}

.empty-state svg { opacity: 0.4; }
.empty-state p { font-size: 13px; line-height: 1.6; }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ===== SAFE AREA (iPhone) ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .pages { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
}

/* ===== AKKAUNT USER INFO ===== */
.acc-userinfo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px 18px;
  width: 100%;
}

#page-akkaunt .acc-userinfo {
  flex-direction: column !important;
  align-items: center !important;
}

#acc-avatar-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  position: static !important;
}

.acc-userinfo-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  border: 3px solid rgba(91,78,232,0.5);
  box-shadow: 0 0 0 4px rgba(91,78,232,0.15);
}

.acc-userinfo-text { min-width: 0; }

.acc-userinfo-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-userinfo-name-badge {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 22px;
  text-align: center;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-userinfo-id {
  font-size: 12px;
  color: var(--text-3);
  font-family: monospace;
  margin-top: 3px;
}

/* ===== YANGI AKKAUNT ===== */
.acc-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 4px 20px;
}

.acc-hero-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff; flex-shrink: 0;
  border: 3px solid rgba(91,78,232,0.35);
}

.acc-hero-info { flex: 1; min-width: 0; }

.acc-hero-name {
  font-size: 18px; font-weight: 800; color: var(--text-1);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.acc-edit-btn {
  background: rgba(168,158,245,0.15); border: 1px solid rgba(168,158,245,0.3);
  color: var(--accent2);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s;
}
.acc-edit-btn:hover { background: rgba(168,158,245,0.28); }

.acc-hero-id { font-size: 12px; color: var(--text-3); font-family: monospace; margin-top: 4px; }

.acc-hero-group { margin-top: 6px; }
.acc-hero-group .badge { font-size: 11px; }

/* Stats row — 3 dona yonma-yon */
.acc-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}

.acc-stat-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px;
  display: flex; align-items: center; gap: 10px;
}

.acc-stat-icon { font-size: 20px; flex-shrink: 0; }

.acc-stat-body { min-width: 0; }
.acc-stat-val { font-size: 20px; font-weight: 800; color: var(--text-1); line-height: 1; }
.acc-stat-lbl { font-size: 10px; color: var(--text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; margin-top: 3px; }

/* Menu */
.acc-menu { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.acc-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.acc-menu-item, .acc-link-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: background .15s, transform .1s;
  text-decoration: none; width: 100%;
}
.acc-menu-item:active, .acc-link-item:active { transform: scale(.98); background: var(--bg-card2); }

.acc-menu-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.acc-menu-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text-1); text-align: left; }
.acc-menu-arrow { color: var(--text-3); flex-shrink: 0; }

/* Edit name modal */
.edit-name-input {
  background: var(--bg-card2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text-1);
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  width: 100%; outline: none;
}
.edit-name-input:focus { border-color: var(--accent); }

/* ===== KUN REJIMI (LIGHT) ===== */
body.light {
  --bg-base:    #f4f6fb;
  --bg-card:    #ffffff;
  --bg-card2:   #eef1f8;
  --bg-input:   #e8ecf5;
  --accent:     #5b4ee8;
  --accent2:    #7c6ff0;
  --gold:       #c47a00;
  --text-1:     #141826;
  --text-2:     #3d4460;
  --text-3:     #7880a0;
  --border:     rgba(0,0,0,0.09);
  --border2:    rgba(0,0,0,0.15);
  --danger:     #d43f3f;
  --success:    #1a9060;
}

body.light .bottom-nav {
  background: #ffffff;
  border-top: 1px solid rgba(0,0,0,0.09);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
}

body.light .header {
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.09);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body.light .stat-chip.streak {
  background: rgba(245,129,58,0.1);
  color: #d4601a;
  border-color: rgba(245,129,58,0.25);
}

body.light .stat-chip.coins {
  background: rgba(196,122,0,0.1);
  color: var(--gold);
  border-color: rgba(196,122,0,0.22);
}

body.light .stat-chip.xp {
  background: rgba(91,78,232,0.1);
  color: #5b4ee8;
  border-color: rgba(91,78,232,0.22);
}

body.light .modal-sheet {
  background: #ffffff;
}

body.light .skeleton-card {
  background: #dde3f0;
}

body.light .course-card {
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

body.light .lb-item {
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

body.light .acc-menu-item,
body.light .acc-link-item {
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

body.light .acc-stat-box {
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* Light modeda lt-card qorong'i ko'rinmasin */
body.light .lt-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

body.light .lt-input {
  background: #eef1f8;
  border-color: rgba(0,0,0,0.15);
  color: #141826;
}

body.light .lt-input:focus {
  border-color: var(--accent);
}

body.light .lt-btn-ghost {
  background: #eef1f8;
  border-color: rgba(0,0,0,0.12);
  color: #3d4460;
}

body.light .lt-ans-cell {
  background: #eef1f8;
  border-color: rgba(0,0,0,0.12);
}

body.light .lt-ans-input {
  color: #141826;
}

body.light .lt-section {
  background: #eef1f8;
}

body.light .lt-nums span {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  color: #141826;
}

body.light .video-row {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

body.light .video-search-box {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
}

body.light .coin-way,
body.light .coin-way-card {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

body.light .page-title-badge {
  background: rgba(91,78,232,0.12);
  color: #5b4ee8;
  border-color: rgba(91,78,232,0.22);
}

/* Theme toggle button */
.freezer-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 8px;
  height: 36px;
  border-radius: 22px;
  border: 1px solid rgba(56,212,255,0.6);
  background: rgba(14,116,144,0.55);
  gap: 3px;
}
.freezer-chip-icon {
  font-size: 15px;
  line-height: 1;
}
.freezer-chip-count {
  font-size: 12px;
  font-weight: 800;
  color: #38d4ff;
}
.freezer-chip-date {
  display: none;
}
body.light .freezer-chip {
  border-color: rgba(14,165,201,0.4);
  background: rgba(14,165,201,0.1);
}
body.light .freezer-chip-count { color: #0ea5c9; }
body.light .freezer-chip-date  { color: rgba(14,165,201,0.8); }

.theme-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--bg-card);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
  flex: 0 0 30px;
}
.theme-btn:active { transform: scale(.9); }

/* ===== VIDEO QIDIRUV & MODAL ===== */
.video-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 10px 12px;
  margin: 0 0 12px;
}
.video-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-1); font-size: 15px; font-family: inherit;
  -moz-appearance: textfield;
}
.video-search-input::-webkit-outer-spin-button,
.video-search-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.video-search-clear {
  background: none; border: none; color: var(--text-3);
  font-size: 14px; cursor: pointer; padding: 2px 4px;
}

/* Video row */
.video-list { display: flex; flex-direction: column; gap: 6px; }

.video-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 12px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.video-row:active { transform: scale(.985); background: rgba(91,78,232,0.08); }
.video-row:hover  { border-color: var(--border2); }

.video-row-locked { opacity: .75; }

.video-row-num {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(91,78,232,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.video-row-locked .video-row-num { background: rgba(255,255,255,0.05); }

.video-row-info { flex: 1; min-width: 0; }
.video-row-name { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-row-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--text-3); }

.skel-sm { height: 48px; background: var(--bg-card); border-radius: var(--radius-sm); animation: pulse 1.4s ease-in-out infinite; margin-bottom: 6px; }

/* Video detail modal */
.video-detail-card {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.vd-thumb {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  background: rgba(91,78,232,0.15); border: 1px solid rgba(91,78,232,0.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vd-info { flex: 1; min-width: 0; }
.vd-name { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; line-height: 1.3; }
.vd-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.vd-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.07); color: var(--text-2); border: 1px solid var(--border);
}
.chip-gold  { background: rgba(245,166,35,0.12); color: var(--gold); border-color: rgba(245,166,35,0.2); }
.chip-green { background: rgba(62,207,142,0.12); color: var(--success); border-color: rgba(62,207,142,0.2); }

/* Video tugmalar */
.vbtn-get, .vbtn-buy, .vbtn-nocoin {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; border: none; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.vbtn-get:active, .vbtn-buy:active { transform: scale(.98); }
.vbtn-get    { background: var(--accent); color: #fff; }
.vbtn-buy    { background: var(--gold); color: #1a1000; }
.vbtn-nocoin { background: rgba(224,84,84,0.12); color: var(--danger); border: 1px solid rgba(224,84,84,0.2); cursor: pointer; }

.vbtn-success {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; border-radius: var(--radius); font-size: 15px; font-weight: 700;
  background: rgba(62,207,142,0.12); color: var(--success);
  border: 1px solid rgba(62,207,142,0.2);
}

@keyframes spin { to { transform: rotate(360deg); } }
.vbtn-spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}

/* Modal back button */
.modal-back {
  background: rgba(255,255,255,0.07); border: none; color: var(--text-2);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ===== KURS BANNER (jami videolar) ===== */
.courses-total-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(91,78,232,0.15) 0%, rgba(124,111,240,0.08) 100%);
  border: 1px solid rgba(91,78,232,0.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ctb-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(91,78,232,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2); flex-shrink: 0;
}
.ctb-num {
  font-size: 28px; font-weight: 800;
  color: var(--text-1); line-height: 1;
}
.ctb-label {
  font-size: 13px; color: var(--text-2);
  margin-top: 3px;
}

/* Video counter */
.video-counter {
  font-size: 12px; color: var(--text-3);
  text-align: right; margin-bottom: 8px;
  padding-right: 4px;
}

/* Load more button */
.btn-load-more {
  width: 100%; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  margin-top: 10px; transition: background .15s, color .15s;
}
.btn-load-more:hover { background: var(--bg-card2); color: var(--text-1); }
.btn-load-more:disabled { opacity: .5; cursor: default; }

/* ===== COIN KERAK MODAL ===== */
.coin-need-banner {
  background: rgba(224,84,84,0.08);
  border: 1px solid rgba(224,84,84,0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.cnb-row { display: flex; justify-content: space-between; align-items: center; }
.cnb-label { font-size: 13px; color: var(--text-2); }
.cnb-val { font-size: 15px; font-weight: 800; color: var(--text-1); }
.cnb-val.gold { color: var(--gold); }
.cnb-val.red  { color: var(--danger); }

.coin-ways-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}

.coin-ways-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.coin-way {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.coin-way:active { transform: scale(.98); background: var(--bg-card2); }

.cw-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.cw-body { flex: 1; min-width: 0; }
.cw-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
.cw-desc  { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-bottom: 5px; }
.cw-action {
  font-size: 12px; font-weight: 700; color: var(--accent2);
  display: inline-block;
}

/* ===== COIN YO'RIQNOMA MODAL ===== */
.coin-way-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.coin-way-card:active { transform: scale(.98); background: var(--bg-card2); }
.coin-way-card:hover { border-color: var(--border2); }

.cwc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.cwc-body { flex: 1; min-width: 0; }
.cwc-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
.cwc-desc  { font-size: 12px; color: var(--text-2); line-height: 1.5; }

 /* ============================================================
   Level Test — User tomoni stillari
   Bu CSS ni main.css ga qo'shing (oxiriga)
   ============================================================ */

/* KOD KIRITISH & CONFIRM KARTASI */
.lt-card {
  background: var(--card-bg, #1c2235);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 16px;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}
.lt-card-icon { font-size: 40px; line-height: 1; }
.lt-card-title { font-size: 18px; font-weight: 800; color: var(--text-primary, #e8eaf0); text-align: center; }
.lt-card-sub   { font-size: 13px; color: var(--text-secondary, #8b92a8); }

.lt-input-wrap { width: 100%; }
.lt-input {
  width: 100%;
  background: var(--input-bg, #0d1117);
  border: 2px solid var(--border2, rgba(255,255,255,.13));
  border-radius: 10px;
  color: var(--text-primary, #e8eaf0);
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
  font-family: monospace;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: border .15s;
}
.lt-input:focus { border-color: var(--accent, #5b4ee8); }

.lt-err { color: #e05454; font-size: 13px; text-align: center; width: 100%; }

.lt-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.lt-btn:active { transform: scale(.97); }
.lt-btn-primary {
  background: var(--accent, #5b4ee8);
  color: #fff;
}
.lt-btn-primary:hover { background: var(--accent2, #7c6ff0); }
.lt-btn-ghost {
  background: var(--input-bg, #1c2235);
  border: 1px solid var(--border2, rgba(255,255,255,.13));
  color: var(--text-secondary, #8b92a8);
}

.lt-hint { font-size: 11px; color: var(--text-tertiary, #5a6078); text-align: center; line-height: 1.6; }

.lt-type-badge {
  background: rgba(91,78,232,.15);
  color: var(--accent2, #7c6ff0);
  border: 1px solid rgba(91,78,232,.25);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
}

.lt-meta { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.lt-meta-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-secondary, #8b92a8);
  padding: 6px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.lt-meta-row b { color: var(--text-primary, #e8eaf0); }

.lt-info-box {
  background: rgba(245,166,35,.08);
  border: 1px solid rgba(245,166,35,.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #f5a623;
  text-align: center;
  line-height: 1.5;
  width: 100%;
}

/* JAVOBLAR PANELI */
.lt-answers-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lt-answers-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.07));
}
.lt-answers-title { font-size: 16px; font-weight: 800; }
.lt-answers-sub   { font-size: 12px; color: var(--text-secondary, #8b92a8); margin-top: 3px; }
.lt-filled-count  {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary, #8b92a8);
  white-space: nowrap;
}

.lt-ans-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.lt-ans-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--input-bg, #1c2235);
  border: 1px solid var(--border2, rgba(255,255,255,.1));
  border-radius: 8px;
  padding: 6px 4px;
  transition: border .15s;
}
.lt-ans-cell:focus-within {
  border-color: var(--accent, #5b4ee8);
}
.lt-ans-num {
  font-size: 10px;
  color: var(--text-tertiary, #5a6078);
  font-weight: 700;
}
.lt-ans-input {
  background: none;
  border: none;
  color: var(--text-primary, #e8eaf0);
  font-size: 14px;
  font-weight: 800;
  width: 100%;
  text-align: center;
  padding: 0;
  text-transform: uppercase;
  outline: none;
  font-family: monospace;
}
.lt-ans-input::placeholder { color: var(--text-tertiary, #5a6078); font-size: 11px; }

/* NATIJA */
.lt-result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}
.lt-result-title { font-size: 17px; font-weight: 800; text-align: center; }

.lt-result-badge {
  padding: 8px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 800;
}
.lt-result-pass {
  background: rgba(62,207,142,.15);
  color: #3ecf8e;
  border: 1px solid rgba(62,207,142,.3);
}
.lt-result-fail {
  background: rgba(224,84,84,.12);
  color: #e05454;
  border: 1px solid rgba(224,84,84,.25);
}
.lt-result-reward {
  font-size: 18px;
  font-weight: 800;
  color: #f5a623;
}
.lt-result-retake {
  background: rgba(245,166,35,.08);
  border: 1px solid rgba(245,166,35,.2);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  color: #f5a623;
  text-align: center;
  line-height: 1.6;
}

.lt-score-circle {
  width: 110px; height: 110px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 4px solid;
}
.lt-score-pass { border-color: #3ecf8e; background: rgba(62,207,142,.07); }
.lt-score-fail { border-color: #e05454; background: rgba(224,84,84,.07); }
.lt-score-num   { font-size: 28px; font-weight: 900; line-height: 1; }
.lt-score-total { font-size: 13px; color: var(--text-secondary, #8b92a8); }
.lt-score-label { font-size: 10px; color: var(--text-tertiary, #5a6078); margin-top: 2px; }

.lt-result-sections { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.lt-section { background: var(--input-bg, #1c2235); border-radius: 10px; overflow: hidden; }
.lt-section-hdr {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
}
.lt-correct { background: rgba(62,207,142,.1);  color: #3ecf8e; }
.lt-wrong   { background: rgba(224,84,84,.1);    color: #e05454; }
.lt-blank   { background: rgba(255,255,255,.04); color: var(--text-secondary, #8b92a8); }

.lt-nums {
  padding: 8px 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.lt-nums span {
  background: var(--card-bg, #0d1117);
  border: 1px solid var(--border2, rgba(255,255,255,.1));
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
}
/* ===== OBUNA TUGMASI ===== */
.sub-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  line-height: 1.3;
  text-align: center;
}
.sub-btn:active { opacity: .8; transform: scale(.97); }

.sub-active {
  border-color: var(--success);
  color: var(--success);
  background: rgba(62,207,142,0.08);
}

/* ===== EMOJI AVATAR — TILLARANG ANIMATSIYA ===== */
@keyframes emoji-ring-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes emoji-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 2.5px #fbbf24, 0 0 8px 3px rgba(251,191,36,0.45); }
  50%       { box-shadow: 0 0 0 3.5px #f59e0b, 0 0 18px 6px rgba(245,158,11,0.65); }
}

/* Header kichik avatar — emoji taqilganda */
.avatar.has-emoji {
  background: rgba(0,0,0,0.25) !important;
  border: none !important;
  animation: emoji-glow-pulse 2s ease-in-out infinite;
  position: relative;
}

/* Akkaunt katta avatar — emoji taqilganda */
.acc-userinfo-avatar.has-emoji {
  background: rgba(0,0,0,0.2) !important;
  border: none !important;
  animation: emoji-glow-pulse 2s ease-in-out infinite;
  font-size: 34px !important;
}

/* Reyting avatari */
.reyting-avatar-emoji {
  box-shadow: 0 0 0 2px #fbbf24, 0 0 10px 3px rgba(251,191,36,0.5);
  animation: emoji-glow-pulse 2s ease-in-out infinite;
  background: transparent !important;
}


/* ============================================================
   TEST TIZIMI v2 — ts- prefiksi
   ============================================================ */

/* ---- Sahifa layout ---- */
.tests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}

/* ---- Kod kiritish bloki ---- */
.ts-code-card {
  background: linear-gradient(135deg, rgba(91,78,232,0.18) 0%, rgba(124,111,240,0.08) 100%);
  border: 1px solid rgba(91,78,232,0.3);
  border-radius: var(--radius);
  padding: 20px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ts-code-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(91,78,232,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.ts-code-icon { font-size: 32px; line-height: 1; margin-bottom: 2px; }
.ts-code-title {
  font-size: 16px; font-weight: 800;
  color: var(--text-1, #e8eaf0);
}
.ts-code-sub {
  font-size: 12px; color: var(--text-2, #8b92a8);
  margin-bottom: 2px;
}

/* ---- Ochiq testlar sarlavhasi ---- */
.ts-section-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-3, #5a6078);
  padding: 6px 2px 2px;
}

/* ---- Test kartasi ---- */
.ts-card {
  background: var(--bg-card, #161b27);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.18s;
}
.ts-card:hover { border-color: var(--border2, rgba(255,255,255,.12)); }
.ts-card-name {
  font-size: 15px; font-weight: 800;
  color: var(--text-1, #e8eaf0);
  line-height: 1.3;
}
.ts-card-desc {
  font-size: 12px; color: var(--text-2, #8b92a8);
  line-height: 1.5; margin-top: -3px;
}
.ts-card-meta { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---- Badglar ---- */
.ts-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 3px;
}
.ts-badge-blue  { background: rgba(91,78,232,.15);  color: #a89ef5; }
.ts-badge-green { background: rgba(62,207,142,.12);  color: #3ecf8e; }
.ts-badge-gold  { background: rgba(245,166,35,.12);  color: var(--gold, #f5a623); }
.ts-badge-red   { background: rgba(224,84,84,.12);   color: #e05454; }

/* ---- Tugmalar ---- */
.ts-btn {
  width: 100%; padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: none; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  text-align: center;
}
.ts-btn:active { transform: scale(.97); }
.ts-btn-primary {
  background: var(--accent, #5b4ee8);
  color: #fff;
}
.ts-btn-primary:hover { background: var(--accent2, #7c6ff0); }
.ts-btn-ghost {
  background: rgba(255,255,255,.05);
  color: var(--text-2, #8b92a8);
  border: 1px solid var(--border, rgba(255,255,255,.07));
}
.ts-btn-ghost:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-1, #e8eaf0);
}

/* ---- Kirish maydoni ---- */
.ts-input-wrap { width: 100%; }
.ts-input {
  width: 100%; padding: 13px 14px;
  background: var(--bg-input, #1a2030);
  border: 1.5px solid var(--border2, rgba(255,255,255,.12));
  border-radius: var(--radius-sm);
  color: var(--text-1, #e8eaf0);
  font-size: 20px; font-weight: 800;
  letter-spacing: 4px; text-align: center;
  box-sizing: border-box; transition: border-color .2s;
}
.ts-input:focus { outline: none; border-color: var(--accent, #5b4ee8); }
.ts-input::placeholder { letter-spacing: 1px; font-size: 13px; font-weight: 400; }
.ts-err {
  color: #e05454; font-size: 12px;
  text-align: center; width: 100%;
  background: rgba(224,84,84,.08);
  border-radius: 8px; padding: 8px 10px;
}

/* ---- Tasdiqlash ---- */
.ts-retake-badge {
  background: rgba(245,166,35,.12); color: var(--gold, #f5a623);
  border-radius: 20px; font-size: 11px; font-weight: 700;
  padding: 4px 12px; align-self: flex-start;
}
.ts-info-box {
  background: var(--bg-card2, #1c2235);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px; color: var(--text-2, #8b92a8);
  line-height: 1.6;
}
.ts-info-green {
  background: rgba(62,207,142,.07);
  border-color: rgba(62,207,142,.18);
  color: #3ecf8e;
}
.ts-warn {
  font-size: 11px; color: var(--text-3, #5a6078);
  text-align: center; line-height: 1.5;
}

/* ---- Javoblar paneli ---- */
.ts-answers-wrap { display: flex; flex-direction: column; }
.ts-answers-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px; gap: 10px;
}
.ts-answers-title { font-size: 15px; font-weight: 800; }
.ts-answers-sub {
  font-size: 11px; color: var(--text-2, #8b92a8); margin-top: 3px;
}
.ts-filled-count {
  font-size: 13px; font-weight: 800;
  color: var(--text-2, #8b92a8); white-space: nowrap; padding-top: 2px;
}

/* ---- ABCD javob grid ---- */
.ts-ans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 4px;
}
.ts-ans-cell {
  background: var(--bg-card, #161b27);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: 10px;
  padding: 7px 10px;
  display: flex; align-items: center; gap: 7px;
  transition: border-color .15s;
}
.ts-ans-cell:focus-within {
  border-color: rgba(91,78,232,.4);
}
.ts-ans-num {
  font-size: 11px; font-weight: 700;
  color: var(--text-3, #5a6078);
  min-width: 16px; text-align: center;
}
.ts-ans-btns { display: flex; gap: 3px; flex: 1; }
.ts-ans-btn {
  flex: 1; padding: 6px 2px; border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,.07);
  background: transparent; color: var(--text-3, #5a6078);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .12s;
}
.ts-ans-btn:hover {
  border-color: rgba(91,78,232,.5);
  color: var(--text-1, #e8eaf0);
  background: rgba(91,78,232,.08);
}
.ts-ans-btn.selected {
  background: var(--accent, #5b4ee8);
  border-color: var(--accent, #5b4ee8);
  color: #fff;
}

/* ---- Natija ---- */
.ts-result-wrap {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  padding-bottom: 12px;
}
.ts-result-title {
  font-size: 16px; font-weight: 800; text-align: center;
}
.ts-result-badge {
  padding: 7px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 800; text-align: center;
}
.ts-result-pass    { background: rgba(62,207,142,.12); color: #3ecf8e; }
.ts-result-fail    { background: rgba(224,84,84,.12);  color: #e05454; }
.ts-result-neutral { background: rgba(91,78,232,.12);  color: #a89ef5; }
.ts-result-bonus {
  font-size: 15px; font-weight: 800;
  color: var(--gold, #f5a623); text-align: center;
}
.ts-result-retake {
  font-size: 12px; color: var(--text-2, #8b92a8);
  text-align: center; line-height: 1.6;
  background: rgba(245,166,35,.07);
  border: 1px solid rgba(245,166,35,.15);
  border-radius: 10px; padding: 10px 14px; width: 100%;
}
.ts-score-circle {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid var(--border, rgba(255,255,255,.1));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.ts-score-pass    { border-color: #3ecf8e; background: rgba(62,207,142,.07); }
.ts-score-fail    { border-color: #e05454; background: rgba(224,84,84,.07);  }
.ts-score-neutral { border-color: #a89ef5; background: rgba(91,78,232,.07);  }
.ts-score-num   { font-size: 26px; font-weight: 900; line-height: 1; }
.ts-score-total { font-size: 12px; color: var(--text-2, #8b92a8); }
.ts-score-label { font-size: 10px; color: var(--text-3, #5a6078); margin-top: 1px; }
.ts-result-stats {
  display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: center;
}
.ts-stat { font-size: 12px; color: var(--text-2, #8b92a8); }
.ts-stat b { color: var(--text-1, #e8eaf0); }
.ts-result-sections { width: 100%; display: flex; flex-direction: column; gap: 7px; }
.ts-section {
  background: var(--bg-card2, #1c2235);
  border-radius: 10px; overflow: hidden;
}
.ts-section-hdr {
  padding: 7px 12px; font-size: 12px; font-weight: 700;
}
.ts-wrong { background: rgba(224,84,84,.1);    color: #e05454; }
.ts-blank { background: rgba(255,255,255,.04); color: var(--text-2, #8b92a8); }
.ts-nums  { padding: 7px 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.ts-nums span {
  background: rgba(255,255,255,.06); border-radius: 5px;
  font-size: 11px; font-weight: 700; padding: 2px 6px;
  color: var(--text-1, #e8eaf0);
}

/* ---- Admin: ABCD tugmalar ---- */
.ans-cell {
  background: var(--bg-card2, #1c2235);
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: 9px; padding: 6px 10px;
  display: flex; align-items: center; gap: 7px;
}
.ans-num {
  font-size: 11px; font-weight: 700;
  color: var(--text-3, #5a6078);
  min-width: 16px; text-align: center;
}
.ans-btns { display: flex; gap: 3px; flex: 1; }
.ans-btn {
  flex: 1; padding: 5px 2px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.07);
  background: transparent; color: var(--text-3, #5a6078);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .12s;
}
.ans-btn:hover   { border-color: var(--accent, #5b4ee8); color: var(--text-1, #e8eaf0); }
.ans-btn.selected {
  background: var(--accent, #5b4ee8);
  border-color: var(--accent, #5b4ee8);
  color: #fff;
}
.answers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px; max-height: 340px;
  overflow-y: auto; padding: 2px;
}

/* ---- Light mode ---- */
body.light .ts-card,
body.light .ts-code-card { background: #f0f2f8; border-color: rgba(0,0,0,.08); }
body.light .ts-code-card { background: linear-gradient(135deg, rgba(91,78,232,.08) 0%, rgba(124,111,240,.04) 100%); }
body.light .ts-input { background: #fff; border-color: #d0d5e8; color: #1a1f35; }
body.light .ts-ans-cell { background: #f0f2f8; border-color: rgba(0,0,0,.08); }
body.light .ts-ans-btn  { border-color: rgba(0,0,0,.1); color: #6b7280; }
body.light .ts-info-box { background: #f0f2f8; border-color: rgba(0,0,0,.08); }
body.light .ts-section  { background: #f0f2f8; }
body.light .ts-nums span { background: rgba(0,0,0,.06); color: #1a1f35; }
body.light .ans-cell { background: #f0f2f8; border-color: rgba(0,0,0,.08); }
body.light .ans-btn  { border-color: rgba(0,0,0,.1); color: #6b7280; }

/* ============================================================
   REYTING — Liga kartochalari (theme-aware)
   ============================================================ */

/* Liga kartasi — night mode default */
.lg-icon svg { display: block; }
.lg-info { flex: 1; min-width: 0; }
.lg-name {
  font-size: 16px; font-weight: 800;
  color: var(--text-1);
  letter-spacing: .2px;
}
.lg-my-rank {
  font-size: 10px; color: var(--text-3);
  margin-top: 3px; letter-spacing: .3px;
}
.lg-arrow { flex-shrink: 0; color: var(--text-3); }
.lg-card-me {
  border-color: rgba(91,78,232,0.5) !important;
  background: rgba(91,78,232,0.08) !important;
}

/* Night mode — har liga uchun o'z rangi */
.lg-card[data-league="grandmaster"] {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-color: rgba(201,168,76,0.55);
}
.lg-card[data-league="grandmaster"] .lg-name { color: #fff; }
.lg-card[data-league="grandmaster"] .lg-arrow { color: rgba(255,255,255,0.3); }

.lg-card[data-league="gold"] {
  background: linear-gradient(135deg, #1c1a0f 0%, #2a2408 50%, #3d3510 100%);
  border-color: rgba(245,200,66,0.5);
}
.lg-card[data-league="gold"] .lg-name { color: #fff; }
.lg-card[data-league="gold"] .lg-arrow { color: rgba(255,255,255,0.3); }

.lg-card[data-league="silver"] {
  background: linear-gradient(135deg, #141414 0%, #1e1e1e 50%, #282828 100%);
  border-color: rgba(203,213,224,0.4);
}
.lg-card[data-league="silver"] .lg-name { color: #fff; }
.lg-card[data-league="silver"] .lg-arrow { color: rgba(255,255,255,0.3); }

.lg-card[data-league="bronze"] {
  background: linear-gradient(135deg, #1a0f0a 0%, #241408 50%, #302010 100%);
  border-color: rgba(196,124,58,0.45);
}
.lg-card[data-league="bronze"] .lg-name { color: #fff; }
.lg-card[data-league="bronze"] .lg-arrow { color: rgba(255,255,255,0.3); }

/* Light mode — hammasi bir xil shaffof */
body.light .lg-card[data-league="grandmaster"],
body.light .lg-card[data-league="gold"],
body.light .lg-card[data-league="silver"],
body.light .lg-card[data-league="bronze"] {
  background: #f4f6fb !important;
  border-color: rgba(0,0,0,0.08) !important;
}
body.light .lg-card[data-league="grandmaster"] .lg-name,
body.light .lg-card[data-league="gold"] .lg-name,
body.light .lg-card[data-league="silver"] .lg-name,
body.light .lg-card[data-league="bronze"] .lg-name {
  color: #1a1f35 !important;
}
body.light .lg-card[data-league="grandmaster"] .lg-arrow,
body.light .lg-card[data-league="gold"] .lg-arrow,
body.light .lg-card[data-league="silver"] .lg-arrow,
body.light .lg-card[data-league="bronze"] .lg-arrow {
  color: rgba(0,0,0,0.2) !important;
}
body.light .lg-card-me {
  background: rgba(91,78,232,0.06) !important;
  border-color: rgba(91,78,232,0.3) !important;
}
body.light .lg-my-rank { color: rgba(0,0,0,0.4) !important; }

/* ── Yangilash paneli ── */
.lb-rebuild-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.lb-rebuild-time {
  font-size: 11px;
  color: var(--text-3);
}
.lb-rebuild-btn {
  background: var(--bg-card2, rgba(255,255,255,0.06));
  border: 1px solid var(--border2, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
body.light .lb-rebuild-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
  color: #444;
}

/* ── Liga kartochkalari ── */
.lg-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 16px;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  transition: opacity .15s;
  box-sizing: border-box;
  width: 100%;
}

/* ── Liga ichidagi user qatori ── */
.lg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 5px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.lg-row-me {
  background: rgba(91,78,232,0.1) !important;
  border-color: rgba(91,78,232,0.35) !important;
}

/* Rank */
.lg-rank {
  flex: 0 0 32px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

/* Streak badge */
.lg-streak {
  flex: 0 0 58px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  height: 26px;
}
.lg-streak-empty { opacity: .4; }
.lg-streak-fire {
  flex: 0 0 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.08);
}
.lg-streak-num {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
}

/* Avatar */
.lg-avatar {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff;
}

/* Ism */
.lg-uname {
  flex: 1 1 0;
  min-width: 0;
  font-size: 13px; font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* XP */
.lg-xp {
  flex: 0 0 auto;
  background: rgba(124,111,240,0.12);
  border: 1px solid rgba(124,111,240,0.2);
  border-radius: 7px;
  padding: 3px 7px;
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800; color: #a78bfa;
  white-space: nowrap;
}

/* Light mode — liga ichidagi qatorlar */
body.light .lg-row {
  background: #f4f6fb;
  border-color: rgba(0,0,0,0.07);
}
body.light .lg-row-me {
  background: rgba(91,78,232,0.06) !important;
  border-color: rgba(91,78,232,0.25) !important;
}
body.light .lg-streak { border-color: rgba(0,0,0,0.1); }

/* ============================================================
   TESTLAR — yangi stiller (ABCD tugmalar, kartochkalar)
   ============================================================ */

/* Kod kiritish bloki */
.tst-code-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  margin-bottom: 20px;
  text-align: center;
}
.tst-code-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 16px;
}
.tst-digits-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.tst-digit {
  width: 56px;
  height: 60px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text1);
  text-align: center;
  caret-color: transparent;
  transition: border-color .15s;
  -moz-appearance: textfield;
}
.tst-digit:focus {
  outline: none;
  border-color: var(--accent);
}
.tst-digit::-webkit-inner-spin-button,
.tst-digit::-webkit-outer-spin-button { -webkit-appearance: none; }
.tst-code-btn { width: 100%; }
.tst-err {
  color: var(--red);
  font-size: 12px;
  margin-top: 6px;
}

/* Ochiq testlar bo'limi sarlavhasi */
.tst-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 10px;
}

/* Test kartochkasi */
.tst-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .15s;
}
.tst-card:active { background: var(--bg3); }
.tst-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 4px;
}
.tst-card-desc {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
  line-height: 1.4;
}
.tst-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 12px;
}
.tst-start-btn { width: 100%; }

/* Tasdiqlash */
.tst-confirm-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.tst-confirm-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}
.tst-confirm-desc {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 12px;
}
.tst-confirm-meta { margin-bottom: 12px; }
.tst-meta-row {
  font-size: 13px;
  color: var(--text2);
  padding: 3px 0;
}
.tst-info-box {
  background: rgba(255,200,0,.07);
  border: 1px solid rgba(255,200,0,.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

/* Javoblar paneli */
.tst-answers-wrap {
  padding-bottom: 20px;
}
.tst-answers-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.tst-answers-title { font-size: 15px; font-weight: 700; }
.tst-answers-sub   { font-size: 12px; color: var(--text3); margin-top: 2px; }
.tst-filled-count  { font-size: 13px; color: var(--text2); font-weight: 700; }

/* ABCD savol katakchasi */
/* Javoblar paneli — full-width kompakt grid */
.tst-ans-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tst-ans-cell {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 8px;
  width: 100%;
  box-sizing: border-box;
}
.tst-ans-num {
  min-width: 28px;
  max-width: 28px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.tst-letter-group {
  display: flex;
  gap: 5px;
  flex: 1;
}
.tst-letter-btn {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  height: 36px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.tst-letter-btn.sel {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tst-letter-btn:active { opacity: .7; }

/* Natija */
.tst-result-wrap { padding-bottom: 24px; }
.tst-result-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.tst-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tst-badge-pass { background: rgba(52,211,153,.15); color: var(--green); }
.tst-badge-fail { background: rgba(239,68,68,.12);  color: var(--red);   }
.tst-retake-info {
  font-size: 13px;
  color: var(--text2);
  background: var(--bg2);
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
  line-height: 1.6;
}
/* Eski tst-score, tst-nums — yangi versiyaga almashtirildi */

/* ============================================================
   ADMIN TEST FORM — yangi javoblar gridi
   ============================================================ */
.answers-grid-new {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
@media (max-width: 900px) {
  .answers-grid-new { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 500px) {
  .answers-grid-new { grid-template-columns: repeat(3, 1fr); }
}
.ans-cell-new {
  background: var(--bg3, rgba(255,255,255,.04));
  border: 1px solid var(--border, rgba(255,255,255,.07));
  border-radius: 7px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ans-letter-group {
  display: flex;
  gap: 2px;
  flex: 1;
}
.ans-letter-btn {
  flex: 1;
  padding: 4px 1px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,.09);
  background: transparent;
  color: var(--text3, #5a6078);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .1s;
  min-width: 0;
}
.ans-letter-btn:hover {
  border-color: var(--accent, #5b4ee8);
  color: var(--text1, #e8eaf0);
}
.ans-letter-btn.selected {
  background: var(--accent, #5b4ee8);
  border-color: var(--accent, #5b4ee8);
  color: #fff;
}
body.light .ans-cell-new {
  background: #f0f2f8;
  border-color: rgba(0,0,0,.08);
}
body.light .ans-letter-btn {
  border-color: rgba(0,0,0,.1);
  color: #6b7280;
}
/* Toggle switch */
.tgl-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tgl {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.tgl input { opacity: 0; width: 0; height: 0; }
.tgl-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  border-radius: 22px;
  cursor: pointer;
  transition: .2s;
}
.tgl-slider:before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.tgl input:checked + .tgl-slider { background: var(--accent, #5b4ee8); }
.tgl input:checked + .tgl-slider:before { transform: translateX(18px); }
body.light .tgl-slider { background: rgba(0,0,0,.18); }

/* ============================================================
   TEST NATIJA — yangi dizayn
   ============================================================ */
.tst-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 4px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px auto 12px;
}
.tst-score-circle.pass { border-color: var(--green); background: rgba(52,211,153,.08); }
.tst-score-circle.fail { border-color: var(--red);   background: rgba(239,68,68,.08);  }
.tst-score-num { font-size: 36px; font-weight: 900; line-height: 1; }

.tst-stat-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tst-stat-row {
  font-size: 13px;
  color: var(--text2);
}
.tst-stat-row span {
  font-size: 12px;
  color: var(--text3);
}
.tst-stat-ok  { color: var(--green); }
.tst-stat-err { color: var(--red);   }
.tst-stat-blank { color: var(--text3); }
.tst-stat-net {
  font-size: 13px;
  color: var(--text1);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* Savollar jadvali */
.tst-full-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tst-fnum-ok, .tst-fnum-err, .tst-fnum-blank {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tst-fnum-ok    { background: rgba(52,211,153,.18); color: var(--green); }
.tst-fnum-err   { background: rgba(239,68,68,.18);  color: var(--red);   }
.tst-fnum-blank { background: var(--bg2);            color: var(--text3); border: 1px solid var(--border); }

/* ============================================================
   KURS BO'LIMLARI (use_sections=1 kurslar uchun)
   ============================================================ */
.cs-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  cursor: pointer;
  background: var(--bg-card2);
  user-select: none;
  gap: 10px;
  transition: background .15s;
}
.cs-header:active { background: rgba(91,78,232,0.07); }
.cs-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cs-chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .2s;
}
.cs-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-badge {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-input);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}
.cs-body {
  padding: 8px 10px 10px;
}
.cs-body.cs-collapsed { display: none; }
.cs-inner-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  margin-bottom: 7px;
}
.cs-inner-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 12px;
}
.cs-inner-input::placeholder { color: var(--text-3); }

body.light .cs-block        { border-color: #e0e0e8; }
body.light .cs-header       { background: #f4f4f8; }
body.light .cs-name         { color: #111; }
body.light .cs-badge        { background: #e8e8f0; color: #888; }
body.light .cs-inner-search { background: #fff; border-color: #ddd; }
body.light .cs-inner-input  { color: #111; }


/* ============================================================
   GAMES BO'LIMI
   ============================================================ */

.games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s, transform 0.15s;
}

.game-card:active {
  transform: scale(0.98);
  opacity: 0.85;
}

.game-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.game-card-body {
  flex: 1;
  min-width: 0;
}

.game-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.game-card-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.game-card > svg {
  flex-shrink: 0;
  stroke: var(--text-3);
}
