:root {
  --brand:       #1a6b5c;
  --brand-dark:  #134f44;
  --brand-light: #e8f5f2;
  --brand-mid:   #2d9e88;
  --text:        #111827;
  --text-soft:   #374151;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --white:       #ffffff;
  --bg:          #f8fafb;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.06);
  --shadow-md:   0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:   0 8px 32px rgba(26,107,92,.15);
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --font:        'Inter', sans-serif;
  --transition:  all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── NAV ── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;          /* slightly shorter on mobile */
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  gap: 12px;
}
.nav-brand {
  font-weight: 800; font-size: .95rem;    /* smaller so it fits on one line */
  color: var(--brand); letter-spacing: -.01em;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;                    /* NEVER wrap */
  flex-shrink: 0;
}
.nav-brand::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); opacity: .7; flex-shrink: 0;
}
.nav-links {
  display: flex; gap: 2px;
  flex-shrink: 0;
  align-items: center;
}
.nav-links a {
  padding: 6px 12px; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: .85rem;
  transition: var(--transition);
  white-space: nowrap;                    /* keep each link on one line */
}
.nav-links a:hover { background: var(--brand-light); color: var(--brand); }

/* ── LAYOUT ── */
.main-content { max-width: 980px; margin: 0 auto; padding: 32px 20px 80px; }

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 56px 20px 44px;
  background: linear-gradient(145deg, #f0faf7 0%, #ffffff 60%, #f5f3ff 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 44px;
  border: 1px solid #e8f5f2;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(26,107,92,.06) 0%, transparent 65%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800;
  color: var(--brand); letter-spacing: -.03em; line-height: 1.15; margin-bottom: 14px;
}
.hero p { font-size: 1.1rem; color: var(--text-soft); max-width: 480px; margin: 0 auto; }

/* ── SECTION ── */
.section { margin-bottom: 48px; }
.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }

/* ── CARDS ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition); cursor: pointer; position: relative; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #c8e8e2; }
.card:hover::after { transform: scaleX(1); }
.card h3 { font-size: 1rem; font-weight: 700; }
.card p  { font-size: .85rem; color: var(--muted); line-height: 1.5; }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.badge.beginner     { background: #dcfce7; color: #15803d; }
.badge.intermediate { background: #fef9c3; color: #a16207; }
.badge.advanced     { background: #fee2e2; color: #b91c1c; }
.badge.topic        { background: #ede9fe; color: #6d28d9; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  padding: 6px 16px; border-radius: 24px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted); font-size: .84rem; font-weight: 500; transition: var(--transition); cursor: pointer;
}
.filter-btn.active, .filter-btn:hover { background: var(--brand); color: var(--white); border-color: var(--brand); }

/* ── LIST TABS — single row horizontal scroll ── */
.list-tabs {
  display: flex; flex-direction: row;
  gap: 6px; margin-bottom: 12px;         /* tighter bottom margin */
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
  flex-wrap: nowrap;
}
.list-tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 6px 14px; border-radius: 20px; /* pill shape, smaller */
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted);
  font-size: .82rem; font-weight: 500;
  transition: var(--transition); white-space: nowrap; flex-shrink: 0;
}
.tab.active {
  background: var(--brand); color: var(--white);
  border-color: var(--brand); font-weight: 700;
  box-shadow: 0 2px 10px rgba(26,107,92,.2);
}

/* ── VIDEO PLAYER ── */
.video-player-wrap { max-width: 800px; margin: 0 auto; }
.video-player-wrap h1 { font-size: 1.4rem; font-weight: 800; margin: 12px 0 8px; }
.video-desc { color: var(--muted); margin-bottom: 16px; font-size: .92rem; }
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-meta { margin-top: 14px; display: flex; gap: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: .875rem; font-weight: 600; margin-bottom: 14px; transition: var(--transition); }
.back-link:hover { gap: 10px; }

/* ── WORD BANK ── */
.wordbank-wrap { max-width: 520px; margin: 0 auto; }

/* progress dots — compact single row */
.word-progress { margin-bottom: 10px; }
.progress-dots {
  display: flex; gap: 4px; justify-content: flex-start;
  flex-wrap: nowrap; overflow: hidden; height: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--border); transition: background .3s; }
.dot.filled { background: var(--brand); }

/* progress bar (>20 words) */
.progress-bar-wrap { height: 5px; background: var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-mid)); border-radius: 10px; transition: width .4s ease; }
.progress-label { font-size: .75rem; color: var(--muted); margin-bottom: 10px; text-align: right; font-weight: 500; }

/* WORD CARD */
.word-card {
  display: none; flex-direction: column; align-items: center; text-align: center;
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 28px 30px;
  box-shadow: var(--shadow-md); gap: 14px;
  border: 1px solid #e8f5f2; position: relative; overflow: hidden;
}
.word-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-mid));
}
.word-card.active { display: flex; }

.word-display { font-size: clamp(1.9rem, 7vw, 2.8rem); font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1.1; }
.phonetic { font-size: .95rem; color: var(--muted); letter-spacing: .05em; font-weight: 500; background: var(--brand-light); padding: 4px 14px; border-radius: 20px; }

.audio-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.btn-play, .btn-again {
  padding: 12px 28px; border-radius: 50px; border: none; cursor: pointer;
  font-size: .95rem; font-family: var(--font); font-weight: 700;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 8px;
  min-width: 160px; justify-content: center;
}
.btn-play { background: var(--brand); color: var(--white); box-shadow: 0 4px 14px rgba(26,107,92,.28); }
.btn-play:hover { background: var(--brand-dark); transform: translateY(-2px); }
.btn-play:active { transform: translateY(0); }
.btn-again { background: var(--brand-light); color: var(--brand); border: 2px solid var(--brand); }
.btn-again:hover { background: #d0ece7; }
.play-count { font-size: .75rem; color: var(--muted); min-height: 16px; font-weight: 500; }

.word-nav { display: flex; gap: 10px; margin-top: 4px; width: 100%; justify-content: center; }
.btn-nav {
  padding: 10px 22px; border-radius: 10px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--text-soft); cursor: pointer;
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  transition: var(--transition); flex: 1; max-width: 150px;
}
.btn-nav:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.btn-done { background: var(--brand); color: var(--white); border-color: var(--brand); }
.btn-done:hover { background: var(--brand-dark); color: var(--white); }

.done-card { background: linear-gradient(135deg, #f0faf7, #e8f5f2); border: 2px solid #c8e8e2; }
.done-icon { font-size: 2.8rem; color: var(--brand); background: var(--white); width: 68px; height: 68px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(26,107,92,.2); }
.done-card h2 { font-size: 1.4rem; font-weight: 800; color: var(--brand); }
.done-card p  { color: var(--text-soft); }

/* ── FOOTER ── */
.footer { text-align: center; padding: 28px 20px 20px; color: var(--muted); font-size: .83rem; border-top: 1px solid var(--border); margin-top: 56px; line-height: 1.8; }
.footer strong { color: var(--text-soft); }
.footer-sub { font-size: .76rem; color: #9ca3af; margin-top: 4px; }
.footer-sub a { color: var(--brand); }
.footer-sub a:hover { text-decoration: underline; }

.empty-state { color: var(--muted); text-align: center; padding: 40px 20px; font-size: .92rem; background: var(--white); border-radius: var(--radius-md); border: 1.5px dashed var(--border); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .navbar { padding: 0 16px; height: 52px; }
  .nav-brand { font-size: .88rem; }
  .nav-links a { padding: 5px 10px; font-size: .82rem; }
  .main-content { padding: 20px 14px 80px; }
  .hero { padding: 40px 18px 32px; border-radius: var(--radius-md); }
  .hero p { font-size: .95rem; }
  .card-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.3rem; margin-bottom: 12px; }
  .word-card { padding: 28px 18px 24px; gap: 12px; }
  .word-display { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .btn-play, .btn-again { min-width: 140px; padding: 11px 20px; font-size: .9rem; }
  .list-tabs { margin-bottom: 10px; }

  /* Mobile bottom nav */
  .navbar .nav-links {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 8px 0 14px;
    display: flex; justify-content: center; gap: 0;
    z-index: 300; box-shadow: 0 -4px 18px rgba(0,0,0,.08);
  }
  .navbar .nav-links a {
    flex: 1; text-align: center; padding: 8px 8px;
    border-radius: 0; font-size: .78rem; white-space: nowrap;
  }
  .main-content { padding-bottom: 90px; }
  .footer { margin-bottom: 68px; }
}