/* ═══════════════════════════════════════
   RESET & ROOT — LIGHT PROFESSIONAL
═══════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4936e8;
  --primary-light: #ede8ff;
  --primary-mid: #8b6ff8;
  --coral: #ff6b8a;
  --coral-light: #fff0f3;
  --teal: #0ba5a0;
  --teal-light: #e6f8f8;
  --amber: #f59e0b;
  --amber-light: #fef9ec;
  --green: #16a34a;
  --green-light: #ecfdf5;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --orange: #ea580c;
  --orange-light: #fff7ed;

  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface2: #f0f1f8;
  --border: #d8daec;
  --border-strong: #b8bbda;

  --text: #0c0e1a;
  --text-mid: #363a55;
  --text-soft: #6a7090;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.11), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.13), 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-card: 0 2px 10px rgba(73, 54, 232, 0.1), 0 0 0 1.5px var(--border);

  --nav-h: 72px;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.app {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.aurora {
  display: none;
}

.grain {
  display: none;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1.5px solid var(--border);
}

.logo-img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

.header-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.1;
}

.header-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars-chip {
  background: var(--amber-light);
  border: 1.5px solid #fde68a;
  border-radius: 30px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 14px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-chip {
  background: var(--primary-light);
  border: 1.5px solid #c4b5fd;
  border-radius: 30px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 11px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════
   BOTTOM NAV
═══════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding: 8px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 4px;
  border: none;
  background: none;
  transition: all 0.2s var(--ease);
  position: relative;
  min-width: 44px;
  min-height: 44px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--spring);
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-soft);
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  transition: color 0.2s;
  letter-spacing: 0.1px;
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-item.active .nav-icon svg {
  stroke: var(--primary);
}

.nav-item.active .nav-label {
  color: var(--primary);
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-item.active .nav-indicator {
  opacity: 1;
}

/* ═══════════════════════════════════════
   SECTION SYSTEM
═══════════════════════════════════════ */
.section {
  display: none;
  padding: 0 16px;
}

.section.active {
  display: block;
  animation: sectionIn 0.35s var(--ease) both;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
}

/* ═══════════════════════════════════════
   GLASS (repurposed as white card)
═══════════════════════════════════════ */
.glass {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.sec-head {
  padding: 22px 0 16px;
}

.sec-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 5.5vw, 34px);
  font-weight: 900;
  letter-spacing: -0.4px;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.sec-sub {
  font-size: clamp(13px, 2.5vw, 15px);
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
}

/* ═══════════════════════════════════════
   HOME SECTION
═══════════════════════════════════════ */
.home-hero {
  padding: 24px 0 6px;
  text-align: center;
}

.hero-greeting {
  font-size: clamp(13px, 2.5vw, 15px);
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
  direction: rtl;
}

.hero-name {
  font-family: "Sora", sans-serif;
  font-size: clamp(44px, 11vw, 76px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--coral) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 600;
  color: var(--text-mid);
  direction: rtl;
  margin-bottom: 24px;
}

.version-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-soft);
  opacity: 0.6;
  margin-top: 8px;
  font-family: "Sora", sans-serif;
  letter-spacing: 0.5px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 16px 12px;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-family: "Sora", sans-serif;
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  direction: rtl;
}

.treasure-map {
  position: relative;
  height: 500px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  background-image: radial-gradient(#e0e7ff 20%, transparent 20%), radial-gradient(#e0e7ff 20%, transparent 20%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.map-path {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-node {
  position: absolute;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transform: translateX(-50%);
  transition: transform 0.2s var(--spring);
  z-index: 2;
}

.map-node:hover {
  transform: translateX(-50%) scale(1.1);
}

.map-node:active {
  transform: translateX(-50%) scale(0.95);
}

.mn-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  box-shadow: var(--shadow-md);
  border: 4px solid var(--surface);
}

.mn-label {
  margin-top: 8px;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 800;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  white-space: nowrap;
}

.node-1 { top: 40px; left: 50%; }
.node-2 { top: 150px; left: 72%; }
.node-3 { top: 260px; left: 28%; }
.node-4 { top: 370px; left: 50%; }

.foxy-avatar {
  position: absolute;
  top: -28px;
  right: -15px;
  font-size: 42px;
  animation: foxyFloat 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
  z-index: 3;
}

@keyframes foxyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════
   ALPHABET
═══════════════════════════════════════ */
.alph-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.prog-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  transition: width 0.6s var(--ease);
}

.prog-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  white-space: nowrap;
}

.alph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 9px;
}

.lcard {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 8px 11px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.25s,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.lcard:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.lcard:active {
  transform: scale(0.94);
}

.lcard.played {
  border-color: #86efac;
  background: #f0fdf4;
}

.lcard.playing {
  animation: cardPulse 0.4s var(--spring);
}

@keyframes cardPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* top accent bar */
.lcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.lcard:hover::before,
.lcard.played::before {
  opacity: 1;
}

.lcard-shine {
  display: none;
}

.l-played-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.lcard.played .l-played-badge {
  opacity: 1;
}

.l-big {
  font-family: "Sora", sans-serif;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.l-sm {
  font-family: "Sora", sans-serif;
  font-size: clamp(18px, 3.5vw, 26px);
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1;
}

.l-emoji {
  font-size: clamp(20px, 4vw, 26px);
  display: block;
  margin: 5px 0 3px;
}

.l-word {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: 0.2px;
}

.l-heb {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
  margin-top: 2px;
}

.lcard-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(108, 79, 246, 0.2);
  transform: scale(0);
  animation: rippleOut 0.55s var(--ease) forwards;
  pointer-events: none;
}

@keyframes rippleOut {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ABC Song launch button */
.song-launch-btn {
  width: 100%;
  background: var(--primary-light);
  border: 2px solid #c4b5fd;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.25s var(--spring);
  box-shadow: var(--shadow-sm);
}

.song-launch-btn:hover {
  background: #e5deff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.song-launch-btn:active {
  transform: scale(0.97);
}

.slb-icon {
  font-size: clamp(30px, 7vw, 38px);
}

.slb-text {
  text-align: left;
}

.slb-title {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(15px, 3.5vw, 18px);
  color: var(--primary);
  margin-bottom: 2px;
}

.slb-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
}

/* ═══════════════════════════════════════
   WORDS
═══════════════════════════════════════ */
.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(108, 79, 246, 0.3);
}

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

.wcard {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.25s,
    border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.wcard:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.wcard:active {
  transform: scale(0.95);
}

.w-emoji {
  font-size: clamp(40px, 7vw, 50px);
  display: block;
  margin-bottom: 9px;
}

.w-en {
  font-family: "Sora", sans-serif;
  font-size: clamp(15px, 3vw, 19px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.w-heb {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
}

/* ═══════════════════════════════════════
   PHRASES
═══════════════════════════════════════ */
.phrases-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 700px;
  margin: 0 auto;
}

.pcard {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
}

.pcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.pcard:active {
  transform: scale(0.98);
}

.p-emoji {
  font-size: clamp(28px, 5vw, 36px);
  flex-shrink: 0;
}

.p-body {
  flex: 1;
}

.p-en {
  font-family: "Sora", sans-serif;
  font-size: clamp(14px, 2.8vw, 17px);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}

.p-heb {
  font-size: clamp(12px, 2vw, 13px);
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
  text-align: right;
}

.p-play {
  font-size: 22px;
  flex-shrink: 0;
  transition: transform 0.2s var(--spring);
}

.pcard:hover .p-play {
  transform: scale(1.2);
}

/* ═══════════════════════════════════════
   GAMES MENU
═══════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.gcard {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 16px 20px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.25s,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Coloured top bar per card */
.gcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gclr, var(--primary));
  border-radius: 0 0 4px 4px;
}

.gcard:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--gclr, var(--primary));
}

.gcard:active {
  transform: scale(0.96);
}

.g-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  margin-top: 8px;
  flex-shrink: 0;
}

.g-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.g-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(16px, 3vw, 19px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
}

.g-desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
}

.g-tag {
  display: inline-block;
  margin-top: 7px;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══════════════════════════════════════
   ARENA (game play area)
═══════════════════════════════════════ */
.arena {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(18px, 4vw, 30px);
  box-shadow: var(--shadow-lg);
  display: none;
}

.arena.active {
  display: block;
  animation: sectionIn 0.35s var(--ease) both;
}

.arena-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.arena-score {
  background: var(--amber-light);
  border: 1.5px solid #fde68a;
  border-radius: 30px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 14px;
  color: #92400e;
}

.arena-q {
  font-size: clamp(60px, 14vw, 90px);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1;
}

.arena-prompt {
  font-family: "Sora", sans-serif;
  font-size: clamp(17px, 3.5vw, 24px);
  font-weight: 900;
  color: var(--text);
  text-align: center;
  margin-bottom: 3px;
}

.arena-heb {
  font-size: clamp(12px, 2vw, 14px);
  font-weight: 600;
  color: var(--text-soft);
  text-align: center;
  direction: rtl;
  margin-bottom: 20px;
}

.opts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 16px;
}

.opt {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 8px;
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(24px, 5vw, 34px);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.opt.word-opt {
  font-size: clamp(13px, 3vw, 16px);
  padding: 14px 10px;
}

.opt:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.04);
}

.opt.correct {
  background: #dcfce7 !important;
  border-color: #4ade80 !important;
  color: #16a34a !important;
  animation: popBounce 0.4s var(--spring);
}

.opt.wrong {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  animation: shake 0.45s var(--ease);
}

@keyframes popBounce {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

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

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

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

/* SPELL */
.spell-slots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px auto;
  max-width: 480px;
}

.slot {
  width: clamp(42px, 9vw, 56px);
  height: clamp(50px, 10vw, 64px);
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 5vw, 30px);
  color: var(--text);
  transition: all 0.2s;
}

.slot.filled {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.slot.ok {
  background: #dcfce7;
  border-color: #4ade80;
  color: #16a34a;
}

.bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 14px;
}

.bkey {
  width: clamp(44px, 9vw, 54px);
  height: clamp(44px, 9vw, 54px);
  border-radius: var(--radius-sm);
  background: var(--primary);
  border: none;
  color: white;
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 4vw, 24px);
  cursor: pointer;
  transition:
    transform 0.2s var(--spring),
    opacity 0.2s;
  box-shadow: 0 3px 10px rgba(108, 79, 246, 0.35);
}

.bkey:hover:not(:disabled) {
  transform: scale(1.12);
}

.bkey:disabled {
  opacity: 0.3;
  cursor: default;
  transform: scale(1);
}

/* MEMORY */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

.mcard {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mcard.flipped,
.mcard.matched {
  transform: rotateY(180deg);
}

.mfront,
.mback {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.mfront {
  background: linear-gradient(135deg, var(--primary), var(--coral));
  border: 2px solid transparent;
  font-size: clamp(20px, 4vw, 26px);
}

.mback {
  background: var(--surface);
  border: 2px solid var(--border);
  transform: rotateY(180deg);
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 5vw, 30px);
  color: var(--primary);
}

.mcard.matched .mback {
  background: #dcfce7;
  border-color: #4ade80;
  color: #16a34a;
}

/* LISTEN & PICK */
.lp-speaker-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.lp-speaker {
  width: clamp(80px, 18vw, 110px);
  height: clamp(80px, 18vw, 110px);
  border-radius: 50%;
  background: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(73, 54, 232, 0.3);
  transition: all 0.25s var(--spring);
}

.lp-speaker:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 30px rgba(73, 54, 232, 0.4);
}

.lp-speaker:active {
  transform: scale(0.92);
}

.lp-speaker svg {
  width: 45%;
  height: 45%;
}

.lp-speaker.speaking {
  animation: speakerPulse 0.5s infinite alternate var(--ease);
}

@keyframes speakerPulse {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ═══════════════════════════════════════
    SENTENCE BUILDER
═══════════════════════════════════════ */
.sb-scene {
  text-align: center;
  margin-bottom: 18px;
}

.sb-scene-emoji {
  font-size: clamp(50px, 12vw, 68px);
  display: block;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
  transition: transform 0.4s var(--spring);
}

.sb-scene-emoji.pop {
  animation: emojiPop 0.5s var(--spring);
}

@keyframes emojiPop {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.22);
  }
}

.sb-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 10px;
  background: var(--bg);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

.sb-slots.ready {
  border-color: #4ade80;
  background: #f0fdf4;
  border-style: solid;
}

.sb-slots.wrong {
  animation: shake 0.45s var(--ease);
  border-color: #fca5a5;
}

.sb-chip {
  background: var(--primary);
  color: white;
  border-radius: 30px;
  padding: 8px 15px;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 3.5vw, 16px);
  cursor: pointer;
  transition:
    transform 0.2s var(--spring),
    box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(108, 79, 246, 0.3);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sb-chip:active {
  transform: scale(0.93);
}

.sb-chip.correct-chip {
  background: #16a34a !important;
  animation: popBounce 0.4s var(--spring);
}

.sb-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  margin-bottom: 14px;
}

.sb-bank-chip {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 30px;
  padding: 9px 16px;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(13px, 3.5vw, 15px);
  cursor: pointer;
  transition: all 0.2s var(--spring);
  user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.sb-bank-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.sb-bank-chip:active {
  transform: scale(0.92);
}

.sb-bank-chip.used {
  opacity: 0.2;
  pointer-events: none;
}

.sb-hint {
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
  margin-bottom: 14px;
  text-align: center;
}

.sb-hint .sb-hint-emoji {
  direction: ltr;
  display: inline-block;
  margin-left: 4px;
}

.sb-result {
  display: none;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
  animation: sectionIn 0.35s var(--ease);
}

.sb-result.show {
  display: block;
}

.sb-result-en {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(17px, 4vw, 22px);
  color: #16a34a;
  margin-bottom: 3px;
}

.sb-result-he {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
}

/* ═══════════════════════════════════════
   GLOBAL BUTTONS
═══════════════════════════════════════ */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 40px;
  padding: 11px 24px;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s var(--spring);
  box-shadow: 0 4px 14px rgba(108, 79, 246, 0.3);
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 22px rgba(108, 79, 246, 0.4);
}

.btn:active {
  transform: scale(0.97);
}

.btn-back {
  background: var(--bg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text-mid);
  font-size: 13px;
  padding: 9px 16px;
}

.btn-back:hover {
  background: var(--surface2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-green {
  background: #16a34a;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.btn-green:hover {
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.4);
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: white;
  padding: 11px 22px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s var(--spring);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* CONFETTI */
.cbit {
  position: fixed;
  border-radius: 3px;
  animation: cfall var(--dur, 2s) var(--delay, 0s) ease-out forwards;
  pointer-events: none;
  z-index: 9998;
}

@keyframes cfall {
  0% {
    transform: translateY(-60px) rotate(0);
    opacity: 1;
  }

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

.fstar {
  position: fixed;
  animation: fup 2s var(--spring) forwards;
  font-size: 20px;
  pointer-events: none;
  z-index: 9999;
}

@keyframes fup {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translateY(-160px) scale(0.4);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════
   LETTER POPUP MODAL
═══════════════════════════════════════ */
.lmodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 29, 46, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

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

.lmodal {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 26px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.85) translateY(24px);
  transition: transform 0.42s var(--spring);
  position: relative;
  overflow: hidden;
}

.lmodal-overlay.open .lmodal {
  transform: scale(1) translateY(0);
}

/* top accent */
.lmodal::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  border-radius: 2px 2px 0 0;
}

.lmodal-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lg, #6c4ff6) 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
}

.lmodal-letters {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
  position: relative;
}

.lmodal-big {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(80px, 20vw, 110px);
  line-height: 1;
  color: var(--primary);
}

.lmodal-small {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(48px, 12vw, 66px);
  line-height: 1;
  color: var(--text-soft);
}

.lmodal-sound {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-light);
  border: 1.5px solid #c4b5fd;
  border-radius: 30px;
  padding: 7px 16px;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 800;
  color: var(--primary);
  direction: rtl;
  margin-bottom: 16px;
}

.lmodal-sound-icon {
  font-size: 16px;
  direction: ltr;
}

.lmodal-word-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.lmodal-emoji {
  font-size: clamp(50px, 12vw, 64px);
}

.lmodal-word {
  text-align: left;
}

.lmodal-en {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 6vw, 30px);
  color: var(--text);
  line-height: 1.1;
}

.lmodal-heb {
  font-size: clamp(13px, 3vw, 17px);
  font-weight: 600;
  color: var(--text-soft);
  direction: rtl;
  text-align: right;
  margin-top: 4px;
}

.lmodal-sentence {
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 20px;
  direction: rtl;
}

.lmodal-sentence span {
  color: var(--primary);
  direction: ltr;
  display: inline-block;
  font-weight: 800;
}

.lmodal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.lmodal-say {
  background: var(--primary);
  border: none;
  border-radius: 30px;
  padding: 11px 22px;
  color: white;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s var(--spring);
  box-shadow: 0 4px 14px rgba(108, 79, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 7px;
}

.lmodal-say:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 22px rgba(108, 79, 246, 0.4);
}

.lmodal-say:active {
  transform: scale(0.96);
}

.lmodal-close {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 11px 18px;
  color: var(--text-mid);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.lmodal-close:hover {
  background: var(--surface2);
}

@keyframes speakerPop {
  0%,
  100% {
    transform: scale(1);
  }

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

.speaking .lmodal-say .sp-icon {
  animation: speakerPop 0.5s ease infinite;
}

/* ═══════════════════════════════════════
   ABC SONG OVERLAY
═══════════════════════════════════════ */
.song-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}

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

.song-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--border);
  z-index: 1;
}

.song-title {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 5vw, 26px);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-close {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.song-close:hover {
  background: var(--surface2);
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 680px;
  padding: 14px 16px 20px;
}

.song-lcard {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--bg);
  border: 2px solid var(--border);
  transition: all 0.2s var(--ease);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.song-lcard.active {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.12);
  z-index: 2;
  box-shadow: 0 6px 20px rgba(108, 79, 246, 0.4);
}

.song-lcard.active .song-l,
.song-lcard.active .song-ls,
.song-lcard.active .song-emoji {
  color: white !important;
}

.song-lcard.sung {
  background: var(--green-light);
  border-color: #86efac;
}

.song-l {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(20px, 5vw, 28px);
  color: var(--primary);
  line-height: 1;
}

.song-ls {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 15px);
  color: var(--text-soft);
  line-height: 1;
}

.song-emoji {
  font-size: clamp(12px, 3vw, 16px);
  line-height: 1;
  color: var(--text);
}

.song-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 20px 20px;
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  width: 100%;
  border-top: 1.5px solid var(--border);
}

.song-play-btn {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: clamp(58px, 14vw, 70px);
  height: clamp(58px, 14vw, 70px);
  font-size: clamp(22px, 6vw, 28px);
  color: white;
  cursor: pointer;
  transition: all 0.3s var(--spring);
  box-shadow: 0 5px 20px rgba(108, 79, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-play-btn:hover {
  transform: scale(1.08);
}

.song-play-btn:active {
  transform: scale(0.94);
}

.song-speed {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-mid);
  border-radius: 30px;
  padding: 9px 14px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

.song-speed.active-speed {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.song-lyrics {
  font-family: "Sora", sans-serif;
  font-weight: 900;
  font-size: clamp(16px, 4vw, 22px);
  color: var(--primary);
  text-align: center;
  padding: 10px 16px 4px;
  min-height: 36px;
  transition: opacity 0.3s;
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
═══════════════════════════════════════ */
@media (hover: none) {
  .lcard:hover,
  .wcard:hover,
  .pcard:hover,
  .home-tile:hover,
  .gcard:hover,
  .opt:hover,
  .bkey:hover,
  .lmodal-say:hover,
  .btn:hover,
  .btn-back:hover,
  .lmodal-close:hover,
  .sb-bank-chip:hover,
  .cat-pill:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    background: inherit;
    border-color: var(--border);
  }

  .cat-pill.active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
  }

  .lcard:active {
    transform: scale(0.93);
  }

  .wcard:active {
    transform: scale(0.93);
  }

  .opt:active {
    transform: scale(0.92);
  }

  .bkey:active:not(:disabled) {
    transform: scale(0.9);
  }

  .home-tile:active {
    transform: scale(0.96);
  }

  .gcard:active {
    transform: scale(0.95);
  }

  .lmodal-say:active {
    transform: scale(0.95);
  }

  .sb-bank-chip:active {
    transform: scale(0.92) !important;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 66px;
  }

  .app {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 4px);
  }

  .section {
    padding: 0 12px;
  }

  .header {
    padding: 9px 14px;
  }

  .avatar {
    width: 34px;
    height: 34px;
    font-size: 17px;
    border-radius: 10px;
  }

  .header-name {
    font-size: 10px;
  }

  .header-title {
    font-size: 15px;
  }

  .stars-chip {
    padding: 5px 10px;
    font-size: 13px;
  }

  .progress-chip {
    display: none;
  }

  .bottom-nav {
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 7px 4px env(safe-area-inset-bottom);
  }

  .nav-icon {
    font-size: 19px;
  }

  .nav-label {
    font-size: 9px;
  }

  .nav-item {
    padding: 4px 2px;
    min-width: 44px;
    min-height: 44px;
  }

  .home-hero {
    padding: 16px 0 4px;
  }

  .hero-name {
    font-size: clamp(36px, 12vw, 52px);
  }

  .hero-tagline {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .stats-row {
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 8px;
    border-radius: 14px;
  }

  .stat-num {
    font-size: clamp(22px, 7vw, 30px);
  }

  .stat-label {
    font-size: 10px;
  }

  .home-grid {
    gap: 10px;
    margin-bottom: 14px;
  }

  .home-tile {
    min-height: 125px;
    padding: 16px 12px 14px;
    border-radius: 20px;
  }

  .tile-icon {
    font-size: 34px;
    top: 13px;
    right: 13px;
  }

  .tile-title {
    font-size: 17px;
  }

  .tile-sub {
    font-size: 10px;
  }

  .sec-head {
    padding: 14px 0 10px;
  }

  .sec-title {
    font-size: 22px;
  }

  .alph-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
  }

  .lcard {
    padding: 10px 5px 8px;
    border-radius: 12px;
  }

  .l-big {
    font-size: 25px;
  }

  .l-sm {
    font-size: 16px;
  }

  .l-emoji {
    font-size: 18px;
    margin: 3px 0;
  }

  .l-word,
  .l-heb {
    font-size: 9px;
  }

  .cat-scroll {
    gap: 7px;
    padding-bottom: 9px;
    margin-bottom: 12px;
  }

  .cat-pill {
    padding: 7px 13px;
    font-size: 12px;
  }

  .words-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
  }

  .wcard {
    padding: 16px 10px 13px;
    border-radius: 16px;
  }

  .w-emoji {
    font-size: 38px;
    margin-bottom: 7px;
  }

  .w-en {
    font-size: 15px;
  }

  .phrases-list {
    gap: 7px;
  }

  .pcard {
    padding: 12px 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .p-emoji {
    font-size: 26px;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gcard {
    padding: 18px 14px 16px;
    border-radius: 20px;
  }

  .g-icon {
    font-size: 42px;
  }

  .arena {
    padding: 15px 12px;
    border-radius: 20px;
  }

  .arena-top {
    margin-bottom: 12px;
  }

  .arena-q {
    font-size: clamp(58px, 16vw, 78px);
  }

  .arena-prompt {
    font-size: clamp(15px, 4vw, 19px);
  }

  .arena-heb {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .opts-grid {
    gap: 8px;
    max-width: 100%;
  }

  .opt {
    padding: 13px 6px;
    border-radius: 14px;
    font-size: clamp(20px, 7vw, 30px);
  }

  .opt.word-opt {
    font-size: clamp(12px, 3.5vw, 15px);
    padding: 12px 7px;
  }

  .spell-slots {
    gap: 6px;
    margin: 12px auto;
  }

  .slot {
    width: clamp(38px, 11vw, 50px);
    height: clamp(46px, 12vw, 58px);
    font-size: clamp(18px, 6vw, 26px);
    border-radius: 10px;
  }

  .bank {
    gap: 7px;
    max-width: 100%;
    margin: 0 auto 12px;
  }

  .bkey {
    width: clamp(44px, 12vw, 52px);
    height: clamp(44px, 12vw, 52px);
    font-size: clamp(17px, 5vw, 22px);
    border-radius: 10px;
  }

  .mem-grid {
    gap: 6px;
    max-width: 100%;
  }

  .mback {
    font-size: clamp(19px, 6vw, 26px);
  }

  .btn {
    padding: 10px 18px;
    font-size: 14px;
  }

  .btn-back {
    padding: 8px 13px;
    font-size: 12px;
  }

  .toast {
    font-size: 12px;
    padding: 9px 16px;
    max-width: 88vw;
    white-space: normal;
    text-align: center;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  }

  .song-launch-btn {
    padding: 12px 14px;
    gap: 11px;
    border-radius: 14px;
  }

  .slb-title {
    font-size: 14px;
  }

  .sb-slots {
    min-height: 50px;
    padding: 10px 8px;
  }

  .sb-chip {
    font-size: 13px;
    padding: 7px 12px;
  }

  .sb-bank-chip {
    font-size: 12px;
    padding: 8px 13px;
    min-height: 42px;
  }
}

@media (max-width: 360px) {
  .alph-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

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

  .home-tile {
    min-height: 80px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .tile-icon {
    position: static;
    font-size: 34px;
  }

  .mem-grid {
    gap: 5px;
  }

  .slot {
    width: clamp(34px, 10vw, 44px);
    height: clamp(42px, 11vw, 52px);
  }

  .bkey {
    width: clamp(40px, 11vw, 48px);
    height: clamp(40px, 11vw, 48px);
    font-size: 15px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .alph-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .words-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (min-width: 768px) {
  .section {
    padding: 0 24px;
  }

  .alph-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }

  .words-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }

  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

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

@media (max-height: 500px) and (orientation: landscape) {
  .home-hero {
    padding: 8px 0 2px;
  }

  .hero-name {
    font-size: 30px;
  }

  .alph-grid {
    grid-template-columns: repeat(7, 1fr);
  }

  .arena-q {
    font-size: 46px;
  }

  .lmodal {
    max-height: 95vh;
    overflow-y: auto;
  }

  .lmodal-big {
    font-size: 58px;
  }

  .lmodal-small {
    font-size: 36px;
  }
}

@media (max-width: 600px) {
  .lmodal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .lmodal {
    width: 100%;
    border-radius: 26px 26px 0 0;
    padding: 6px 20px 26px;
    padding-bottom: max(26px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    max-width: 100%;
  }

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

  .lmodal::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: 0 auto 14px;
  }

  .lmodal-big {
    font-size: clamp(68px, 18vw, 96px);
  }

  .lmodal-small {
    font-size: clamp(40px, 10vw, 58px);
  }

  .lmodal-emoji {
    font-size: clamp(42px, 10vw, 54px);
  }

  .lmodal-en {
    font-size: clamp(18px, 5.5vw, 26px);
  }

  .lmodal-sound {
    font-size: clamp(15px, 4vw, 19px);
    padding: 6px 13px;
  }

  .lmodal-sentence {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .lmodal-say,
  .lmodal-close {
    min-height: 48px;
  }
}

/* ═══════════════════════════════════════
   SPEAK IT GAME
═══════════════════════════════════════ */
.spi-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid #e11d48;
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.15);
  transition: all 0.3s var(--spring);
  position: relative;
}

.spi-mic-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.25);
  background: #fff1f2;
}

.spi-mic-btn:active {
  transform: scale(0.95);
}

.spi-mic-btn.listening {
  background: #e11d48;
  color: white;
  animation: micPulse 1.5s infinite;
}

@keyframes micPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(225, 29, 72, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
  }
}

/* ═══════════════════════════════════════
   MASCOT (FOXY / DUO-STYLE)
═══════════════════════════════════════ */
.mascot-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: max-content;
  height: max-content;
}

.mascot-btn {
  background: none;
  border: none;
  font-size: clamp(45px, 10vw, 55px);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
  cursor: pointer;
  pointer-events: auto;
  transform-origin: bottom center;
  transition: transform 0.2s var(--spring);
}

.mascot-btn:active {
  transform: scale(0.9);
}

.mascot-btn.happy {
  animation: mascotBounce 0.5s var(--spring) 2;
}

.mascot-btn.sad {
  animation: mascotShake 0.5s ease-in-out;
}

.mascot-tooltip {
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 16px 16px 0 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(10px) scale(0.8);
  transition: all 0.3s var(--spring);
  transform-origin: bottom right;
  border: 2px solid var(--primary);
  pointer-events: none;
  max-width: 260px;
  min-width: 120px;
  text-align: center;
  direction: rtl;
  position: relative;
  line-height: 1.4;
}

.mascot-tooltip::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 18px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
  transform: rotate(45deg);
}

.mascot-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes mascotBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-16px) scale(1.05);
  }
}

@keyframes mascotShake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

/* ════ FEED FOXY ════ */
.foxy-pet-area {
  font-size: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 150px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  transition: transform 0.3s;
}
.foxy-pet-area.eating {
  animation: foxyEat 0.8s ease;
}
.foxy-pet-area.playing {
  animation: foxyPlay 1s ease infinite;
}
@keyframes foxyEat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
@keyframes foxyPlay {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(10deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-10px) rotate(-10deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
.foxy-pet-status {
  text-align: center;
  font-family: 'Sora', sans-serif;
  color: var(--text-mid);
  font-weight: 700;
  font-size: 14px;
}
