:root {
    --bg: #fdfcfb;
    --bg-alt: #f7f5f2;
    --bg-accent: #fff7ed;
    --card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --primary: #e85d26;
    --primary-hover: #d14a16;
    --primary-light: #ffedd5;
    --secondary: #0e7490;
    --secondary-hover: #0c6580;
    --accent: #facc15;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-serif: 'Merriweather', serif;
    --container: 1120px;
    --header-h: 72px;
    --transition: 0.2s ease;
}

/* ---- Reset & Base ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }

/* Accessibility */
.skip-link {
    position: absolute; left: -9999px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
    left: 16px; top: 16px; width: auto; height: auto;
    background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); z-index: 1000;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }

/* ---- Container & Sections ---- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-accent { background: var(--bg-accent); padding: 72px 0; }
.page-header { padding: 48px 24px 32px; }
.page-header h1 { font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; margin-bottom: 12px; }
.page-header p { color: var(--text-muted); max-width: 680px; font-size: 1.05rem; }

/* ---- Header & Nav ---- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(253,252,251,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.navbar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.logo-icon { font-size: 1.6rem; }
.logo-text { letter-spacing: -0.02em; }
.nav-menu { display: flex; gap: 6px; align-items: center; }
.nav-menu a {
    padding: 8px 14px; border-radius: var(--radius-full);
    color: var(--text-muted); font-weight: 500; font-size: 0.95rem;
    transition: all var(--transition); text-decoration: none;
}
.nav-menu a:hover { background: var(--bg-alt); color: var(--text); }
.nav-menu a.active { background: var(--text); color: #fff; }

/* Mobile toggle */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; display: block; transition: var(--transition); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: var(--radius-full); border: 1px solid transparent;
    font-weight: 600; font-size: 0.95rem; transition: all var(--transition); text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn-secondary { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg-alt); border-color: var(--border-strong); text-decoration: none; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.full-width { width: 100%; }
.link-arrow { font-weight: 600; color: var(--secondary); }
.link-btn { background: none; border: 0; color: var(--secondary); font-weight: 600; text-decoration: underline; padding: 0 2px; }

/* ---- Cards & Grids ---- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-accent { background: linear-gradient(135deg, #fff, var(--primary-light)); border-color: #fed7aa; }
.card-success { background: var(--success-bg); border-color: #bbf7d0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.badge { display: inline-flex; padding: 6px 12px; border-radius: var(--radius-full); background: var(--primary-light); color: var(--primary); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.02em; }
.badge-muted { background: var(--bg-alt); color: var(--text-muted); }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }

/* ---- Hero ---- */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: center; padding: 64px 24px 48px; }
.hero h1 { font-family: var(--font-serif); font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.05; margin: 16px 0; }
.text-accent { color: var(--primary); }
.hero-subtitle { color: var(--text-muted); font-size: 1.15rem; max-width: 560px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-stats { display: flex; gap: 24px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.4rem; line-height: 1; }
.hero-stats span { color: var(--text-muted); font-size: 0.85rem; }

.hero-visual { display: flex; justify-content: center; }
.hero-card {
    width: 100%; max-width: 320px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg);
    transform: rotate(2deg); transition: transform var(--transition);
}
.hero-card:hover { transform: rotate(0deg) translateY(-4px); }
.hero-card-header { display: flex; gap: 6px; margin-bottom: 24px; }
.hero-card-header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.hero-word-kr { font-family: var(--font-serif); font-size: 2.8rem; font-weight: 700; color: var(--text); }
.hero-word-en { color: var(--text-muted); margin-top: 4px; }
.hero-word-pron { margin-top: 12px; font-family: monospace; color: var(--text-light); }

/* ---- Section Header ---- */
.section-header { margin-bottom: 28px; }
.section-header h2 { font-family: var(--font-serif); font-size: 1.9rem; margin-bottom: 8px; }
.section-header p { color: var(--text-muted); max-width: 640px; }

/* ---- Word of Day ---- */
.wod-section { padding: 48px 0; text-align: center; }
.wod-section .section-header { text-align: center; margin: 0 auto; }
.wod-section .section-header h2 { margin-bottom: 6px; }
.wod-section .section-header p { margin: 0 auto 18px; }

.wod-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.word-of-day-card { padding: 32px; display: grid; gap: 12px; }

.word-of-day-card-compact {
  max-width: 380px;
  width: 100%;
  min-height: 0;
  padding: 20px 22px;
  gap: 8px;
  margin: 0 auto;
  text-align: center;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.word-of-day-card-compact .word-main {
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.word-of-day-card-compact .word-main h3 {
  font-size: 1.7rem;
  line-height: 1.2;
}

.word-of-day-card-compact .dict-pron {
  font-size: 0.85rem;
  color: var(--text-light);
}

.word-of-day-card-compact .word-meta {
  justify-content: center;
}

.word-of-day-card-compact p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.word-main { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; }
.word-main h3 { font-size: 2rem; font-family: var(--font-serif); }
.word-meta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Dictionary ---- */
.search-card { padding: 20px; margin-bottom: 24px; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input-wrapper input {
    width: 100%; padding: 14px 44px 14px 44px; border-radius: var(--radius-full);
    border: 1px solid var(--border); background: var(--bg); outline: none;
    font-size: 1rem; transition: all var(--transition);
}
.search-input-wrapper input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.search-input-wrapper.small input { padding: 10px 36px 10px 36px; font-size: 0.9rem; }
.search-icon { position: absolute; left: 16px; pointer-events: none; }
.btn-clear { position: absolute; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--bg-alt); }
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-group label { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.filter-group select { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); }
.radio-group { display: flex; gap: 12px; }
.radio-group label { display: flex; gap: 6px; align-items: center; font-weight: 400; color: var(--text); }
.results-count { margin-left: auto; font-size: 0.9rem; color: var(--text-muted); }

.dictionary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dict-card h3 { font-size: 1.3rem; font-family: var(--font-serif); }
.dict-trans { margin-top: 8px; display: grid; gap: 4px; font-size: 0.95rem; }
.dict-trans span { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dict-example { margin-top: 12px; padding: 10px 12px; background: var(--bg-alt); border-radius: var(--radius-sm); font-style: italic; color: var(--text-muted); font-size: 0.9rem; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* ---- Learn ---- */
.learn-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.learn-sidebar .sticky-card { position: sticky; top: 96px; }
.lesson-nav { display: grid; gap: 6px; margin-top: 12px; }
.lesson-link {
    text-align: left; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
}
.lesson-link:hover { background: var(--bg-alt); }
.lesson-link.active { background: var(--text); color: #fff; border-color: var(--text); }
.lesson-link.completed::after { content: "✓"; color: var(--success); }
.lesson-link.active.completed::after { color: #fff; }
.progress-wrapper { margin-top: 20px; max-width: 400px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar { height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.4s ease; }
.lesson-detail h2 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 6px; }
.lesson-detail .lesson-desc { color: var(--text-muted); margin-bottom: 20px; }
.vocab-list { display: grid; gap: 12px; margin: 20px 0; }
.vocab-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 12px; background: var(--bg-alt); border-radius: var(--radius-sm); align-items: center; }
.vocab-kr { font-weight: 700; }
.vocab-en { color: var(--text-muted); }
.lesson-controls { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.tip-box { background: #fefce8; border: 1px solid #fde68a; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; }

/* ---- Library ---- */
.book-cover { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-alt); margin-bottom: 12px; }
.book-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.level { font-size: 0.7rem; padding: 4px 8px; border-radius: var(--radius-full); background: var(--bg-alt); font-weight: 600; text-transform: uppercase; }
.level.beginner { background: #dcfce7; color: #166534; }
.level.intermediate { background: #dbeafe; color: #1e40af; }
.level.culture { background: #ffedd5; color: #9a3412; }
.level.children { background: #fef9c3; color: #854d0e; }
.steps { display: grid; gap: 8px; padding-left: 20px; list-style: decimal; }

/* ---- Games ---- */
.game-tabs { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.tab-btn { padding: 10px 18px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--card); font-weight: 600; }
.tab-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.game-section { padding-bottom: 48px; }
.game-container { max-width: 720px; margin: 0 auto; }
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.game-instruction { color: var(--text-muted); margin-bottom: 16px; }
.score-board { display: flex; gap: 16px; font-size: 0.9rem; }

/* Flashcard */
.flashcard { perspective: 1000px; cursor: pointer; min-height: 280px; }
.flashcard-inner { position: relative; width: 100%; height: 280px; transition: transform 0.6s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute; inset: 0; backface-visibility: hidden;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; box-shadow: var(--shadow);
}
.flashcard-back { transform: rotateY(180deg); background: var(--bg-alt); }
.flashcard-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); margin-bottom: 12px; }
.flashcard-word { font-family: var(--font-serif); font-size: 2.5rem; font-weight: 700; text-align: center; }
.flashcard-example { margin-top: 16px; font-style: italic; color: var(--text-muted); text-align: center; }
.flashcard-hint { margin-top: 16px; font-size: 0.8rem; color: var(--text-light); }
.game-controls { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.game-controls.secondary { margin-top: 12px; }
.checkbox { display: flex; gap: 6px; align-items: center; font-size: 0.9rem; }

/* Quiz */
.quiz-word { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; text-align: center; margin: 12px 0; }
.quiz-pron { text-align: center; color: var(--text-light); font-family: monospace; }
.quiz-label { text-align: center; color: var(--text-muted); }
.quiz-options { display: grid; gap: 10px; margin: 24px 0; }
.quiz-option {
    padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--card); text-align: left; transition: all var(--transition);
}
.quiz-option:hover { border-color: var(--border-strong); background: var(--bg-alt); }
.quiz-option.correct { background: var(--success-bg); border-color: var(--success); color: #166534; }
.quiz-option.wrong { background: #fee2e2; border-color: #ef4444; }
.quiz-feedback { padding: 12px; border-radius: var(--radius-sm); margin: 12px 0; text-align: center; font-weight: 500; }
.quiz-feedback.correct { background: var(--success-bg); color: #166534; }
.quiz-feedback.wrong { background: #fee2e2; color: #991b1b; }

/* Memory */
.matchup-grid, .memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.memory-card {
    aspect-ratio: 3/2; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--card); display: flex; align-items: center; justify-content: center;
    font-weight: 600; text-align: center; padding: 8px; cursor: pointer;
    transition: all var(--transition); user-select: none;
}
.memory-card.flipped { background: var(--bg-alt); border-color: var(--text); }
.memory-card.matched { background: var(--success-bg); border-color: var(--success); color: #166534; pointer-events: none; }
.memory-card .hidden-text { visibility: hidden; }
.memory-card.flipped .hidden-text, .memory-card.matched .hidden-text { visibility: visible; }

/* ---- Contact ---- */
.contact-layout { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 28px; align-items: start; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--card); outline: none; transition: all var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.error-message { color: #dc2626; font-size: 0.8rem; margin-top: 4px; display: block; min-height: 1em; }
.form-note { font-size: 0.8rem; color: var(--text-light); margin-top: 12px; }
.info-list { display: grid; gap: 10px; font-size: 0.9rem; }
.code-block { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }

/* ---- About ---- */
.stats-row { display: flex; gap: 20px; margin: 16px 0; }
.stats-row div { display: flex; flex-direction: column; }
.stats-row strong { font-size: 1.5rem; }
.stats-row span { font-size: 0.8rem; color: var(--text-muted); }
.check-list { display: grid; gap: 8px; margin-top: 12px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; }
.check-list li::before { content: "✓"; color: var(--success); font-weight: 700; }

/* ---- Mission ---- */
.mission-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.mission-grid h2 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 16px; }
.mission-grid p { color: var(--text-muted); margin-bottom: 12px; }

/* ---- Newsletter ---- */
.newsletter-card {
    padding: 28px;
    background: var(--card);
    border: 1px solid #fed7aa;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.newsletter-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.newsletter-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: var(--primary-light);
    border-radius: 12px;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.newsletter-card h3 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    margin-bottom: 8px;
}
.newsletter-card > p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}
.newsletter-form {
    display: grid;
    gap: 10px;
}
.newsletter-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.newsletter-input-wrap input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg);
    outline: none;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.newsletter-input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: #fff;
}
.newsletter-input-wrap .btn {
    white-space: nowrap;
    padding: 12px 22px;
    flex-shrink: 0;
}
.newsletter-success {
    text-align: center;
    padding: 20px 10px;
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}
.newsletter-success .success-icon {
    width: 36px; height: 36px;
    margin: 0 auto 10px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700;
}
.newsletter-success strong {
    display: block;
    color: #166534;
    font-size: 1.05rem;
}
.newsletter-success p {
    color: #15803d;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ---- Footer ---- */
.site-footer { background: #111827; color: #9ca3af; padding: 56px 0 24px; margin-top: 48px; }
.site-footer .logo { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 0.8fr 0.8fr; gap: 32px; }
.footer-brand p { margin: 12px 0 16px; max-width: 320px; font-size: 0.9rem; }
.socials { display: flex; gap: 10px; }
.socials a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.08); display: grid; place-items: center; color: #fff; font-size: 0.8rem; text-decoration: none; }
.socials a:hover { background: rgba(255,255,255,0.15); }
.footer-links h4 { color: #fff; margin-bottom: 12px; font-size: 0.95rem; }
.footer-links ul { display: grid; gap: 8px; }
.footer-links a { color: #9ca3af; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 40px; padding-top: 20px; text-align: center; font-size: 0.85rem; }

/* ---- Utilities ---- */
.card-icon { font-size: 1.8rem; margin-bottom: 12px; }
.loading-text { color: var(--text-muted); padding: 20px; text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
    .hero-visual { order: -1; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .learn-layout, .contact-layout, .mission-grid, .footer-grid { grid-template-columns: 1fr; }
    .learn-sidebar .sticky-card { position: static; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .nav-toggle { display: flex; }
    .nav-menu {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        background: var(--card); border-bottom: 1px solid var(--border);
        flex-direction: column; align-items: stretch; padding: 16px;
        transform: translateY(-120%); transition: transform 0.25s ease; pointer-events: none;
    }
    .nav-menu.open { transform: translateY(0); pointer-events: auto; }
    .nav-menu a { padding: 12px 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; align-items: stretch; }
    .results-count { margin-left: 0; }
    .memory-grid { grid-template-columns: repeat(3, 1fr); }
    .vocab-item { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
}

/* ---- Games Tabs & Match Up ---- */
.game-tabs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover { background: var(--bg-alt); color: var(--text); }
.tab-btn.active { background: var(--text); color: #fff; border-color: var(--text); }

.game-section.hidden { display: none !important; }
.game-section { padding-bottom: 48px; }
.game-container { max-width: 720px; margin: 0 auto; }
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.game-header h2 { font-family: var(--font-serif); }
.game-instruction { color: var(--text-muted); margin-bottom: 0; font-size: 0.95rem; }

.quiz-final-card { text-align: center; }

.matchup-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.matchup-message { color: var(--text-muted); font-size: 0.9rem; }
.matchup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.matchup-card {
  aspect-ratio: 3/2;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; text-align: center; padding: 8px;
  cursor: pointer; transition: all var(--transition); user-select: none;
  box-shadow: var(--shadow-sm);
}
.matchup-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.matchup-card .hidden-text { visibility: visible; }
.matchup-card.selected { background: var(--primary-light); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,93,38,0.15); }
.matchup-card.matched { background: var(--success-bg); border-color: var(--success); color: #166534; pointer-events: none; opacity: 0.9; }
.matchup-card.wrong { background: #fee2e2; border-color: #ef4444; animation: shake 0.3s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

@media (max-width: 640px) {
  .matchup-grid { grid-template-columns: repeat(3, 1fr); }
  .game-tabs { justify-content: flex-start; }
}

/* ---- Homepage: 4 games on left + featured product ---- */
.home-games-header{ display:flex; justify-content:space-between; align-items:end; flex-wrap:wrap; gap:12px; }
.home-games-layout{
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 24px;
  align-items: start;
  margin-top: 20px;
}
.home-games-main .grid{ gap:16px; }
.home-games-more{
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px;
  padding:14px 16px; background:var(--bg-alt); border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:0.9rem; color:var(--text-muted); flex-wrap:wrap;
}
.featured-product-card{
  position:relative; padding:0; overflow:hidden; display:flex; flex-direction:column;
}
.featured-badge{
  position:absolute; top:12px; left:12px; background:var(--primary); color:#fff;
  font-size:0.7rem; font-weight:700; letter-spacing:0.05em; padding:4px 10px; border-radius:9999px; z-index:2;
}
.featured-product-image{ aspect-ratio:4/3; background:var(--bg-alt); overflow:hidden; }
.featured-product-image img{ width:100%; height:100%; object-fit:cover; transition: transform 0.3s ease; }
.featured-product-card:hover .featured-product-image img{ transform:scale(1.03); }
.featured-product-info{ padding:18px; }
.featured-product-info h4{ font-family:var(--font-serif); font-size:1.1rem; margin-bottom:6px; }
.featured-product-desc{ font-size:0.88rem; color:var(--text-muted); line-height:1.5; margin-bottom:10px; }
.featured-product-meta{ display:flex; gap:8px; align-items:center; }
.featured-price{ font-weight:700; font-size:1.05rem; color:var(--text); }
.featured-note{ font-size:0.7rem; color:var(--text-light); margin-top:8px; text-align:center; }

/* Games page with aside - smaller product so it doesn't interfere */
.games-with-aside{
  display:grid;
  grid-template-columns: 1fr 280px;
  gap:24px;
  align-items:start;
}
.games-main{ min-width:0; }
.games-aside{
  position:sticky;
  top: calc(var(--header-h) + 20px);
  display:flex;
  flex-direction:column;
  gap:16px;
}
.featured-product-card-small{
  max-width:280px;
  font-size:0.9rem;
}
.featured-product-card-small .featured-product-image{ aspect-ratio: 1/1; }
.featured-product-card-small .featured-product-info{ padding:14px; }
.featured-product-card-small h4{ font-size:1rem; }
.featured-product-card-small .featured-product-desc{ font-size:0.82rem; }
.featured-product-card-small .btn{ padding:10px 14px; font-size:0.85rem; }
.aside-tip{
  padding:14px;
  background: var(--bg-accent);
  border-color:#fed7aa;
  font-size:0.85rem;
}
.aside-tip h4{ font-size:0.9rem; margin-bottom:6px; }
.aside-tip p{ color:var(--text-muted); line-height:1.5; font-size:0.85rem; }

/* Word of Day compact centered */
.wod-section{ padding:48px 0; text-align:center; }
.wod-wrapper{ display:flex; justify-content:center; align-items:center; width:100%; }
.word-of-day-card-compact{
  max-width:380px; width:100%; min-height:0; padding:20px 22px; gap:8px;
  margin:0 auto; text-align:center; border-radius:18px; box-shadow:var(--shadow);
}

/* Scramble - uppercase letters */
.scramble-question{ text-align:center; margin-bottom:16px; }
.scramble-english{ font-size:1.1rem; }
.scramble-letters{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  margin:20px 0; min-height:48px;
}
.scramble-letter{
  display:inline-flex; align-items:center; justify-content:center;
  width:44px; height:44px;
  background: var(--card);
  border:1px solid var(--border);
  border-radius:10px;
  font-weight:800; font-size:1.15rem;
  text-transform:uppercase;
  letter-spacing:0.02em;
  box-shadow: var(--shadow-sm);
  user-select:none;
}
.scramble-input-wrap{
  display:flex; gap:10px; margin:16px 0; max-width:480px; margin-left:auto; margin-right:auto;
}
.scramble-input{
  flex:1; padding:12px 16px; border-radius:9999px; border:1px solid var(--border);
  background: var(--card); font-size:1rem; outline:none; text-transform:uppercase;
  transition: all var(--transition);
}
.scramble-input:focus{ border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-light); }
.scramble-input.shake{ animation: shake 0.35s ease; border-color:#ef4444; }
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}

@media (max-width: 1100px){
  .home-games-layout{ grid-template-columns:1fr; }
  .games-with-aside{ grid-template-columns:1fr; }
  .games-aside{ position:static; flex-direction:row; flex-wrap:wrap; }
  .games-aside .card{ flex:1; min-width:260px; }
}
@media (max-width: 640px){
  .games-aside{ flex-direction:column; }
}