/* =================================================================
   BALLOON BLAST — STYLESHEET
   Organized sections: Variables, Reset, Background, Typography,
   Buttons, Home Screen, Game Screen, Modals, Components,
   Animations, Responsive
   ================================================================= */

/* ---------------------------------------------------------------
   1. ROOT VARIABLES
   --------------------------------------------------------------- */
:root {
  /* Primary palette */
  --sky-blue: #4FC3F7;
  --sky-blue-dark: #1E9EDB;
  --purple: #9B5DE5;
  --purple-dark: #7B3FC4;
  --pink: #FF6FB5;
  --pink-dark: #E84393;
  --yellow: #FFD93D;
  --yellow-dark: #F5B700;

  /* Accents */
  --gold: #FFC93C;
  --white: #FFFFFF;

  /* Neutrals */
  --ink: #2D2A4A;
  --ink-soft: #5A567A;
  --shadow-color: rgba(45, 42, 74, 0.25);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-blur: 14px;

  /* Fonts */
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Poppins', sans-serif;
  --font-alt: 'Nunito', sans-serif;

  /* Radii & Spacing */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 999px;

  /* Transitions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------
   2. RESET
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
}

img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------
   3. ANIMATED BACKGROUND
   --------------------------------------------------------------- */
.app-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--sky-blue-dark) 0%, var(--sky-blue) 45%, #B8E8FF 100%);
  transition: background 0.6s ease;
}

/* Theme variants — applied via body[data-theme], set by the Settings
   modal's theme swatches (js/settings.js). Sky theme is the default
   above, so only Sunset and Candy need overrides here. */
body[data-theme="sunset"] .sky {
  background: linear-gradient(180deg, #7B3FC4 0%, #E84393 45%, #FFB199 75%, #FFD93D 100%);
}
body[data-theme="sunset"] .sun-glow {
  background: radial-gradient(circle, rgba(255, 217, 61, 0.9) 0%, rgba(255, 111, 181, 0.4) 60%, transparent 100%);
}
body[data-theme="sunset"] .mountain--back { border-bottom-color: rgba(123, 63, 196, 0.55); }
body[data-theme="sunset"] .mountain--front { border-bottom-color: rgba(232, 67, 147, 0.55); }

body[data-theme="candy"] .sky {
  background: linear-gradient(180deg, #7B3FC4 0%, #9B5DE5 40%, #FF6FB5 75%, #FFC9E3 100%);
}
body[data-theme="candy"] .sun-glow {
  background: radial-gradient(circle, rgba(255, 111, 181, 0.9) 0%, rgba(155, 93, 229, 0.4) 60%, transparent 100%);
}
body[data-theme="candy"] .mountain--back { border-bottom-color: rgba(123, 63, 196, 0.55); }
body[data-theme="candy"] .mountain--front { border-bottom-color: rgba(255, 111, 181, 0.5); }

.sun-glow {
  position: absolute;
  top: -80px;
  right: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.9) 0%, rgba(255, 217, 61, 0) 70%);
  animation: pulse 5s ease-in-out infinite;
}

.cloud {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius-full);
  opacity: 0.9;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.05));
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: var(--white);
  border-radius: 50%;
}
.cloud--1 { width: 140px; height: 46px; top: 8%; left: -10%; animation: drift 38s linear infinite; }
.cloud--1::before { width: 70px; height: 70px; top: -34px; left: 15px; }
.cloud--1::after { width: 50px; height: 50px; top: -22px; left: 70px; }

.cloud--2 { width: 100px; height: 36px; top: 20%; left: -20%; animation: drift 50s linear infinite 4s; }
.cloud--2::before { width: 50px; height: 50px; top: -24px; left: 10px; }
.cloud--2::after { width: 40px; height: 40px; top: -16px; left: 50px; }

.cloud--3 { width: 160px; height: 50px; top: 5%; left: -15%; animation: drift 60s linear infinite 10s; }
.cloud--3::before { width: 80px; height: 80px; top: -38px; left: 20px; }
.cloud--3::after { width: 60px; height: 60px; top: -26px; left: 85px; }

.cloud--4 { width: 90px; height: 32px; top: 15%; left: -12%; animation: drift 44s linear infinite 20s; }
.cloud--4::before { width: 44px; height: 44px; top: -20px; left: 10px; }
.cloud--4::after { width: 34px; height: 34px; top: -14px; left: 44px; }

.mountains {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 100%;
  height: 160px;
}
.mountain {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
}
.mountain--back {
  left: -5%;
  border-bottom: 140px solid rgba(123, 63, 196, 0.35);
}
.mountain--front {
  left: 25%;
  border-bottom: 110px solid rgba(155, 93, 229, 0.4);
}

.grass {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(180deg, #7ED957 0%, #4CAF50 100%);
  border-top-left-radius: 50% 20px;
  border-top-right-radius: 50% 20px;
}

/* ---------------------------------------------------------------
   4. SCREENS (layout containers)
   --------------------------------------------------------------- */
.screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s var(--ease-smooth);
}

/* ---------------------------------------------------------------
   5. HOME SCREEN
   --------------------------------------------------------------- */
#home-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.floating-balloons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.balloon {
  position: absolute;
  width: 90px;
  height: 110px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  box-shadow: inset -12px -12px 20px rgba(0,0,0,0.12), 0 10px 20px rgba(0,0,0,0.15);
  animation: float 6s ease-in-out infinite;
}
.balloon::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid inherit;
}
.balloon-string {
  position: absolute;
  bottom: -60px;
  left: 50%;
  width: 2px;
  height: 60px;
  background: rgba(45,42,74,0.35);
}

.balloon--pink   { background: var(--pink);   left: 8%;  top: 15%; animation-duration: 7s; }
.balloon--purple { background: var(--purple); left: 78%; top: 10%; animation-duration: 8s; animation-delay: 1s; }
.balloon--yellow { background: var(--yellow); left: 85%; top: 55%; animation-duration: 6.5s; animation-delay: 2s; }
.balloon--sky    { background: var(--sky-blue); left: 5%; top: 60%; animation-duration: 7.5s; animation-delay: 0.5s; }
.balloon--small  { width: 55px; height: 68px; }
.floating-balloons .balloon--pink.balloon--small   { left: 15%; top: 45%; animation-duration: 5s; }
.floating-balloons .balloon--purple.balloon--small { left: 65%; top: 75%; animation-duration: 5.5s; animation-delay: 1.5s; }

.home-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 48px 56px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px var(--shadow-color);
  animation: scaleIn 0.6s var(--ease-bounce);
}

.logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.game-logo {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.logo-word--balloon { color: var(--white); text-shadow: 0 4px 0 var(--purple-dark), 0 8px 16px rgba(0,0,0,0.25); }
.logo-word--blast { color: var(--yellow); text-shadow: 0 4px 0 var(--pink-dark), 0 8px 16px rgba(0,0,0,0.25); }
.logo-dot { color: var(--pink); animation: pulse 1.6s ease-in-out infinite; display: inline-block; }

.logo-subtitle {
  font-family: var(--font-alt);
  font-weight: 700;
  color: var(--white);
  opacity: 0.9;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.main-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 280px;
}

.version-tag {
  font-family: var(--font-alt);
  font-size: 0.8rem;
  color: var(--white);
  opacity: 0.75;
}

.home-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-alt);
  font-size: 0.78rem;
  color: var(--white);
  opacity: 0.85;
  z-index: 2;
}
.home-footer .heart { color: var(--pink); animation: pulse 1.2s ease-in-out infinite; display: inline-block; }

/* ---------------------------------------------------------------
   6. BUTTONS
   --------------------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s var(--ease-bounce), box-shadow 0.2s var(--ease-smooth), filter 0.2s;
  box-shadow: 0 6px 0 rgba(0,0,0,0.18), 0 10px 20px rgba(0,0,0,0.15);
}
.btn:hover { transform: translateY(-3px); filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.12); }

.btn--primary { background: linear-gradient(180deg, var(--pink) 0%, var(--pink-dark) 100%); }
.btn--secondary { background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%); }
.btn--ghost {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: none;
}
.btn--ghost:active { transform: translateY(1px); }
.btn--danger { background: linear-gradient(180deg, #FF6B6B 0%, #E84545 100%); }

.btn--large { font-size: 1.2rem; padding: 18px 36px; }
.btn--small { padding: 8px 18px; font-size: 0.85rem; box-shadow: 0 3px 0 rgba(0,0,0,0.18); }

.btn-icon { font-size: 0.95em; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.5);
  color: var(--ink);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease-bounce), background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.5); transform: scale(1.08); }
.icon-btn:active { transform: scale(0.94); }

/* ---------------------------------------------------------------
   7. GLASSMORPHISM PANEL (shared)
   --------------------------------------------------------------- */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 12px 30px var(--shadow-color);
}

/* ---------------------------------------------------------------
   8. GAME SCREEN — TOP BAR
   --------------------------------------------------------------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-wrap: wrap;
}

.stat-group { display: flex; align-items: center; gap: 12px; }
.stat-group--center { flex: 1; justify-content: center; }

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.4);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  min-width: 70px;
}
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--purple-dark); }

.timer-pill, .combo-pill {
  font-family: var(--font-display);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--white);
}
.timer-pill { background: linear-gradient(135deg, var(--sky-blue), var(--sky-blue-dark)); }
.combo-pill { background: linear-gradient(135deg, var(--yellow), var(--yellow-dark)); color: var(--ink); animation: pulse 1.5s ease-in-out infinite; }

.top-bar-actions { gap: 8px; }

/* ---------------------------------------------------------------
   9. GAME SCREEN — GAME AREA
   --------------------------------------------------------------- */
.game-area-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.game-area {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: min(70vh, 640px);
  background: rgba(255,255,255,0.15);
  border: 3px dashed rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(255,255,255,0.15);
}

.game-area-placeholder {
  font-family: var(--font-alt);
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------------------------------------------------------------
   10. GAME SCREEN — BOTTOM BAR
   --------------------------------------------------------------- */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 14px 24px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
  gap: 12px;
}

.bottom-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bottom-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-weight: 700; }

.badge {
  font-family: var(--font-display);
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: 0.9rem;
}
.badge--difficulty { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); }
.badge--level { background: linear-gradient(135deg, var(--pink), var(--pink-dark)); }

.lives-display { display: flex; gap: 4px; }
.life-icon { color: var(--pink); font-size: 1.2rem; animation: pulse 2s ease-in-out infinite; }

/* Level progress bar */
.level-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.3);
}
.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--gold));
  transition: width 0.4s var(--ease-smooth);
  box-shadow: 0 0 10px var(--gold);
}

/* ---------------------------------------------------------------
   11. MODALS (Game Over / Settings)
   --------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 15, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s var(--ease-smooth);
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  animation: scaleIn 0.4s var(--ease-bounce);
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(255,255,255,0.6));
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--purple-dark);
  margin-bottom: 6px;
}
.modal-subtitle { font-family: var(--font-alt); color: var(--ink-soft); margin-bottom: 24px; }

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  font-size: 1.1rem;
  color: var(--ink);
  transition: background 0.2s, transform 0.15s;
}
.modal-close-btn:hover { background: rgba(0,0,0,0.15); transform: rotate(90deg); }

/* Game Over specifics */
.trophy-wrap { position: relative; display: inline-block; margin-bottom: 8px; }
.trophy-icon {
  font-size: 4.5rem;
  display: inline-block;
  animation: bounce 1.4s ease-in-out infinite;
}
.trophy-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,201,60,0.6) 0%, rgba(255,201,60,0) 70%);
  animation: glow 2s ease-in-out infinite;
}

.score-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.score-box {
  flex: 1;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.score-box--best { background: linear-gradient(160deg, rgba(255,217,61,0.5), rgba(255,201,60,0.3)); }
.score-box-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); font-weight: 700; margin-bottom: 4px; }
.score-box-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; color: var(--purple-dark); }

.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.btn--share { align-self: center; }

/* Settings specifics */
.settings-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; text-align: left; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row-label { font-family: var(--font-alt); font-weight: 700; color: var(--ink); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #D8D4E8;
  border-radius: var(--radius-full);
  transition: background 0.3s var(--ease-smooth);
  cursor: pointer;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.3s var(--ease-bounce);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: linear-gradient(135deg, var(--pink), var(--purple)); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(24px); }

/* Segmented control (difficulty) */
.segmented-control {
  display: flex;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}
.segment {
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  color: var(--ink-soft);
  transition: all 0.2s var(--ease-smooth);
}
.segment--active, .segment:hover { background: var(--white); color: var(--purple-dark); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }

/* Theme selector swatches */
.theme-selector { display: flex; gap: 10px; }
.theme-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease-bounce);
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch--sky { background: linear-gradient(135deg, var(--sky-blue), var(--purple)); }
.theme-swatch--sunset { background: linear-gradient(135deg, var(--pink), var(--yellow)); }
.theme-swatch--candy { background: linear-gradient(135deg, var(--purple), var(--pink)); }

/* ---------------------------------------------------------------
   12. ACHIEVEMENT POPUP (toast)
   --------------------------------------------------------------- */
.achievement-popup {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--white), #FFF6DA);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: dropIn 0.5s var(--ease-bounce);
}
.achievement-icon { font-size: 1.8rem; animation: pulse 1s ease-in-out infinite; }
.achievement-text { display: flex; flex-direction: column; text-align: left; }
.achievement-title { font-family: var(--font-display); font-weight: 600; color: var(--purple-dark); font-size: 0.95rem; }
.achievement-desc { font-family: var(--font-alt); font-size: 0.78rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------
   13. LOADING SPINNER
   --------------------------------------------------------------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 15, 40, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.spinner {
  width: 56px; height: 56px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-text { font-family: var(--font-display); color: var(--white); font-size: 1rem; }

/* ---------------------------------------------------------------
   14. TOOLTIP
   --------------------------------------------------------------- */
.tooltip-wrap { position: relative; cursor: help; display: inline-block; }
.tooltip-text {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-alt);
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.tooltip-wrap:hover .tooltip-text,
.tooltip-wrap:focus .tooltip-text {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ---------------------------------------------------------------
   15. KEYFRAME ANIMATIONS
   --------------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-30px) rotate(2deg); }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(130vw); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes dropIn {
  from { opacity: 0; transform: translate(-50%, -30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------
   16. RESPONSIVE DESIGN
   --------------------------------------------------------------- */

/* Tablet */
@media (max-width: 900px) {
  .home-content { padding: 36px 32px; }
  .top-bar, .bottom-bar { padding: 12px 16px; }
  .game-area { height: 60vh; }
}

/* Mobile */
@media (max-width: 600px) {
  .game-logo { font-size: 2.4rem; gap: 6px; }
  .home-content { padding: 28px 20px; gap: 28px; }
  .main-menu { max-width: 100%; }

  .top-bar { flex-direction: column; gap: 10px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .stat-group--center { order: 3; }
  .top-bar-actions { order: 2; }

  .bottom-bar { flex-direction: row; justify-content: space-between; padding: 10px 14px; }
  .bottom-label { font-size: 0.6rem; }

  .modal { padding: 28px 20px; }
  .score-summary { flex-direction: column; }

  .balloon { width: 60px; height: 74px; }
  .balloon--small { width: 40px; height: 50px; }
}

/* Small mobile */
@media (max-width: 380px) {
  .stat-card { min-width: 56px; padding: 4px 10px; }
  .stat-value { font-size: 1.05rem; }
  .btn--large { padding: 14px 24px; font-size: 1.05rem; }
}