/* =====================================================================
   English Hero | The Primary School English Quest with Adam 🎒
   Designed for the Algerian Primary Curriculum (3AP, 4AP, 5AP)
   ===================================================================== */

:root {
  --blue: #1565c0;
  --blue-d: #0d47a1;
  --blue-l: #e3f2fd;
  --gold: #fbc02d;
  --gold-d: #f57f17;
  --green: #2e7d32;
  --green-d: #1b5e20;
  --coral: #e53935;
  --cream: #fffdf8;
  --dark: #102027;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Nunito', 'Cairo', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: #194622 url('assets/bg.jpg') center/cover no-repeat fixed;
  overflow-x: hidden;
  user-select: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(10, 25, 18, 0.1);
}

#app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px;
  min-height: 100vh;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}
.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ==================== BUTTONS & BADGES ==================== */
.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 12px 24px;
  cursor: pointer;
  background: linear-gradient(180deg, #1e88e5, var(--blue-d));
  box-shadow: 0 5px 0 #0b387e, 0 8px 18px rgba(0,0,0,0.25);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0b387e; }

.btn-primary {
  background: linear-gradient(180deg, #fbc02d, #f57f17);
  box-shadow: 0 5px 0 #bc5c00, 0 8px 18px rgba(245, 127, 23, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-primary:active { box-shadow: 0 2px 0 #bc5c00; }

.btn-secondary {
  background: linear-gradient(180deg, #43a047, var(--green-d));
  box-shadow: 0 5px 0 #124016, 0 8px 18px rgba(0,0,0,0.2);
}
.btn-secondary:active { box-shadow: 0 2px 0 #124016; }

.btn-ghost {
  background: #ffffff;
  color: #0d47a1;
  box-shadow: 0 4px 0 #cfd8dc, 0 8px 18px rgba(0,0,0,0.12);
  border: 2px solid #e1f5fe;
}
.btn-ghost:active { box-shadow: 0 1px 0 #cfd8dc; }

.btn-danger {
  background: linear-gradient(180deg, #e53935, #c62828);
  box-shadow: 0 5px 0 #8e0000;
}

.btn-xl { font-size: 1.35rem; padding: 16px 42px; border-radius: 22px; }
.btn-sm { font-size: 0.95rem; padding: 8px 18px; border-radius: 14px; }

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid #bbdefb;
  background: #ffffff;
  cursor: pointer;
  font-size: 1.3rem;
  font-family: inherit;
  font-weight: 900;
  color: var(--dark);
  box-shadow: 0 4px 0 #90caf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s;
  flex-shrink: 0;
}
.icon-btn:hover { filter: brightness(1.04); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #90caf9; }
.icon-btn.off { opacity: 0.55; }

.stars-pill {
  background: linear-gradient(180deg, #fffde7, #fff59d);
  color: #e65100;
  font-weight: 900;
  border: 2px solid #fbc02d;
  border-radius: 999px;
  padding: 6px 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  white-space: nowrap;
}

.glass {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px;
  border: 3.5px solid #fbc02d;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* ==================== MAIN MENU ==================== */
#scr-menu.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 8px 14px;
}

.top-controls {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 10px;
  z-index: 20;
}

.menu-card {
  max-width: 960px;
  width: 100%;
  text-align: center;
  padding: 16px 24px 18px;
  margin-top: 36px;
  position: relative;
}
.menu-card .stars-pill {
  position: absolute;
  top: 14px;
  left: 16px;
}

.mascot-badge {
  position: relative;
  display: inline-block;
  margin-top: -65px;
  margin-bottom: 2px;
}
.mascot-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #ffffff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  animation: floatMascot 3.2s ease-in-out infinite;
}
.crest-sparkle {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 1.6rem;
  animation: pulse 1.5s infinite;
}
@keyframes floatMascot {
  50% { transform: translateY(-6px) rotate(2deg); }
}

.logo {
  font-family: 'Fredoka', 'Cairo', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin: 2px 0;
  color: var(--blue-d);
  text-shadow: 0 2px 0 #bbdefb;
}
.logo span {
  color: #f57f17;
  text-shadow: 0 2px 0 #ffe082;
}

.tagline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #37474f;
  margin-bottom: 4px;
}
.tagline b { color: var(--blue-d); }

.hello {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 10px;
  min-height: 1.4em;
}
.hello button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: 6px;
}

/* 3 MODES GRID : VERTICAL ON 3 COLUMNS */
.modes-selection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 10px 0 16px;
}

.mode-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 12px;
  border: 2.5px solid #dce8dc;
  cursor: pointer;
  color: var(--dark);
  font-family: inherit;
  box-shadow: 0 4px 0 #b0bec5, 0 8px 18px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.mode-card:hover {
  transform: translateY(-4px);
  border-color: #fbc02d;
  box-shadow: 0 7px 0 #90a4ae, 0 14px 24px rgba(0,0,0,0.14);
}
.mode-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #90a4ae;
}

.mode-icon {
  font-size: 2.4rem;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #e8f5e9;
  border-radius: 14px;
  margin-bottom: 2px;
}
.mode-info { width: 100%; }
.mode-badge {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-block;
  margin-bottom: 4px;
}
.mode-hunter .mode-badge { background: #ffe0b2; color: #e65100; }
.mode-match .mode-badge { background: #c8e6c9; color: #1b5e20; }
.mode-dialogue .mode-badge { background: #bbdefb; color: #0d47a1; }

.mode-info h3 {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1a2a1d;
  margin-bottom: 3px;
}
.mode-info p {
  font-size: 0.85rem;
  font-weight: 600;
  color: #455a64;
  line-height: 1.3;
}
.ar-hint {
  display: block;
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #2e7d32;
  margin-top: 4px;
  direction: rtl;
}

.arrow-badge {
  display: none;
}

.menu-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================== TOPBAR & HUD ==================== */
.topbar, .hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 10px 16px;
  border: 2px solid #e0c888;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.topbar h2, .hud-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--blue-d);
}

.dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cfd8dc;
  transition: all 0.25s;
}
.dots .dot.current {
  width: 18px;
  height: 18px;
  background: #ffffff;
  border: 4px solid #f57f17;
  transform: scale(1.15);
}
.dots .dot.perfect { background: #2ecc71; }

/* ==================== LEVELS SELECTION ==================== */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.level-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 20px;
  border: 3px solid var(--c, #1565c0);
  cursor: pointer;
  color: var(--dark);
  font-family: inherit;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 12px 24px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.12s, box-shadow 0.12s;
  text-align: left;
}
.level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 0 rgba(0,0,0,0.18), 0 18px 30px rgba(0,0,0,0.18);
}
.level-card:active { transform: translateY(2px); }
.level-card.locked { filter: grayscale(1); opacity: 0.55; cursor: not-allowed; }

.lc-icon { font-size: 3rem; }
.lc-title { font-size: 1.35rem; font-weight: 900; color: #1a2a1d; }
.lc-desc { font-size: 0.95rem; font-weight: 600; color: #546e7a; }
.lc-stars { font-size: 1.3rem; letter-spacing: 4px; color: #fbc02d; }
.lc-stars .on { color: #fbc02d; }
.lc-stars .off { color: #cfd8dc; }
.lc-lock {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
}
.lc-lock small { display: block; font-size: 0.9rem; color: #616161; }

/* ==================== MODE 1 : PHONICS HUNTER ==================== */
.stage-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 520px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 3.5px solid #fbc02d;
  border-radius: 30px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.25), inset 0 0 0 2px rgba(255,255,255,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.target-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2.5px solid rgba(251, 192, 45, 0.5);
  z-index: 5;
}
.target-image {
  font-size: 4.2rem;
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  background: #e3f2fd;
  border: 2px solid #90caf9;
  border-radius: 20px;
  flex-shrink: 0;
}
.target-details { flex: 1; text-align: center; }
.target-hint {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blue-d);
  margin-bottom: 8px;
}

.sound-slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sound-slot {
  min-width: 65px;
  height: 60px;
  padding: 0 12px;
  background: #fffdf4;
  border: 2.5px solid #e5ad48;
  border-radius: 14px;
  box-shadow: inset 0 2px 6px rgba(220, 160, 50, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: #0d47a1;
  letter-spacing: 1px;
}
.sound-slot.filled {
  background: linear-gradient(180deg, #ffffff, #e3f2fd);
  border-color: #1976d2;
  animation: pop 0.25s cubic-bezier(.3,1.8,.5,1);
}

.speak-btn {
  background: linear-gradient(180deg, #1565c0, #0d47a1);
  border: 2.5px solid #fbc02d;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.4rem;
}

.bubbles-sky {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(227, 242, 253, 0.45), transparent 80%);
}

.sound-bubble {
  position: absolute;
  padding: 14px 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #ffffff, #fff9c4 70%, #fff176);
  border: 3px solid #f57f17;
  box-shadow: 0 8px 18px rgba(245, 127, 23, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.8);
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #e65100;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
  animation: floatBubble 4s ease-in-out infinite alternate;
}
.sound-bubble:hover {
  transform: scale(1.12);
  border-color: #0288d1;
  color: #01579b;
}
.sound-bubble:active { transform: scale(0.92); }

@keyframes floatBubble {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-16px) rotate(3deg); }
}

.adam-corner {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}
.adam-corner img {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.adam-bubble {
  background: #ffffff;
  border: 2px solid #fbc02d;
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0d47a1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  max-width: 250px;
}

/* ==================== MODE 2 : WORDS & PICTURES (VOCAB MATCH) ==================== */
.match-stage {
  max-width: 960px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 3.5px solid #fbc02d;
  border-radius: 30px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  padding: 18px 24px;
}

.match-theme-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #1565c0, #0d47a1);
  border: 2.5px solid #fbc02d;
  border-radius: 999px;
  padding: 8px 24px;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.match-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.cards-column, .words-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-card {
  background: #ffffff;
  border: 2.5px solid #cfd8dc;
  border-radius: 18px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b0bec5, 0 6px 14px rgba(0,0,0,0.06);
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: #1565c0;
  box-shadow: 0 6px 0 #90caf9, 0 10px 18px rgba(0,0,0,0.1);
}
.match-card.selected {
  background: #e3f2fd;
  border-color: #1565c0;
  box-shadow: 0 4px 0 #0d47a1, 0 0 0 3px rgba(21, 101, 192, 0.25);
  transform: scale(1.02);
}
.match-card.matched {
  background: #e8f5e9;
  border-color: #2e7d32;
  box-shadow: 0 4px 0 #1b5e20;
  pointer-events: none;
  opacity: 0.9;
}

.match-card-emoji { font-size: 2.8rem; line-height: 1; }
.match-card-hint {
  font-size: 0.95rem;
  font-weight: 700;
  color: #455a64;
}

.match-word-tile {
  background: #ffffff;
  border: 2.5px solid #cfd8dc;
  border-radius: 18px;
  padding: 16px 20px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #102027;
  cursor: pointer;
  box-shadow: 0 4px 0 #b0bec5, 0 6px 14px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.1s, border-color 0.1s;
}
.match-word-tile:hover {
  transform: translateY(-2px);
  border-color: #f57f17;
  box-shadow: 0 6px 0 #ffb74d;
}
.match-word-tile.selected {
  background: #fff8e1;
  border-color: #f57f17;
  box-shadow: 0 4px 0 #e65100, 0 0 0 3px rgba(245, 127, 23, 0.25);
  transform: scale(1.02);
}
.match-word-tile.matched {
  background: #e8f5e9;
  border-color: #2e7d32;
  color: #1b5e20;
  box-shadow: 0 4px 0 #1b5e20;
  pointer-events: none;
  opacity: 0.9;
}

.match-bottom-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
}
.match-guide-text {
  font-size: 1rem;
  font-weight: 800;
  color: #0d47a1;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==================== MODE 3 : DAILY SITUATIONS & DIALOGUES ==================== */
.dialogue-stage {
  max-width: 820px;
  margin: 0 auto;
}

.dialogue-card {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 3.5px solid #fbc02d;
  border-radius: 30px;
  box-shadow: 0 16px 44px rgba(0,0,0,0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dialogue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.scenario-pill {
  background: #ffffff;
  border: 2px solid #fbc02d;
  border-radius: 999px;
  padding: 6px 20px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0d47a1;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.exact-speaker-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(180deg, #1565c0, #0d47a1);
  border: 3px solid #fbc02d;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  color: #fff;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.exact-speaker-btn:hover { transform: scale(1.06); }
.exact-speaker-btn:active { transform: scale(0.92); }

.adam-dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 8px 0;
}
.adam-chat-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.adam-chat-bubble {
  background: #ffffff;
  border: 2.5px solid #64b5f6;
  border-radius: 24px 24px 24px 4px;
  padding: 16px 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  flex: 1;
}
.chat-en {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0d47a1;
  line-height: 1.35;
  margin-bottom: 6px;
}
.chat-ar {
  display: block;
  font-family: 'Cairo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2e7d32;
  direction: rtl;
}

.instruction-dialogue {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #37474f;
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  background: #ffffff;
  border: 2.5px solid #cfd8dc;
  border-radius: 20px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b0bec5, 0 6px 14px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  transition: transform 0.1s, border-color 0.1s;
  text-align: left;
}
.choice-btn:hover {
  transform: translateY(-2px);
  border-color: #1565c0;
  box-shadow: 0 6px 0 #0d47a1, 0 10px 18px rgba(0,0,0,0.12);
}
.choice-btn:active { transform: translateY(2px); }

.choice-text-en {
  font-size: 1.35rem;
  font-weight: 900;
  color: #102027;
}
.choice-text-ar {
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2e7d32;
  margin-left: 12px;
  direction: rtl;
}

.choice-btn.correct-choice {
  background: #e8f5e9;
  border-color: #2e7d32;
  box-shadow: 0 4px 0 #1b5e20;
}
.choice-btn.wrong-choice {
  background: #ffebee;
  border-color: #c62828;
  box-shadow: 0 4px 0 #b71c1c;
  animation: shake 0.4s;
}

/* ==================== RESULT SCREEN ==================== */
.result-card {
  max-width: 580px;
  margin: 70px auto 20px;
  text-align: center;
  padding: 30px 24px;
}
.result-card h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--blue-d);
  margin: 10px 0 4px;
}
.result-card p {
  font-size: 1.15rem;
  font-weight: 700;
  color: #455a64;
}
.big-stars {
  font-size: 4rem;
  letter-spacing: 8px;
  margin: 8px 0;
}
.big-stars span {
  display: inline-block;
  animation: starPop 0.5s cubic-bezier(.3,1.8,.5,1) both;
}

.r-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.r-stat {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 0 #cfd8dc;
  font-weight: 700;
  font-size: 0.95rem;
}
.r-stat b {
  display: block;
  font-size: 1.6rem;
  color: #e65100;
  margin-top: 4px;
}

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

.r-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ==================== TROPHIES & PARENTS ==================== */
.trophies-card {
  padding: 24px;
}
.trophies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.trophy-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 0 #cfd8dc;
  border: 2px solid #eceff1;
}
.trophy-card.unlocked {
  background: #fffde7;
  border-color: #fbc02d;
}
.trophy-card.locked { opacity: 0.5; filter: grayscale(1); }
.trophy-card .t-icon { font-size: 3rem; margin-bottom: 6px; }
.trophy-card .t-name { font-weight: 900; font-size: 1.15rem; color: #102027; }
.trophy-card .t-desc { font-size: 0.85rem; font-weight: 600; color: #546e7a; }

.p-wrap { display: grid; gap: 14px; }
.p-section {
  background: rgba(255, 254, 248, 0.98);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  border: 2px solid #e0c888;
}
.p-section h3 {
  color: var(--blue-d);
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 12px;
}
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.p-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 0 #cfd8dc;
}
.p-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  margin-bottom: 6px;
}

/* ==================== MODAL ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 15, 0.65);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal.show { display: grid; }
.modal-card {
  background: var(--cream);
  border-radius: 26px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  animation: pop 0.3s;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  border: 3px solid #fbc02d;
}
.modal-card h2 { margin: 8px 0; color: var(--blue-d); font-size: 1.6rem; }
.modal-card p { margin-bottom: 12px; font-weight: 600; color: #455a64; }
.modal-card input {
  width: 100%;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 12px;
  border-radius: 14px;
  border: 3px solid #90caf9;
  text-align: center;
  margin-bottom: 14px;
  outline: none;
}
.modal-card input:focus { border-color: var(--blue); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes pulse { 50% { transform: scale(1.1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.confetti {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  z-index: 100;
  pointer-events: none;
  animation: confFall linear forwards;
}
@keyframes confFall {
  to { transform: translate(var(--dx), 110vh) rotate(var(--r)); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .logo { font-size: 2.4rem; }
  .match-container { grid-template-columns: 1fr; }
  .chat-en { font-size: 1.25rem; }
  .choice-text-en { font-size: 1.15rem; }
  .target-image { font-size: 3.2rem; width: 64px; height: 64px; }
  .sound-bubble { font-size: 1.5rem; padding: 10px 18px; }
}

/* زر العودة لأكاديمية النابغة الصغير (مدمج في الركن الأيمن والبطاقة) */
.btn-academy-hub {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #ffffff !important;
  border: 2px solid #ffca28;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn-academy-hub:hover, .btn-academy-hub:active {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
}
.btn-academy-hub .hub-arrow {
  font-size: 1.1rem;
  color: #ffca28;
}

.btn-home-hub {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #fff !important;
  border: 2px solid #ffca28;
  border-radius: 18px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(27, 67, 50, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn-home-hub:hover, .btn-home-hub:active {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(27, 67, 50, 0.55);
}

@media (max-width: 640px) {
  .top-controls {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  .btn-academy-hub {
    padding: 6px 12px;
    font-size: 0.82rem;
    gap: 4px;
  }
}

