:root {
  --green: #58cc02;
  --green-dark: #3fa100;
  --blue: #1cb0f6;
  --purple: #7f52ff;
  --yellow: #ffc800;
  --red: #ff5c5c;
  --ink: #171a21;
  --muted: #6f7785;
  --card: rgba(255, 255, 255, 0.92);
  --bg: #f3f7fb;
  --border: #d9e2ec;
  --shadow: 0 18px 45px rgba(23, 35, 53, 0.12);
  --soft: #eef6ff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #dfffd5 0, #f3f7fb 30%, #eef4ff 100%);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { user-select: none; }
.app-shell { display: grid; grid-template-columns: 292px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(255,255,255,0.90);
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; text-decoration: none; color: inherit; }
.logo {
  height: 56px; width: 56px; border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: white; font-size: 31px; font-weight: 900;
  box-shadow: var(--shadow);
}
.brand strong { display: block; font-size: 26px; line-height: 1; }
.brand small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.nav-stack { display: grid; gap: 10px; }
.nav-button, .primary-action, .secondary-action, .tiny-button, .audio-button, button {
  border: 0; border-radius: 16px; padding: 13px 16px; font-weight: 850;
  font-size: 15px; cursor: pointer; transition: 0.15s ease;
  background: #eaf1f8; color: #324153;
}
.nav-button { text-align: left; }
.nav-button:hover, button:hover, .practice-card:hover, .lesson-card:hover { transform: translateY(-1px); }
.nav-button.active { background: var(--green); color: white; box-shadow: 0 8px 18px rgba(88, 204, 2, 0.30); }
.sidebar-note {
  margin-top: 32px; padding: 16px; border-radius: 18px; background: #f0fbea;
  color: #24420d; display: grid; gap: 6px; font-size: 14px;
}
.content { padding: 34px; max-width: 1240px; width: 100%; }
.screen { display: none; animation: fade 0.22s ease; }
.active-screen { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
.hero-card {
  background: linear-gradient(135deg, #ffffff, #ecfce5);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 26px;
  align-items: center;
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; color: var(--green-dark); font-size: 12px; font-weight: 950; margin: 0 0 8px; }
h1 { font-size: clamp(31px, 4vw, 50px); line-height: 1.03; margin: 0 0 14px; letter-spacing: -0.04em; }
h2 { font-size: 24px; line-height: 1.12; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero-card p, .section-heading p:not(.eyebrow) { color: var(--muted); font-size: 17px; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.primary-action, button { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(28,176,246,0.22); }
.secondary-action, .secondary-button { background: #6f7785; color: white; }
.success-button { background: var(--green); color: white; }
.warning-button { background: var(--yellow); color: #402f00; }
.danger-button, .tiny-button.danger { background: var(--red); color: white; }
.hero-word {
  position: relative;
  background: white; border: 3px solid #d7f9c8; border-radius: 28px; padding: 32px 18px;
  text-align: center; box-shadow: 0 8px 24px rgba(88,204,2,0.13);
}
.hero-word span { display: block; font-size: 52px; font-weight: 950; color: var(--green-dark); }
.hero-word small { color: var(--muted); font-weight: 800; }
.audio-button {
  min-width: 44px; height: 44px; padding: 8px 10px; display: inline-grid; place-items: center; border-radius: 14px;
  background: #edf8ff; color: #096999; box-shadow: none; border: 1px solid #cce8fb;
}
.hero-audio { position: absolute; top: 14px; right: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 22px 0; }
.stat-card, .panel, .flashcard, .match-column, .lesson-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 22px; box-shadow: var(--shadow);
}
.stat-card span { display: block; font-size: 36px; font-weight: 950; color: var(--purple); }
.stat-card label { color: var(--muted); font-weight: 850; }
.dashboard-grid, .progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.practice-cards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.practice-card, .lesson-card {
  text-align: left; border: 2px solid var(--border); background: #f8fbff; color: var(--ink); box-shadow: none;
  display: grid; gap: 8px; min-height: 96px;
}
.practice-card span, .lesson-card strong { font-size: 18px; font-weight: 950; }
.practice-card small, .lesson-card small, .weak-list, .mini-example { color: var(--muted); line-height: 1.45; }
.category-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.category-chip { background: #e7f6ff; color: #0b5e87; border: 1px solid #bfe7ff; padding: 7px 11px; border-radius: 999px; font-weight: 850; font-size: 12px; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lesson-card { cursor: pointer; position: relative; overflow: hidden; }
.lesson-card::after { content: ''; position: absolute; width: 92px; height: 92px; border-radius: 50%; background: rgba(88,204,2,0.12); right: -22px; bottom: -26px; }
.lesson-meta { display: flex; justify-content: space-between; color: var(--muted); font-weight: 800; font-size: 13px; }
.section-heading { margin-bottom: 20px; }
.row-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.category-select, input, select {
  border: 2px solid var(--border); background: white; border-radius: 14px; padding: 12px 14px; color: var(--ink); outline: none;
}
.category-select { min-width: 210px; }
.flashcard { position: relative; min-height: 330px; display: grid; place-items: center; text-align: center; overflow: hidden; }
.flashcard::before { content: ''; position: absolute; width: 320px; height: 320px; background: #f1eaff; border-radius: 50%; opacity: .7; }
.card-audio { position: absolute; top: 18px; right: 18px; z-index: 1; }
.card-face { font-size: clamp(52px, 8vw, 86px); font-weight: 950; color: var(--purple); z-index: 1; }
.card-subtitle { color: var(--muted); font-size: 18px; font-weight: 850; z-index: 1; }
.mini-example { z-index: 1; max-width: 650px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.compact-row { margin-top: 12px; }
.quiz-panel { max-width: 840px; }
.quiz-topline { display: flex; justify-content: space-between; color: var(--muted); font-weight: 950; margin-bottom: 16px; }
.quiz-audio { margin-bottom: 8px; min-width: 120px; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.answer-option { background: #f5f8fb; color: var(--ink); border: 2px solid var(--border); box-shadow: none; text-align: left; }
.answer-option.correct { border-color: var(--green); background: #efffe8; }
.answer-option.wrong { border-color: var(--red); background: #fff0f0; }
.feedback { min-height: 24px; font-weight: 850; color: var(--muted); margin: 10px 0; }
.match-status { display: flex; justify-content: space-between; align-items: center; max-width: 960px; font-weight: 950; color: var(--muted); margin-bottom: 16px; }
.matching-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 960px; }
.pill-list { display: grid; gap: 12px; }
.match-pill { border: 2px solid var(--border); background: white; color: var(--ink); border-radius: 18px; padding: 14px 16px; font-size: 18px; font-weight: 950; box-shadow: none; text-align: left; }
.match-pill.selected { border-color: var(--purple); background: #f3efff; }
.match-pill.done { opacity: 0.35; pointer-events: none; }
.form-panel form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.form-panel form input:nth-child(5) { grid-column: span 2; }
.form-panel button { white-space: nowrap; }
.deck-controls { align-items: center; }
.control-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: end; }
.word-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; max-height: 620px; overflow: auto; padding-right: 4px; }
.word-row { border: 1px solid var(--border); background: #fbfdff; border-radius: 16px; padding: 12px; display: grid; gap: 5px; }
.word-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.word-main strong { font-size: 22px; color: var(--purple); }
.word-row small { color: var(--muted); font-weight: 750; }
.tag { display: inline-block; width: fit-content; background: #e7f6ff; color: #0b5e87; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.big-number { font-size: 58px; font-weight: 950; color: var(--purple); }
.check-list { padding-left: 20px; line-height: 1.8; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #172335; color: white; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); z-index: 9; font-weight: 800; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .content { padding: 22px; }
  .hero-card, .dashboard-grid, .progress-grid, .matching-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-grid, .word-list { grid-template-columns: 1fr; }
  .form-panel form { grid-template-columns: 1fr; }
  .row-heading { display: block; }
  .category-select { width: 100%; margin-top: 10px; }
}
@media (max-width: 620px) {
  .practice-cards, .answer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-word span { font-size: 42px; }
}
