/* Talking Amal Fatima - Main Application Stylesheet */

:root {
  --primary: #FF5E88;
  --primary-light: #FFA3BA;
  --secondary: #7B68EE;
  --accent-yellow: #FFD166;
  --accent-blue: #4D96FF;
  --accent-green: #6BCB77;
  --bg-gradient: radial-gradient(circle at 50% 20%, #2D1B4E 0%, #150E28 50%, #0A0616 100%);
  --panel-bg: rgba(255, 255, 255, 0.09);
  --panel-border: rgba(255, 255, 255, 0.18);
  --text-main: #FFFFFF;
  --text-sub: #D9D5EB;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

/* Background Ambient Lighting */
.bg-ambient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: floatOrb 10s ease-in-out infinite alternate;
}

.glow-orb.orb-1 {
  width: 350px;
  height: 350px;
  background: #FF5E88;
  top: -100px;
  left: 10%;
}

.glow-orb.orb-2 {
  width: 400px;
  height: 400px;
  background: #7B68EE;
  bottom: -100px;
  right: 5%;
  animation-delay: -5s;
}

@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(40px) scale(1.15); }
}

/* App Header */
header.app-header {
  width: 100%;
  max-width: 600px;
  padding: 16px 20px 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 26px;
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  padding: 6px 10px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(255, 94, 136, 0.4);
}

.brand-title {
  font-family: 'Comfortaa', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FFFFFF 40%, #FFB8C9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-sub);
  letter-spacing: 0.5px;
}

/* Character Switcher Bar */
.char-switcher-row {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 6px;
  z-index: 12;
}

.char-switcher {
  display: flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(16px);
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.switcher-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.switcher-btn.active {
  background: linear-gradient(135deg, #0284C7, #38BDF8);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.5);
  transform: scale(1.04);
}

.switcher-btn[data-mode="amal"].active {
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  box-shadow: 0 4px 15px rgba(255, 94, 136, 0.5);
}

.switcher-btn[data-mode="duo"].active {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
}

/* Header Utilities & Action Icons */
.header-utils {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-tool-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: #FFF;
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.icon-tool-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px) scale(1.08);
}

/* Voice Selector Row */
.voice-row {
  width: 100%;
  max-width: 500px;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  z-index: 10;
}

.voice-selector {
  display: flex;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Shirt Color Palette Drawer */
.palette-drawer {
  position: absolute;
  top: 75px;
  right: 20px;
  background: rgba(24, 15, 40, 0.95);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.9);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.palette-drawer.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.palette-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-dots {
  display: flex;
  gap: 8px;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-dot.active, .color-dot:hover {
  transform: scale(1.25);
  border-color: #FFFFFF;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.dot-pink { background: #FFBCC9; }
.dot-blue { background: #74C0FC; }
.dot-yellow { background: #FFD43B; }
.dot-purple { background: #DA77F2; }
.dot-green { background: #8CE99A; }
.dot-red { background: #FF8787; }

/* Night Mode Starry Sky */
.night-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.moon {
  position: absolute;
  top: 60px;
  right: 15%;
  font-size: 48px;
  filter: drop-shadow(0 0 20px #FFE066);
}

.star {
  position: absolute;
  font-size: 20px;
  animation: starTwinkle 2s infinite ease-in-out alternate;
}

.star.s1 { top: 12%; left: 18%; animation-delay: 0.2s; }
.star.s2 { top: 22%; left: 82%; animation-delay: 0.8s; font-size: 24px; }
.star.s3 { top: 35%; left: 10%; animation-delay: 1.4s; }
.star.s4 { top: 40%; right: 12%; animation-delay: 0.5s; font-size: 26px; }
.star.s5 { top: 8%; left: 50%; animation-delay: 1.1s; }

@keyframes starTwinkle {
  0% { transform: scale(0.6); opacity: 0.3; }
  100% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 10px #FFF); }
}

body.night-mode {
  background: radial-gradient(circle at 50% 20%, #100824 0%, #080414 60%, #03010A 100%);
}

body.night-mode .night-sky {
  opacity: 1;
}

/* Rhymes Jukebox Modal */
.rhymes-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 6, 22, 0.85);
  backdrop-filter: blur(14px);
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rhymes-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.rhymes-content {
  background: linear-gradient(135deg, #24163B, #170E28);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalZoom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.rhymes-header h3 {
  font-family: 'Comfortaa', cursive;
  font-size: 1.25rem;
  color: #FFF;
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #FFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rhymes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rhyme-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFF;
  font-family: 'Outfit', sans-serif;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: all 0.2s ease;
}

.rhyme-card:hover {
  background: linear-gradient(135deg, rgba(255, 94, 136, 0.3), rgba(123, 104, 238, 0.3));
  border-color: var(--primary);
  transform: translateX(4px);
}

.song-icon {
  font-size: 28px;
}

.rhyme-card strong {
  display: block;
  font-size: 15px;
  color: #FFF;
}

.rhyme-card p {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.voice-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s ease;
}

.voice-btn.active {
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(255, 94, 136, 0.4);
}

/* Character Viewport & Stage */
.character-stage {
  flex: 1;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  padding: 10px;
}

/* Status Speech Bubble */
.status-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #1A132F;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 20px;
  border-radius: 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 10;
}

.status-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6BCB77;
  display: inline-block;
  animation: pulseDot 1.5s infinite;
}

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

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

/* Stage Characters Wrapper */
.stage-characters-wrapper {
  width: 100%;
  height: 100%;
  max-height: clamp(300px, 54vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 24px);
  position: relative;
}

/* SVG Character Stage Box (Solo Mode) */
.character-box {
  width: 100%;
  max-width: min(85vw, 380px);
  height: 100%;
  max-height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Duo Mode Side-by-Side Setup */
.character-stage.mode-duo .stage-characters-wrapper {
  max-width: min(96vw, 760px);
  gap: clamp(8px, 2.5vw, 20px);
}

.character-stage.mode-duo .character-box {
  flex: 1 1 0;
  width: 48%;
  max-width: min(46vw, 320px);
  height: 100%;
  max-height: 100%;
}

@media (max-width: 540px) {
  .character-stage.mode-duo .character-box {
    max-width: 48%;
    height: 100%;
  }
}

@media (max-height: 720px) {
  .stage-characters-wrapper {
    max-height: clamp(260px, 48vh, 400px);
  }
}

.character-box object,
.character-box svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  pointer-events: none;
}

/* Sound Wave Aura / Glow when Active */
.sound-aura {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 94, 136, 0.3) 0%, rgba(255, 209, 102, 0.1) 50%, transparent 70%);
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.sound-aura.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
  animation: wavePulse 1.2s infinite ease-out;
}

@keyframes wavePulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 0; }
}

/* Touch Interactive Hotspots (Over Character) */
.touch-zone {
  position: absolute;
  cursor: pointer;
  z-index: 20;
  border-radius: 50%;
  transition: background 0.15s ease;
}

.zone-head {
  top: 15%;
  left: 32%;
  width: 36%;
  height: 20%;
}

.zone-cheeks {
  top: 28%;
  left: 28%;
  width: 44%;
  height: 12%;
}

.zone-belly {
  top: 42%;
  left: 30%;
  width: 40%;
  height: 25%;
}

.zone-feet {
  top: 75%;
  left: 28%;
  width: 44%;
  height: 20%;
}

/* Bottom Action Dashboard */
.bottom-dashboard {
  width: 100%;
  max-width: 580px;
  padding: 6px 14px clamp(12px, 2.5vh, 24px) 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 14px);
  position: relative;
  z-index: 10;
}

/* Mini Action Buttons Row */
.action-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  padding: clamp(6px, 1.2vh, 10px) clamp(8px, 2vw, 14px);
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  gap: 4px;
}

.ribbon-btn {
  flex: 1 1 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(9px, 2.4vw, 11px);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: clamp(4px, 0.8vh, 6px) clamp(2px, 1vw, 6px);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 0;
}

.ribbon-btn span.icon {
  font-size: clamp(18px, 4.8vw, 24px);
}

.ribbon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
}

.ribbon-btn.active {
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  box-shadow: 0 4px 15px rgba(255, 94, 136, 0.4);
}

/* Center Giant Microphone Button */
.mic-control-bar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 16px);
}

.giant-mic-btn {
  width: clamp(60px, 13vw, 76px);
  height: clamp(60px, 13vw, 76px);
  border-radius: 50%;
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px rgba(255, 94, 136, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.5);
  color: #FFF;
  font-size: clamp(26px, 5.5vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

.giant-mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 40px rgba(255, 94, 136, 0.6);
}

.giant-mic-btn.recording {
  background: linear-gradient(135deg, #FF3366, #FF6B8B);
  animation: pulseRecording 1s infinite alternate;
}

@keyframes pulseRecording {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 51, 102, 0.6); }
  100% { transform: scale(1.1); box-shadow: 0 0 40px rgba(255, 51, 102, 0.9); }
}

.mode-toggle-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-sub);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn.active {
  background: rgba(107, 203, 119, 0.25);
  border-color: #6BCB77;
  color: #6BCB77;
}

.fun-rhyme-btn {
  background: linear-gradient(135deg, #FFD166, #FF9F45);
  color: #1A1128;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 209, 102, 0.35);
  transition: all 0.2s ease;
}

.fun-rhyme-btn.btn-counting {
  background: linear-gradient(135deg, #4D96FF, #6BCB77);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(77, 150, 255, 0.4);
}

.fun-rhyme-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

/* Giant Learning Flashcard Badge (Popup for ABCD & 123) */
.flashcard-badge {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: linear-gradient(135deg, rgba(255, 94, 136, 0.96), rgba(123, 104, 238, 0.96));
  color: #FFF;
  border: 3px solid rgba(255, 255, 255, 0.9);
  padding: 16px 36px;
  border-radius: 40px;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.5);
  z-index: 150;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 12px;
}

.flashcard-badge.show {
  transform: translateX(-50%) scale(1);
  animation: flashcardPulse 0.8s infinite alternate ease-in-out;
}

.flashcard-badge strong {
  font-size: 42px;
  color: #FFD166;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.flashcard-badge span {
  font-size: 20px;
  font-weight: 600;
}

@keyframes flashcardPulse {
  0% { transform: translateX(-50%) scale(1); }
  100% { transform: translateX(-50%) scale(1.06); }
}

/* Treats Floating Bar */
.treats-bar {
  position: absolute;
  bottom: 8px;
  background: rgba(26, 17, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border-radius: 40px;
  padding: 6px 12px;
  display: flex;
  gap: 8px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.treats-bar.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.treat-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.treat-item:hover {
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  transform: scale(1.08);
}

/* Disco Party Light Beams */
.disco-lights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.disco-lights.active {
  opacity: 1;
}

.light-beam {
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  filter: blur(35px);
  opacity: 0.6;
}

.light-beam.beam-1 {
  left: 15%;
  background: linear-gradient(180deg, #FF5E88 0%, transparent 80%);
  animation: sweepBeam1 2s infinite alternate ease-in-out;
}

.light-beam.beam-2 {
  left: 50%;
  background: linear-gradient(180deg, #FFD166 0%, transparent 80%);
  animation: sweepBeam2 1.6s infinite alternate ease-in-out;
}

.light-beam.beam-3 {
  right: 15%;
  background: linear-gradient(180deg, #4D96FF 0%, transparent 80%);
  animation: sweepBeam3 2.2s infinite alternate ease-in-out;
}

@keyframes sweepBeam1 {
  0% { transform: rotate(-25deg); opacity: 0.3; }
  100% { transform: rotate(15deg); opacity: 0.7; }
}

@keyframes sweepBeam2 {
  0% { transform: rotate(10deg) scaleX(1); opacity: 0.7; }
  100% { transform: rotate(-10deg) scaleX(1.4); opacity: 0.4; }
}

@keyframes sweepBeam3 {
  0% { transform: rotate(25deg); opacity: 0.3; }
  100% { transform: rotate(-15deg); opacity: 0.7; }
}

body.disco-mode {
  animation: discoStrobe 3s infinite alternate ease-in-out;
}

@keyframes discoStrobe {
  0% { background: radial-gradient(circle at 50% 20%, #42163B 0%, #170E28 60%, #080512 100%); }
  50% { background: radial-gradient(circle at 50% 20%, #1A284D 0%, #0E182E 60%, #060B18 100%); }
  100% { background: radial-gradient(circle at 50% 20%, #3B2A16 0%, #241A0E 60%, #120C06 100%); }
}

/* Floating Elements (Hearts, Emojis, Balloons, Confetti) */
.floating-feedback-emoji {
  position: absolute;
  font-size: 36px;
  pointer-events: none;
  z-index: 50;
  animation: floatUpFade 1.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes floatUpFade {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  40% { transform: translate(-50%, -100%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1); opacity: 0; }
}

/* Floating Balloons Mini-Game */
.game-balloon {
  position: absolute;
  bottom: -60px;
  width: 55px;
  height: 70px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  cursor: pointer;
  z-index: 40;
  animation: balloonRise 5s linear forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.game-balloon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 25px;
  background: rgba(255, 255, 255, 0.7);
}

@keyframes balloonRise {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.95; }
  100% { transform: translateY(-750px) rotate(15deg); opacity: 0.95; }
}

/* Permission Modal / Welcome Overlay */
.overlay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 6, 22, 0.85);
  backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, #24163B, #170E28);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalZoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-icon {
  font-size: 56px;
  margin-bottom: 12px;
  animation: bounceSlow 2s infinite ease-in-out;
}

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

.modal-title {
  font-family: 'Comfortaa', cursive;
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #FFF;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 24px;
}

.start-app-btn {
  background: linear-gradient(135deg, #FF5E88, #FF8CA3);
  color: #FFF;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 50px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 8px 25px rgba(255, 94, 136, 0.45);
  transition: all 0.25s ease;
}

.start-app-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255, 94, 136, 0.6);
}

/* Keyframe animations applied to SVG Character Root */
.char-breathe {
  animation: charBreathe 3.2s ease-in-out infinite;
  transform-origin: bottom center;
}

.char-giggle {
  animation: charGiggle 0.6s ease-in-out infinite;
  transform-origin: center bottom;
}

.char-dance {
  animation: charDance 0.75s ease-in-out infinite;
  transform-origin: center bottom;
}

.char-jump {
  animation: charJump 0.55s ease-in-out;
  transform-origin: bottom center;
}

.char-talking {
  animation: charTalking 0.35s ease-in-out infinite alternate;
  transform-origin: center bottom;
}

@keyframes charTalking {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-3px) scaleY(1.008); }
}

@keyframes charBreathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-4px) scaleY(1.006); }
}

@keyframes charGiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-8px) rotate(-3.5deg); }
  40% { transform: translateY(0px) rotate(3.5deg); }
  60% { transform: translateY(-6px) rotate(-2deg); }
  80% { transform: translateY(-2px) rotate(2deg); }
}

@keyframes charDance {
  0%, 100% { transform: translateY(0) rotate(0deg) scaleX(1); }
  25% { transform: translateY(-14px) rotate(4.5deg) scaleX(1.02); }
  50% { transform: translateY(0px) rotate(0deg) scaleX(1); }
  75% { transform: translateY(-14px) rotate(-4.5deg) scaleX(1.02); }
}

@keyframes charJump {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-30px) scale(1.04); }
  70% { transform: translateY(4px) scale(0.97); }
}

/* ================= COMPREHENSIVE RESPONSIVE ADAPTATIONS ================= */

/* 1. Mobile Screen Width Adapters (< 480px) */
@media (max-width: 480px) {
  header.app-header {
    padding: 10px 14px 4px 14px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-icon {
    font-size: 22px;
    padding: 4px 8px;
  }

  .icon-tool-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .char-switcher {
    padding: 3px;
    gap: 2px;
  }

  .switcher-btn {
    font-size: 12px;
    padding: 5px 10px;
    gap: 4px;
  }

  .voice-selector {
    padding: 3px;
    gap: 2px;
  }

  .voice-btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  .status-bubble {
    font-size: 12.5px;
    padding: 6px 16px;
    margin-bottom: 6px;
  }

  .bottom-dashboard {
    padding: 6px 12px 14px 12px;
    gap: 10px;
  }

  .action-ribbon {
    padding: 6px 6px;
    border-radius: 20px;
    gap: 2px;
  }

  .ribbon-btn {
    font-size: 9.5px;
    padding: 4px 2px;
    border-radius: 10px;
  }

  .ribbon-btn span.icon {
    font-size: 20px;
  }

  .giant-mic-btn {
    width: 62px;
    height: 62px;
    font-size: 28px;
  }
}

/* 2. Short Viewport Height Adapters (< 700px) */
@media (max-height: 700px) {
  header.app-header {
    padding: 6px 16px 2px 16px;
  }

  .brand-subtitle {
    display: none;
  }

  .char-switcher-row {
    margin-top: 1px;
    margin-bottom: 2px;
  }

  .voice-row {
    margin-bottom: 2px;
  }

  .status-bubble {
    font-size: 12px;
    padding: 4px 12px;
    margin-bottom: 4px;
  }

  .stage-characters-wrapper {
    max-height: clamp(220px, 46vh, 340px);
  }

  .character-box {
    max-height: 100%;
  }

  .bottom-dashboard {
    padding: 4px 12px 10px 12px;
    gap: 6px;
  }

  .giant-mic-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }
}

/* 3. Very Small Phones & Ultra-Compact (< 360px Width) */
@media (max-width: 360px) {
  .brand-title {
    font-size: 1rem;
  }

  .switcher-btn {
    font-size: 11px;
    padding: 4px 6px;
  }

  .voice-btn {
    font-size: 10px;
    padding: 3px 6px;
  }

  .ribbon-btn span.icon {
    font-size: 18px;
  }

  .ribbon-btn {
    font-size: 8.5px;
  }
}
