/* ==========================================================
   GoStudyTurkish — Centralized Shell & Design System (shell.css)
   Contains CSS Variables for all 5 themes, Shell layout, Topbar,
   Drawer, Modals, Course components, Hub components, and Utilities.
   No hardcoded hex colors where theme variables apply.
   ========================================================== */

/* ── Theme Definitions ── */
/* 1. Cloud Soft (Default: Airy, soft pastel blue-white, high lightness, low saturation) */
:root,
[data-theme="cloud-soft"],
[data-theme="soft-mint"],
[data-theme="modern-light"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-border: rgba(37, 99, 235, 0.20);
  --primary-glow: transparent;

  --bg: #f8fafc;
  --card: #ffffff;
  --card-hover: #f1f5f9;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;

  --gradient-end: #60a5fa;
  --shadow-color: rgba(15, 23, 42, 0.08);
  --shadow-soft: rgba(15, 23, 42, 0.04);
  --white-alpha: rgba(15, 23, 42, 0.04);
  --dialog-bg: #ffffff;

  --max-width: 1200px;
  --sidebar-w: 320px;
  --accent-glow: transparent;
}

/* 2. Soft Dark (Pastel slate/navy, gentle on eyes, never harsh pure black) */
[data-theme="soft-dark"],
[data-theme="modern-dark"] {
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-soft: rgba(96, 165, 250, 0.12);
  --primary-border: rgba(96, 165, 250, 0.25);
  --primary-glow: transparent;

  --bg: #0e131f;
  --card: #161e2e;
  --card-hover: #1e293d;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;

  --gradient-end: #93c5fd;
  --shadow-color: rgba(0, 0, 0, 0.60);
  --shadow-soft: rgba(0, 0, 0, 0.35);
  --white-alpha: rgba(255, 255, 255, 0.08);
  --dialog-bg: #161e2e;
  --accent-glow: transparent;
}

/* 3. Warm Pastel (Warm cream, soft peach/terracotta and earthy tones) */
[data-theme="warm-pastel"],
[data-theme="turk-indo"] {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: rgba(234, 88, 12, 0.08);
  --primary-border: rgba(234, 88, 12, 0.22);
  --primary-glow: transparent;

  --bg: #faf7f2;
  --card: #ffffff;
  --card-hover: #f5eee4;
  --muted: #78716c;
  --border: rgba(120, 53, 15, 0.09);
  --text: #292524;

  --gradient-end: #fb923c;
  --shadow-color: rgba(120, 53, 15, 0.06);
  --shadow-soft: rgba(120, 53, 15, 0.03);
  --white-alpha: rgba(120, 53, 15, 0.04);
  --dialog-bg: #ffffff;
  --accent-glow: transparent;
}

/* 4. Deep Night (Classic enterprise dark mode) */
[data-theme="deep-night"],
[data-theme="classic-dark"] {
  --primary: #ffffff;
  --primary-hover: #e4e4e7;
  --primary-soft: rgba(255, 255, 255, 0.08);
  --primary-border: rgba(255, 255, 255, 0.18);
  --primary-glow: transparent;

  --bg: #050505;
  --card: #111111;
  --card-hover: #18181b;
  --muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.10);
  --text: #fafafa;

  --gradient-end: #d4d4d8;
  --shadow-color: rgba(0, 0, 0, 0.70);
  --shadow-soft: rgba(0, 0, 0, 0.40);
  --white-alpha: rgba(255, 255, 255, 0.08);
  --dialog-bg: #111111;
  --accent-glow: transparent;
}

/* ── Deep Night / Classic Dark: High-contrast black text on white/light backgrounds ── */
[data-theme="deep-night"] .conj-table thead tr,
[data-theme="deep-night"] .conj-table thead tr *,
[data-theme="deep-night"] .conj-table th,
[data-theme="deep-night"] .vocab-table-responsive thead tr,
[data-theme="deep-night"] .vocab-table-responsive thead tr *,
[data-theme="deep-night"] .vocab-table-responsive th,
[data-theme="classic-dark"] .conj-table thead tr,
[data-theme="classic-dark"] .conj-table thead tr *,
[data-theme="classic-dark"] .conj-table th,
[data-theme="classic-dark"] .vocab-table-responsive thead tr,
[data-theme="classic-dark"] .vocab-table-responsive thead tr *,
[data-theme="classic-dark"] .vocab-table-responsive th {
  color: #050505 !important;
}

[data-theme="deep-night"] .settings-save-btn,
[data-theme="classic-dark"] .settings-save-btn,
[data-theme="deep-night"] .complete-btn,
[data-theme="classic-dark"] .complete-btn,
[data-theme="deep-night"] .play-btn,
[data-theme="classic-dark"] .play-btn,
[data-theme="deep-night"] .nav-signup-btn,
[data-theme="classic-dark"] .nav-signup-btn,
[data-theme="deep-night"] .notfound__btn--primary,
[data-theme="classic-dark"] .notfound__btn--primary,
[data-theme="deep-night"] .theme-card-check,
[data-theme="classic-dark"] .theme-card-check,
[data-theme="deep-night"] .fc-level-chip.active,
[data-theme="classic-dark"] .fc-level-chip.active,
[data-theme="deep-night"] .section-card .card-number,
[data-theme="deep-night"] .card-number,
[data-theme="classic-dark"] .section-card .card-number,
[data-theme="classic-dark"] .card-number,
[data-theme="deep-night"] .gst-dialog-line .gst-speaker,
[data-theme="classic-dark"] .gst-dialog-line .gst-speaker {
  color: #050505 !important;
}

[data-theme="deep-night"] .vocab-audio-btn:hover,
[data-theme="classic-dark"] .vocab-audio-btn:hover,
[data-theme="deep-night"] .fc-word-audio-btn:hover,
[data-theme="classic-dark"] .fc-word-audio-btn:hover {
  color: #050505 !important;
}

[data-theme="deep-night"] .vocab-audio-btn:hover svg,
[data-theme="classic-dark"] .vocab-audio-btn:hover svg,
[data-theme="deep-night"] .fc-word-audio-btn:hover svg,
[data-theme="classic-dark"] .fc-word-audio-btn:hover svg {
  fill: #050505 !important;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip !important;
  margin: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip !important;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

#router-view {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: clip;
}

/* ==========================================================
   TOPBAR
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px var(--shadow-soft);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease !important;
  will-change: transform;
}

.topbar.topbar--hidden {
  transform: translateY(-100%) !important;
}

/* Smooth global theme transitions */
body, .topbar, .card, .settings-card, #drawerMenu, .letters-grid, .btn-play-again {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}

/* Theme Onboarding Modal */
.theme-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 1;
}
.theme-modal-overlay.hidden {
  display: none !important;
}
.theme-modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 20px;
}

.theme-option-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 13px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

.theme-option-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-soft);
}

.theme-option-card:active {
  transform: scale(0.97);
}

.theme-option-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
  background: var(--card-hover, var(--card));
}

.theme-card-check {
  display: none;
  position: absolute;
  top: 9px;
  right: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.theme-option-card.selected .theme-card-check {
  display: flex;
}

.theme-palette-preview {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.theme-swatch {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.theme-card-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}

.theme-card-badge {
  font-size: 0.62rem;
  background: var(--accent-subtle, rgba(37, 99, 235, 0.12));
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.theme-card-desc {
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Compact layout for Settings modal */
.settings-theme-grid {
  margin-top: 4px;
  margin-bottom: 10px;
  gap: 8px;
}

.settings-theme-grid .theme-option-card {
  padding: 11px 10px;
  border-radius: 12px;
}

.settings-theme-grid .theme-palette-preview {
  margin-bottom: 6px;
  gap: 5px;
}

.settings-theme-grid .theme-swatch {
  width: 15px;
  height: 15px;
}

.settings-theme-grid .theme-card-title {
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.settings-theme-grid .theme-card-desc {
  font-size: 0.7rem;
  line-height: 1.25;
}

@media (max-width: 480px) {
  .settings-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    max-height: calc(100svh - 24px) !important;
  }
  .settings-form {
    gap: 12px !important;
  }
  .settings-theme-grid {
    margin-top: 2px !important;
    margin-bottom: 6px !important;
    gap: 7px !important;
  }
  .settings-theme-grid .theme-option-card {
    padding: 10px 9px !important;
  }
  .settings-theme-grid .theme-card-title {
    font-size: 0.78rem !important;
  }
  .settings-theme-grid .theme-card-desc {
    font-size: 0.67rem !important;
  }
  .settings-save-btn {
    padding: 12px !important;
    font-size: 0.95rem !important;
    margin-top: 4px !important;
  }
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.25rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 10px var(--accent-glow);
  text-decoration: none;
  cursor: pointer;
}

.topbar-level-badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.menu {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 10px;
}
.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Theme 4-way switcher */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px;
  gap: 4px;
  margin-right: 8px;
  box-shadow: 0 2px 5px var(--shadow-soft);
}

.theme-switch-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 14px;
  transition: all 0.25s ease;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-switch-btn:hover {
  opacity: 0.85;
}

.theme-switch-btn.active {
  opacity: 1;
  background: var(--card);
  box-shadow: 0 1px 4px var(--shadow-soft);
}

/* User chip & Login buttons */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
}

.user-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.logout-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  font-size: .85rem;
  transition: color 0.2s;
  font-family: inherit;
}

.logout-btn:hover {
  color: var(--primary);
}

#loginGroup {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-login-btn,
.nav-signup-btn {
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  font-family: inherit;
  transition: all .2s ease;
}

.nav-login-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.nav-login-btn:hover {
  background: var(--primary-soft);
}

.nav-signup-btn {
  background: var(--primary);
  color: #fff;
  border: none;
}

.nav-signup-btn:hover {
  background: var(--primary-hover);
}

/* Progress bar */
.progress-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 10px;
}

.progress-container {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px var(--shadow-soft);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--gradient-end));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
  font-weight: 500;
}

/* ==========================================================
   DRAWER
   ========================================================== */
#drawerOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#drawerOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#drawerMenu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: var(--card);
  z-index: 210;
  box-shadow: 10px 0 30px var(--shadow-color);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

#drawerMenu.open {
  left: 0;
}

.drawer-header {
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.drawer-close-btn:hover {
  color: var(--primary);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
  flex-grow: 1;
  overflow-y: auto;
}

.drawer-nav button,
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.drawer-nav button:hover,
.drawer-nav a:hover {
  background: var(--card-hover);
  color: var(--text);
}

.drawer-nav button.active,
.drawer-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.drawer-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
  width: 100%;
}

.hamburger-btn,
.menu-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
}

.hamburger-btn:hover,
.menu-toggle:hover {
  color: var(--primary);
  background: var(--primary-soft, rgba(239, 68, 68, 0.1));
}

.hamburger-btn svg,
.menu-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

.drawer-accordion-btn {
  justify-content: space-between !important;
}

.accordion-icon {
  transition: transform 0.3s ease;
  width: 18px;
  height: 18px;
}

.drawer-accordion-btn.open .accordion-icon {
  transform: rotate(180deg);
}

.drawer-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.drawer-accordion-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 12px;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-accordion-content a {
  font-size: 0.92rem !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
}

/* ==========================================================
   SETTINGS / ONBOARDING MODAL
   ========================================================== */
#settingsOverlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 50px var(--shadow-color);
  position: relative;
}

.settings-close-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: var(--card-hover) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  z-index: 10 !important;
}

.settings-close-btn:hover {
  background: var(--border) !important;
  color: var(--text) !important;
}

.settings-card h2 {
  color: var(--text);
  margin-bottom: 6px;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.settings-card p {
  color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.45;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lang-group-title {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.settings-form select {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  cursor: pointer;
}

.settings-form select:focus {
  border-color: var(--primary);
}

.settings-save-btn {
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.settings-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* Custom Flag Dropdown */
.flag-dropdown {
  position: relative;
  width: 100%;
}

.flag-dd-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.flag-dd-selected:hover {
  border-color: var(--primary-border);
}

.flag-dropdown.open .flag-dd-selected {
  border-color: var(--primary);
}

.flag-dropdown.open .dd-chevron {
  transform: rotate(180deg);
}

.dd-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.flag-dd-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px var(--shadow-color);
  z-index: 10;
  overflow: hidden;
}

.flag-dropdown.open .flag-dd-panel {
  display: block;
}

.flag-dd-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.flag-dd-option:hover {
  background: var(--card-hover);
}

.flag-dd-option.selected {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.flag-dd-option .opt-check {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--primary);
  opacity: 0;
}

.flag-dd-option.selected .opt-check {
  opacity: 1;
}

.flag-svg {
  width: 32px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  overflow: hidden;
  border-radius: 4px;
}

.flag-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ==========================================================
   LOGIN OVERLAY
   ========================================================== */
#loginOverlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px var(--shadow-color);
  position: relative;
  overflow: hidden;
}

.login-card .login-close-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: var(--card-hover) !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  padding: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  z-index: 10 !important;
}

.login-card .login-close-btn:hover {
  background: var(--border) !important;
  color: var(--text) !important;
}

.login-card h2 {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 1.4rem;
  font-weight: 700;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.login-card .google-login-btn {
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1.5px solid var(--border) !important;
  padding: 12px 20px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  width: 100% !important;
  font-family: inherit !important;
  box-shadow: 0 2px 8px var(--shadow-soft) !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.login-card .google-login-btn:hover {
  background: var(--card-hover) !important;
  border-color: var(--primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px var(--shadow-soft) !important;
}

.login-card .guest-login-btn,
.login-card #guestBtn {
  background: transparent !important;
  border: 1px dashed var(--border) !important;
  box-shadow: none !important;
  margin-top: 10px !important;
  color: var(--muted) !important;
  padding: 10px 18px !important;
  border-radius: 12px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  width: 100% !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.login-card .guest-login-btn:hover,
.login-card #guestBtn:hover {
  background: var(--card-hover) !important;
  border-color: var(--muted) !important;
  color: var(--text) !important;
}

/* ==========================================================
   TOAST NOTIFICATION
   ========================================================== */
#notif {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 400;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 500;
  box-shadow: 0 10px 30px var(--shadow-color);
  border-left: 4px solid var(--primary);
  display: none;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.hidden {
  display: none !important;
}

/* ==========================================================
   ROUTER VIEW CONTAINER
   ========================================================== */
#router-view {
  flex: 1;
  width: 100%;
}

/* ==========================================================
   COURSE PAGE LAYOUT & SIDEBAR
   ========================================================== */
.page {
  display: flex;
  gap: 24px;
  max-width: var(--max-width);
  margin: 24px auto;
  padding: 0 16px;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px var(--shadow-soft);
  padding: 20px;
  height: calc(100vh - 160px);
  overflow-y: auto;
  position: sticky;
  top: 110px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.sidebar-title {
  font-size: .85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
  font-weight: 700;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
  transition: all .2s ease;
  border: 1px solid transparent;
}

.toc-list li:hover {
  background: var(--card-hover);
  color: var(--text);
  transform: translateX(4px);
}

.toc-list li.active {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--text);
  font-weight: 600;
}

.toc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex: 0 0 10px;
  transition: all .3s ease;
}

.toc-dot.done {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.toc-list li.active .toc-dot {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.toc-list li.active .toc-dot.done {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

/* ==========================================================
   CONTENT AREA & PLACEHOLDERS
   ========================================================== */
.content {
  flex: 1;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 36px;
  box-shadow: 0 10px 30px var(--shadow-soft);
  min-height: 70vh;
}

.content h1 {
  font-size: 2.2rem;
  color: var(--text);
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.content h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 24px 0 16px;
  font-weight: 600;
}

.content h3 {
  color: var(--text);
  margin: 20px 0 10px;
  font-size: 1.2rem;
}

.content p {
  margin-bottom: 16px;
  color: var(--text);
  opacity: 0.9;
  font-size: 1.05rem;
}

.content ul {
  margin: 0 0 20px 24px;
  color: var(--text);
  opacity: 0.9;
}

.content li {
  margin-bottom: 8px;
}

.content strong {
  color: var(--text);
  font-weight: 700;
}

.content em {
  color: var(--muted);
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: var(--muted);
  text-align: center;
  gap: 16px;
}

.placeholder h2 {
  color: var(--text);
  font-weight: 700;
  font-size: 2rem;
}

.placeholder p {
  font-size: 1.1rem;
}

/* Lesson Footer */
.lesson-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.complete-btn {
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all .3s ease;
}

.complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.complete-btn[disabled] {
  background: #2ecc71;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
  cursor: default;
  transform: none;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card, #111111);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
  padding: 8px 20px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 24px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.back-btn:hover {
  background: var(--card-hover, #18181b);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff !important;
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* ==========================================================
   INTERACTIVE LESSON MODULES
   ========================================================== */

/* Letters Grid */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.letter-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
}

.letter-card:hover {
  transform: translateY(-2px) scale(1.01);
  background: var(--card-hover);
  border-color: var(--primary);
}

.vocab-row,
.clickable-tts-row {
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s;
}

.vocab-row:hover,
.clickable-tts-row:hover {
  transform: translateY(-2px) scale(1.01);
  background: var(--card-hover);
}

.clickable-tts-cell {
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border-radius: 4px;
}

.clickable-tts-cell:hover {
  background: var(--card-hover);
  color: var(--primary) !important;
}

.letter-card .char {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.letter-card.special .char {
  color: var(--primary);
  text-shadow: 0 0 10px var(--accent-glow);
}

.letter-card .desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Vowel Wrap */
.vowel-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.vowel-box {
  border-radius: 20px;
  padding: 26px;
  color: #fff;
  box-shadow: 0 8px 20px var(--shadow-soft);
}

.vowel-box.thick {
  background: linear-gradient(135deg, #f97316, #fb923c);
}

.vowel-box.thin {
  background: linear-gradient(135deg, #14b8a6, #2dd4bf);
}

.vowel-box h3 {
  margin-top: 0;
  font-size: 1.3rem;
  color: #fff;
}

.vowel-letters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.vowel-letters span {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 700;
}

/* Conjugation & General Tables */
.conj-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 4px 14px var(--shadow-soft);
}

.conj-table thead tr {
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #fff;
}

.conj-table th,
.conj-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.93rem;
  border-bottom: 1px solid var(--border);
}

.conj-table tbody tr:hover td {
  background: var(--card-hover);
}

.conj-table td.mono {
  font-family: 'Consolas', monospace;
  font-weight: 700;
  color: var(--primary);
}

.conj-table td.neg {
  color: #fca5a5;
  font-family: 'Consolas', monospace;
  font-weight: 700;
}

/* Vocabulary & Key Phrases (Desktop / Base) */
.vocab-section {
  margin: 32px 0 28px;
  width: 100%;
}

.vocab-header-banner {
  margin-bottom: 14px;
}

.vocab-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.vocab-header-icon {
  font-size: 1.3rem;
}

.vocab-header-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 4px;
}

.vocab-tts-icon {
  font-size: 0.95rem;
}

.vocab-table-wrapper {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow-soft);
  background: var(--bg);
  border: 1px solid var(--border);
}

.vocab-table-responsive {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.vocab-table-responsive thead tr {
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #ffffff;
}

.vocab-table-responsive th {
  padding: 13px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  border: none;
}

.vocab-table-responsive th:nth-child(1) { width: 22%; }
.vocab-table-responsive th:nth-child(2) { width: 16%; }
.vocab-table-responsive th:nth-child(3) { width: 24%; }
.vocab-table-responsive th:nth-child(4) { width: 38%; }

.vocab-table-responsive td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.vocab-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.vocab-row:hover td {
  background: var(--card-hover);
}

.vocab-tr-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocab-word {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
}

.vocab-audio-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.vocab-audio-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.vocab-pron-badge {
  display: inline-block;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
}

.vocab-id-label {
  display: none;
}

.vocab-id-text {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.vocab-note-pill {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.35;
}

.vocab-note-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
}

.vocab-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Dialogue Hub */
.dialogue-hub {
  margin-bottom: 24px;
}

.dialogue-cat {
  margin-bottom: 32px;
}

.dialogue-cat-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
}

.vocab-table tr {
  border-bottom: 1px solid var(--border);
}

.vocab-table tr:last-child {
  border-bottom: none;
}

.vocab-table td {
  padding: 14px 16px;
  font-size: 1rem;
}

.vocab-table td:nth-child(1) {
  font-weight: 700;
  color: var(--text);
  width: 35%;
}

.vocab-table td:nth-child(2) {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  width: 30%;
}

.vocab-table td:nth-child(3) {
  color: var(--text);
  width: 35%;
}

.dialogue-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 24px;
}

.dialogue-box h4 {
  margin: 0 0 20px;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialogue-line {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.dialogue-line:hover {
  transform: translateY(-2px) scale(1.01);
}

.dialogue-line .speaker {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.dialogue-line.alt .speaker {
  border-color: rgba(99, 102, 241, 0.4);
  color: #6366f1;
}

.dialogue-content {
  background: var(--card);
  padding: 12px 16px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  flex-grow: 1;
  transition: background 0.2s ease;
}

.dialogue-line:hover .dialogue-content {
  background: var(--card-hover);
}

.dialogue-line.alt .dialogue-content {
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}

.dialogue-target {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  display: block;
}

.dialogue-native {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Number Table */
.number-table-wrapper {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 28px;
}

.nt-title {
  color: var(--primary);
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.nt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.nt-col h3 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.nt-table {
  width: 100%;
  border-collapse: collapse;
}

.nt-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
}

.nt-table tr:last-child td {
  border-bottom: none;
}

.nt-num {
  font-weight: 700;
  color: var(--primary);
  width: 48px;
  font-size: 1.05rem;
}

.nt-tr {
  font-weight: 500;
}

.nt-formula {
  text-align: right;
}

.math-badge {
  display: inline-block;
  background: var(--card);
  color: var(--muted);
  font-family: 'Consolas', monospace;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Flashcards */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.flashcard {
  background: var(--bg);
  border-radius: 18px;
  padding: 26px 16px;
  text-align: center;
  box-shadow: 0 6px 16px var(--shadow-soft);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
}

.flashcard:hover {
  border-color: var(--primary);
  transform: rotate(-1deg) scale(1.04);
  box-shadow: 0 14px 28px var(--shadow-color);
}

.flashcard .tr-word {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.flashcard .id-word {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Important Words */
.important-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.important-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 6px 16px var(--shadow-soft);
  transition: transform 0.25s;
}

.important-card:hover {
  transform: translateY(-6px);
}

.important-card .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.important-card .tr {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.important-card .id {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.important-card.yes { border-bottom: 5px solid #22c55e; }
.important-card.no { border-bottom: 5px solid #ef4444; }
.important-card.ok { border-bottom: 5px solid #3b82f6; }
.important-card.understand { border-bottom: 5px solid #8b5cf6; }
.important-card.c1 { border-bottom: 5px solid #f97316; }
.important-card.c2 { border-bottom: 5px solid #ec4899; }
.important-card.c3 { border-bottom: 5px solid #14b8a6; }
.important-card.c4 { border-bottom: 5px solid #eab308; }

/* Drag & Drop Matching */
.matching-wrapper {
  margin-bottom: 28px;
  width: 100%;
  box-sizing: border-box;
}

.dnd-container,
.matching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.dnd-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.dnd-item,
.dnd-target,
.matching-card {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dnd-item {
  background: var(--bg);
  border: 2px solid var(--primary-border);
  color: var(--primary);
}

.dnd-item:hover {
  background: var(--card-hover);
}

.dnd-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-border), 0 4px 12px var(--primary-glow);
  background: var(--card-hover);
  transform: scale(1.02);
}

.dnd-target {
  background: var(--bg);
  border: 2px dashed var(--border);
  color: var(--text);
  cursor: default;
}

.dnd-target.drag-over {
  border-color: var(--primary);
  background: var(--card-hover);
}

.dnd-item.correct,
.dnd-target.correct {
  background: var(--bg);
  border-color: #22c55e;
  color: #86efac;
  cursor: default;
}

.dnd-item.incorrect,
.dnd-target.incorrect {
  background: var(--bg);
  border-color: #ef4444;
  color: #fca5a5;
}

/* Mobile Matching UX Fix */
@media (max-width: 768px) {
  .matching-wrapper {
    margin-bottom: 20px;
    width: 100%;
    overflow-x: hidden;
  }

  .dnd-container,
  .matching-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .dnd-col {
    gap: 8px;
    min-width: 0;
  }

  .dnd-item,
  .dnd-target,
  .matching-card {
    padding: 10px 6px !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    border-radius: 8px;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    box-sizing: border-box;
  }

  /* Mobile Vocabulary Card Transformation */
  .vocab-section {
    margin: 24px 0 20px;
    width: 100%;
    overflow-x: hidden;
  }

  .vocab-header-banner {
    margin-bottom: 12px;
  }

  .vocab-header-title {
    font-size: 1.15rem;
  }

  .vocab-header-subtitle {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 3px;
  }

  .vocab-table-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  .vocab-table-responsive {
    display: block !important;
    width: 100% !important;
    border: none !important;
    background: transparent !important;
  }

  .vocab-table-responsive thead {
    display: none !important; /* Hide rigid 4-column desktop header on mobile */
  }

  .vocab-table-responsive tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .vocab-table-responsive tr.vocab-row,
  .conj-table tr.vocab-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 2px 8px var(--shadow-soft) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease !important;
    -webkit-tap-highlight-color: transparent;
  }

  .vocab-table-responsive tr.vocab-row:active,
  .conj-table tr.vocab-row:active {
    transform: scale(0.985);
    border-color: var(--primary) !important;
    background: var(--card-hover) !important;
  }

  .vocab-table-responsive td,
  .conj-table tr.vocab-row td {
    padding: 0 !important;
    border: none !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  /* Card Row 1: Word + Speaker (left) and Pronunciation badge (right) */
  .vocab-cell-tr {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .vocab-tr-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .vocab-word {
    font-size: 1.06rem !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    letter-spacing: -0.01em;
    word-break: break-word;
  }

  .vocab-audio-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }

  .vocab-cell-pron {
    display: flex !important;
    align-items: center;
    margin-top: -2px;
  }

  .vocab-pron-badge {
    font-size: 0.8rem !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    background: rgba(148, 163, 184, 0.14) !important;
    max-width: 100%;
    word-break: break-word;
  }

  /* Card Row 2: Indonesian Meaning */
  .vocab-cell-id {
    margin-top: 1px;
  }

  .vocab-id-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
  }

  .vocab-id-label {
    display: inline-block !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--muted) !important;
    flex-shrink: 0;
  }

  .vocab-id-text {
    font-size: 0.94rem !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    line-height: 1.35;
    word-break: break-word;
  }

  /* Card Row 3: Culture Note Pill */
  .vocab-cell-note {
    margin-top: 3px;
  }

  .vocab-note-pill {
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    line-height: 1.38 !important;
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.22) !important;
  }

  .vocab-note-text {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  .vocab-empty {
    display: none !important;
  }

  /* General tables horizontal scroll safety */
  .conj-table:not(.vocab-table-responsive) {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Quiz Cards */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.quiz-card {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.quiz-card.solved {
  border-color: transparent;
  background: var(--card);
}

.quiz-card .quiz-question {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  font-size: 1rem;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.2s;
  color: var(--text);
  font-size: 0.95rem;
}

.quiz-option:hover {
  background: var(--card-hover);
  border-color: var(--primary-border);
}

.quiz-option.correct {
  background: var(--card);
  border-color: #22c55e;
  color: #86efac;
}

.quiz-option.incorrect {
  background: var(--card);
  border-color: #ef4444;
  color: #fca5a5;
}

.quiz-answer-key {
  display: none;
  margin-top: 12px;
  background: var(--card);
  border-left: 4px solid #22c55e;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: #86efac;
  line-height: 1.5;
}

.quiz-answer-key.show {
  display: block;
}

/* Info & Dialog Boxes */
.gst-info-box {
  background: var(--bg);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 16px 0 24px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.gst-dialog-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.gst-dialog-line {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.gst-dialog-line .gst-speaker {
  flex-shrink: 0;
  width: 76px;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 8px;
  text-align: center;
  color: #fff;
  background: var(--primary);
}

.gst-dialog-line.alt .gst-speaker {
  background: #14b8a6;
}

.gst-dialog-line .gst-dlg-content {
  flex: 1;
}

.gst-dialog-line .gst-tr-line {
  font-weight: 700;
  color: var(--text);
}

.gst-dialog-line .gst-id-line {
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Dashboard Section Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.section-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-border);
  background: var(--card-hover);
  box-shadow: 0 12px 32px var(--shadow-color);
}

.section-card:hover::before {
  opacity: 1;
}

.section-card .card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

[data-theme="deep-night"] .section-card .card-number,
[data-theme="deep-night"] .card-number,
[data-theme="classic-dark"] .section-card .card-number,
[data-theme="classic-dark"] .card-number {
  color: #050505 !important;
}

.section-card .card-badge {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.section-card .card-type {
  font-size: 0.8rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 4px;
}

.section-card .card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 1.2rem;
  color: var(--muted);
  transition: all 0.3s ease;
}

.section-card:hover .card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* ==========================================================
   GAMES & HUBS
   ========================================================== */
.hub-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  width: 100%;
}

.hub-header {
  text-align: center;
  margin-bottom: 48px;
}

.hub-header h1 {
  font-size: 2.8rem;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hub-header p {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px var(--shadow-color);
  background: var(--card-hover);
}

.game-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.game-card h3 {
  font-size: 1.45rem;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 700;
}

.game-card p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  margin-bottom: 24px;
  flex: 1;
}

.play-btn {
  background: linear-gradient(135deg, var(--primary), var(--gradient-end));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: all 0.3s ease;
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ==========================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================== */
@media (max-width: 980px) {
  .page {
    flex-direction: column !important;
    margin: 12px auto !important;
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    gap: 14px !important;
  }

  .sidebar {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    height: auto !important;
    max-height: 200px !important;
    position: static !important;
    margin-bottom: 12px !important;
    padding: 14px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 20px 14px !important;
    overflow-x: hidden !important;
  }

  .topbar-inner {
    padding: 10px 14px;
  }
}

@media (max-width: 768px) {
  .hub-header h1 {
    font-size: 1.8rem;
  }
  
  .vowel-wrap,
  .nt-grid {
    grid-template-columns: 1fr;
  }

  .top-right {
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-card,
  .login-card {
    padding: 24px 18px;
    max-width: 360px;
    border-radius: 16px;
  }

  .content h1 {
    font-size: 1.35rem !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  .content h2 {
    font-size: 1.15rem !important;
  }
  .back-btn {
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    margin-bottom: 14px !important;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .hamburger-btn {
    flex-shrink: 0 !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 5px !important;
  }
  .brand {
    font-size: 1.05rem !important;
    letter-spacing: -0.02em;
    flex-shrink: 0 !important;
  }
  .topbar-level-badge {
    display: none !important;
  }
  .coin-chip {
    display: none !important;
  }
  .nav-signup-btn {
    display: none !important;
  }
  .nav-login-btn {
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
  }
  .user-chip .logout-btn {
    display: none !important;
  }
  .user-chip {
    max-width: 85px !important;
    padding: 4px 8px !important;
    gap: 5px !important;
    font-size: 0.74rem !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border-radius: 9999px !important;
  }
  .user-chip #userLabel {
    max-width: 50px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
  }
  .progress-wrap {
    padding: 0 10px 4px !important;
  }
  .progress-label {
    font-size: 0.7rem !important;
  }
  .toc-list li {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    min-width: 0 !important;
  }
  .toc-list li span:last-child {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 360px) {
  .brand {
    font-size: 0.95rem !important;
  }
  .user-chip {
    max-width: 75px !important;
  }
  .user-chip #userLabel {
    max-width: 42px !important;
  }
}

/* ==========================================================
   PROVERBS MODULE — SPA
   ========================================================== */

.proverbs-page,
.memes-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.proverbs-hero,
.memes-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 26px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 20px 60px var(--shadow-soft);
}

.proverbs-hero::after,
.memes-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -120px;
  right: -70px;
  border-radius: 50%;
  background: var(--primary-soft);
  pointer-events: none;
}

.proverbs-hero-copy,
.memes-hero > div:first-child {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.proverbs-eyebrow,
.memes-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.proverbs-hero h1,
.memes-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.03em;
}

.proverbs-hero p,
.memes-hero p {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.7;
}

.proverbs-hero-mark,
.memes-hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border: 1px solid var(--primary-border);
  border-radius: 36px;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 12px 35px var(--shadow-soft);
}

.proverbs-hero-mark {
  grid-template-rows: auto auto auto;
  gap: 0;
}

.proverbs-hero-mark span {
  margin-top: -4px;
  font-size: 3.4rem;
  font-weight: 800;
  line-height: .65;
}

.proverbs-hero-mark strong {
  font-size: 2rem;
  line-height: 1;
}

.proverbs-hero-mark small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.memes-hero-mark {
  font-size: 3.1rem;
}

.proverbs-toolbar {
  position: sticky;
  top: 78px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 14px 35px var(--shadow-soft);
}

.proverbs-search {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--muted);
}

.proverbs-search > span {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 800;
}

.proverbs-search input {
  min-width: 0;
  flex: 1;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.proverbs-search input::placeholder {
  color: var(--muted);
}

.proverbs-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.proverbs-search kbd {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--muted);
  font: 600 .72rem/1 inherit;
}

.proverbs-result-count {
  min-width: 110px;
  padding: 0 12px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  text-align: right;
}

.proverbs-grid {
  columns: 2 360px;
  column-gap: 22px;
}

.proverb-card {
  position: relative;
  display: inline-flex;
  width: 100%;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 22px;
  padding: 26px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 12px 35px var(--shadow-soft);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.proverb-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  opacity: .92;
}

.proverb-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.proverb-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proverb-number,
.proverb-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.proverb-number {
  font-size: .76rem;
  letter-spacing: .03em;
}

.proverb-turkish {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.32rem, 2.2vw, 1.55rem);
  font-weight: 800;
  line-height: 1.36;
  letter-spacing: -.015em;
}

.proverb-literal,
.proverb-meaning {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.proverb-literal > span,
.proverb-meaning > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.proverb-literal p,
.proverb-meaning p,
.proverb-details p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.proverb-literal p {
  color: var(--muted);
  font-style: italic;
}

.proverb-meaning p {
  font-weight: 650;
}

.proverb-details {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.proverb-details summary {
  color: var(--primary);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 750;
  list-style-position: inside;
}

.proverb-details p {
  margin-top: 10px;
  color: var(--muted);
  font-size: .92rem;
}

.proverb-tags,
.meme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.proverb-tags span,
.meme-tags span {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
}

.proverbs-state,
.memes-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--muted);
  text-align: center;
}

.proverbs-state h2,
.memes-state h2 {
  margin-bottom: 6px;
  color: var(--text);
}

.proverbs-state p,
.memes-state p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.proverbs-empty {
  break-inside: avoid;
}

.proverbs-empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 800;
}

.proverbs-error {
  border-color: var(--primary-border);
}

.proverbs-error code,
.memes-error code {
  color: var(--primary);
}

@media (max-width: 900px) {
  .proverbs-page {
    width: min(100% - 24px, 760px);
    padding-top: 28px;
  }

  .proverbs-toolbar {
    top: 70px;
    grid-template-columns: 1fr;
  }

  .proverbs-result-count {
    padding: 0 8px 4px;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .proverbs-page {
    width: min(100% - 16px, 560px);
    padding-bottom: 48px;
  }

  .proverbs-hero {
    align-items: flex-start;
    padding: 24px;
    border-radius: 22px;
  }

  .proverbs-hero-mark {
    width: 82px;
    height: 82px;
    border-radius: 24px;
  }

  .proverbs-hero-mark span {
    font-size: 2.5rem;
  }

  .proverbs-hero-mark strong {
    font-size: 1.35rem;
  }

  .proverbs-hero-mark small {
    font-size: .6rem;
  }

  .proverbs-search {
    padding: 0 11px;
  }

  .proverbs-search kbd {
    display: none;
  }

  .proverb-card {
    padding: 21px;
    border-radius: 20px;
  }
}

/* ==========================================================
   TURKISH MEMES MODULE
   ========================================================== */

.memes-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 76px;
}

.memes-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  margin-bottom: 24px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--card);
}

.memes-hero::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -130px;
  right: -50px;
  border: 1px solid var(--border);
  border-radius: 50%;
  pointer-events: none;
}

.memes-hero::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: 80px;
  bottom: -110px;
  border: 1px solid var(--border);
  border-radius: 50%;
  pointer-events: none;
}

.memes-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.memes-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.memes-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.memes-hero p {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  line-height: 1.75;
}

.memes-hero-mark {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border: 1px solid var(--border);
  border-radius: 34px;
  background: var(--bg);
  color: var(--primary);
}

.memes-hero-mark span {
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .18em;
}

.memes-hero-mark strong {
  margin-top: 3px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.05em;
}

.memes-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
}

.memes-intro {
  min-width: 0;
}

.memes-section-label {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .12em;
}

.memes-intro h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.25;
}

.memes-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.memes-count {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--primary);
  font-size: .76rem;
  font-weight: 800;
  white-space: nowrap;
}

.memes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.meme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: var(--card);
  box-shadow: 0 10px 30px var(--border);
  transition:
    transform .28s ease,
    box-shadow .28s ease,
    border-color .28s ease;
}

.meme-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.meme-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 16px 34px var(--border);
}

.meme-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.meme-number,
.meme-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.meme-number {
  color: var(--primary);
  font-size: .76rem;
}

.meme-category {
  text-align: center;
}

.meme-quote {
  position: relative;
  margin-bottom: 18px;
  padding: 25px 25px 25px 42px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
}

.meme-quote-mark {
  position: absolute;
  top: 12px;
  left: 15px;
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
}

.meme-quote p {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.3rem, 2.4vw, 1.62rem);
  font-weight: 850;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.meme-title {
  margin: 0 0 19px;
  color: var(--text);
  font-size: 1.13rem;
  font-weight: 800;
  line-height: 1.35;
}

.meme-detail {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.meme-detail + .meme-detail {
  margin-top: 15px;
}

.meme-detail-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.meme-detail p {
  margin: 0;
  color: var(--text);
  font-size: .93rem;
  line-height: 1.7;
}

.meme-detail .meme-literal {
  color: var(--muted);
  font-style: italic;
}

.meme-context p {
  color: var(--muted);
}

.meme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.meme-tags span {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.memes-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--muted);
  text-align: center;
}

.memes-state-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 9px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 900;
}

.memes-state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.2rem;
}

.memes-state p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.memes-state code {
  color: var(--primary);
}

.memes-error {
  border-color: var(--primary);
}

@media (max-width: 900px) {
  .memes-page {
    width: min(100% - 24px, 760px);
    padding-top: 28px;
  }

  .memes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .memes-page {
    width: min(100% - 16px, 560px);
    padding-top: 20px;
    padding-bottom: 48px;
  }

  .memes-hero {
    align-items: flex-start;
    padding: 24px;
    border-radius: 22px;
  }

  .memes-hero-mark {
    width: 82px;
    height: 82px;
    border-radius: 23px;
  }

  .memes-hero-mark strong {
    font-size: 1.35rem;
  }

  .memes-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .memes-card,
  .meme-card {
    padding: 20px;
    border-radius: 20px;
  }

  .meme-quote {
    padding: 22px 20px 22px 37px;
  }

  .meme-quote-mark {
    left: 12px;
  }

  .meme-quote p {
    font-size: 1.25rem;
  }
}

/* ==========================================================
   FLASHCARD SPA — PREMIUM 3D FLIP UI
   ========================================================== */

.fc-page {
  width: min(100%, 1100px);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.fc-header {
  width: min(100%, 760px);
  margin-bottom: 26px;
}

.fc-eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fc-header h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.1;
  font-weight: 800;
}

.fc-header p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.94rem, 2vw, 1.05rem);
}

.fc-progress {
  width: min(100%, 760px);
  margin-bottom: 22px;
}

.fc-progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.fc-progress-label {
  font-weight: 600;
}

.fc-counter {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.fc-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.fc-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  box-shadow: 0 0 18px var(--primary);
  transition: width 320ms ease;
}

.fc-level-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}

.fc-level-chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fc-level-chip:hover {
  background: var(--card-hover, rgba(255, 255, 255, 0.08));
  border-color: var(--primary);
  transform: translateY(-1px);
}

.fc-level-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.fc-card-stage {
  width: min(100%, 760px);
  height: clamp(340px, 52vw, 470px);
  margin: 0 auto 26px;
  perspective: 1800px;
}

.fc-flashcard {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 30px;
  background: transparent;
  color: var(--text);
  box-shadow:
    0 24px 70px var(--bg),
    0 8px 28px var(--border);
  cursor: pointer;
  outline: none;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  will-change: transform;
  transition:
    transform 700ms cubic-bezier(0.2, 0.72, 0.2, 1),
    box-shadow 250ms ease;
  -webkit-tap-highlight-color: transparent;
}

.fc-flashcard:hover {
  box-shadow:
    0 28px 80px var(--bg),
    0 10px 34px var(--primary);
}

.fc-flashcard:hover .fc-face {
  border-color: var(--primary);
}

.fc-flashcard:focus-visible .fc-face {
  border-color: var(--primary);
  box-shadow:
    0 0 0 4px var(--border),
    0 0 34px var(--primary);
}

.fc-flashcard.is-flipped {
  transform: rotateY(180deg);
}

.fc-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(30px, 6vw, 64px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: border-color 250ms ease;
}

.fc-face::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--primary);
  box-shadow: 0 0 24px var(--primary);
}

.fc-face::after {
  content: "";
  position: absolute;
  inset: 14% 9%;
  border: 1px solid var(--border);
  border-radius: 50%;
  transform: scaleX(1.5);
  opacity: 0.38;
  pointer-events: none;
}

.fc-face-front {
  transform: rotateY(0deg);
}

.fc-face-back {
  transform: rotateY(180deg) translateZ(1px);
}

.fc-face-kicker {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.fc-image-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 80px;
  margin: 0 auto 16px;
  overflow: visible;
}

.fc-image-container img,
.fc-card-img {
  width: 76px;
  height: 76px;
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 0;
  filter: drop-shadow(0 4px 14px rgba(99, 102, 241, 0.35));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fc-image-container svg {
  width: 76px;
  height: 76px;
  max-width: 80px;
  max-height: 80px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(99, 102, 241, 0.35));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fc-flashcard:hover .fc-card-img,
.fc-flashcard:hover .fc-image-container svg {
  transform: scale(1.08);
}

.fc-word-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 100%;
}

.fc-word-audio-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fc-word-audio-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 6px 18px rgba(255, 51, 68, 0.35);
  border-color: var(--primary);
}

.fc-front-word {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: var(--primary);
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.fc-face-helper {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.88rem;
}

.fc-back-translation {
  position: relative;
  z-index: 1;
  max-width: 90%;
  margin-bottom: 28px;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3.7rem);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.fc-example-label {
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fc-example {
  position: relative;
  z-index: 1;
  max-width: 88%;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.22rem);
  line-height: 1.65;
  font-style: italic;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.fc-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 760px);
  gap: 12px;
}

.fc-control-btn,
.fc-speak-btn {
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.fc-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
}

.fc-control-btn:hover:not(:disabled),
.fc-speak-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px var(--border);
}

.fc-control-btn:focus-visible,
.fc-speak-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.fc-control-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--text);
  box-shadow: 0 8px 24px var(--border);
}

.fc-control-primary:hover:not(:disabled) {
  background: var(--card);
  color: var(--primary);
}

.fc-control-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.fc-secondary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: min(100%, 760px);
  margin-top: 16px;
}

.fc-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 15px;
  color: var(--muted);
}

.fc-key-hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.fc-empty-state {
  width: min(100%, 620px);
  padding: 48px 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 18px 60px var(--bg);
}

.fc-empty-icon {
  margin-bottom: 18px;
  font-size: 3rem;
}

/* ==========================================================
   COIN DISPLAY & HINT ECONOMY STYLES
   ========================================================== */
.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid rgba(234, 179, 8, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #facc15;
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.15);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.coin-chip:hover {
  transform: translateY(-1px);
  border-color: #facc15;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.3);
}

.fc-hint-container {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  position: relative;
}

.fc-hint-unlock-btn {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.15);
}

.fc-hint-unlock-btn:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: #facc15;
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.35);
}

.fc-hint-unlocked {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 6px 14px;
  color: #34d399;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
  max-width: 90%;
  animation: fadeIn 0.3s ease;
}

.fc-empty-state h1 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.8rem;
}

.fc-empty-state p {
  margin: 0;
  color: var(--muted);
}

.fc-empty-state code {
  color: var(--primary);
}

@media (max-width: 700px) {
  .fc-page {
    min-height: auto;
    padding-top: 28px;
  }

  .fc-card-stage {
    height: min(72vw, 390px);
    min-height: 330px;
  }

  .fc-face {
    padding: 28px 22px;
  }

  .fc-front-word {
    font-size: clamp(2.35rem, 12vw, 4.5rem);
  }

  .fc-back-translation {
    font-size: clamp(1.8rem, 8vw, 3rem);
  }

  .fc-controls {
    grid-template-columns: 1fr;
  }

  .fc-control-btn {
    min-height: 50px;
  }

  .fc-secondary-controls {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-flashcard,
  .fc-progress-fill,
  .fc-control-btn,
  .fc-speak-btn {
    transition: none;
  }
}


/* ==========================================================
   SPA GAMES — Shared Premium Theme
   All game surfaces consume the existing global theme tokens.
   ========================================================== */
.game-view { width: 100%; }
.game-container { width: min(100%, 980px); margin: 0 auto; padding: 42px 20px 64px; }
.game-header, .multiplayer-header { text-align: center; margin-bottom: 26px; }
.multiplayer-header { text-align:left; display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.game-kicker, .field-kicker { color: var(--primary); font-size:.74rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.game-header h1, .multiplayer-header h1 { margin:6px 0; font-size:clamp(2rem, 4vw, 3rem); letter-spacing:-.03em; }
.game-header p, .multiplayer-header p { color:var(--muted); max-width:680px; margin:0 auto; }
.multiplayer-header p { margin:0; }
.selectors-bar { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom:22px; }
.selectors-bar select, .controls select { min-height:46px; border:1px solid var(--border); border-radius:14px; background:var(--card); color:var(--text); padding:0 15px; font:inherit; outline:none; transition:.2s ease; }
.selectors-bar select:hover, .selectors-bar select:focus, .controls select:hover, .controls select:focus { border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.status-bar, .stats-bar { display:flex; align-items:center; justify-content:space-between; gap:14px; width:100%; padding:14px 16px; margin-bottom:22px; border:1px solid var(--border); border-radius:18px; background:linear-gradient(135deg, var(--card), var(--card-hover)); box-shadow:0 18px 50px var(--shadow-soft); }
.hangman-card { width:100%; padding:28px 20px 34px; border:1px solid var(--border); border-radius:26px; background:linear-gradient(160deg, var(--card), var(--bg)); box-shadow:0 24px 70px var(--shadow-soft); }
.hangman-figure { display:block; margin:0 auto 12px; color:var(--text); filter:drop-shadow(0 10px 24px var(--primary-glow)); }
.part { display:none; stroke:currentColor; stroke-width:4; }
.part.show { display:block; animation:fadeIn .35s ease-out; }
@keyframes fadeIn { from{opacity:0; transform:translateY(-5px)} to{opacity:1; transform:translateY(0)} }
.lives, .score, .score-board { color:var(--primary); font-weight:800; }
.clue { max-width:760px; margin:0 auto 24px; padding:14px 18px; border:1px solid var(--border); border-radius:14px; background:var(--bg); color:var(--muted); }
.word-display { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-bottom:24px; }
.letter-box { width:42px; min-height:52px; display:flex; align-items:center; justify-content:center; border-bottom:4px solid var(--primary); color:var(--text); font-size:1.9rem; font-weight:800; }
.letter-box.space { border-bottom:none; width:18px; }
.keyboard { display:grid; grid-template-columns:repeat(auto-fit,minmax(44px,1fr)); gap:8px; max-width:680px; margin:0 auto; }
.key { min-height:46px; border:1px solid var(--border); border-radius:12px; background:var(--card); color:var(--text); font:700 1rem inherit; cursor:pointer; transition:.2s ease; }
.key:hover:not(:disabled) { background:var(--card-hover); border-color:var(--primary); box-shadow:0 0 18px var(--primary-glow); transform:translateY(-2px); }
.key:disabled { opacity:.35; cursor:not-allowed; }
.key.correct, .key.wrong { border-color:var(--primary); color:var(--primary); }
.overlay, .modal-overlay { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; padding:20px; background:var(--bg); opacity:0; pointer-events:none; z-index:1000; transition:.25s ease; }
.overlay.show, .overlay.active, .modal-overlay.is-open { opacity:1; pointer-events:auto; }
.modal { width:min(100%,420px); padding:30px; border:1px solid var(--border); border-radius:24px; background:var(--card); box-shadow:0 30px 90px var(--shadow-color); }
.modal h2, .modal h3 { margin:7px 0 10px; }
.btn-play-again, .play-again-btn, .lobby-btn { border:1px solid transparent; border-radius:13px; min-height:46px; padding:10px 17px; background:var(--primary); color:#050505; font:700 .94rem inherit; cursor:pointer; transition:.2s ease; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn-play-again:hover, .play-again-btn:hover, .lobby-btn:hover { background:var(--primary-hover, #e4e4e7); color:#050505; transform:translateY(-2px); }
.lobby-btn.secondary { background:var(--bg); color:var(--muted); border-color:var(--border); }
.stacked-stat { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.stacked-stat.right { align-items:flex-end; }
.player-info { display:flex; align-items:center; gap:10px; font-weight:700; }
.player-info img, .avatar { width:42px; height:42px; border-radius:50%; background:var(--bg); border:1px solid var(--border); }
.player-info span:last-child { color:var(--primary); font-size:.78rem; }
.timer-display { font-variant-numeric:tabular-nums; font-size:1.45rem; font-weight:900; }
.mistake-counter { color:var(--primary); font-weight:700; }
.leaderboard-container, .card, .lobby-header, .room-list, .chat-box { border:1px solid var(--border); border-radius:20px; background:linear-gradient(145deg,var(--card),var(--bg)); box-shadow:0 18px 55px var(--shadow-soft); }
.leaderboard-container { padding:20px; margin-top:26px; }
.leaderboard-container h3 { margin-bottom:12px; }
.leaderboard-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 2px; border-bottom:1px solid var(--border); }
.leaderboard-item:last-child { border-bottom:0; }
.empty-inline, .empty-state { color:var(--muted); text-align:center; padding:24px; }
.loading-spinner { width:42px; height:42px; margin:18px auto 30px; border:3px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin 1s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.match-board { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:20px 0 26px; }
.column { display:flex; flex-direction:column; gap:12px; }
.word-btn { min-height:62px; padding:14px 18px; border:1px solid var(--border); border-radius:16px; background:var(--card); color:var(--text); font:600 1rem inherit; cursor:pointer; transition:.2s ease; }
.word-btn:hover { background:var(--card-hover); border-color:var(--primary); box-shadow:0 10px 25px var(--primary-glow); transform:translateY(-2px); }
.word-btn.selected { border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-soft), 0 10px 25px var(--primary-glow); }
.word-btn.correct { border-color:var(--primary); color:var(--primary); pointer-events:none; }
.word-btn.incorrect { border-color:var(--primary); animation:shake .4s; }
@keyframes shake {0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
.multiplayer-container { max-width:1040px; }
.lobby-panel { display:flex; flex-direction:column; gap:18px; }
.lobby-header { padding:20px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.lobby-header h2 { margin:0 0 4px; }
.lobby-header p, .muted-copy { margin:0; color:var(--muted); }
.lobby-actions { display:flex; gap:10px; flex-wrap:wrap; }
.room-list { padding:14px; min-height:220px; }
.room-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border-bottom:1px solid var(--border); border-radius:12px; transition:.2s ease; }
.room-item:hover { background:var(--card-hover); }
.room-item:last-child { border-bottom:0; }
.room-info h3 { margin:0 0 4px; }
.room-info p { margin:0; color:var(--muted); font-size:.9rem; }
.chat-box { overflow:hidden; display:flex; flex-direction:column; min-height:290px; }
.chat-messages { flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:9px; }
.chat-msg { padding:8px 10px; border-radius:12px; background:var(--bg); }
.chat-msg span { color:var(--primary); font-weight:800; }
.chat-input-area { display:flex; border-top:1px solid var(--border); }
.chat-input-area input { flex:1; min-height:50px; border:0; outline:0; background:transparent; color:var(--text); padding:0 15px; font:inherit; }
.chat-input-area button { border:0; border-left:1px solid var(--border); background:var(--primary); color:var(--text); padding:0 18px; font-weight:800; cursor:pointer; }
#battleArena { display:none; }
.status-panel { display:none; margin:22px 0; padding:24px; text-align:center; border:1px solid var(--border); border-radius:20px; background:var(--card); }
.scoreboards { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.score-card { padding:22px; border:1px solid var(--border); border-radius:22px; background:linear-gradient(145deg,var(--card),var(--bg)); text-align:center; box-shadow:0 18px 50px var(--shadow-soft); }
.score-card .score { font-size:3rem; color:var(--text); }
.avatar-wrapper { display:flex; justify-content:center; margin-bottom:10px; }
.elo-badge { display:inline-block; margin-left:6px; padding:3px 8px; border:1px solid var(--border); border-radius:999px; color:var(--muted); font-size:.72rem; vertical-align:middle; }
.powerups, .emotes-bar { display:flex; justify-content:center; gap:12px; margin:18px 0; }
.powerup-btn, .emote-btn { border:1px solid var(--border); background:var(--card); color:var(--text); cursor:pointer; transition:.2s ease; }
.powerup-btn { position:relative; width:54px; height:54px; border-radius:50%; font-size:1.4rem; }
.powerup-btn:hover:not(:disabled), .emote-btn:hover { background:var(--card-hover); border-color:var(--primary); box-shadow:0 0 22px var(--primary-glow); transform:translateY(-2px); }
.powerup-btn:disabled { opacity:.35; cursor:not-allowed; }
.powerup-btn .cost { position:absolute; bottom:-9px; right:-8px; padding:2px 6px; border-radius:999px; background:var(--primary); color:var(--text); font-size:.64rem; font-weight:800; }
.mana-bar-container { width:100%; height:10px; margin-top:12px; overflow:hidden; border-radius:999px; background:var(--border); }
.mana-bar { height:100%; width:0; background:var(--primary); transition:.3s; box-shadow:0 0 12px var(--primary-glow); }
.emote-btn { width:46px; height:46px; border-radius:14px; font-size:1.35rem; }
.flashcard { margin:14px auto 20px; padding:28px; width:min(100%,760px); min-height:160px; display:flex; align-items:center; justify-content:center; border:1px solid var(--border); border-radius:24px; background:linear-gradient(145deg,var(--card),var(--bg)); box-shadow:0 22px 60px var(--shadow-soft); }
.flashcard .word-display { margin:0; font-size:clamp(1.8rem,4vw,3rem); font-weight:900; }
.speaker-icon { color:var(--primary); cursor:pointer; margin-left:10px; }
.options-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; max-width:760px; margin:0 auto; }
.option-btn { min-height:56px; padding:12px 15px; border:1px solid var(--border); border-radius:15px; background:var(--card); color:var(--text); text-align:left; cursor:pointer; font:600 1rem inherit; transition:.2s ease; }
.option-btn:hover:not(:disabled) { background:var(--card-hover); border-color:var(--primary); box-shadow:0 0 18px var(--primary-glow); transform:translateY(-2px); }
.option-btn.correct, .option-btn.wrong { background:var(--card-hover); border-color:var(--primary); color:var(--text); }
.modal input, .input-group input { width:100%; min-height:50px; border:1px solid var(--border); border-radius:14px; background:var(--bg); color:var(--text); padding:0 14px; outline:none; font:inherit; transition:.2s ease; }
.modal input:focus, .input-group input:focus { border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-soft); }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; }
#waitingRoom, #game-phase, #score-phase { display:none; }
#waitingRoom.card, #game-phase.card, #score-phase.card { padding:22px; margin-top:18px; }
.players-grid { display:flex; justify-content:center; gap:15px; flex-wrap:wrap; margin:22px 0; }
.player-card { width:130px; padding:15px; border:1px solid var(--border); border-radius:16px; background:var(--bg); }
.player-card img { width:58px; height:58px; border-radius:50%; background:var(--card); }
.game-view-isimsehir .game-header { display:flex; align-items:center; justify-content:space-between; gap:16px; text-align:left; background:var(--bg); border:1px solid var(--border); border-radius:18px; padding:16px 18px; }
.field-kicker { color:var(--muted); font-size:.76rem; margin-bottom:4px; }
.letter-display { font-size:clamp(2.8rem,7vw,4.2rem); line-height:1; font-weight:900; color:var(--primary); text-align:center; }
.timer { font-size:2rem; font-weight:900; color:var(--primary); font-variant-numeric:tabular-nums; }
.timer.urgent { animation:pulse 1s infinite; }
@keyframes pulse {50%{opacity:.45}}
.inputs-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin:22px 0; }
.input-group { display:flex; flex-direction:column; gap:7px; }
.input-group label { color:var(--muted); font-size:.78rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.input-group input { min-height:56px; font-size:1.05rem; }
.input-group input.correct, .input-group input.incorrect, .input-group input.collision { background:var(--card-hover); border-color:var(--primary); }
.centered { display:flex; justify-content:center; }
.score-phase-title { text-align:center; margin-bottom:18px; }
.table-scroll { overflow:auto; }
.score-table { width:100%; border-collapse:collapse; }
.score-table th, .score-table td { padding:12px 10px; border-bottom:1px solid var(--border); text-align:left; white-space:nowrap; }
.score-table th { color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; background:var(--bg); }
.points-badge { display:inline-block; margin-top:4px; padding:2px 7px; border-radius:999px; background:var(--primary-soft); color:var(--primary); font-size:.7rem; font-weight:800; }
@media (max-width:720px) { .game-container{padding:28px 14px 50px;} .status-bar,.stats-bar,.lobby-header,.multiplayer-header{flex-direction:column; align-items:stretch;} .stacked-stat.right{align-items:flex-start;} .match-board,.scoreboards,.options-grid{grid-template-columns:1fr;} .game-view-isimsehir .game-header{flex-direction:column; align-items:stretch;} .keyboard{grid-template-columns:repeat(7,1fr);} }
@media (prefers-reduced-motion:reduce) { *{scroll-behavior:auto!important;} .key,.word-btn,.lobby-btn,.powerup-btn,.emote-btn,.option-btn{transition:none;} }

/* ==========================================================
   PREMIUM 404 / ROUTE NOT FOUND (CUSTOM SVG CAT ILLUSTRATION)
   ========================================================== */

.notfound {
  position: relative;
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg);
  overflow: hidden;
}

.notfound__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
  filter: blur(20px);
}

.notfound__card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 32px;
  max-width: 900px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--primary-border);
  border-radius: 28px;
  padding: 48px;
  box-shadow: 0 20px 60px var(--shadow-soft);
}

.notfound__illustration {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notfound__svg {
  width: 100%;
  max-width: 340px;
  height: auto;
}

/* Gentle floating animations */
.nf-sign {
  animation: nf-float 3.2s ease-in-out infinite;
  transform-origin: center;
}

.nf-question {
  animation: nf-bob 2.4s ease-in-out infinite;
  transform-origin: center;
}

.nf-compass {
  animation: nf-spin-wobble 5s ease-in-out infinite;
  transform-origin: 290px 250px;
}

.nf-cat {
  animation: nf-sway 4s ease-in-out infinite;
  transform-origin: 180px 275px;
}

@keyframes nf-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes nf-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}

@keyframes nf-spin-wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

@keyframes nf-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.2deg); }
}

.notfound__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notfound__eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}

.notfound__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.notfound__body {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.notfound__tip {
  font-size: 14px;
  color: var(--text);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 14px;
  padding: 14px 16px;
  line-height: 1.6;
}

.notfound__tip strong {
  color: var(--primary);
}

.notfound__tip-example {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: italic;
}

.notfound__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notfound__btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.notfound__btn:active {
  transform: scale(0.97);
}

.notfound__btn--primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 20px var(--primary-glow);
}

.notfound__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--primary-glow);
}

.notfound__btn--ghost {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--primary-border);
}

.notfound__btn--ghost:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Responsive: stack on smaller screens */
@media (max-width: 720px) {
  .notfound__card {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    text-align: center;
  }

  .notfound__eyebrow {
    margin: 0 auto;
  }

  .notfound__title {
    font-size: 22px;
  }

  .notfound__actions {
    justify-content: center;
  }

  .notfound__svg {
    max-width: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nf-sign,
  .nf-question,
  .nf-compass,
  .nf-cat {
    animation: none;
  }
}

/* ==========================================================
   MOBILE STICKY AD ANCHOR — 320×50 AdSense Banner
   Highest-earning mobile ad unit. Sits fixed at bottom of
   viewport, above the cookie consent (z-index 9000 < 9999).
   Shown only on mobile (≤768px). Respects iOS safe-area.
   ========================================================== */
#sticky-ad-anchor.mobile-sticky-ad {
  display: none !important;
}

@media (max-width: 768px) {
  #sticky-ad-anchor.mobile-sticky-ad {
    display: none !important;
  }
}

@keyframes slideUpAd {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Tap target compliance: ensure the ad area is at minimum 48×48px */
#sticky-ad-anchor.mobile-sticky-ad ins.adsbygoogle {
  min-height: 50px;
  min-width: 320px;
}

/* ========================================================
   LANGUAGE SELECTOR AUTO-DETECTION OVERRIDE
   ======================================================== */
#language-selector-container,
.lang-select-wrapper,
.fc-lang-container {
  display: none !important;
}

/* ========================================================
   DRAWER & FOOTER SOCIAL MEDIA LINKS
   ======================================================== */
.drawer-social-links,
.footer-social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
}

.drawer-social-links {
  border-top: 1px solid var(--border);
  width: 100%;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.social-icon-btn:hover {
  color: #fff;
  background: var(--primary-soft, rgba(239, 68, 68, 0.2));
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 51, 68, 0.25);
}

.social-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ========================================================
   SEO & ADSENSE EDITORIAL GUIDE STYLES
   ======================================================== */
.seo-editorial-wrapper {
  max-width: var(--max-width, 1140px);
  margin: 36px auto 60px;
  padding: 0 16px;
  box-sizing: border-box;
  width: 100%;
}
.seo-editorial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 12px 36px var(--shadow-soft);
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}
@media (max-width: 640px) {
  .seo-editorial-wrapper {
    padding: 0 12px !important;
    margin: 20px auto 40px !important;
  }
  .seo-editorial-card {
    padding: 20px 14px !important;
    border-radius: 14px !important;
  }
  .seo-author-badge {
    font-size: 0.68rem !important;
    padding: 4px 10px !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
  }
  .seo-article-title {
    font-size: 1.35rem !important;
    word-break: break-word !important;
  }
}
.seo-editorial-header {
  margin-bottom: 24px;
}
.seo-author-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 9999px;
  padding: 5px 14px;
  font-size: 0.76rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  margin-bottom: 16px;
  max-width: 100%;
  box-sizing: border-box;
}
.seo-author-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.seo-article-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  word-break: break-word;
}
.seo-article-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}
.seo-divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}
.seo-article-body {
  color: var(--text);
  line-height: 1.8;
  font-size: 0.98rem;
}
.seo-section {
  margin-bottom: 36px;
}
.seo-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.seo-section p {
  color: var(--text);
  opacity: 0.92;
  margin-bottom: 14px;
}
.seo-section ul, .seo-section ol {
  margin: 14px 0 18px 24px;
}
.seo-section li {
  margin-bottom: 8px;
}
.seo-table-container {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.seo-vocab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}
.seo-vocab-table th, .seo-vocab-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.seo-vocab-table th {
  background: var(--bg);
  color: var(--primary);
  font-weight: 600;
}
.seo-vocab-table tr:last-child td {
  border-bottom: none;
}
.seo-level-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 18px;
}
@media (max-width: 640px) {
  .seo-level-grid {
    grid-template-columns: 1fr;
  }
}
.seo-level-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.seo-level-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.seo-level-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}
.seo-article-footer {
  margin-top: 36px;
  padding: 20px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
}


