/* Moonveil Academy visual system — applied to every learning surface.
   Immersive game routes keep their purpose-built game interfaces. */

body.game-route-active .academy-seal {
  display: none;
}

body:not(.game-route-active) {
  --academy-night: #090919;
  --academy-night-2: #15112b;
  --academy-violet: #261447;
  --academy-violet-2: #3a205f;
  --academy-blue: #182c64;
  --academy-paper: #f3e8d2;
  --academy-paper-light: #fbf3e2;
  --academy-paper-deep: #dfcfaf;
  --academy-ink: #281e1b;
  --academy-copy: #65584d;
  --academy-muted: #695a4d;
  --academy-gold: #b8923e;
  --academy-gold-ink: #77551d;
  --academy-gold-light: #e0c675;
  --academy-gold-pale: #f3df9b;
  --academy-line: rgba(132, 99, 42, 0.42);
  --academy-line-soft: rgba(132, 99, 42, 0.2);
  --academy-shadow: 0 18px 42px rgba(37, 25, 23, 0.16);
  --platform-bg: var(--academy-paper);
  --platform-surface: var(--academy-paper-light);
  --platform-surface-soft: #eee2ca;
  --platform-ink: var(--academy-ink);
  --platform-copy: var(--academy-copy);
  --platform-muted: var(--academy-muted);
  --platform-line: var(--academy-line-soft);
  --platform-green: var(--academy-violet-2);
  --platform-green-dark: var(--academy-night-2);
  --platform-green-soft: #e8dcc9;
  --platform-gold: var(--academy-gold);
  --text: var(--academy-ink);
  --soft: var(--academy-copy);
  --muted: var(--academy-muted);
  --gold: var(--academy-gold);
  --red: #8f3d36;
  --green: #315d42;
  color: var(--academy-ink);
  background: var(--academy-night);
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

body:not(.game-route-active) ::selection {
  color: #fff8e5;
  background: var(--academy-violet-2);
}

body:not(.game-route-active) :focus-visible {
  outline: 3px solid var(--academy-violet-2);
  outline-offset: 3px;
}

body:not(.game-route-active) :is(.app-sidebar, .top-bar, .auth-screen) :focus-visible,
body:not(.game-route-active) .app-shell :is(
  .dashboard-hero,
  .language-course-hero,
  .course-hero-redesign,
  .grammar-library-hero,
  .lesson-hero,
  .class-detail-hero,
  .section-heading,
  .games-header
) :focus-visible {
  outline-color: var(--academy-gold-pale);
}

body:not(.game-route-active) :is(h1, h2, h3) {
  color: var(--academy-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

body:not(.game-route-active) :is(button, input, select, textarea) {
  font-family: inherit;
}

body:not(.game-route-active) .app-shell {
  min-height: 100vh;
  margin-left: 226px;
  background:
    radial-gradient(circle at 14% 7%, rgba(255, 250, 231, 0.78), transparent 28%),
    radial-gradient(circle at 86% 88%, rgba(161, 118, 57, 0.1), transparent 34%),
    repeating-linear-gradient(0deg, rgba(101, 75, 38, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(112deg, #eee0c5 0%, #f8efdd 52%, #e8d8b8 100%);
}

/* Global controls */
body:not(.game-route-active) :is(.primary-button, .ghost-button, .danger-button) {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 197, 0.16), 0 5px 13px rgba(32, 20, 44, 0.14);
}

body:not(.game-route-active) .primary-button {
  color: #fff7dd;
  background: linear-gradient(180deg, #321956, #1c0f36);
  border: 1px solid var(--academy-gold);
}

body:not(.game-route-active) .primary-button:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(180deg, #462573, #291246);
  border-color: var(--academy-gold-light);
  box-shadow: inset 0 0 0 1px rgba(255, 243, 182, 0.26), 0 7px 18px rgba(40, 20, 64, 0.22);
}

body:not(.game-route-active) :is(.ghost-button, .danger-button) {
  color: #332545;
  background: rgba(255, 249, 232, 0.64);
  border: 1px solid var(--academy-line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

body:not(.game-route-active) .ghost-button:hover:not(:disabled) {
  color: var(--academy-violet);
  background: #fff8e8;
  border-color: var(--academy-gold);
}

body:not(.game-route-active) .danger-button {
  color: #742e2b;
  background: #f5ded4;
  border-color: rgba(153, 62, 54, 0.42);
}

body:not(.game-route-active) .danger-button:hover:not(:disabled) {
  color: #fff8ef;
  background: #8f3d36;
  border-color: #6f2925;
}

body:not(.game-route-active) .text-button,
body:not(.game-route-active) .hero-text-button {
  color: var(--academy-violet-2);
  font-weight: 700;
}

body:not(.game-route-active) .reward-pill,
body:not(.game-route-active) .status-pill,
body:not(.game-route-active) .duration-pill,
body:not(.game-route-active) .practice-focus {
  color: #5c431a;
  background: linear-gradient(180deg, #f8e8b7, #ead198);
  border: 1px solid rgba(153, 111, 37, 0.36);
}

body:not(.game-route-active) .xp-bar {
  height: 8px;
  overflow: hidden;
  background: rgba(81, 56, 38, 0.14);
  border: 1px solid rgba(104, 76, 43, 0.12);
  border-radius: 999px;
}

body:not(.game-route-active) .xp-bar i {
  background: linear-gradient(90deg, #2e1b59, #254d8e 48%, #c29a42);
}

body:not(.game-route-active) :is(input, select, textarea) {
  color: var(--academy-ink);
  background: rgba(255, 251, 237, 0.86);
  border: 1px solid rgba(128, 94, 45, 0.35);
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(74, 46, 28, 0.08);
}

body:not(.game-route-active) :is(input, select, textarea):focus {
  border-color: var(--academy-gold);
  box-shadow: 0 0 0 3px rgba(184, 146, 62, 0.15);
}

body:not(.game-route-active) .eyebrow,
body:not(.game-route-active) :is(.eyebrow):not(.gold) {
  color: #5e4779;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

body:not(.game-route-active) .eyebrow.gold {
  color: var(--academy-gold-ink);
}

/* Academy shell */
body:not(.game-route-active) .app-sidebar {
  inset: 0 auto 0 0;
  width: 226px;
  gap: 8px;
  padding: 18px 12px 16px;
  overflow-y: auto;
  color: #f7eac6;
  background:
    radial-gradient(circle at 50% 12%, rgba(80, 52, 128, 0.32), transparent 28%),
    radial-gradient(circle at 18% 42%, rgba(227, 195, 107, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 64%, rgba(227, 195, 107, 0.07) 0 1px, transparent 2px),
    linear-gradient(rgba(9, 7, 22, 0.87), rgba(12, 8, 25, 0.94)),
    linear-gradient(160deg, #17102e, #090716 72%);
  border: 0;
  border-right: 2px solid #9e792d;
  border-radius: 0;
  box-shadow: inset -5px 0 0 rgba(228, 197, 111, 0.08), 12px 0 32px rgba(10, 7, 22, 0.24);
  backdrop-filter: none;
}

body:not(.game-route-active) .app-sidebar::after {
  position: fixed;
  z-index: 2;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 210px;
  border: 1px solid rgba(220, 185, 91, 0.32);
  pointer-events: none;
  content: "";
}

body:not(.game-route-active) .brand-block {
  position: relative;
  z-index: 3;
  min-height: 120px;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(218, 185, 96, 0.34);
}

body:not(.game-route-active) .brand-block img {
  width: 188px;
  max-height: 78px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.45));
}

body:not(.game-route-active) .brand-block small {
  color: #d6b85f;
  font-family: Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body:not(.game-route-active) .side-nav {
  position: relative;
  z-index: 3;
  gap: 2px;
}

body:not(.game-route-active) .nav-label {
  margin: 16px 12px 5px;
  color: rgba(235, 213, 154, 0.74);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
}

body:not(.game-route-active) .side-nav a {
  position: relative;
  min-height: 46px;
  grid-template-columns: 30px minmax(0, 1fr);
  padding: 0 12px;
  color: rgba(245, 234, 204, 0.78);
  border: 1px solid transparent;
  border-radius: 2px;
}

body:not(.game-route-active) .side-nav a::before {
  position: absolute;
  inset: 4px;
  border: 1px solid transparent;
  pointer-events: none;
  content: "";
}

body:not(.game-route-active) .side-nav a:hover,
body:not(.game-route-active) .side-nav a.active {
  color: #fff7dc;
  background: linear-gradient(90deg, rgba(59, 30, 93, 0.94), rgba(34, 20, 61, 0.8));
  border-color: #a98537;
  box-shadow: inset 3px 0 0 #dfc26a, 0 4px 14px rgba(0, 0, 0, 0.2);
}

body:not(.game-route-active) .side-nav a:hover::before,
body:not(.game-route-active) .side-nav a.active::before {
  border-color: rgba(231, 202, 120, 0.2);
}

body:not(.game-route-active) .side-nav a.active::after {
  position: absolute;
  right: -4px;
  width: 9px;
  height: 9px;
  margin: 0;
  background: #f3d87d;
  border: 2px solid #45266a;
  border-radius: 0;
  box-shadow: 0 0 12px rgba(242, 211, 120, 0.52);
  content: "";
  transform: rotate(45deg);
}

body:not(.game-route-active) .side-nav span {
  color: #d7b554;
  font-size: 1.08rem;
}

body:not(.game-route-active) .side-nav b {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  font-weight: 600;
}

body:not(.game-route-active) .academy-seal {
  position: relative;
  z-index: 3;
  min-height: 150px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0;
  margin: auto 10px 0;
  color: #e2c568;
  background:
    radial-gradient(circle, rgba(60, 34, 98, 0.82) 0 43%, transparent 44%),
    radial-gradient(circle, transparent 0 55%, rgba(201, 160, 63, 0.35) 56% 57%, transparent 58%),
    linear-gradient(rgba(9, 8, 23, 0.66), rgba(9, 8, 23, 0.78)),
    url("/assets/moonveil-academy-hero.png") 30% center / cover;
  border: 1px solid #8f6d29;
  border-radius: 50% 50% 12px 12px;
  box-shadow: inset 0 0 0 5px rgba(12, 8, 27, 0.8), inset 0 0 0 6px rgba(213, 176, 76, 0.28);
  text-align: center;
  text-transform: uppercase;
}

body:not(.game-route-active) .academy-seal > span {
  margin-bottom: 4px;
  font-size: 1.6rem;
  text-shadow: 0 0 16px #9175ff;
}

body:not(.game-route-active) .academy-seal small,
body:not(.game-route-active) .academy-seal strong {
  font-family: Georgia, serif;
  letter-spacing: 0.08em;
}

body:not(.game-route-active) .academy-seal small {
  font-size: 0.68rem;
}

body:not(.game-route-active) .academy-seal strong {
  font-size: 0.9rem;
}

body:not(.game-route-active) .top-bar {
  top: 0;
  width: 100%;
  min-height: 70px;
  margin: 0;
  padding: 10px max(30px, calc((100% - 1240px) / 2));
  color: #f4e7c2;
  background:
    radial-gradient(circle at 78% 0%, rgba(44, 37, 98, 0.36), transparent 34%),
    linear-gradient(90deg, #0c0b1b, #111124 62%, #0a0a17);
  border: 0;
  border-bottom: 1px solid #9b762d;
  border-radius: 0;
  box-shadow: 0 5px 18px rgba(15, 9, 22, 0.2);
  backdrop-filter: none;
}

body:not(.game-route-active) .top-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(239, 225, 190, 0.65);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
}

body:not(.game-route-active) .top-route-title {
  color: #f5e6bd;
  font-family: Georgia, serif;
  font-size: 1.12rem;
  font-weight: 600;
}

body:not(.game-route-active) .top-summary-user {
  color: rgba(247, 235, 204, 0.8);
}

body:not(.game-route-active) .top-summary-divider {
  background: rgba(214, 178, 85, 0.34);
}

body:not(.game-route-active) .top-summary-xp {
  color: #ecd27f;
  background: rgba(192, 148, 58, 0.1);
  border: 1px solid rgba(204, 165, 70, 0.25);
}

body:not(.game-route-active) .language-select select {
  min-height: 40px;
  color: #f3e5bd;
  background: #17132c;
  border: 1px solid rgba(207, 170, 75, 0.45);
  border-radius: 999px;
}

body:not(.game-route-active) .avatar-button {
  border: 1px solid #d3aa4f;
  box-shadow: 0 0 0 3px rgba(80, 53, 119, 0.6), 0 0 16px rgba(212, 174, 77, 0.18);
}

body:not(.game-route-active) .top-actions > .ghost-button {
  color: #ead8a7;
  background: transparent;
  border-color: rgba(206, 166, 66, 0.4);
}

body:not(.game-route-active) .page {
  width: min(1240px, calc(100% - 60px));
  padding: 28px 0 76px;
}

/* First visit */
body:not(.game-route-active) .onboarding-page {
  min-height: calc(100vh - 92px);
}

body:not(.game-route-active) .onboarding-card {
  position: relative;
  width: min(900px, 100%);
  padding: clamp(28px, 5vw, 54px);
  color: var(--academy-ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(89, 55, 121, 0.08), transparent 28%),
    repeating-linear-gradient(0deg, rgba(101, 75, 38, 0.014) 0 1px, transparent 1px 4px),
    linear-gradient(125deg, #fbf1dc, #ead8b8);
  border: 1px solid var(--academy-gold);
  border-radius: 5px;
  box-shadow: inset 0 0 0 4px rgba(255, 250, 232, 0.48), var(--academy-shadow);
}

body:not(.game-route-active) .onboarding-card::after {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(142, 103, 38, 0.2);
  border-radius: 2px;
  pointer-events: none;
  content: "";
}

body:not(.game-route-active) .onboarding-card > * {
  position: relative;
  z-index: 1;
}

body:not(.game-route-active) .onboarding-card h1 {
  max-width: 680px;
  margin: 10px 0 12px;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
}

body:not(.game-route-active) .language-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

body:not(.game-route-active) .language-choice {
  min-height: 200px;
  padding: 24px;
  color: var(--academy-ink);
  background: rgba(255, 249, 232, 0.74);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.36);
}

body:not(.game-route-active) .language-choice:hover {
  transform: translateY(-3px);
  background: #fff8e8;
  border-color: var(--academy-gold);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.44), 0 13px 24px rgba(47, 29, 47, 0.14);
}

body:not(.game-route-active) .language-choice > span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #ead9b9;
  border: 1px solid var(--academy-gold);
  border-radius: 50%;
  font-size: 1.9rem;
}

body:not(.game-route-active) .language-choice > strong {
  color: var(--academy-ink);
  font-family: Georgia, serif;
  font-size: 1.5rem;
}

body:not(.game-route-active) .language-choice > small {
  color: var(--academy-copy);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* Reusable parchment surfaces */
body:not(.game-route-active) .app-shell :is(
  .dashboard-card,
  .admin-grid .stat-card,
  .content-card,
  .module-card,
  .codex-card,
  .grammar-card,
  .grammar-detail,
  .lesson-card,
  .exercise-card,
  .profile-card-main,
  .path-card,
  .leaderboard-card,
  .management-panel,
  .class-card,
  .class-code-box,
  .detail-panel,
  .game-card,
  .language-path-card,
  .level-preview-card,
  .course-unit-row,
  .grammar-index,
  .grammar-workspace
) {
  color: var(--academy-ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.52), transparent 30%),
    repeating-linear-gradient(0deg, rgba(101, 75, 38, 0.014) 0 1px, transparent 1px 4px),
    linear-gradient(115deg, #f8eed9, #f2e4ca 62%, #ebdcc0);
  border: 1px solid var(--academy-line);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 232, 0.46), var(--academy-shadow);
}

body:not(.game-route-active) .app-shell :is(
  .dashboard-card,
  .profile-card-main,
  .path-card,
  .leaderboard-card,
  .management-panel,
  .class-card,
  .game-card,
  .language-path-card,
  .course-unit-row,
  .grammar-index,
  .grammar-workspace
) :is(h2, h3, strong) {
  color: var(--academy-ink);
}

body:not(.game-route-active) .app-shell :is(
  .dashboard-card,
  .profile-card-main,
  .path-card,
  .leaderboard-card,
  .management-panel,
  .class-card,
  .game-card,
  .language-path-card,
  .course-unit-row,
  .grammar-index,
  .grammar-workspace
) :is(p, li, small):not(.eyebrow) {
  color: var(--academy-copy);
}

body:not(.game-route-active) .app-shell :is(
  .admin-grid .stat-card,
  .content-card,
  .management-panel,
  .profile-card-main,
  .path-card,
  .leaderboard-card,
  .codex-card,
  .grammar-card,
  .grammar-detail,
  .lesson-card,
  .exercise-card,
  .game-card,
  .detail-panel,
  .class-card,
  .module-card
) :is(p, li, small):not(.eyebrow):not(.form-message):not(.reward-pill):not(.status-pill) {
  color: var(--academy-copy);
}

body:not(.game-route-active) .app-shell :is(
  .admin-grid .stat-card,
  .content-card,
  .management-panel,
  .profile-card-main,
  .path-card,
  .leaderboard-card,
  .codex-card,
  .grammar-card,
  .grammar-detail,
  .lesson-card,
  .exercise-card,
  .game-card,
  .detail-panel,
  .class-card,
  .module-card
) :is(h2, h3, strong) {
  color: var(--academy-ink);
}

body:not(.game-route-active) .app-shell :is(
  .management-panel,
  .profile-card-main,
  .grammar-detail,
  .lesson-card,
  .exercise-card,
  .detail-panel,
  .class-card
) :is(input, select, textarea),
body:not(.game-route-active) .app-shell .role-select {
  color: var(--academy-ink);
  background: rgba(255, 251, 237, 0.88);
  border-color: var(--academy-line);
  border-radius: 4px;
}

/* Illustrated headings and heroes */
body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
) {
  position: relative;
  overflow: hidden;
  color: #f8efd5;
  background:
    linear-gradient(90deg, rgba(7, 8, 27, 0.98) 0%, rgba(14, 15, 52, 0.9) 45%, rgba(24, 20, 71, 0.5) 75%, rgba(6, 8, 27, 0.42)),
    url("/assets/moonveil-academy-hero.png") center 42% / cover no-repeat;
  border: 1px solid #a98334;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(11, 8, 27, 0.74), inset 0 0 0 4px rgba(224, 192, 105, 0.24), 0 17px 34px rgba(28, 18, 45, 0.2);
}

body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
)::after {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(229, 199, 114, 0.25);
  border-radius: 2px;
  pointer-events: none;
  content: "";
}

body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
) > * {
  position: relative;
  z-index: 1;
}

body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
) :is(h1, h2, h3) {
  color: #fff8e6;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}

body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
) p:not(.eyebrow) {
  color: rgba(247, 235, 204, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.48);
}

body:not(.game-route-active) :is(
  .dashboard-hero,
  .language-course-hero,
  .codex-hero.course-hero,
  .grammar-hero,
  .lesson-hero,
  .section-heading,
  .games-header
) .eyebrow {
  color: #e2c56e;
}

body:not(.game-route-active) .section-heading,
body:not(.game-route-active):not(.grammar-clash-route-active) .section-heading,
body:not(.game-route-active) .games-header {
  max-width: none;
  min-height: 210px;
  display: grid;
  align-content: center;
  margin-bottom: 28px;
  padding: 34px 46px;
}

body:not(.game-route-active) .section-heading h1,
body:not(.game-route-active):not(.grammar-clash-route-active) .section-heading h1,
body:not(.game-route-active) .games-header h1 {
  max-width: 780px;
  margin: 8px 0 10px;
  font-size: clamp(2.3rem, 4vw, 3.6rem);
}

body:not(.game-route-active) .section-heading p:not(.eyebrow),
body:not(.game-route-active):not(.grammar-clash-route-active) .section-heading p:not(.eyebrow),
body:not(.game-route-active) .games-header p:not(.eyebrow) {
  max-width: 720px;
}

body:not(.game-route-active) .section-heading.compact {
  min-height: 0;
  display: block;
  margin: 0 0 20px;
  padding: 0;
  overflow: visible;
  color: var(--academy-ink);
  background: none;
  border: 0;
  box-shadow: none;
}

body:not(.game-route-active) .section-heading.compact::after {
  display: none;
}

body:not(.game-route-active) .section-heading.compact :is(h1, h2, h3) {
  color: var(--academy-ink);
  text-shadow: none;
}

body:not(.game-route-active) .section-heading.compact p:not(.eyebrow) {
  color: var(--academy-copy);
  text-shadow: none;
}

/* Dashboard */
body:not(.game-route-active) .dashboard-hero {
  min-height: 390px;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  padding: clamp(34px, 5vw, 62px);
}

body:not(.game-route-active) .dashboard-hero h1 {
  max-width: 690px;
  margin: 12px 0 14px;
  font-size: clamp(2.8rem, 5.2vw, 4.9rem);
  letter-spacing: -0.04em;
}

body:not(.game-route-active) .dashboard-hero #dashboard-welcome {
  color: #fff8e6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.2vw, 4.9rem);
  font-weight: 600;
  line-height: 1.04;
}

body:not(.game-route-active) .dashboard-intro-copy {
  color: rgba(247, 235, 204, 0.82);
}

body:not(.game-route-active) .dashboard-hero .primary-button,
body:not(.game-route-active) .course-hero-redesign .course-primary-light {
  color: #fff5d5;
  background: linear-gradient(180deg, #3c1e65, #21103e);
  border-color: #d1ab50;
}

body:not(.game-route-active) .hero-text-button {
  color: #e7d49d;
}

body:not(.game-route-active) .hero-language-card {
  color: #f8edd0;
  background: linear-gradient(145deg, rgba(16, 11, 36, 0.9), rgba(37, 20, 67, 0.86));
  border: 1px solid rgba(219, 183, 85, 0.58);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(228, 199, 117, 0.08), 0 18px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

body:not(.game-route-active) .hero-language-card :is(h2, p, .eyebrow, .course-progress-copy, .course-progress-copy strong) {
  color: #f4e8c7;
}

body:not(.game-route-active) .course-flag {
  color: #f7e8b9;
  background: rgba(231, 202, 119, 0.1);
  border: 1px solid rgba(218, 181, 86, 0.34);
  border-radius: 50%;
}

body:not(.game-route-active) .level-badge {
  color: #2c194c;
  background: linear-gradient(180deg, #f7e8bc, #dfc489);
  border: 1px solid rgba(133, 91, 28, 0.3);
  border-radius: 50%;
}

body:not(.game-route-active) .dashboard-grid {
  gap: 18px;
  margin-top: 22px;
}

body:not(.game-route-active) .learning-stats {
  gap: 0;
  background: var(--academy-line);
  border: 1px solid var(--academy-line);
  border-radius: 5px;
  box-shadow: var(--academy-shadow);
}

body:not(.game-route-active) .learning-stats article {
  position: relative;
  background: linear-gradient(135deg, #f9efd9, #ead9b9);
}

body:not(.game-route-active) .learning-stats article + article::before {
  position: absolute;
  inset: 17px auto 17px 0;
  width: 1px;
  background: rgba(133, 93, 39, 0.24);
  content: "";
}

body:not(.game-route-active) .learning-stats strong {
  color: #2b1b3f;
  font-family: Georgia, serif;
}

body:not(.game-route-active) .lesson-skill-row span,
body:not(.game-route-active) .unit-outcomes span,
body:not(.game-route-active) :is(.tag-list span, .skill-chip-row span, .class-meta-row span) {
  color: #4f3467;
  background: rgba(80, 51, 104, 0.08);
  border: 1px solid rgba(95, 61, 116, 0.16);
}

body:not(.game-route-active) .study-plan-list > li > span {
  color: #f5e5b7;
  background: var(--academy-violet);
  border: 1px solid var(--academy-gold);
}

body:not(.game-route-active) .daily-practice-card,
body:not(.game-route-active) #daily-card {
  background:
    linear-gradient(90deg, rgba(249, 239, 217, 0.98) 0%, rgba(246, 233, 207, 0.96) 55%, rgba(242, 226, 194, 0.66)),
    url("/assets/daily-grammar-quest-book-quill.png") right center / 52% auto no-repeat;
}

body:not(.game-route-active) .daily-practice-action,
body:not(.game-route-active) .level-overview-row > div,
body:not(.game-route-active) .skill-practice-grid > span {
  color: var(--academy-ink);
  background: rgba(255, 248, 228, 0.72);
  border: 1px solid var(--academy-line-soft);
  border-radius: 4px;
}

/* Course cards and overview */
body:not(.game-route-active) .language-path-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

body:not(.game-route-active) .language-path-card {
  min-height: 360px;
  padding: 28px;
}

body:not(.game-route-active) .language-path-card:hover {
  transform: translateY(-3px);
  border-color: var(--academy-gold);
  box-shadow: inset 0 0 0 3px rgba(255, 250, 232, 0.54), 0 19px 38px rgba(45, 27, 51, 0.18);
}

body:not(.game-route-active) .language-path-card .flag {
  background: rgba(57, 31, 88, 0.08);
  border: 1px solid rgba(112, 71, 129, 0.15);
  border-radius: 50%;
}

body:not(.game-route-active) .course-availability,
body:not(.game-route-active) .course-availability.full {
  color: #6b4a1b;
  background: #f0dfb2;
  border: 1px solid rgba(147, 103, 34, 0.22);
}

body:not(.game-route-active) .language-card-link {
  color: var(--academy-violet-2);
  border-color: var(--academy-line-soft);
}

body:not(.game-route-active) .language-course-hero {
  min-height: 390px;
}

body:not(.game-route-active) .language-progress-panel {
  color: #f5e8c5;
  background: rgba(17, 11, 39, 0.86);
  border: 1px solid rgba(216, 178, 82, 0.48);
  border-radius: 5px;
}

body:not(.game-route-active) .language-progress-panel :is(strong, small, p) {
  color: #f2e5c3;
}

body:not(.game-route-active) .course-proof-grid,
body:not(.game-route-active) .course-proof-strip {
  overflow: hidden;
  background: var(--academy-line);
  border: 1px solid var(--academy-line);
  border-radius: 5px;
  box-shadow: var(--academy-shadow);
}

body:not(.game-route-active) :is(.course-proof-grid, .course-proof-strip) article {
  background: linear-gradient(135deg, #f9efd9, #ead9b9);
}

body:not(.game-route-active) :is(.course-proof-grid, .course-proof-strip) strong {
  color: #301e4c;
  font-family: Georgia, serif;
}

body:not(.game-route-active) .level-preview-card li button {
  color: var(--academy-ink);
  background: rgba(255, 250, 234, 0.58);
  border-color: var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .course-feature-band {
  color: #f4e8c7;
  background:
    radial-gradient(circle at 88% 18%, rgba(55, 45, 113, 0.4), transparent 30%),
    linear-gradient(135deg, #0d0b20, #20143b);
  border: 1px solid var(--academy-gold);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(229, 199, 114, 0.08);
}

body:not(.game-route-active) .course-feature-grid article {
  border-color: rgba(224, 194, 108, 0.24);
}

body:not(.game-route-active) .course-feature-grid span {
  color: #e1bf5d;
}

/* Learning path */
body:not(.game-route-active) .course-hero-redesign,
body:not(.game-route-active):not(.grammar-clash-route-active) .course-hero-redesign {
  min-height: 330px;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 38px;
  padding: clamp(32px, 5vw, 54px);
}

body:not(.game-route-active) .course-hero h1,
body:not(.game-route-active):not(.grammar-clash-route-active) .course-hero h1 {
  max-width: 690px;
  margin: 9px 0 12px;
  color: #fff8e6;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

body:not(.game-route-active) .course-next-card {
  align-self: center;
  gap: 9px;
  padding: 24px;
  color: #f7eac8;
  background: linear-gradient(145deg, rgba(15, 10, 34, 0.9), rgba(44, 24, 74, 0.86));
  border: 1px solid rgba(218, 180, 84, 0.58);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(225, 194, 106, 0.08), 0 18px 38px rgba(0, 0, 0, 0.32);
}

body:not(.game-route-active) .course-next-card h2 + p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body:not(.game-route-active) .course-next-card :is(h2, p, span, strong, b) {
  color: #f4e8c7;
}

body:not(.game-route-active) .course-next-topline span,
body:not(.game-route-active) .course-next-topline b,
body:not(.game-route-active) .course-next-meta span {
  background: rgba(229, 199, 114, 0.09);
  border-color: rgba(229, 199, 114, 0.25);
}

body:not(.game-route-active) .course-method {
  background: linear-gradient(135deg, #151027, #271641);
  border: 1px solid var(--academy-gold);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(226, 196, 109, 0.07);
}

body:not(.game-route-active) .course-method :is(h2, strong) {
  color: #f5e9ca;
}

body:not(.game-route-active) .course-method :is(.eyebrow, small) {
  color: #d8c28b;
}

body:not(.game-route-active) .course-method li {
  background: rgba(255, 249, 226, 0.07);
  border: 1px solid rgba(224, 194, 108, 0.2);
}

body:not(.game-route-active) .course-method li > span {
  color: #e0be5d;
}

body:not(.game-route-active) .course-toolbar,
body:not(.game-route-active) .course-toolbar-redesign,
body:not(.game-route-active) .grammar-library-controls {
  background: rgba(246, 235, 211, 0.94);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  box-shadow: 0 9px 24px rgba(55, 38, 30, 0.11);
  backdrop-filter: blur(12px);
}

body:not(.game-route-active) .segmented button {
  color: #695b4f;
  background: rgba(255, 250, 236, 0.56);
  border-color: var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .segmented button.active {
  color: #f7e9c2;
  background: linear-gradient(180deg, #3b205f, #22143d);
  border-color: var(--academy-gold);
}

body:not(.game-route-active) .course-catalog-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}

body:not(.game-route-active) .course-guide {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 158px;
}

body:not(.game-route-active) .course-results {
  grid-column: 1;
  grid-row: 1;
}

body:not(.game-route-active) .cefr-guide-card,
body:not(.game-route-active) .independent-study-card {
  background: linear-gradient(145deg, #f8ecd3, #ead8b6);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 231, 0.45);
}

body:not(.game-route-active) .cefr-guide-card.active {
  border-color: var(--academy-gold);
  box-shadow: inset 4px 0 0 var(--academy-violet-2), inset 0 0 0 3px rgba(255, 250, 231, 0.45);
}

body:not(.game-route-active) .cefr-guide-card header > span {
  color: #2e1a4f;
  background: #ead6a6;
  border: 1px solid rgba(138, 96, 32, 0.3);
}

body:not(.game-route-active) .independent-study-card {
  color: #f5e7c1;
  background:
    radial-gradient(circle at 50% 24%, rgba(71, 52, 139, 0.48), transparent 26%),
    linear-gradient(145deg, #100d24, #281642);
  border-color: #9f7b30;
}

body:not(.game-route-active) .independent-study-card :is(span, li) {
  color: #ead7a3;
}

body:not(.game-route-active) .course-level-heading {
  border-color: var(--academy-line);
}

body:not(.game-route-active) .course-level-heading > strong {
  color: #6b4e20;
  background: #efddb0;
}

body:not(.game-route-active) .course-unit-row {
  overflow: hidden;
}

body:not(.game-route-active) .course-unit-row.expanded {
  border-color: var(--academy-gold);
  box-shadow: inset 0 0 0 3px rgba(255, 249, 229, 0.52), 0 17px 34px rgba(44, 27, 47, 0.16);
}

body:not(.game-route-active) .course-unit-row.completed {
  border-color: rgba(56, 94, 67, 0.5);
}

body:not(.game-route-active) .course-unit-toggle {
  color: var(--academy-ink);
  background: transparent;
}

body:not(.game-route-active) .course-unit-toggle:hover {
  background: rgba(255, 249, 229, 0.48);
}

body:not(.game-route-active) .course-unit-sequence {
  color: #3c2458;
  font-family: Georgia, serif;
}

body:not(.game-route-active) .course-unit-sequence i {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 6px;
  height: 6px;
  display: block;
  background: var(--academy-violet-2);
  border: 1px solid var(--academy-gold-light);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(58, 32, 95, 0.1);
}

body:not(.game-route-active) .course-unit-row.completed .course-unit-sequence i {
  background: #315d42;
}

body:not(.game-route-active) .course-unit-summary > small {
  color: var(--academy-gold-ink);
  font-size: 0.72rem;
}

body:not(.game-route-active) .course-unit-summary > strong {
  color: var(--academy-ink);
  font-family: Georgia, serif;
}

body:not(.game-route-active) .course-unit-summary > span,
body:not(.game-route-active) .course-unit-metrics small {
  color: var(--academy-copy);
}

body:not(.game-route-active) .course-unit-chevron {
  color: #f6e6b9;
  background: #24143f;
  border: 1px solid var(--academy-gold);
  box-shadow: 0 0 0 3px rgba(75, 49, 109, 0.12);
}

body:not(.game-route-active) .course-unit-progress {
  background: rgba(109, 77, 42, 0.12);
}

body:not(.game-route-active) .course-unit-progress i {
  background: linear-gradient(90deg, #3c205e, #244f8b, #b7903d);
}

body:not(.game-route-active) .course-unit-panel {
  background: rgba(255, 249, 232, 0.45);
  border-color: var(--academy-line-soft);
}

body:not(.game-route-active) :is(.unit-can-do, .unit-focus-grid article, .unit-lessons) {
  background: rgba(255, 250, 236, 0.66);
  border-color: var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .unit-can-do blockquote {
  color: #f8e9be;
  background: linear-gradient(135deg, #1a1133, #332052);
  border-color: #a17c2e;
}

body:not(.game-route-active) .course-unit-row .unit-can-do blockquote strong {
  color: #f8e9be;
}

body:not(.game-route-active) .course-unit-row .unit-can-do blockquote small {
  color: #dbc68f;
  font-size: 0.72rem;
}

body:not(.game-route-active) .unit-lesson-button {
  color: var(--academy-ink);
  background: rgba(247, 237, 216, 0.72);
  border-color: var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .unit-lesson-button:hover {
  background: #fff8e8;
  border-color: var(--academy-gold);
}

body:not(.game-route-active) .unit-lesson-index {
  color: #f3dfaa;
  background: #2a1749;
  border-color: #9f792f;
}

body:not(.game-route-active) .codex-page :is(
  .course-next-topline span,
  .course-next-topline b,
  .course-next-meta span,
  .course-proof-strip span,
  .course-method li > span,
  .course-method li small,
  .unit-progress-line small,
  .unit-lesson-button small,
  .unit-lesson-meta,
  .unit-lessons-heading > span
) {
  font-size: 0.72rem;
  line-height: 1.4;
}

/* Lesson workspace */
body:not(.game-route-active) .lesson-breadcrumb {
  color: var(--academy-copy);
  border-color: var(--academy-line);
}

body:not(.game-route-active) .lesson-breadcrumb button {
  color: var(--academy-violet-2);
}

body:not(.game-route-active) .lesson-hero,
body:not(.game-route-active):not(.grammar-clash-route-active) .lesson-hero {
  min-height: 310px;
  padding: clamp(32px, 5vw, 54px);
}

body:not(.game-route-active) .lesson-goal-card {
  color: #f5e9c9;
  background: rgba(18, 11, 38, 0.86);
  border: 1px solid rgba(216, 178, 82, 0.52);
  border-radius: 4px;
}

body:not(.game-route-active):not(.grammar-clash-route-active) .lesson-goal-card p,
body:not(.game-route-active) .lesson-goal-card > span {
  color: #f1dfad;
}

body:not(.game-route-active) .lesson-outline {
  background: linear-gradient(145deg, #151027, #271641);
  border: 1px solid var(--academy-gold);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(225, 194, 106, 0.07);
}

body:not(.game-route-active) .lesson-outline :is(.eyebrow, a, span, strong) {
  color: #ead8a7;
}

body:not(.game-route-active) .lesson-outline a:hover {
  color: #fff2c9;
  background: rgba(224, 194, 108, 0.09);
}

body:not(.game-route-active) .lesson-outline a {
  min-height: 44px;
  font-size: 0.82rem;
}

body:not(.game-route-active) .lesson-outline a span {
  color: #dbc68f;
  font-size: 0.72rem;
}

body:not(.game-route-active) .lesson-outline-score {
  background: rgba(255, 249, 226, 0.07);
  border: 1px solid rgba(224, 194, 108, 0.16);
}

body:not(.game-route-active) .lesson-outline .lesson-outline-score :is(small, span) {
  color: #d8c593;
  font-size: 0.72rem;
}

body:not(.game-route-active) .lesson-outline .lesson-outline-score strong {
  color: #fff1c9;
}

body:not(.game-route-active) .lesson-section {
  background: linear-gradient(125deg, #f8eed8, #edddc0);
  border: 1px solid var(--academy-line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 232, 0.46), 0 12px 28px rgba(55, 36, 31, 0.1);
}

body:not(.game-route-active) .lesson-section-heading > span {
  color: #efdba4;
  background: #2b174b;
  border: 1px solid #a17c2e;
}

body:not(.game-route-active) .lesson-explanation-panel,
body:not(.game-route-active) .lesson-source-panel,
body:not(.game-route-active) .independent-task-grid > article,
body:not(.game-route-active) .lesson-conjugation-panel,
body:not(.game-route-active) .static-practice-item,
body:not(.game-route-active) .practice-completion-panel {
  color: var(--academy-ink);
  background: rgba(255, 250, 236, 0.72);
  border: 1px solid var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .lesson-source-panel blockquote {
  color: #2d2137;
  background: #fff8e8;
  border-color: var(--academy-line-soft);
  border-left-color: var(--academy-violet-2);
}

body:not(.game-route-active) .lesson-source-strategy b {
  color: var(--academy-violet-2);
}

body:not(.game-route-active) .tag-list span,
body:not(.game-route-active):not(.grammar-clash-route-active) .tag-list span {
  color: #4e3565;
  background: rgba(70, 43, 97, 0.07);
  border-color: rgba(91, 57, 112, 0.18);
}

body:not(.game-route-active) .model-sentence-list button,
body:not(.game-route-active) .word-chip {
  color: var(--academy-ink);
  background: rgba(255, 249, 232, 0.76);
  border-color: var(--academy-line-soft);
  border-radius: 3px;
}

body:not(.game-route-active) .model-sentence-list button:hover,
body:not(.game-route-active) .word-chip:hover {
  border-color: var(--academy-gold);
}

body:not(.game-route-active) .lesson-page .model-sentence-list :is(span, small) {
  color: var(--academy-muted);
  font-size: 0.72rem;
}

body:not(.game-route-active) .lesson-page .independent-task-grid > article > span {
  color: var(--academy-gold-ink);
  font-size: 0.72rem;
}

body:not(.game-route-active) .lesson-score-status,
body:not(.game-route-active) .grammar-complete-panel {
  color: #4f3a19;
  background: #f1dfb2;
  border-color: rgba(151, 108, 37, 0.35);
}

/* Games hub and secondary platform pages */
body:not(.game-route-active) #page-games .games-header {
  min-height: 320px;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 42px;
  padding: clamp(34px, 5vw, 56px);
  background:
    radial-gradient(circle at 78% 38%, rgba(126, 94, 214, 0.3), transparent 25%),
    linear-gradient(90deg, rgba(6, 7, 24, 0.98), rgba(21, 17, 60, 0.88) 54%, rgba(21, 20, 66, 0.5)),
    url("/assets/moonveil-academy-hero.png") center 42% / cover no-repeat;
}

body:not(.game-route-active) #page-games .games-header-copy h1 {
  max-width: 680px;
  margin: 8px 0 12px;
  font-size: clamp(2.6rem, 5vw, 4.25rem);
}

body:not(.game-route-active) #page-games .games-header-copy > p:not(.eyebrow) {
  max-width: 690px;
  font-size: 1rem;
  line-height: 1.65;
}

body:not(.game-route-active) #page-games .games-header-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

body:not(.game-route-active) #page-games .games-header-features span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: #e8d9ad;
  background: rgba(12, 9, 34, 0.58);
  border: 1px solid rgba(221, 187, 94, 0.34);
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
}

body:not(.game-route-active) #page-games .games-header-features strong {
  color: #fff1c4;
}

body:not(.game-route-active) #page-games .games-header-emblem {
  position: relative;
  width: 218px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: end;
  gap: 8px;
  color: #f4e6bd;
  background:
    radial-gradient(circle, rgba(94, 69, 171, 0.62), rgba(20, 12, 48, 0.92) 68%),
    #17102e;
  border: 1px solid #b48b35;
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px rgba(226, 194, 105, 0.08), 0 0 0 1px rgba(12, 9, 31, 0.8), 0 22px 50px rgba(0, 0, 0, 0.32);
  text-align: center;
}

body:not(.game-route-active) #page-games .games-header-emblem::before,
body:not(.game-route-active) #page-games .games-header-emblem::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 238px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c59c42, transparent);
  transform: translate(-50%, -50%);
  content: "";
}

body:not(.game-route-active) #page-games .games-header-emblem::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

body:not(.game-route-active) #page-games .games-header-emblem > * {
  position: relative;
  z-index: 1;
}

body:not(.game-route-active) #page-games .games-header-emblem > span {
  color: #e4c667;
  font-size: 2rem;
  text-shadow: 0 0 20px rgba(160, 118, 255, 0.85);
}

body:not(.game-route-active) #page-games .games-header-emblem strong {
  color: #fff0c5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.15;
}

body:not(.game-route-active) #page-games .games-header-emblem small {
  color: #d8c48d;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:not(.game-route-active) #page-games .games-catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 8px 0 20px;
  padding: 0 4px 16px;
  border-bottom: 1px solid var(--academy-line);
}

body:not(.game-route-active) #page-games .games-catalog-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

body:not(.game-route-active) #page-games .games-catalog-heading > p {
  max-width: 450px;
  margin: 0;
  color: var(--academy-copy);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: right;
}

body:not(.game-route-active) #page-games .game-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 22px;
}

body:not(.game-route-active) #page-games .game-card {
  min-height: 454px;
  grid-template-rows: 214px minmax(0, 1fr);
  overflow: hidden;
  color: var(--academy-ink);
  background:
    repeating-linear-gradient(0deg, rgba(100, 73, 35, 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #f8ecd5, #ead8b8);
  border: 1px solid rgba(131, 94, 34, 0.5);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px rgba(255, 249, 231, 0.48), 0 16px 35px rgba(43, 27, 45, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body:not(.game-route-active) #page-games .game-card:not(.game-card--locked):hover {
  transform: translateY(-4px);
  border-color: #9f782b;
  box-shadow: inset 0 0 0 3px rgba(255, 249, 231, 0.54), 0 22px 46px rgba(41, 24, 48, 0.22);
}

body:not(.game-route-active) #page-games .game-card--featured {
  min-height: 454px;
  grid-column: span 2;
  grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.78fr);
  grid-template-rows: 1fr;
  border-color: #a98232;
}

body:not(.game-route-active) #page-games .game-art {
  position: relative;
  min-height: 214px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #111026;
  border-bottom: 1px solid var(--academy-gold);
}

body:not(.game-route-active) #page-games .game-cover-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.015);
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 240ms ease;
}

body:not(.game-route-active) #page-games .game-card:not(.game-card--locked):hover .game-cover-image {
  transform: scale(1.055);
}

body:not(.game-route-active) #page-games .game-card--featured .game-art {
  min-height: 100%;
  border-right: 1px solid var(--academy-gold);
  border-bottom: 0;
}

body:not(.game-route-active) #page-games .game-art::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 8, 29, 0.03) 20%, rgba(8, 7, 28, 0.2) 54%, rgba(8, 7, 28, 0.92));
  content: "";
}

body:not(.game-route-active) #page-games .game-art-kicker {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #fff0c4;
  background: rgba(12, 9, 32, 0.8);
  border: 1px solid rgba(221, 184, 83, 0.52);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(9px);
}

body:not(.game-route-active) #page-games .game-cover-lockup {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  z-index: 2;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 0;
  text-align: left;
}

body:not(.game-route-active) #page-games .game-cover-lockup small {
  color: #f2ce76;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

body:not(.game-route-active) #page-games .game-cover-lockup strong {
  max-width: 260px;
  color: #fff0ca;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2vw, 1.72rem);
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.92);
}

body:not(.game-route-active) #page-games .game-cover-logo {
  width: min(78%, 270px);
  max-height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.72));
}

body:not(.game-route-active) #page-games .game-cover-logo--grammar {
  width: min(90%, 310px);
}

body:not(.game-route-active) #page-games .game-cover-monogram,
body:not(.game-route-active) #page-games .game-voca-mark {
  width: 66px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #f4d87f;
  background: rgba(16, 10, 42, 0.86);
  border: 1px solid #b78b32;
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(225, 193, 102, 0.08), 0 8px 24px rgba(0, 0, 0, 0.36);
  font-family: Georgia, serif;
  font-size: 1.16rem;
}

body:not(.game-route-active) #page-games .game-voca-mark {
  width: 84px;
  color: #cdeaff;
  border-color: #74b9d1;
  font-size: 2rem;
  text-shadow: 0 0 18px #59c8ec;
}

body:not(.game-route-active) #page-games .game-art-shine {
  position: absolute;
  right: -20%;
  bottom: -65%;
  width: 75%;
  aspect-ratio: 1;
  z-index: 1;
  background: radial-gradient(circle, rgba(120, 92, 255, 0.27), transparent 66%);
  pointer-events: none;
}

body:not(.game-route-active) #page-games .game-card--locked .game-art::before {
  background: linear-gradient(180deg, rgba(14, 13, 26, 0.18), rgba(13, 10, 26, 0.88));
}

body:not(.game-route-active) #page-games .game-card--locked .game-art {
  filter: saturate(0.8);
}

body:not(.game-route-active) #page-games .game-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 13px;
  padding: 20px;
  background: transparent;
}

body:not(.game-route-active) #page-games .game-card--featured .game-body {
  justify-content: center;
  padding: 28px;
}

body:not(.game-route-active) #page-games .game-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body:not(.game-route-active) #page-games .reward-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: #725a35;
  background: rgba(129, 100, 58, 0.1);
  border: 1px solid rgba(117, 88, 43, 0.24);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body:not(.game-route-active) #page-games .reward-pill.is-playable {
  color: #28563b;
  background: rgba(49, 93, 66, 0.1);
  border-color: rgba(49, 93, 66, 0.32);
}

body:not(.game-route-active) #page-games .game-level {
  color: var(--academy-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

body:not(.game-route-active) #page-games .game-card-copy {
  display: grid;
  gap: 6px;
}

body:not(.game-route-active) #page-games .game-card-category {
  margin: 0;
  color: var(--academy-gold-ink);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:not(.game-route-active) #page-games .game-card h2 {
  margin: 0;
  color: var(--academy-ink);
  font-size: 1.42rem;
  line-height: 1.12;
}

body:not(.game-route-active) #page-games .game-card--featured h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

body:not(.game-route-active) #page-games .game-card-copy > p:last-child {
  margin: 0;
  color: var(--academy-copy);
  font-size: 0.82rem;
  line-height: 1.55;
}

body:not(.game-route-active) #page-games .game-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-top: 11px;
  border-top: 1px solid var(--academy-line-soft);
}

body:not(.game-route-active) #page-games .game-card-facts span {
  color: var(--academy-muted);
  font-size: 0.72rem;
}

body:not(.game-route-active) #page-games .game-card-facts b {
  color: #4d365e;
}

body:not(.game-route-active) #page-games .game-card-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

body:not(.game-route-active) #page-games .tag-list span {
  min-height: 28px;
  padding: 0 9px;
  color: #4d365e;
  background: rgba(69, 43, 96, 0.07);
  border: 1px solid rgba(86, 55, 111, 0.18);
  font-size: 0.71rem;
}

body:not(.game-route-active) #page-games .game-card-footer button {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
}

body:not(.game-route-active) #page-games .game-card-footer button > span {
  color: inherit;
  font-size: 1rem;
}

body:not(.game-route-active) #page-games .game-card-footer button:disabled {
  color: #766b5f;
  background: rgba(104, 91, 76, 0.08);
  border-color: rgba(104, 91, 76, 0.22);
  opacity: 1;
}

@media (max-width: 1120px) {
  body:not(.game-route-active) #page-games .game-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body:not(.game-route-active) #page-games .games-header {
    grid-template-columns: 1fr;
  }

  body:not(.game-route-active) #page-games .games-header-emblem {
    display: none;
  }

  body:not(.game-route-active) #page-games .game-card--featured {
    grid-template-columns: 1fr;
    grid-template-rows: 250px minmax(0, 1fr);
  }

  body:not(.game-route-active) #page-games .game-card--featured .game-art {
    min-height: 250px;
    border-right: 0;
    border-bottom: 1px solid var(--academy-gold);
  }
}

@media (max-width: 700px) {
  body:not(.game-route-active) #page-games .games-header {
    min-height: 0;
    gap: 24px;
    padding: 30px 24px;
  }

  body:not(.game-route-active) #page-games .games-header-copy h1 {
    font-size: clamp(2.35rem, 12vw, 3.2rem);
  }

  body:not(.game-route-active) #page-games .games-header-features {
    align-items: flex-start;
    flex-direction: column;
  }

  body:not(.game-route-active) #page-games .games-catalog-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  body:not(.game-route-active) #page-games .games-catalog-heading > p {
    text-align: left;
  }

  body:not(.game-route-active) #page-games .game-card-grid {
    grid-template-columns: 1fr;
  }

  body:not(.game-route-active) #page-games .game-card--featured {
    grid-column: span 1;
  }
}

@media (max-width: 520px) {
  body:not(.game-route-active) #page-games .game-card,
  body:not(.game-route-active) #page-games .game-card--featured {
    grid-template-rows: 210px minmax(0, 1fr);
  }

  body:not(.game-route-active) #page-games .game-card--featured .game-art {
    min-height: 210px;
  }

  body:not(.game-route-active) #page-games .game-body,
  body:not(.game-route-active) #page-games .game-card--featured .game-body {
    padding: 18px;
  }
}

body:not(.game-route-active) .class-detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  padding: clamp(28px, 5vw, 46px);
  color: #f8efd5;
  background:
    linear-gradient(90deg, rgba(7, 8, 27, 0.97), rgba(23, 16, 55, 0.78) 58%, rgba(11, 11, 35, 0.48)),
    url("/assets/moonveil-academy-hero.png") center 44% / cover no-repeat;
  border: 1px solid var(--academy-gold);
  border-radius: 5px;
  box-shadow: inset 0 0 0 4px rgba(226, 194, 104, 0.08), var(--academy-shadow);
}

body:not(.game-route-active) .class-detail-hero::after {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(229, 199, 114, 0.24);
  pointer-events: none;
  content: "";
}

body:not(.game-route-active) .class-detail-hero > * {
  position: relative;
  z-index: 1;
}

body:not(.game-route-active) .class-detail-hero :is(h1, p, small, strong, span) {
  color: #f7e8c1;
}

body:not(.game-route-active) .class-detail-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

body:not(.game-route-active) .class-detail-hero .class-code-box {
  color: #f5e7c0;
  background: rgba(13, 9, 30, 0.78);
  border-color: rgba(220, 183, 86, 0.55);
}

body:not(.game-route-active) .profile-avatar,
body:not(.game-route-active) .profile-avatar-choice > span {
  border-color: var(--academy-gold);
  box-shadow: 0 0 0 3px rgba(70, 42, 96, 0.11);
}

body:not(.game-route-active) .profile-avatar-choice {
  color: var(--academy-ink);
  background: linear-gradient(145deg, #f8ecd4, #ead7b5);
  border-color: var(--academy-line);
  border-radius: 4px;
}

body:not(.game-route-active) .profile-avatar-choice:hover,
body:not(.game-route-active) .profile-avatar-choice.selected {
  color: var(--academy-violet);
  background: #fff7e6;
  border-color: var(--academy-gold);
  box-shadow: inset 0 -4px 0 var(--academy-violet-2), 0 8px 18px rgba(46, 28, 48, 0.14);
}

body:not(.game-route-active) .profile-avatar-choice b {
  color: inherit;
}

body:not(.game-route-active) :is(.path-stats div, .activity-row, .leaderboard-row, .data-table tr) {
  color: var(--academy-ink);
  background: rgba(255, 249, 232, 0.62);
  border-color: var(--academy-line-soft);
}

body:not(.game-route-active) .data-table th {
  color: #4d365e;
  background: #ead9b9;
}

body:not(.game-route-active) .dashboard-card .daily-answer-field span {
  color: #4d3464;
  font-size: 0.78rem;
}

body:not(.game-route-active) .dashboard-card .daily-answer-field input {
  color: var(--academy-ink);
  background: rgba(255, 251, 237, 0.9);
  border-color: var(--academy-line);
}

body:not(.game-route-active) .word-chip:disabled {
  opacity: 0.72;
}

body:not(.game-route-active) .class-card.archived {
  opacity: 0.8;
}

body:not(.game-route-active) .app-shell .class-code-box small {
  color: var(--academy-gold-ink);
}

body:not(.game-route-active) .class-detail-hero .class-code-box :is(small, strong, span) {
  color: #f7e8c1;
}

body:not(.game-route-active) .data-table :is(th, td) {
  border-bottom-color: var(--academy-line-soft);
}

body:not(.game-route-active) .data-table td,
body:not(.game-route-active) .empty-state,
body:not(.game-route-active) .management-panel p:not(.eyebrow) {
  color: var(--academy-copy);
}

body:not(.game-route-active) .app-shell .form-message.error {
  color: #7c2e2a;
}

body:not(.game-route-active) .app-shell .form-message.success {
  color: #315d42;
}

body:not(.game-route-active) :is(.codex-page, .grammar-page) :is(button, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--academy-violet-2);
}

/* Authentication */
body:not(.game-route-active) .auth-screen {
  background:
    linear-gradient(100deg, rgba(6, 6, 18, 0.88), rgba(21, 14, 48, 0.42)),
    url("/assets/moonveil-academy-hero.png") center / cover no-repeat;
}

body:not(.game-route-active) .auth-shell {
  background: #0e0b20;
  border: 1px solid var(--academy-gold);
  border-radius: 6px;
  box-shadow: inset 0 0 0 4px rgba(226, 194, 104, 0.08), 0 28px 80px rgba(0, 0, 0, 0.48);
}

body:not(.game-route-active) .auth-visual {
  background:
    linear-gradient(180deg, rgba(8, 7, 24, 0.05), rgba(8, 6, 22, 0.72)),
    url("/assets/moonveil-academy-hero.png") center / cover no-repeat;
}

body:not(.game-route-active) .auth-visual h1 {
  color: #fff4d3;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 600;
  text-transform: none;
}

body:not(.game-route-active) .auth-card {
  color: var(--academy-ink);
  background:
    repeating-linear-gradient(0deg, rgba(100, 73, 35, 0.017) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #f8eed9, #e9d7b6);
  border-left: 1px solid var(--academy-gold);
}

body:not(.game-route-active) .auth-form p:not(.eyebrow):not(.form-message),
body:not(.game-route-active) .auth-form label span {
  color: var(--academy-copy);
}

body:not(.game-route-active) .auth-form input {
  color: var(--academy-ink);
  background: rgba(255, 250, 235, 0.82);
  border-color: var(--academy-line);
  border-radius: 3px;
}

body:not(.game-route-active) .auth-card .segmented button {
  background: rgba(255, 248, 228, 0.46);
}

body:not(.game-route-active) .auth-card .segmented button.active {
  color: #f7e8bd;
  background: #281746;
}

/* Responsive academy shell */
@media (max-width: 1120px) {
  body:not(.game-route-active) .course-catalog-layout {
    grid-template-columns: 1fr;
  }

  body:not(.game-route-active) .course-results {
    grid-column: 1;
    grid-row: 1;
  }

  body:not(.game-route-active) .course-guide {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }
}

@media (max-width: 1080px) {
  body:not(.game-route-active) .app-sidebar {
    inset: auto 0 0;
    width: auto;
    min-height: 70px;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #a47d30;
    border-right: 0;
  }

  body:not(.game-route-active) .app-sidebar::after,
  body:not(.game-route-active) .academy-seal {
    display: none;
  }

  body:not(.game-route-active) .brand-block {
    min-width: 50px;
    width: 50px;
    min-height: 50px;
    padding: 0;
    overflow: hidden;
    border: 0;
  }

  body:not(.game-route-active) .brand-block img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    object-position: left center;
    border: 1px solid #a47d30;
    border-radius: 50%;
  }

  body:not(.game-route-active) .brand-block small,
  body:not(.game-route-active) .nav-label,
  body:not(.game-route-active) .side-nav b {
    display: none;
  }

  body:not(.game-route-active) .side-nav {
    flex: 1;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: rgba(218, 185, 96, 0.42) transparent;
  }

  body:not(.game-route-active) .side-nav a {
    min-width: 82px;
    grid-template-columns: 1fr;
    grid-template-rows: 20px auto;
    gap: 2px;
    justify-items: center;
    padding: 0 8px;
  }

  body:not(.game-route-active) .side-nav a b {
    display: block;
    overflow: hidden;
    font-size: 0.65rem;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.game-route-active) .side-nav a.active::after {
    top: -3px;
    right: calc(50% - 4px);
    display: block;
  }

  body:not(.game-route-active) .app-shell {
    margin-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

}

@media (max-width: 920px) {
  body:not(.game-route-active) .dashboard-hero,
  body:not(.game-route-active) .language-course-hero,
  body:not(.game-route-active) .course-hero-redesign,
  body:not(.game-route-active):not(.grammar-clash-route-active) .course-hero-redesign,
  body:not(.game-route-active) .grammar-library-hero,
  body:not(.game-route-active):not(.grammar-clash-route-active) .grammar-library-hero {
    grid-template-columns: 1fr;
  }

  body:not(.game-route-active) .hero-language-card,
  body:not(.game-route-active) .course-next-card,
  body:not(.game-route-active) .grammar-progress-card,
  body:not(.game-route-active) .language-progress-panel {
    max-width: 620px;
  }

  body:not(.game-route-active) .top-course-context,
  body:not(.game-route-active) .top-summary-user,
  body:not(.game-route-active) .top-summary-divider {
    display: none;
  }
}

@media (max-width: 720px) {
  body:not(.game-route-active) .top-bar {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 9px 14px;
  }

  body:not(.game-route-active) .top-actions {
    display: flex;
    margin-left: auto;
  }

  body:not(.game-route-active) .top-actions > .ghost-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  body:not(.game-route-active) .top-actions > .ghost-button::before {
    font-size: 1.15rem;
    content: "↪";
  }

  body:not(.game-route-active) .language-select select {
    max-width: 130px;
  }

  body:not(.game-route-active) .page {
    width: min(100% - 24px, 560px);
    padding-top: 18px;
  }

  body:not(.game-route-active) :is(
    .dashboard-hero,
    .language-course-hero,
    .course-hero-redesign,
    .grammar-library-hero,
    .class-detail-hero,
    .lesson-hero,
    .section-heading,
    .games-header
  ) {
    min-height: 0;
    padding: 28px 24px;
  }

  body:not(.game-route-active) :is(
    .dashboard-hero,
    .language-course-hero,
    .course-hero-redesign,
    .grammar-library-hero,
    .class-detail-hero,
    .lesson-hero,
    .section-heading,
    .games-header
  )::after {
    inset: 7px;
  }

  body:not(.game-route-active) .dashboard-hero h1,
  body:not(.game-route-active) .dashboard-hero #dashboard-welcome,
  body:not(.game-route-active) .course-hero h1,
  body:not(.game-route-active) .language-course-hero h1,
  body:not(.game-route-active) .grammar-library-hero h1 {
    font-size: clamp(2.2rem, 12vw, 3.25rem);
  }

  body:not(.game-route-active) .learning-stats,
  body:not(.game-route-active) .language-path-grid,
  body:not(.game-route-active) .language-choice-grid,
  body:not(.game-route-active) .course-proof-grid,
  body:not(.game-route-active) .course-proof-strip {
    grid-template-columns: 1fr 1fr;
  }

  body:not(.game-route-active) .learning-stats article + article::before {
    display: none;
  }

  body:not(.game-route-active) .course-unit-row,
  body:not(.game-route-active) .lesson-section,
  body:not(.game-route-active) .grammar-workspace,
  body:not(.game-route-active) .grammar-index {
    border-radius: 3px;
  }

  body:not(.game-route-active) .auth-screen {
    padding: 14px;
  }

  body:not(.game-route-active) .auth-card {
    padding: 24px 20px;
  }
}

@media (max-width: 520px) {
  body:not(.game-route-active) .top-route-title {
    max-width: 88px;
    overflow: hidden;
    font-size: 0.92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.game-route-active) .top-summary-xp {
    display: none;
  }

  body:not(.game-route-active) .language-select select {
    width: 100px;
    font-size: 0.72rem;
  }

  body:not(.game-route-active) .avatar-button,
  body:not(.game-route-active) .top-actions > .ghost-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  body:not(.game-route-active) .top-actions {
    gap: 6px;
  }

  body:not(.game-route-active) .learning-stats,
  body:not(.game-route-active) .language-path-grid,
  body:not(.game-route-active) .language-choice-grid,
  body:not(.game-route-active) .course-proof-grid,
  body:not(.game-route-active) .course-proof-strip {
    grid-template-columns: 1fr;
  }

  body:not(.game-route-active) .dashboard-card,
  body:not(.game-route-active) .language-path-card,
  body:not(.game-route-active) .profile-card-main,
  body:not(.game-route-active) .path-card,
  body:not(.game-route-active) .leaderboard-card {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.game-route-active),
  body:not(.game-route-active) * {
    scroll-behavior: auto !important;
  }

  body:not(.game-route-active) * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
