/* ==========================================================================
   NUMBER BONDS TRAIN: 2-CAR SCANDINAVIAN WOODEN TRAIN
   Brand: Shining Star (#e61c89, #06509f)
   Design: Modern Minimalist Scandinavian Wooden Toy Train
   ========================================================================== */

:root {
  --brand-pink: #e61c89;
  --brand-pink-dark: #b8146c;
  --brand-pink-soft: #fdf2f8;
  --brand-blue: #06509f;
  --brand-blue-dark: #04356b;
  
  --wood-light: #e8c598;
  --wood-grain: #dfb785;
  --wood-dark: #784421;
  --wood-rim: #8d562f;
  
  --train-blue: #4679b2;
  --train-yellow: #d89b28;
  --train-dark: #2d3748;
  
  --bg-cream: #faf9f6;
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --font-family-playful: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-sub: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 28px -6px rgba(6, 80, 159, 0.07);
  --shadow-button: 0 6px 0 rgba(0, 0, 0, 0.12), 0 10px 18px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-family-playful);
  background-color: var(--bg-cream);
  color: var(--text-main);
  position: relative;
}

/* ==========================================================================
   MINIMALIST BACKDROP
   ========================================================================== */
.minimal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f8fd 0%, #faf9f6 65%);
}

.sun-orb {
  position: absolute;
  top: 20px;
  right: 8%;
  width: 68px;
  height: 68px;
  background: #fef08a;
  border-radius: 50%;
  opacity: 0.85;
  filter: drop-shadow(0 0 20px rgba(254, 240, 138, 0.7));
}

.soft-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 40px;
}
.cloud-a { top: 45px; left: 10%; width: 110px; height: 34px; opacity: 0.7; }
.cloud-b { top: 95px; right: 22%; width: 130px; height: 38px; opacity: 0.6; }

.minimal-hill {
  position: absolute;
  bottom: -25px;
  left: -5%;
  width: 110%;
  height: 95px;
  background: #e2f5ec;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.75;
}

/* ==========================================================================
   CONTAINER & TOP NAVIGATION
   ========================================================================== */
.game-container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 16px 24px;
  display: flex;
  flex-direction: column;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.brand-badge {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 42px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  background: transparent;
}

.progress-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.progress-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-blue);
}

.star-track {
  display: flex;
  gap: 5px;
}

.progress-star {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #cbd5e1;
  background: #f8fafc;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  transition: all 0.25s ease;
}

.progress-star.active {
  color: #ffffff;
  background: var(--brand-pink);
  border-color: var(--brand-pink);
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(230, 28, 137, 0.4);
}

.progress-star.completed {
  color: #ffffff;
  background: #fbbf24;
  border-color: #d97706;
}

/* ==========================================================================
   SCREEN 1: START SCREEN
   ========================================================================== */
.game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.start-card {
  background: #ffffff;
  padding: 32px 28px;
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  text-align: center;
  max-width: 580px;
  width: 100%;
  border: 1px solid #f1f5f9;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-hero {
  margin-bottom: 10px;
}

.hero-logo {
  max-width: 220px;
  height: auto;
  background: transparent;
}

.game-main-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-blue);
  line-height: 1.1;
}

.game-sub-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand-pink);
  margin-top: 3px;
}

.vn-title-caption {
  font-family: var(--font-family-sub);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
  margin-bottom: 16px;
}

.start-train-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px 0 18px;
  padding: 12px 18px;
  background: #f8fafc;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.mini-train-preview {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-loco {
  font-size: 2.2rem;
  line-height: 1;
}

.preview-mini-car {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--wood-light);
  border: 2px solid var(--wood-dark);
  font-size: 1.3rem;
}

.preview-sum-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: #e0f2fe;
  padding: 3px 12px;
  border-radius: 10px;
}

.start-instructions {
  font-family: var(--font-family-sub);
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 22px;
  padding: 0 10px;
}

.btn-play-bounce {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 28px;
  padding: 14px 44px;
  cursor: pointer;
  box-shadow: 0 6px 0 #047857, 0 14px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.15s ease;
  animation: gentlePulse 2s infinite ease-in-out;
}

.btn-play-bounce:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #047857, 0 16px 24px rgba(16, 185, 129, 0.4);
}

.btn-play-bounce:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #047857;
}

.btn-play-bounce .btn-icon { font-size: 2rem; line-height: 1; }
.btn-play-bounce .btn-text { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.btn-play-bounce .btn-subtext { font-family: var(--font-family-sub); font-size: 0.95rem; opacity: 0.95; }

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ==========================================================================
   SCREEN 2: QUESTION BANNER & REPLAY
   ========================================================================== */
.question-banner {
  width: 100%;
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid #f1f5f9;
}

.question-text-group {
  flex: 1;
  padding-right: 12px;
}

.english-question {
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--brand-blue);
  line-height: 1.2;
}

.vietnamese-question {
  font-family: var(--font-family-sub);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-pink);
  margin-top: 2px;
}

.audio-replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fdf2f8;
  color: var(--brand-pink);
  border: 2px solid var(--brand-pink);
  border-radius: 18px;
  padding: 9px 16px;
  font-family: var(--font-family-playful);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--brand-pink-dark);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.audio-replay-btn:hover { transform: translateY(-2px); background: #fce7f3; }
.audio-replay-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--brand-pink-dark); }
.audio-replay-btn.playing { background: var(--brand-pink); color: #ffffff; }
.audio-icon { font-size: 1.25rem; }

/* ==========================================================================
   SINGAPORE MATH CHERRY DIAGRAM (Part-Part-Whole)
   ========================================================================== */
.bond-diagram-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 12px 18px 8px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  width: 100%;
  max-width: 480px;
}

.bond-node {
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.node-whole {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border: 3px solid #eab308;
  color: #854d0e;
}

.star-mini-emblem {
  position: absolute;
  top: -5px;
  right: -3px;
  font-size: 0.95rem;
}

.node-whole .node-num { font-size: 2.3rem; font-weight: 700; line-height: 1; }
.node-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: #a16207; letter-spacing: 0.5px; }

.bond-branches {
  width: 170px;
  height: 34px;
  display: flex;
  justify-content: center;
}
.branch-svg { width: 100%; height: 100%; }
.branch-line { stroke: #cbd5e1; stroke-width: 3.5; stroke-linecap: round; fill: none; }

.bond-parts-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.node-part {
  width: 66px;
  height: 66px;
  border: 3px solid #e2e8f0;
}
.node-part .node-num { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.node-part .part-avatar { 
  font-size: 1.3rem; 
  line-height: 1; 
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.part-1 {
  background: #fef9c3;
  border-color: #facc15;
  color: #854d0e;
}

.plus-symbol { font-size: 1.6rem; font-weight: 700; color: #94a3b8; }

.part-2 {
  background: #fdf2f8;
  border-color: #f472b6;
  color: var(--brand-pink);
}

.part-2.waiting {
  background: #f8fafc;
  border: 3px dashed #cbd5e1;
  color: #94a3b8;
  animation: waitingPulse 1.6s infinite ease-in-out;
}

@keyframes waitingPulse {
  0%, 100% { transform: scale(1); border-color: #cbd5e1; }
  50% { transform: scale(1.05); border-color: var(--brand-pink); }
}

.part-2.solved {
  background: #fdf2f8;
  border-color: var(--brand-pink);
  color: var(--brand-pink);
  animation: popSuccess 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popSuccess {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   2-CAR SCANDINAVIAN WOODEN TRAIN
   ========================================================================== */
.train-stage-container {
  width: 100%;
  position: relative;
  margin: 4px 0 14px;
  padding: 16px 4px 8px;
}

/* Subtle steam */
.steam-chimney-area {
  position: absolute;
  top: 0px;
  left: 28px;
  pointer-events: none;
}
.steam-puff { position: absolute; background: rgba(203, 213, 225, 0.85); border-radius: 50%; }
.puff-1 { width: 14px; height: 14px; top: 6px; left: 0; animation: steamDrift 2s infinite ease-out; }
.puff-2 { width: 18px; height: 18px; top: -2px; left: 6px; animation: steamDrift 2s infinite ease-out 0.8s; }

@keyframes steamDrift {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0.8; }
  100% { transform: translate(32px, -32px) scale(1.4); opacity: 0; }
}

.train-assembly {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  z-index: 4;
}

/* 1. LOCOMOTIVE (Wooden Scandinavian Style) */
.loco-unit {
  width: 145px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.loco-cabin {
  width: 66px;
  height: 54px;
  background: var(--train-yellow);
  border-radius: 8px 8px 0 0;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #b45309;
}

.cabin-window {
  width: 32px;
  height: 30px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
}

.engineer-emoji { font-size: 1.25rem; }

.loco-boiler {
  width: 140px;
  height: 52px;
  background: var(--train-blue);
  border-radius: 16px 8px 4px 4px;
  position: relative;
  border: 2.5px solid var(--brand-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chimney {
  position: absolute;
  top: -18px;
  left: 20px;
  width: 18px;
  height: 18px;
  background: var(--train-dark);
  border-radius: 3px 3px 0 0;
}
.chimney-cap {
  position: absolute;
  top: -4px;
  left: -3px;
  width: 24px;
  height: 5px;
  background: var(--train-dark);
  border-radius: 2px;
}

.loco-logo-wrap {
  width: 95px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.train-brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.headlight {
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 16px;
  background: #fef08a;
  border-radius: 6px 0 0 6px;
  box-shadow: -4px 0 8px rgba(254, 240, 138, 0.8);
}

.cowcatcher {
  position: absolute;
  bottom: 6px;
  left: -12px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-right: 14px solid var(--wood-light);
}

/* 2. COUPLINGS */
.train-coupling {
  width: 12px;
  height: 8px;
  background: var(--train-dark);
  border-radius: 2px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

/* 3. CARRIAGES 1 & 2 (WOODEN BOX BODY + PORTHOLE WINDOWS) */
.wooden-car {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.car-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.wood-car-body {
  background: linear-gradient(180deg, #ecd3ae 0%, #ddb481 100%);
  border: 2.5px solid var(--wood-dark);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  position: relative;
}

/* Portholes row */
.portholes-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Circular Wooden Porthole Window */
.porthole {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 4.5px solid var(--wood-rim);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  position: relative;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Subtle rivet bolts on wooden porthole rim */
.porthole::before, .porthole::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--wood-dark);
  border-radius: 50%;
}
.porthole::before { top: 1px; left: 50%; transform: translateX(-50%); }
.porthole::after { bottom: 1px; left: 50%; transform: translateX(-50%); }

.porthole.seat-empty {
  background: #f8fafc;
  border: 3.5px dashed #94a3b8;
  color: #94a3b8;
  font-size: 1.6rem;
  font-weight: 700;
  animation: portholePulse 1.6s infinite ease-in-out;
}

@keyframes portholePulse {
  0%, 100% { border-color: #94a3b8; background: #f8fafc; }
  50% { border-color: var(--brand-pink); background: #fdf2f8; }
}

.porthole.seat-bunny {
  animation: popSuccess 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Blue Carriage Chassis Base */
.car-chassis {
  width: 100%;
  height: 10px;
  background: var(--train-blue);
  border-radius: 0 0 3px 3px;
  border: 2px solid var(--brand-blue-dark);
  border-top: none;
  margin-top: -2px;
}

/* Wheels (Dark Tire + Wooden Hub) */
.wheel-group {
  display: flex;
  justify-content: space-around;
  width: 85%;
  margin-top: -5px;
}

.wheel-outer {
  border-radius: 50%;
  background: var(--train-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.25);
}

.wheel-hub {
  border-radius: 50%;
  background: var(--wood-light);
  border: 1.5px solid var(--wood-dark);
}

.w-back { width: 38px; height: 38px; }
.w-back .wheel-hub { width: 16px; height: 16px; }

.w-front { width: 30px; height: 30px; margin-top: 8px; }
.w-front .wheel-hub { width: 12px; height: 12px; }

.w-car-1, .w-car-2, .w-car-3, .w-car-4 {
  width: 28px;
  height: 28px;
}
.w-car-1 .wheel-hub, .w-car-2 .wheel-hub, .w-car-3 .wheel-hub, .w-car-4 .wheel-hub {
  width: 12px;
  height: 12px;
}

/* Railway Track */
.railway-track-line {
  width: 100%;
  height: 16px;
  position: relative;
  margin-top: -3px;
  z-index: 2;
}

.steel-rail {
  width: 100%;
  height: 4px;
  background: #94a3b8;
  border-radius: 2px;
}

.ties-group {
  width: 100%;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #cbd5e1 0px,
    #cbd5e1 10px,
    transparent 10px,
    transparent 24px
  );
  margin-top: 2px;
}

/* ==========================================================================
   INTERACTION ZONE & 5 NUMBER BUTTONS (1 to 5, NO 0)
   ========================================================================== */
.interaction-zone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.prompt-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.prompt-text { font-size: 1.15rem; font-weight: 700; color: var(--brand-blue); }
.prompt-vn { font-family: var(--font-family-sub); font-size: 0.95rem; font-weight: 600; color: var(--text-muted); }

/* 5 Number Buttons (1, 2, 3, 4, 5) */
.choices-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
}

.choice-btn {
  flex: 1;
  min-height: 82px;
  max-width: 90px;
  border-radius: 22px;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-button);
}

.choice-1 { background: #e0f2fe; color: #0284c7; }
.choice-2 { background: #fef9c3; color: #ca8a04; }
.choice-3 { background: #dcfce7; color: #16a34a; }
.choice-4 { background: #fce7f3; color: #db2777; }
.choice-5 { background: #ede9fe; color: #7c3aed; }

.choice-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.05); }
.choice-btn:active:not(:disabled) { transform: translateY(3px) scale(0.96); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }

.choice-num { font-size: 3rem; font-weight: 700; line-height: 1; }

.choice-btn.correct-choice {
  background: #10b981 !important;
  color: #ffffff !important;
  transform: scale(1.1) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 4px 0 #047857 !important;
}

.choice-btn.wrong-choice {
  background: #fecdd3 !important;
  color: #be123c !important;
  animation: gentleShake 0.45s ease-in-out;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* Feedback Notification Banner */
.feedback-banner {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  visibility: hidden;
  opacity: 0;
  transition: all 0.25s ease;
}

.feedback-banner.show { visibility: visible; opacity: 1; }

.feedback-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  border-radius: 18px;
  font-weight: 700;
  box-shadow: var(--shadow-subtle);
  animation: popIn 0.3s ease;
}

.feedback-banner.is-correct .feedback-inner { background: #ecfdf5; color: #065f46; border: 1.5px solid #6ee7b7; }
.feedback-banner.is-wrong .feedback-inner { background: #fff1f2; color: #9f1239; border: 1.5px solid #fda4af; }
.feedback-icon { font-size: 1.4rem; }
.feedback-messages { display: flex; flex-direction: column; }
.feedback-en { font-size: 1.1rem; }
.feedback-vn { font-family: var(--font-family-sub); font-size: 0.9rem; opacity: 0.9; }

/* ==========================================================================
   SCREEN 3: CELEBRATION MODAL & FLYING BEE
   ========================================================================== */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#confetti-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 101; }

.celebration-card {
  position: relative;
  z-index: 102;
  background: #ffffff;
  border-radius: 36px;
  padding: 34px 28px 28px;
  max-width: 580px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 4px solid #fef08a;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bee-stage { position: relative; width: 100%; height: 130px; margin-bottom: 6px; }
.bee-flyer { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: beeFloat 3.5s ease-in-out infinite; }
.bee-img { width: 125px; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15)); }

@keyframes beeFloat { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-12px); } }

.bee-speech-bubble {
  position: absolute;
  bottom: 80px;
  left: 105px;
  background: #fef08a;
  border: 2px solid #eab308;
  border-radius: 18px;
  padding: 8px 14px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  animation: popIn 0.5s ease;
}

.bubble-tail { position: absolute; bottom: -8px; left: 16px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #eab308; }
.bubble-quote { font-size: 1.2rem; font-weight: 700; color: #854d0e; }
.bubble-vn { font-family: var(--font-family-sub); font-size: 0.9rem; font-weight: 600; color: #a16207; }

.celebration-badge-logo { margin-bottom: 8px; }
.celeb-logo { height: 40px; width: auto; background: transparent; }
.celeb-headline { font-size: 2.3rem; font-weight: 700; color: var(--brand-pink); line-height: 1.1; }
.celeb-subline { font-size: 1.5rem; font-weight: 700; color: var(--brand-blue); margin-top: 4px; }
.celeb-vn { font-family: var(--font-family-sub); font-size: 1.05rem; font-weight: 600; color: #64748b; margin: 4px 0 16px; }

.celebration-stars-row { font-size: 1.6rem; letter-spacing: 8px; margin-bottom: 20px; }

.btn-play-again-bounce {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--brand-pink) 0%, var(--brand-pink-dark) 100%);
  color: #ffffff;
  border: none;
  border-radius: 26px;
  padding: 12px 38px;
  cursor: pointer;
  box-shadow: 0 6px 0 #9d174d, 0 14px 20px rgba(230, 28, 137, 0.3);
  transition: all 0.15s ease;
}

.btn-play-again-bounce:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #9d174d; }
.btn-play-again-bounce:active { transform: translateY(3px); box-shadow: 0 3px 0 #9d174d; }

.restart-icon { font-size: 1.6rem; line-height: 1; }
.restart-main { font-size: 1.5rem; font-weight: 700; }
.restart-sub { font-family: var(--font-family-sub); font-size: 0.9rem; opacity: 0.95; }

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================================================== */
@media (max-width: 780px) {
  .train-assembly { transform: scale(0.85); transform-origin: center bottom; }
  .bond-diagram-card { max-width: 380px; }
}

@media (max-width: 640px) {
  .game-container { padding: 6px 8px 16px; }
  .top-nav { padding: 6px 10px; }
  .brand-logo { height: 34px; }
  .question-banner { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; }
  .english-question { font-size: 1.5rem; }
  .vietnamese-question { font-size: 0.95rem; }
  .bond-diagram-card { max-width: 320px; padding: 8px 12px; }
  .node-whole { width: 58px; height: 58px; }
  .node-whole .node-num { font-size: 1.9rem; }
  .node-part { width: 54px; height: 54px; }
  .node-part .node-num { font-size: 1.7rem; }
  .node-part .part-avatar { font-size: 1.1rem; margin-bottom: 1px; }
  .train-assembly { transform: scale(0.68); transform-origin: center bottom; }
  .choices-container { gap: 10px; }
  .choice-btn { min-height: 68px; border-radius: 16px; }
  .choice-num { font-size: 2.4rem; }
}

@media (max-width: 480px) {
  .train-assembly { transform: scale(0.56); transform-origin: center bottom; }
  .choices-container { gap: 8px; }
  .choice-btn { min-height: 60px; border-radius: 14px; }
  .choice-num { font-size: 2rem; }
}

/* Audio replay prompt animation when autoplay is restricted */
.audio-replay-btn.pulse-prompt {
  animation: promptPulse 1.2s infinite ease-in-out;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.45) !important;
}
@keyframes promptPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
