/* ===========================================================
   DeutschEdu — umumiy uslublar
   =========================================================== */

:root {
  --navy: #1B2B6B;
  --navy-light: #2a3f8f;
  --navy-dark: #0f1d4d;
  --teal: #2ABFAB;
  --teal-light: #4fd4c2;
  --teal-dark: #1e9c8a;
  --yellow: #F5A623;
  --yellow-light: #ffc559;
  --purple: #8B5CF6;
  --purple-light: #a78bfa;
  --white: #ffffff;

  --card-bg: #FFFFFF;
  --bg: #f4f6fb;
  --bg2: #eaecf5;
  --text: #1a2340;
  --text-2: #4a5480;
  --gray: #6b7a99;
  --border: rgba(27,43,107,0.12);
  --border2: #dde3f0;
  --success: #22c55e;
  --danger: #ef4444;

  --shadow: 0 4px 24px rgba(27,43,107,0.10);
  --shadow-lg: 0 12px 40px rgba(27,43,107,0.14);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;

  --font-head: 'Nunito', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; overflow-x: hidden; font-size: 17.5px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  margin: 0 0 0.5em;
  line-height: 1.25;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff; box-shadow: 0 6px 20px rgba(42,191,171,0.35); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(42,191,171,0.4); color: #fff; }

.btn-accent { background: linear-gradient(135deg, var(--yellow), var(--yellow-light)); color: var(--navy-dark); box-shadow: 0 6px 20px rgba(245,166,35,0.35); }
.btn-accent:hover { box-shadow: 0 10px 28px rgba(245,166,35,0.4); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--border2);
}
.btn-outline:hover { border-color: var(--navy); }

.btn-block { width: 100%; }

/* ---------- Navbar ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(27,43,107,0.06);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1180px;
  margin: 0 auto;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 21px;
  color: var(--navy);
  flex-shrink: 0;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(27,43,107,0.2);
}
.site-footer .brand-logo { width: 36px; height: 36px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links > li { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  background: rgba(42,191,171, 0.12);
  color: var(--teal-dark);
  text-decoration: none;
}

.dd-btn {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.dd-btn:hover { background: rgba(42,191,171, 0.12); color: var(--teal-dark); }
.dd-btn .chev { transition: transform 0.15s ease; font-size: 11px; }
.dd-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dropdown.active .dd-btn { background: linear-gradient(135deg, rgba(42,191,171,0.16), rgba(27,43,107,0.06)); color: var(--navy); box-shadow: inset 0 0 0 1.5px rgba(42,191,171,0.35); }

@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1.5px solid rgba(42,191,171,0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 50;
  animation: dropIn 0.15s ease;
}
.dropdown-menu.open { display: block; }
.dropdown:hover > .dropdown-menu { display: block; }

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.dropdown-menu a:hover { background: var(--bg); color: var(--teal-dark); text-decoration: none; }
.dropdown-menu a.active { background: rgba(42,191,171,0.1); color: var(--teal-dark); font-weight: 700; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy);
  border-radius: 10px;
}
.menu-toggle:hover { background: rgba(42,191,171,0.1); }

@media (max-width: 1040px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 66px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 12px; animation: none; }
  .dropdown:hover > .dropdown-menu:not(.open) { display: none; }
  .nav-actions { flex-direction: column; align-items: stretch; margin: 6px 4px 2px; }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 72px 0 90px;
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
}
.hero > .container { width: 100%; }
@media (max-width: 900px) { .hero { min-height: 0; } }
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 78% 30%, rgba(42,191,171,0.25) 0%, transparent 55%),
              radial-gradient(ellipse at 15% 85%, rgba(139,92,246,0.16) 0%, transparent 45%);
}
.hero .container { position: relative; z-index: 1; }

.hero-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: right 30%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.4s ease, transform 7s ease-out;
}
.hero-slides img.active { opacity: 1; transform: scale(1); }
.hero-slides::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(15,29,77,0.94) 0%, rgba(15,29,77,0.86) 32%, rgba(15,29,77,0.45) 55%, rgba(15,29,77,0.08) 78%),
    linear-gradient(to top, rgba(15,29,77,0.5) 0%, transparent 30%);
}
.hero-dots {
  position: absolute;
  right: 28px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.hero-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.45);
  transition: width 0.4s ease, background 0.4s ease;
}
.hero-dots span.active { width: 24px; background: var(--teal-light); }

@media (max-width: 900px) {
  .hero-slides::after { background: rgba(15,29,77,0.82); }
  .hero-dots { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slides img { transition: none; transform: none; }
}
.hero h1 { color: #fff; font-size: 42px; max-width: 720px; }
.hero-brand {
  display: block;
  font-size: 1.35em;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff 0%, var(--teal-light) 70%, var(--yellow-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (max-width: 600px) { .hero h1 { font-size: 30px; } }
.hero p { color: rgba(255,255,255,0.85); font-size: 19px; max-width: 620px; }
.hero .btn-row { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Cards / grid ---------- */

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head p { color: var(--text-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card .icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 16px;
}
.icon-badge.navy { background: var(--navy); }
.icon-badge.teal { background: var(--teal); }
.icon-badge.purple { background: var(--purple); }
.icon-badge.yellow { background: var(--yellow); color: var(--navy-dark); }

.card h3 { font-size: 19px; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 15px; margin: 0; }

/* ---------- Topic grid (mavzular / test / topshiriqlar ro'yxatlari) ---------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.topic-item {
  background: #fff;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(27,43,107,0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.topic-item::before {
  content: attr(data-n);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(27,43,107,0.08), rgba(42,191,171,0.14));
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 15px;
}
.topic-item:hover { border-color: var(--teal); box-shadow: 0 8px 22px rgba(42,191,171,0.18); text-decoration: none; transform: translateY(-2px); }
.topic-item .num { color: var(--teal-dark); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.topic-item .title { font-weight: 700; margin-top: 2px; color: var(--navy); }
.topic-item .count { color: var(--gray); font-size: 13px; margin-top: 2px; }

/* ---------- Main content wrapper ---------- */

.main {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 20px 60px;
}

/* ---------- Page header (ichki sahifa banneri) ---------- */

.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1e6b8a 100%);
  color: #fff;
  padding: 46px 20px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(42,191,171,0.22) 0%, transparent 60%);
}
.page-header h1 { font-family: var(--font-head); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 900; position: relative; color: #fff; margin-bottom: 8px; }
.page-header p { color: rgba(255,255,255,0.85); font-size: 1.05rem; position: relative; max-width: 620px; margin: 0 auto; }

/* ---------- Info / warning box ---------- */

.info-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(27,43,107,0.05);
  border: 1px solid rgba(27,43,107,0.12);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
  color: var(--text-2);
}
.warn-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(245,166,35,0.09);
  border: 1px solid rgba(245,166,35,0.3);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px;
  color: var(--navy);
}

/* ---------- File list (adabiyotlar / taqdimotlar) ---------- */

.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.file-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(27,43,107,0.07);
  border: 1.5px solid var(--border2);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.file-item:hover { border-color: var(--teal); box-shadow: 0 8px 22px rgba(42,191,171,0.16); transform: translateY(-2px); }
.file-num {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 900;
}
.file-info { flex: 1; min-width: 0; }
.file-info h4 { font-size: 15.5px; font-weight: 700; color: var(--navy); line-height: 1.35; margin: 0; }
.file-info p { font-size: 13px; color: var(--gray); margin-top: 3px; }
.file-badge {
  display: inline-block;
  background: rgba(42,191,171,0.1);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(42,191,171,0.22);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.file-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn-view, .btn-dl {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 38px;
  border: none;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
.btn-view { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: #fff; }
.btn-view:hover { opacity: 0.9; color: #fff; text-decoration: none; }
.btn-dl { background: rgba(42,191,171,0.1); color: var(--teal-dark); border: 1px solid rgba(42,191,171,0.25); }
.btn-dl:hover { background: var(--teal); color: #fff; text-decoration: none; }

/* ---------- Video grid (videodarslar) ---------- */

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.video-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.video-thumb { position: relative; padding-top: 56.25%; background: var(--bg2); overflow: hidden; }
.video-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-num-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(15,29,77,0.82);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.video-info { padding: 16px 18px; }
.video-title { font-family: var(--font-head); font-size: 16px; font-weight: 800; color: var(--navy); line-height: 1.4; }
.video-author { font-size: 13px; color: var(--gray); margin-top: 4px; }
.video-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13.5px; font-weight: 700; color: var(--purple); }
.video-link:hover { color: var(--navy); text-decoration: none; }

/* ---------- Modal (PDF viewer) ---------- */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15,29,77,0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border2); flex-shrink: 0; gap: 10px; }
.modal-head span { font-family: var(--font-head); font-weight: 800; font-size: 16px; color: var(--navy); }
.modal-head-actions { display: flex; gap: 8px; align-items: center; }
.modal-dl-btn {
  background: rgba(42,191,171,0.1);
  color: var(--teal-dark);
  border: 1px solid rgba(42,191,171,0.25);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.modal-close {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--danger); color: #fff; }
.modal iframe { flex: 1; border: none; min-height: 0; width: 100%; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(27,43,107,0.25);
  z-index: 600;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- Forms ---------- */

.auth-wrap {
  max-width: 440px;
  margin: 60px auto;
  padding: 0 20px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  border: 1px solid var(--border2);
}
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-2); margin-bottom: 24px; font-size: 15px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  font-size: 16px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,191,171,0.15);
}

.form-msg { font-size: 14px; margin-top: 10px; min-height: 20px; }
.form-msg.error { color: var(--danger); }
.form-msg.success { color: var(--teal-dark); }

.auth-switch { text-align: center; margin-top: 18px; font-size: 15px; color: var(--text-2); }

/* ---------- Author profile (muallif.html) ---------- */

.author-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.author-avatar {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(27,43,107,0.2);
}
.author-photo {
  width: 100px;
  height: 128px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 6px 20px rgba(27,43,107,0.22);
}
.author-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  text-align: left;
  font-size: 15.5px;
}
.author-info-grid > div { background: var(--bg); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--border2); }
.author-info-grid strong { color: var(--navy); }

/* ---------- Leaderboard (bosh sahifa) ---------- */

.leaderboard-section { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.leaderboard {
  max-width: 820px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  background: #fff;
}
.lb-head, .lb-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 90px minmax(150px, 220px);
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.lb-head {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lb-head span:nth-child(3), .lb-row .lb-col-attempts { text-align: center; }
.lb-row { border-top: 1px solid var(--border2); transition: background 0.15s ease; }
.lb-row:hover { background: rgba(42,191,171,0.05); }
.lb-top1 { background: linear-gradient(90deg, rgba(245,166,35,0.14), transparent 70%); }
.lb-top2 { background: linear-gradient(90deg, rgba(148,163,184,0.16), transparent 70%); }
.lb-top3 { background: linear-gradient(90deg, rgba(180,110,60,0.12), transparent 70%); }
.lb-rank { font-family: var(--font-head); font-weight: 900; font-size: 20px; color: var(--navy); text-align: center; }
.lb-student { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 13px;
}
.lb-name { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-col-attempts { color: var(--text-2); font-weight: 600; }
.lb-score { display: flex; align-items: center; gap: 10px; }
.lb-score strong { font-family: var(--font-head); font-weight: 900; color: var(--teal-dark); min-width: 52px; text-align: right; }
.lb-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.lb-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--teal-dark)); }
.lb-state { padding: 36px 20px; text-align: center; color: var(--text-2); }

@media (max-width: 600px) {
  .lb-head, .lb-row { grid-template-columns: 40px minmax(0, 1fr) 72px; padding: 11px 14px; gap: 10px; }
  .lb-col-attempts { display: none; }
  .lb-bar { display: none; }
  .lb-avatar { width: 32px; height: 32px; font-size: 12px; }
  .lb-rank { font-size: 17px; }
}

/* ---------- Placeholder / coming soon ---------- */

.coming-soon {
  text-align: center;
  padding: 90px 20px;
  max-width: 560px;
  margin: 0 auto;
}
.coming-soon .icon-badge { margin: 0 auto 20px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 24px;
  margin-top: 60px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.site-footer a { color: #fff; }
.site-footer .foot-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 24px;
  padding-top: 18px;
  font-size: 14px;
  text-align: center;
  color: rgba(255,255,255,0.6);
}

/* ---------- Utility ---------- */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 163, 125, 0.12);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .navbar { padding: 10px 16px; }
  .brand { font-size: 19px; }
  .brand-logo { width: 38px; height: 38px; }
  .page-header { padding: 34px 16px 30px; }
  .file-list, .video-grid, .topic-grid { grid-template-columns: 1fr; }
  .modal { height: 100vh; max-height: 100vh; border-radius: 0; max-width: 100%; }
  .toast { left: 16px; right: 16px; transform: translateY(80px); max-width: none; }
  .toast.show { transform: translateY(0); }
  .file-item { flex-wrap: wrap; }
  .file-actions { width: 100%; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border2); }
  .author-hero { text-align: center; justify-content: center; }
  .author-info-grid { text-align: left; }
}

@media (max-width: 480px) {
  .brand-logo { width: 34px; height: 34px; }
  .brand { font-size: 17px; gap: 8px; }
  .file-num, .topic-item::before { width: 38px; height: 38px; font-size: 13px; }
}
