/* ==========================================================================
   Listen, Blend & Build! - Phonics CVC Game
   Child-Friendly Preschool UI Stylesheet
   ========================================================================== */

:root {
  --font-main: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
  --font-letter: 'Nunito', 'Fredoka', system-ui, sans-serif;

  /* Pastel Color Palette */
  --pastel-blue-bg: #e0f2fe;
  --pastel-yellow-bg: #fef9c3;
  --pastel-pink-bg: #fce7f3;
  --pastel-green-bg: #dcfce7;
  --pastel-orange-bg: #ffedd5;

  /* Accent & Interactive Colors */
  --primary-blue: #0284c7;
  --primary-blue-light: #38bdf8;
  --accent-yellow: #f59e0b;
  --accent-yellow-light: #fef08a;
  --accent-green: #22c55e;
  --accent-green-dark: #15803d;
  --accent-green-light: #86efac;
  --accent-coral: #f97316;
  --accent-coral-soft: #fed7aa;
  --accent-purple: #8b5cf6;

  /* Neutral tones */
  --text-dark: #1e293b;
  --text-medium: #475569;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.94);
  --card-border: #e2e8f0;
  
  /* Tile Colors */
  --tile-bg-1: #fed7aa; /* Soft Peach */
  --tile-border-1: #fb923c;
  --tile-bg-2: #fef08a; /* Pastel Yellow */
  --tile-border-2: #eab308;
  --tile-bg-3: #bae6fd; /* Sky Blue */
  --tile-border-3: #38bdf8;
  --tile-correct-bg: #86efac; /* Mint Green */
  --tile-correct-border: #22c55e;
  --tile-correct-text: #14532d;
}

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

html, body {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-main);
  background: linear-gradient(135deg, #e0f2fe 0%, #fef9c3 50%, #fce7f3 100%);
  color: var(--text-dark);
}

/* Ambient Floating Clouds and Bubbles */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  filter: blur(2px);
}
.cloud-1 {
  width: 240px;
  height: 70px;
  top: 6%;
  left: -80px;
  animation: driftCloud 45s linear infinite;
}
.cloud-2 {
  width: 320px;
  height: 90px;
  top: 18%;
  right: -120px;
  animation: driftCloudRev 55s linear infinite;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.15));
  box-shadow: 0 4px 15px rgba(255,255,255,0.4);
}
.bubble-1 { width: 50px; height: 50px; bottom: 15%; left: 8%; animation: floatBubble 9s ease-in-out infinite; }
.bubble-2 { width: 70px; height: 70px; top: 35%; right: 6%; animation: floatBubble 11s ease-in-out infinite 2s; }
.bubble-3 { width: 40px; height: 40px; bottom: 25%; right: 14%; animation: floatBubble 8s ease-in-out infinite 1s; }
.bubble-4 { width: 35px; height: 35px; top: 12%; left: 22%; animation: floatBubble 10s ease-in-out infinite 3s; }

@keyframes driftCloud {
  0% { transform: translateX(0); }
  50% { transform: translateX(calc(100vw + 160px)); }
  50.01% { transform: translateX(-300px); }
  100% { transform: translateX(0); }
}
@keyframes driftCloudRev {
  0% { transform: translateX(0); }
  50% { transform: translateX(calc(-100vw - 200px)); }
  50.01% { transform: translateX(300px); }
  100% { transform: translateX(0); }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.08); }
}

/* Game Outer Wrapper */
.game-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header Section
   ========================================================================== */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
}

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

.school-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.title-wrap {
  display: flex;
  flex-direction: column;
}

.game-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0369a1;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.game-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: #d97706;
}

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

/* Progress Star Pills */
.progress-tracker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(241, 245, 249, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
}

.star-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  background: transparent;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-pill.active {
  background: #fef08a;
  color: #854d0e;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.3);
  transform: scale(1.08);
}

.star-pill.completed {
  background: #bbf7d0;
  color: #166534;
}

.star-icon {
  font-size: 1rem;
}

/* Sound Control Button */
.control-btn {
  background: white;
  border: 2px solid #e2e8f0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.control-btn:hover {
  transform: scale(1.06);
  border-color: #38bdf8;
}

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

/* ==========================================================================
   Main Play Area (Landscape 3-Section Layout)
   ========================================================================== */
.play-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 16px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------------------
   Section A: Audio Hint & Bee Mascot
   -------------------------------------------------------------------------- */
.audio-hint-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.mascot-speaker-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(254, 240, 138, 0.4) 0%, rgba(224, 242, 254, 0.5) 100%);
  padding: 10px 24px;
  border-radius: 24px;
  border: 2px solid #fde047;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.12);
}

/* Bee Mascot */
.mascot-wrap {
  position: relative;
  width: 90px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatMascot 3.5s ease-in-out infinite;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.12));
  transition: transform 0.3s ease;
}

.mascot-shadow {
  position: absolute;
  bottom: -4px;
  width: 50px;
  height: 8px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  filter: blur(2px);
  animation: shadowPulse 3.5s ease-in-out infinite;
}

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

@keyframes shadowPulse {
  0%, 100% { transform: scale(1); opacity: 0.12; }
  50% { transform: scale(0.85); opacity: 0.06; }
}

/* Speaker Callout */
.speaker-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.big-speaker-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
  border: none;
  border-radius: 999px;
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #d97706, 0 10px 20px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
}

.big-speaker-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #d97706, 0 12px 24px rgba(245, 158, 11, 0.35);
}

.big-speaker-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #d97706, 0 4px 8px rgba(245, 158, 11, 0.2);
}

.big-speaker-btn.playing {
  animation: speakerPulse 1s ease-in-out infinite;
}

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

.speaker-icon-wrap {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.svg-speaker {
  width: 100%;
  height: 100%;
}

.speaker-wave-ring {
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid #fbbf24;
  opacity: 0;
  pointer-events: none;
}

.big-speaker-btn.playing .ring-1 {
  animation: waveRing 1.4s ease-out infinite;
}
.big-speaker-btn.playing .ring-2 {
  animation: waveRing 1.4s ease-out infinite 0.4s;
}

@keyframes waveRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.hint-audio-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  letter-spacing: 0.2px;
}

/* --------------------------------------------------------------------------
   Section B: Scrambled Letter Tiles
   -------------------------------------------------------------------------- */
.scrambled-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.section-label {
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.2px;
}

.tiles-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  min-height: 122px;
  width: 100%;
  max-width: 540px;
  padding: 8px 18px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 28px;
  border: 2px dashed #cbd5e1;
}

/* Letter Tile Styling */
.letter-tile {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  font-family: var(--font-letter);
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-dark);
  cursor: grab;
  touch-action: none;
  box-shadow: 0 7px 0 rgba(0,0,0,0.12), 0 10px 18px rgba(0,0,0,0.08);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.2s ease;
}

.letter-tile:active {
  cursor: grabbing;
}

.letter-tile.tile-color-0 {
  background: linear-gradient(180deg, #ffedd5 0%, #fed7aa 100%);
  border: 3px solid #fb923c;
  color: #9a3412;
  box-shadow: 0 7px 0 #ea580c, 0 10px 18px rgba(234, 88, 12, 0.25);
}

.letter-tile.tile-color-1 {
  background: linear-gradient(180deg, #fef9c3 0%, #fef08a 100%);
  border: 3px solid #facc15;
  color: #854d0e;
  box-shadow: 0 7px 0 #ca8a04, 0 10px 18px rgba(202, 138, 4, 0.25);
}

.letter-tile.tile-color-2 {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  border: 3px solid #38bdf8;
  color: #0369a1;
  box-shadow: 0 7px 0 #0284c7, 0 10px 18px rgba(2, 132, 199, 0.25);
}

.letter-tile:hover {
  transform: translateY(-4px) scale(1.04);
}

.letter-tile:active, .letter-tile.dragging {
  transform: translateY(2px) scale(1.08);
  z-index: 999;
}

/* Sound wave icon badge on tile */
.tile-audio-indicator {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.75rem;
  opacity: 0.55;
  pointer-events: none;
}

/* Tile ghost while dragging */
.letter-tile.is-drag-origin {
  opacity: 0.25;
  filter: grayscale(0.6);
}

/* Tile incorrect shake */
.letter-tile.shake, .letter-slot.shake {
  animation: tileShake 0.45s ease-in-out;
}

@keyframes tileShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-12px) rotate(-4deg); }
  40% { transform: translateX(12px) rotate(4deg); }
  60% { transform: translateX(-8px) rotate(-2deg); }
  80% { transform: translateX(8px) rotate(2deg); }
}

/* Correct state in slot */
.letter-tile.snapped-correct {
  background: linear-gradient(180deg, #bbf7d0 0%, #86efac 100%) !important;
  border-color: #22c55e !important;
  color: #14532d !important;
  box-shadow: 0 6px 0 #16a34a, 0 10px 18px rgba(22, 163, 74, 0.3) !important;
  cursor: default;
  animation: correctPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correctPop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Section C: Fill in the Blank Word Builder (Preschool Worksheet Style)
   Directly inspired by user worksheet reference
   -------------------------------------------------------------------------- */
.word-building-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  width: 100%;
}

.worksheet-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: #ffffff;
  padding: 14px 28px;
  border-radius: 30px;
  border: 3px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  max-width: 680px;
  width: 100%;
}

/* Picture Prompt Card on Left (like Image 2 worksheet) */
.target-word-visual-hint {
  display: flex;
  align-items: center;
}

.worksheet-pic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2.5px solid #cbd5e1;
  border-radius: 24px;
  padding: 10px 16px;
  min-width: 106px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.worksheet-emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.worksheet-pic-caption {
  font-size: 0.92rem;
  font-weight: 800;
  color: #334155;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

/* The 3 Blanks Track */
.blanks-track {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Blank Slot */
.blank-slot {
  position: relative;
  width: 104px;
  height: 120px;
  background: #f8fafc;
  border-radius: 22px;
  border: 3px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 6px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.65;
}

/* Current sequential target blank */
.blank-slot.active-target {
  opacity: 1;
  background: #ffffff;
  border-color: #38bdf8;
  border-style: dashed;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18), 0 4px 12px rgba(56, 189, 248, 0.1);
  animation: activeTargetGlow 2s ease-in-out infinite alternate;
}

@keyframes activeTargetGlow {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* The Letter inside the Blank */
.blank-letter {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-letter);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: #14532d;
}

/* The Worksheet Blank Underline ___ */
.blank-underline {
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background: #94a3b8;
  transition: all 0.25s ease;
}

.blank-slot.active-target .blank-underline {
  background: #0284c7;
}

.blank-check-icon {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #22c55e;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}

/* Drag Over State */
.blank-slot.drag-over {
  border-color: #0284c7 !important;
  border-style: solid !important;
  background: #e0f2fe !important;
  transform: scale(1.06) !important;
  box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.25) !important;
}

.blank-slot.drag-over .blank-underline {
  background: #0284c7;
  transform: scaleX(1.15);
}

/* Error Flash State */
.blank-slot.error-flash {
  border-color: #f97316 !important;
  background: #fff7ed !important;
  opacity: 1 !important;
}

.blank-slot.error-flash .blank-underline {
  background: #ea580c !important;
}

/* Filled & Correct State */
.blank-slot.filled-correct {
  opacity: 1 !important;
  border-color: #86efac;
  border-style: solid;
  background: #f0fdf4;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.15);
  animation: correctPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blank-slot.filled-correct .blank-underline {
  background: #22c55e;
  height: 7px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.blank-slot.filled-correct .blank-check-icon {
  opacity: 1;
  transform: scale(1);
}

/* Visual Illustration for current word */
.target-word-visual-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-medium);
  min-height: 38px;
}

.word-pictogram {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Word Completion Celebration Overlay (1.8s auto-advance)
   ========================================================================== */
.celebration-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 28px;
  animation: fadeIn 0.2s ease-out;
}

.celebration-card {
  background: linear-gradient(135deg, #ffffff 0%, #fef9c3 100%);
  border: 4px solid #facc15;
  border-radius: 32px;
  padding: 24px 44px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(234, 179, 8, 0.25);
  animation: celebrationPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrationPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.celebration-stars {
  font-size: 1.8rem;
  margin-bottom: 4px;
  animation: starTwinkle 0.8s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15); }
}

.celebration-praise {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ca8a04;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(202, 138, 4, 0.15);
}

.celebration-word {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #15803d;
  margin: 6px 0;
  font-family: var(--font-letter);
}

.celebration-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
}

/* ==========================================================================
   End-of-Game Final Victory Screen
   ========================================================================== */
.victory-screen {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 28px;
  animation: fadeIn 0.3s ease-out;
}

.victory-card {
  width: 100%;
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.victory-mascot-wrap {
  width: 120px;
  height: 110px;
  margin: 0 auto;
  animation: victoryDance 1s ease-in-out infinite alternate;
}

.victory-bee {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}

@keyframes victoryDance {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-14px) rotate(4deg); }
}

.victory-title {
  font-size: 2.6rem;
  font-weight: 800;
  color: #0369a1;
  line-height: 1.1;
}

.victory-subtitle {
  font-size: 1.35rem;
  font-weight: 700;
  color: #d97706;
}

/* Grid of 4 completed words */
.completed-words-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  margin: 8px 0;
}

.word-card {
  background: #f8fafc;
  border: 2.5px solid #86efac;
  border-radius: 20px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  transition: transform 0.2s ease;
}

.word-card:hover {
  transform: translateY(-4px);
  border-color: #22c55e;
}

.word-card-letters {
  display: flex;
  gap: 3px;
}

.word-card-letter {
  background: #dcfce7;
  color: #15803d;
  font-family: var(--font-letter);
  font-size: 1.35rem;
  font-weight: 800;
  width: 26px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-card-icon {
  font-size: 1.6rem;
  margin: 2px 0;
}

.word-replay-btn {
  background: white;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.word-replay-btn:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}

.play-again-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 38px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #15803d, 0 10px 20px rgba(34, 197, 94, 0.35);
  transition: all 0.15s ease;
}

.play-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #15803d, 0 14px 24px rgba(34, 197, 94, 0.4);
}

.play-again-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d, 0 4px 10px rgba(34, 197, 94, 0.25);
}

/* ==========================================================================
   Start / Browser Audio Permission Modal
   ========================================================================== */
.start-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 28px;
}

.start-card {
  max-width: 520px;
  background: white;
  border: 3px solid #bae6fd;
  border-radius: 32px;
  padding: 32px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(3, 105, 161, 0.15);
}

.modal-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.modal-bee-wrap {
  width: 100px;
  height: 90px;
  animation: floatMascot 3s ease-in-out infinite;
}

.modal-bee {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12));
}

.modal-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #0369a1;
  line-height: 1.15;
}

.modal-desc {
  font-size: 1.05rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.45;
}

.start-game-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 42px;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: white;
  border: none;
  border-radius: 999px;
  font-family: var(--font-main);
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #0369a1, 0 10px 22px rgba(2, 132, 199, 0.35);
  transition: all 0.15s ease;
}

.start-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #0369a1, 0 14px 26px rgba(2, 132, 199, 0.4);
}

.start-game-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0369a1, 0 4px 10px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   Confetti Canvas
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-height: 720px) {
  .game-container {
    padding: 8px 12px;
  }
  .game-header {
    padding: 6px 12px;
    margin-bottom: 8px;
  }
  .school-logo {
    height: 38px;
  }
  .game-title {
    font-size: 1.25rem;
  }
  .play-area {
    padding: 10px 16px;
    gap: 8px;
  }
  .mascot-wrap {
    width: 70px;
    height: 65px;
  }
  .big-speaker-btn {
    padding: 8px 18px;
    font-size: 1.1rem;
  }
  .letter-tile {
    width: 82px;
    height: 82px;
    font-size: 3rem;
    border-radius: 20px;
  }
  .worksheet-row {
    padding: 10px 20px;
    gap: 20px;
  }
  .worksheet-pic-card {
    min-width: 90px;
    padding: 8px 12px;
  }
  .worksheet-emoji {
    font-size: 2.6rem;
  }
  .blank-slot {
    width: 90px;
    height: 106px;
    border-radius: 20px;
  }
  .blank-letter {
    font-size: 3.4rem;
  }
  .blank-underline {
    width: 60px;
    height: 5px;
  }
}

@media (max-width: 640px) {
  .game-title {
    font-size: 1.15rem;
  }
  .game-subtitle {
    display: none;
  }
  .star-pill .pill-label {
    display: none;
  }
  .letter-tile {
    width: 74px;
    height: 74px;
    font-size: 2.7rem;
  }
  .tiles-dock {
    gap: 12px;
    padding: 6px 12px;
    min-height: 98px;
  }
  .worksheet-row {
    flex-direction: column;
    padding: 8px 14px;
    gap: 12px;
  }
  .worksheet-pic-card {
    min-width: 80px;
    padding: 4px 10px;
    flex-direction: row;
    gap: 8px;
  }
  .worksheet-emoji {
    font-size: 2rem;
  }
  .blanks-track {
    gap: 12px;
  }
  .blank-slot {
    width: 82px;
    height: 96px;
    border-radius: 18px;
  }
  .blank-letter {
    font-size: 3rem;
  }
  .blank-underline {
    width: 54px;
    height: 5px;
  }
  .completed-words-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
