:root {
  --bg-1: #6d7cff;
  --bg-2: #8f5dff;
  --bg-3: #ff7ac6;

  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #1f2430;
  --muted: #667085;
  --border: rgba(99, 102, 241, 0.14);

  --primary: #6b5cff;
  --primary-hover: #5948ff;
  --secondary: #eef2ff;
  --secondary-text: #312e81;

  --success: #10b981;
  --success-hover: #0da271;

  --shadow-lg: 0 24px 80px rgba(27, 34, 72, 0.22);
  --shadow-md: 0 14px 30px rgba(27, 34, 72, 0.16);

  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  color: var(--text);

  background:
  radial-gradient(circle at top left, rgba(255,255,255,0.25), transparent 30%),
  radial-gradient(circle at bottom right, rgba(255,255,255,0.2), transparent 20%),
  linear-gradient(135deg, var(--bg-1), var(--bg-2) 60%, var(--bg-3));

  min-height: 100vh;
}

/* ---------- LAYOUT ---------- */

.page-shell{
  min-height:100vh;
  padding:28px;
}

.container{
  width:min(1100px,100%);
  margin:0 auto;
}

/* ---------- HEADER ---------- */

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
  margin-bottom:24px;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
}

.brand-badge{
  width:56px;
  height:56px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-size:1.5rem;
  background:rgba(255,255,255,0.18);
  backdrop-filter:blur(12px);
  box-shadow:var(--shadow-md);
}

.brand h1{
  margin:0;
  font-size:2rem;
  color:white;
}

.brand p{
  margin:0;
  color:rgba(255,255,255,0.85);
}

/* ---------- NAV ---------- */

.nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.nav-link{
  text-decoration:none;
  color:white;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,0.14);
  backdrop-filter:blur(12px);
  font-weight:600;
}

.nav-link:hover{
  background:rgba(255,255,255,0.22);
}

.nav-link.active{
  background:rgba(255,255,255,0.28);
}

/* ---------- CARDS ---------- */

.card{
  background:var(--surface);
  border-radius:var(--radius-xl);
  padding:28px;
  box-shadow:var(--shadow-lg);
}

/* ---------- HERO ---------- */

.hero{
  display:grid;
  grid-template-columns:1.2fr 0.8fr;
  gap:30px;
}

.hero-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* ---------- BUTTONS ---------- */

.primary-btn,
.secondary-btn,
.speak-btn,
.answer-btn{

  border:none;
  cursor:pointer;
  border-radius:14px;
  font:inherit;
  font-weight:700;
}

.primary-btn{
  padding:12px 18px;
  background:var(--primary);
  color:white;
  box-shadow:var(--shadow-md);
  text-decoration:none;
}

.primary-btn:hover{
  background:var(--primary-hover);
}

.secondary-btn{
  padding:12px 18px;
  background:var(--secondary);
  color:var(--secondary-text);
  text-decoration:none;
}

.speak-btn{
  padding:12px 18px;
  background:var(--success);
  color:white;
}

.speak-btn:hover{
  background:var(--success-hover);
}

/* ---------- STATS ---------- */

.stats-grid{
  display:grid;
  gap:14px;
}

.stat-card{
  padding:18px;
  border-radius:18px;
  background:var(--surface-strong);
  box-shadow:var(--shadow-md);
}

.stat-label{
  display:block;
  color:var(--muted);
}

.stat-value{
  font-size:1.6rem;
  font-weight:800;
}

/* ---------- HOME ---------- */

.home-grid{
  margin-top:24px;
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:20px;
}

.feature h3{
  margin-top:0;
}

.text-link{
  text-decoration:none;
  color:var(--primary);
  font-weight:700;
}

/* ---------- WORD TABLE ---------- */

.table-wrap{
  overflow:auto;
  border-radius:18px;
}

.word-table{
  width:100%;
  border-collapse:collapse;
  background:var(--surface-strong);
  border-radius:18px;
}

.word-table th,
.word-table td{
  padding:14px 16px;
  border-bottom:1px solid rgba(99,102,241,0.08);
}

.word-table th{
  background:rgba(107,92,255,0.08);
}

.icon-btn{
  border:none;
  background:var(--secondary);
  color:var(--secondary-text);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
}

/* ---------- FLASHCARDS ---------- */

.flashcard-page{
  padding:28px;
}

.flashcard{
  width:100%;
  border:none;
  background:transparent;
  cursor:pointer;
  perspective:1400px;
}

.flashcard-inner{
  position:relative;
  width:100%;
  min-height:320px;
  transform-style:preserve-3d;
  transition:transform .6s ease;
}

.flashcard.is-flipped .flashcard-inner{
  transform:rotateY(180deg);
}

.flashcard-face{
  position:absolute;
  inset:0;
  border-radius:24px;
  padding:28px;
  backface-visibility:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  background:linear-gradient(145deg, rgba(255,255,255,0.98), rgba(238,242,255,0.92));
  box-shadow:var(--shadow-md);
}

.flashcard-back{
  transform:rotateY(180deg);
  background:linear-gradient(145deg, rgba(107,92,255,0.98), rgba(143,93,255,0.94));
  color:white;
}

.flashcard-label{
  font-size:.9rem;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  margin-bottom:12px;
}

.flashcard-face h2{
  font-size:2rem;
  text-align:center;
}

/* ---------- QUIZ ---------- */

.quiz-card{
  padding:28px;
}

.answers-grid{
  display:grid;
  gap:12px;
}

.answer-btn{
  text-align:left;
  padding:14px 16px;
  background:var(--surface-strong);
  box-shadow:var(--shadow-md);
}

.answer-btn.correct{
  background:rgba(16,185,129,.16);
}

.answer-btn.wrong{
  background:rgba(239,68,68,.14);
}

.quiz-feedback{
  min-height:28px;
  margin-top:16px;
  font-weight:700;
}

/* ---------- GRAMMAR ---------- */

.prose-card{
  padding:28px;
  line-height:1.7;
}

.example-box{
  margin:18px 0;
  padding:18px;
  border-radius:18px;
  background:var(--surface-strong);
  box-shadow:var(--shadow-md);
}

.pretty-list{
  padding-left:20px;
}

/* ---------- MOBILE ---------- */

@media(max-width:920px){

.hero{
grid-template-columns:1fr;
}

.home-grid{
grid-template-columns:1fr;
}

}

@media(max-width:640px){

.page-shell{
padding:18px;
}

.flashcard-inner{
min-height:260px;
}

}
