:root {
  --y: #feca57;
  --g: #48dbac;
  --pk: #fd79a8;
  --pu: #a29bfe;
  --bl: #54a0ff;
  --or: #ff9f43;
  /* Dark, dreamy base (not black) */
  --bg: #1b2337;
  --surface: #222c42;
  --surface-rgb: 34, 44, 66;
  --surface-2: #2a3650;
  --surface-3: #303c5a;
  --surface-4: #1f283d;
  --text: #eef2fb;
  --text-soft: #cfd7ea;
  --text-muted: #a8b3c8;
  --stroke: rgba(255, 255, 255, 0.16);
  --shadow: rgba(6, 12, 22, 0.55);
  /* Theme vars - default neutral, overridden by JS */
  --theme-h1: #667eea;
  --theme-h2: #764ba2;
  --theme-h1-rgb: 102, 126, 234;
  --theme-h2-rgb: 118, 75, 162;
  --theme-accent: #a29bfe;
  --theme-light: #f0ebff;
  --theme-btn-color: #764ba2;

  /* Responsive Font Sizes */
  --fs-title: clamp(1.8rem, 6vw, 3rem);
  --fs-page-title: clamp(1.3rem, 4.5vw, 2rem);
  --fs-body: 1rem;
  --fs-sub: 0.95rem;
  --fs-nav: 0.93rem;
  --fs-label: 0.88rem;
  --fs-small: 0.75rem;
  
  /* Featured Card Sizes */
  --fs-feat-big: clamp(3rem, 12vw, 5.5rem);
  --fs-feat-med: clamp(1.6rem, 6vw, 2.8rem);
  --fs-feat-sml: clamp(1.2rem, 4vw, 1.9rem);
  
  /* Trace Sizes */
  --fs-trace-xl: clamp(5rem, 16vw, 9rem);
  --fs-trace-lg: clamp(2.5rem, 8vw, 5rem);
  --fs-trace-md: clamp(1.6rem, 5vw, 3rem);
}

/* Medium Screens (Tablet) */
@media (max-width: 1024px) {
  :root {
    --fs-title: clamp(1.6rem, 5vw, 2.5rem);
    --fs-page-title: clamp(1.2rem, 4vw, 1.8rem);
    --fs-body: 0.95rem;
  }
}

/* Small Screens (Mobile) */
@media (max-width: 600px) {
  :root {
    --fs-title: clamp(1.4rem, 5vw, 2rem);
    --fs-page-title: clamp(1.1rem, 4vw, 1.6rem);
    --fs-body: 0.9rem;
    --fs-sub: 0.85rem;
    --fs-nav: 0.85rem;
    --fs-feat-big: clamp(2.5rem, 10vw, 4rem);
    --fs-feat-med: clamp(1.4rem, 5vw, 2.2rem);
    --fs-feat-sml: clamp(1.1rem, 4vw, 1.6rem);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* Use dynamic viewport height if supported */
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable; /* Avoid layout shifts when scrollbar appears */
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(255, 126, 179, 0.12) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 10%,
      rgba(90, 175, 255, 0.14) 0%,
      transparent 40%
    ),
    var(--bg);
}

/* ===== GENDER PICKER SCREEN ===== */
#gender-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(160deg, #1f243a 0%, #26344e 50%, #1e2a3f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.03);
  }
}

#gender-screen.hiding {
  animation: fadeOut 0.45s ease forwards;
  pointer-events: none;
}

.gs-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gs-star {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0.25;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

.gs-title {
  font-family: 'Fredoka One', cursive;
  font-size: var(--fs-title);
  text-align: center;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gs-title.gs-splash {
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
}

.gs-tagline {
  margin-top: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-soft);
  font-family: 'Nunito', sans-serif;
  text-align: center;
  max-width: 440px;
  line-height: 1.35;
}

.gs-title.gs-splash .gs-tagline {
  margin-top: 0;
}

.gs-title-text {
  background: linear-gradient(135deg, #ff6ec7, #ffd700, #5bc8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(255, 180, 255, 0.4));
}

.gs-title-logo {
  height: 2.2em;
  width: auto;
}

.gs-title.gs-splash .gs-title-logo {
  height: clamp(90px, 22vw, 140px);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

.gs-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
}

.gs-cards {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.gs-card {
  width: 185px;
  height: 215px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  border: 4px solid transparent;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px var(--shadow);
}

.gs-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 25%,
    rgba(255, 255, 255, 0.45),
    transparent 65%
  );
  border-radius: inherit;
}

.gs-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 24px 50px rgba(5, 10, 18, 0.6);
}

.gs-card.boy {
  background: linear-gradient(145deg, #7aa8e6, #4f80cf, #3a66b8);
  border-color: #b8d4fb;
}

.gs-card.girl {
  background: linear-gradient(145deg, #e6a0c2, #cc6f9f, #b6568a);
  border-color: #f3c3da;
}

.gs-card-emoji {
  font-size: 4rem;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.gs-card-label {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: #fff;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}

.gs-card-sparkles {
  font-size: 0.9rem;
  letter-spacing: 4px;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

.gs-card.boy .gs-card-sparkles {
  color: #cfe0fb;
}

.gs-card.girl .gs-card-sparkles {
  color: #f1d1e4;
}

/* Floating bubbles on cards */
.gs-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  animation: floatUp 4s ease-in-out infinite;
}

@keyframes floatUp {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

/* ===== MAIN APP ===== */
#app {
  display: none;
  flex: 1 0 auto;
}

#app.visible {
  display: block;
}

header {
  background: linear-gradient(
    135deg,
    rgba(var(--theme-h1-rgb), 0.75),
    rgba(var(--theme-h2-rgb), 0.75)
  );
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 4px 22px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 600;
  transition: background 0.5s ease;
}

.logo {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.header-actions > *:not(.menu-panel) {
  height: 34px;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.menu-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-label {
  display: none;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-soft);
  margin: 0 0 6px 4px;
  letter-spacing: 0.3px;
}

.theme-select-wrap {
  display: none;
}

.theme-select {
  width: 100%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1 1 auto;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo-img {
  height: clamp(44px, 7.5vw, 72px);
  width: auto;
  display: block;
  cursor: pointer;
}

.logo-text {
  cursor: pointer;
}

.logo-tagline {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
  margin-top: 2px;
  text-transform: none;
}

.lang-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 7px 0;
}

.lang-select-wrap {
  display: inline-flex;
  align-items: center;
}

.lang-select {
  background: linear-gradient(135deg, var(--theme-h1), var(--theme-h2));
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  padding: 0 34px 0 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.77rem;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  height: 34px;
  line-height: 34px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='white' d='M7 2.2 2.4 6.4h9.2z'/%3E%3Cpath fill='white' d='M7 11.8 2.4 7.6h9.2z'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--theme-h1), var(--theme-h2));
  background-repeat: no-repeat;
  background-position:
    right 9px center,
    center;
  background-size:
    14px 14px,
    100% 100%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-select:hover {
  filter: brightness(1.05);
  transform: scale(1.02);
}

.lang-select:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.lang-select option {
  background: var(--surface-3);
  color: #fff;
}

.simple-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 0;
}

.simple-link {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  padding: 4px 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s;
}

.simple-link:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.simple-link.active {
  background: #fff;
  color: var(--theme-btn-color);
  border-color: #fff;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  padding: 4px 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.77rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.04);
}

.lang-btn.active {
  background: #fff;
  color: var(--theme-btn-color);
  border-color: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 0;
  flex-wrap: wrap;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1 1 auto;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.06)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  height: 34px;
}

.theme-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.theme-label.active {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition:
    background 0.25s ease,
    border 0.25s ease;
}

.theme-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--theme-light);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease;
}

.theme-switch input:checked + .theme-slider {
  background: linear-gradient(135deg, var(--theme-h1), var(--theme-h2));
  border-color: rgba(255, 255, 255, 0.55);
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(24px);
}

.theme-switch input:focus-visible + .theme-slider {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.tab-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 0.93rem;
  padding: 8px 18px;
  border-radius: 36px;
  border: none;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tab-btn.t-learn {
  background: var(--y);
  color: #7d6000;
}

.tab-btn.t-practice {
  background: var(--g);
  color: #005c43;
}

.tab-btn.t-quiz {
  background: var(--pk);
  color: #7d0040;
}

.tab-btn.active,
.tab-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  filter: brightness(1.04);
}

@media (max-width: 930px) {
  header {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'logo menu'
      'nav nav'
      'nav nav';
    row-gap: 8px;
  }

  .logo {
    grid-area: logo;
  }

  .header-nav {
    grid-area: nav;
    width: 100%;
    justify-content: center;
    padding-top: 0px !important;
    padding-bottom: 20px;
  }

  .header-actions {
    grid-area: menu;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .menu-btn {
    display: inline-flex;
  }

  .menu-panel {
    display: none;
    position: fixed;
    top: var(--menu-top, 72px);
    right: var(--menu-right, 12px);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(28, 38, 62, 0.75);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    z-index: 650;
    width: min(220px, calc(100vw - 24px));
  }

  .header-actions.menu-open .menu-panel {
    display: flex;
  }

  .header-actions.menu-open .menu-btn {
    background: rgba(255, 255, 255, 0.3);
  }

  .menu-panel .lang-select-wrap,
  .menu-panel .lang-select,
  .menu-panel .theme-toggle,
  .menu-panel .theme-select-wrap {
    width: 100%;
  }

  .menu-panel .lang-select-wrap,
  .menu-panel .theme-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    padding-bottom: 6px;
  }

  .menu-panel .theme-toggle {
    display: none;
  }

  .menu-panel .theme-select-wrap {
    display: block;
  }

  .menu-panel .menu-label {
    display: block;
  }
}

@media (max-width: 520px) {
  header {
    padding-top: 10px;
  }

  .header-nav {
    padding-top: 16px;
  }
}

.page {
  display: none;
  padding: 16px 12px 40px;
  max-width: 1120px;
  margin: 0 auto;
}

.page.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 0; /* allow flex to shrink to fit without forcing scroll */
}

.page-title {
  font-family: 'Fredoka One', cursive;
  font-size: var(--fs-page-title);
  text-align: center;
  margin-bottom: 3px;
  background: linear-gradient(135deg, var(--theme-h1), var(--pk));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 14px;
  font-weight: 600;
}

.static-page {
  padding-top: 18px;
}

.static-grid {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #fff;
}

.detail-list {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.55;
  font-weight: 600;
}

.detail-list li {
  margin-bottom: 6px;
}

.static-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px var(--shadow);
  color: var(--text);
}

.static-card p {
  color: var(--text-soft);
  line-height: 1.6;
  font-weight: 600;
  margin-bottom: 10px;
}

.static-card a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.6);
}

.static-card a:hover {
  opacity: 0.85;
}

.contact-list {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.topic-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

.topic-btn {
  font-family: 'Fredoka One', cursive;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 26px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  color: #1f2332;
}

.topic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.topic-btn.active {
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

#featured-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.featured-card {
  background: linear-gradient(
    135deg,
    rgba(var(--theme-h1-rgb), 0.65),
    rgba(var(--theme-h2-rgb), 0.65)
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  padding: 20px 30px;
  text-align: center;
  box-shadow: 0 8px 30px var(--shadow);
  min-width: 200px;
  max-width: 280px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(
    circle at 70% 30%,
    rgba(255, 255, 255, 0.12),
    transparent 60%
  );
}

.featured-card:hover {
  transform: scale(1.03) translateY(-4px);
}

.feat-main {
  font-family: 'Fredoka One', cursive;
  color: #fff;
  line-height: 1;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
  display: block;
  transition: transform 0.3s;
}

.feat-main.big {
  font-size: var(--fs-feat-big);
}

.feat-main.med {
  font-size: var(--fs-feat-med);
  letter-spacing: 3px;
}

.feat-main.sml {
  font-size: var(--fs-feat-sml);
  letter-spacing: 2px;
}

.feat-sub {
  font-size: 1rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 3px;
}

.feat-emoji {
  font-size: 9rem;
  display: block;
}

.feat-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.feat-sound {
  background: rgba(255, 255, 255, 0.24);
  border: none;
  border-radius: 28px;
  padding: 6px 16px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.2s;
}

.feat-sound:hover {
  background: rgba(255, 255, 255, 0.42);
}

.feat-more {
  z-index: 1;
  background: rgba(255, 255, 255, 0.24);
  border: none;
  border-radius: 28px;
  padding: 6px 16px;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.2s;
}

.feat-more:hover {
  background: rgba(255, 255, 255, 0.42);
}

#featured-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.carousel-btn {
  position: relative;
  margin: 0;
  background: rgba(var(--theme-h1-rgb), 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-prev {
  transform: translateX(-10px);
}

.carousel-next {
  transform: translateX(10px);
}

.carousel-btn:hover {
  background: rgba(var(--theme-h1-rgb), 1);
}

.carousel-prev:hover {
  transform: translateX(-10px) scale(1.1);
}

.carousel-next:hover {
  transform: translateX(10px) scale(1.1);
}

@media (max-width: 600px) {
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .carousel-prev {
    transform: translateX(-8px);
  }
  .carousel-next {
    transform: translateX(8px);
  }
  .carousel-prev:hover {
    transform: translateX(-8px) scale(1.1);
  }
  .carousel-next:hover {
    transform: translateX(8px) scale(1.1);
  }
}

@media (max-width: 480px) {
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .carousel-prev {
    transform: translateX(-6px);
  }
  .carousel-next {
    transform: translateX(6px);
  }
  .carousel-prev:hover {
    transform: translateX(-6px) scale(1.1);
  }
  .carousel-next:hover {
    transform: translateX(6px) scale(1.1);
  }
}

.info-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(var(--theme-h1-rgb), 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 9px 14px;
  margin: 0 auto 14px;
  width: 100%;
  max-width: 300px;
  flex-wrap: wrap;
  color: #fff;
  box-shadow: 0 6px 16px rgba(8, 12, 24, 0.25);
}

.info-big {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  color: var(--theme-btn-color);
}

.info-word {
  font-weight: 800;
  font-size: 0.95rem;
}

.info-emoji-s {
  font-size: 1.3rem;
}

.alpha-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.alpha-tile {
  aspect-ratio: 1;
  flex: 0 0 62px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.17s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  font-weight: 800;
  color: #1f2332;
}

.alpha-tile:hover,
.alpha-tile.sel {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.1);
}

.alpha-tile.sel {
  border-color: #444;
}

.alpha-tile .tl {
  font-family: 'Fredoka One', cursive;
  font-size: 1.45rem;
  line-height: 1;
}

.alpha-tile .te {
  font-size: 0.75rem;
}

.alpha-tile.script .tl {
  font-size: 1.15rem;
}

.word-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.word-tile {
  border-radius: 15px;
  flex: 0 0 110px;
  padding: 11px 7px;
  text-align: center;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.17s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  color: #1f2332;
}

.word-tile:hover,
.word-tile.sel {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.1);
}

.word-tile.sel {
  border-color: #444;
}

.word-tile .we {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 3px;
}

.word-tile .ww {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  display: block;
  line-height: 1.2;
}

.word-tile .wsub {
  font-size: 0.72rem;
  color: #4d556a;
  font-weight: 700;
  margin-top: 2px;
  display: block;
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1.1) translateY(-3px);
  }

  50% {
    transform: scale(1.16) translateY(-7px);
  }
}

.alpha-tile.bounce,
.word-tile.bounce {
  animation: bounce 0.38s ease;
}

.pmode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mode-card {
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #fff;
}

.mode-card:hover,
.mode-card.active-mode {
  transform: translateY(-4px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

.mode-icon {
  font-size: 1.9rem;
  display: block;
  margin-bottom: 4px;
}

.mode-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
}

.mode-desc {
  font-size: 0.72rem;
  color: #515c74;
  margin-top: 2px;
  font-weight: 600;
}

#practice-area {
  min-height: 260px;
}

.trace-wrap {
  text-align: center;
}

.trace-big {
  font-family: 'Fredoka One', cursive;
  display: block;
  line-height: 1;
  text-shadow: 2px 2px 0 #d0c8ee;
  user-select: none;
  color: #e8e0f5;
}

.trace-big.sz-xl {
  font-size: var(--fs-trace-xl);
}

.trace-big.sz-lg {
  font-size: var(--fs-trace-lg);
  letter-spacing: 6px;
}

.trace-big.sz-md {
  font-size: var(--fs-trace-md);
  letter-spacing: 4px;
}

.trace-nav {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.trace-nav button {
  font-family: 'Fredoka One', cursive;
  font-size: 0.88rem;
  border: none;
  border-radius: 26px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.btn-prev {
  background: var(--bl);
  color: #fff;
}

.btn-next {
  background: var(--pu);
  color: #fff;
}

.btn-say {
  background: var(--y);
  color: #7d6000;
}

.trace-nav button:hover {
  transform: translateY(-2px);
}

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.match-item {
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  border: 3px solid transparent;
  font-size: 0.92rem;
  color: #1f2332;
}

.match-item:hover {
  transform: scale(1.04);
}

.match-item.sel-m {
  border-color: #333;
  transform: scale(1.04);
}

.match-item.correct {
  background: #c5eddf !important;
  border-color: #48dbac !important;
}

.match-item.wrong {
  background: #f5d5d5 !important;
  border-color: #ff6b6b !important;
  animation: shake 0.3s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.pscore {
  text-align: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1.15rem;
  margin-bottom: 11px;
  color: var(--theme-btn-color);
}

.spell-wrap {
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

.spell-emoji {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 3px;
}

.spell-hint {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: var(--theme-btn-color);
  margin-bottom: 12px;
}

.spell-slots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.spell-slot {
  width: 48px;
  height: 54px;
  border-radius: 10px;
  border: 3px dashed var(--theme-accent);
  background: var(--theme-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--theme-btn-color);
  transition: all 0.2s;
}

.spell-slot.filled {
  background: var(--theme-h1);
  color: #fff;
  border-style: solid;
  border-color: var(--theme-h1);
}

.spell-slot.ok {
  background: #48dbac;
  border-color: #48dbac;
  color: #fff;
}

.spell-slot.bad {
  background: #ff6b6b;
  border-color: #ff6b6b;
  color: #fff;
}

.spell-letters {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.slbtn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem;
  transition: all 0.2s;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  color: #1f2332;
}

.slbtn:hover {
  transform: translateY(-3px);
}

.slbtn:disabled {
  opacity: 0.28;
  transform: none;
  cursor: default;
}

.spell-fb {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  min-height: 28px;
  margin: 7px 0;
}

.math-help {
  margin: 10px auto 0;
  background: rgba(var(--surface-rgb), 0.5);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 12px 14px;
  text-align: start;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.math-help-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  color: var(--theme-btn-color);
  margin-bottom: 6px;
}

.math-help-body {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.35;
}

.math-help-eq {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--text);
}

.math-help-list {
  margin: 8px 0 0;
  padding-inline-start: 18px;
}

.math-help-list li {
  margin: 4px 0;
}

.quiz-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 24px 20px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 8px 28px var(--shadow);
}

#quiz-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.q-question {
  text-align: center;
  margin-bottom: 16px;
}

.q-display {
  font-family: 'Fredoka One', cursive;
  display: block;
  line-height: 1;
  margin-bottom: 5px;
}

.q-display.qbig {
  font-size: var(--fs-feat-big);
}

.q-display.qmed {
  font-size: var(--fs-feat-med);
  letter-spacing: 4px;
}

.q-display.qsml {
  font-size: var(--fs-feat-sml);
  letter-spacing: 2px;
}

.q-text {
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--text-soft);
}

.quiz-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.q-opt {
  border-radius: 14px;
  padding: 12px 8px;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
  color: #1f2332;
}

.q-opt:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1);
}

.q-opt.correct {
  background: #c5eddf !important;
  border-color: #48dbac !important;
}

.q-opt.wrong {
  background: #f5d5d5 !important;
  border-color: #ff6b6b !important;
  animation: shake 0.3s;
}

.qprog {
  text-align: center;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.prog-bar {
  height: 9px;
  background: var(--surface-3);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 6px;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-h1), var(--pk));
  border-radius: 9px;
  transition: width 0.4s ease;
}

.quiz-result {
  text-align: center;
  padding: 12px 0;
}

.res-em {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 6px;
}

.res-score {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--theme-h1), var(--pk));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.res-stars {
  font-size: 1.3rem;
  letter-spacing: 3px;
}

.res-msg {
  font-weight: 700;
  color: var(--text-soft);
  margin: 5px 0 14px;
}

.btn-restart {
  font-family: 'Fredoka One', cursive;
  font-size: 0.97rem;
  background: linear-gradient(135deg, var(--theme-h1), var(--theme-h2));
  color: #fff;
  border: none;
  border-radius: 28px;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.btn-restart:hover {
  transform: translateY(-3px);
}

.cp {
  position: fixed;
  border-radius: 3px;
  pointer-events: none;
  z-index: 9999;
  animation: cf 2.5s ease-out forwards;
}

@keyframes cf {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.flex-c {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mt8 {
  margin-top: 8px;
}

.mt12 {
  margin-top: 12px;
}

.mb8 {
  margin-bottom: 8px;
}

.btn-sm {
  font-family: 'Fredoka One', cursive;
  border: none;
  border-radius: 18px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.btn-sm:hover {
  transform: translateY(-2px);
}

@media (max-width: 900px) {
  #page-quiz.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 110px);
    padding-top: 18px;
    padding-bottom: 60px;
  }

  #page-quiz.active #quiz-host {
    width: 100%;
    max-width: 520px;
  }
}

@media (max-width: 480px) {
  .alpha-grid {
    gap: 5px;
  }

  .alpha-tile {
    flex-basis: 52px;
  }

  .word-grid {
    gap: 7px;
  }

  .word-tile {
    flex-basis: 95px;
  }

  .pmode-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-opts {
    grid-template-columns: 1fr;
  }
}

.topic-pick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 18px;
  background: linear-gradient(
    135deg,
    rgba(var(--theme-h1-rgb), 0.8),
    rgba(var(--theme-h2-rgb), 0.8)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 11px 22px;
  width: 100%;
  max-width: 300px;
  cursor: pointer;
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: all 0.22s;
}

.topic-pick-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);
}

.topic-pick-btn .tpb-label {
  flex: 1;
  text-align: left;
}

.topic-pick-btn .tpb-chevron {
  font-size: 0.8rem;
  opacity: 0.75;
}

.tdlg-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(8, 12, 24, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.tdlg-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.tdlg {
  width: 100%;
  max-width: 680px;
  background: rgba(var(--surface-rgb), 0.8);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: none;
  padding: 0 0 env(safe-area-inset-bottom, 12px);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 1.2, 0.5, 1);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .tdlg {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    border-radius: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .tdlg-overlay {
    align-items: flex-end;
  }
}

.tdlg-overlay.open .tdlg {
  transform: translateY(0);
}

.tdlg-handle {
  width: 44px;
  height: 5px;
  background: var(--surface-3);
  border-radius: 9px;
  margin: 12px auto 0;
}

.tdlg-head {
  padding: 14px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.tdlg-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--theme-h1), var(--pk));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tdlg-close {
  background: var(--theme-light);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--theme-btn-color);
  font-weight: 700;
}

.tdlg-close:hover {
  background: #e0d5ff;
  transform: scale(1.1);
}

.tdlg-search-wrap {
  padding: 0 16px 10px;
  flex-shrink: 0;
}

.tdlg-search {
  width: 100%;
  border: 2px solid var(--stroke);
  border-radius: 26px;
  padding: 9px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  outline: none;
  background: var(--surface-3);
  color: var(--text);
  transition: border-color 0.2s;
}

.tdlg-search::placeholder {
  color: var(--text-muted);
}

.tdlg-search:focus {
  border-color: var(--theme-accent);
}

.tdlg-body {
  overflow-y: auto;
  padding: 0 14px 16px;
  flex: 1;
}

.tdlg-cat {
  margin-bottom: 18px;
}

.tdlg-cat-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.tdlg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .tdlg-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.tdlg-item {
  border-radius: 16px;
  padding: 12px 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.18s;
  box-shadow: 0 2px 10px rgba(6, 12, 22, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #1f2332;
}

.tdlg-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.tdlg-item.active {
  border-color: var(--theme-h1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.tdlg-item .di-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.tdlg-item .di-label {
  font-family: 'Fredoka One', cursive;
  font-size: 0.88rem;
  line-height: 1.2;
}

@media (max-width: 600px) {
  .tdlg-head {
    padding: 18px 20px 12px;
  }

  .tdlg-body {
    padding: 0 16px 20px;
  }
}

footer#app-footer {
  background: linear-gradient(135deg, var(--theme-h1), var(--theme-h2));
  color: #fff;
  padding: 32px 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: auto;
}

footer#app-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.1),
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.08),
      transparent 45%
    );
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.footer-logo {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.footer-tagline {
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.82;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.footer-links span {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.footer-links span:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
}

.footer-dot {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.1rem !important;
  opacity: 0.5;
  cursor: default !important;
}

.footer-dot:hover {
  transform: none !important;
}

.footer-copy {
  font-size: 0.9rem;
  opacity: 0.75;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.footer-copy a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.65);
}

.footer-copy a:hover {
  opacity: 0.85;
}

@media (max-width: 480px) {
  footer#app-footer {
    padding: 24px 16px 20px;
  }

  .footer-logo {
    font-size: 1.3rem;
  }
}

/* Math Difficulty Selection */
.math-difficulty-selection {
  text-align: center;
  padding: 20px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  max-width: 500px;
  margin: 0 auto;
}

@media (max-width: 420px) {
  .difficulty-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    max-width: 100%;
  }

  .difficulty-tile {
    padding: 16px 10px;
  }
}

.difficulty-tile {
  border-radius: 18px;
  padding: 20px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 3px solid transparent;
  color: #1f2332;
  font-weight: 800;
}

.difficulty-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

.difficulty-tile .diff-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.difficulty-tile .diff-label {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  line-height: 1.2;
}
