*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep: #050a14;
  --bg-card: #0c1525;
  --bg-card-hover: #111d30;
  --border: rgba(120, 160, 200, 0.22);
  --border-strong: rgba(120, 160, 200, 0.35);
  --text: #e8edf5;
  --text-muted: #9aa8bc;
  --accent: #4a6a8a;
  --accent-light: #5a7d9e;
  --cta-bg: #3d5570;
  --pill-bg: rgba(20, 35, 55, 0.9);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Bokeh background */
.bokeh-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(100,150,200,0.06) 0%, transparent 45%),
    var(--bg-deep);
  z-index: 0;
}

.bokeh-bg::before,
.bokeh-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 15%, rgba(255,255,255,0.35), transparent),
    radial-gradient(2px 2px at 25% 45%, rgba(255,255,255,0.2), transparent),
    radial-gradient(3px 3px at 40% 80%, rgba(255,255,255,0.25), transparent),
    radial-gradient(2px 2px at 55% 25%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,0.2), transparent),
    radial-gradient(3px 3px at 85% 35%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 92% 85%, rgba(255,255,255,0.25), transparent),
    radial-gradient(4px 4px at 5% 70%, rgba(255,255,255,0.15), transparent),
    radial-gradient(2px 2px at 33% 10%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 60% 90%, rgba(255,255,255,0.2), transparent);
}

/* Welcome / Landing */
.welcome {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.landing-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(255, 154, 108, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, rgba(126, 184, 247, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 88% 20%, rgba(192, 132, 252, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 70% 90%, rgba(255, 217, 61, 0.12) 0%, transparent 45%),
    linear-gradient(160deg, #1a0a2e 0%, #2a1a4a 30%, #1a3050 65%, #0d1f3a 100%);
}

.float-items {
  position: absolute;
  inset: 0;
}

.float-item {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  font-size: var(--size, 2.5rem);
  line-height: 1;
  opacity: var(--opacity, 0.75);
  animation: float-drift var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
  will-change: transform;
}

@keyframes float-drift {
  0%, 100% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(-50%, -50%) translate(18px, -22px) rotate(10deg) scale(1.1);
  }
  50% {
    transform: translate(-50%, -50%) translate(-14px, 12px) rotate(-8deg) scale(0.94);
  }
  75% {
    transform: translate(-50%, -50%) translate(22px, 16px) rotate(6deg) scale(1.06);
  }
}

.landing-center {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 32px);
}

.landing-brand {
  text-align: center;
}

.landing-kicker {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 200, 140, 0.9);
}

.landing-title {
  margin: 0;
  font-family: 'Fredoka', var(--font);
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(105deg, #ffe566 0%, #ff9a6c 35%, #f472b6 65%, #7eb8f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 20px rgba(255, 154, 108, 0.25));
}

.landing-tagline {
  margin: 10px 0 0;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  color: rgba(232, 237, 245, 0.82);
  line-height: 1.4;
}

.landing-menu-wrap {
  width: 100%;
  padding: clamp(16px, 3vw, 22px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.landing-menu.mode-options {
  gap: clamp(10px, 2.5vw, 16px);
}

.landing-menu .mode-option-btn {
  min-height: clamp(118px, 26vw, 150px);
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.landing-menu .mode-option-btn[data-category="animals"] {
  background: linear-gradient(155deg, rgba(56, 120, 90, 0.55), rgba(20, 40, 35, 0.95));
}

.landing-menu .mode-option-btn[data-category="fruits"] {
  background: linear-gradient(155deg, rgba(180, 100, 40, 0.5), rgba(45, 28, 18, 0.95));
}

.landing-menu .mode-option-btn[data-category="vehicles"] {
  background: linear-gradient(155deg, rgba(50, 90, 150, 0.55), rgba(18, 28, 48, 0.95));
}

.landing-menu .mode-option-btn[data-category="default"] {
  background: linear-gradient(155deg, rgba(120, 70, 160, 0.5), rgba(30, 20, 45, 0.95));
}

@media (prefers-reduced-motion: reduce) {
  .float-item {
    animation: none;
  }
}

.welcome-scroll {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.nav-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.nav-btn {
  display: block;
  padding: 14px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.nav-btn-full {
  grid-column: 1 / -1;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.hero-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-desc {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.feature-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  display: block;
  padding: 10px 12px;
  font-size: 0.78rem;
  text-align: center;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  line-height: 1.3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  color: var(--text);
}

.btn:active {
  transform: scale(0.98);
}

.btn-cta {
  width: 100%;
  padding: 18px 24px;
  font-size: 1.05rem;
  background: var(--cta-bg);
  border-color: var(--border-strong);
  margin-bottom: 16px;
}

.btn-cta:hover {
  background: var(--accent-light);
}

.btn-primary {
  background: var(--cta-bg);
  border-color: var(--border-strong);
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-secondary {
  background: var(--pill-bg);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.social-proof {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.live-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-pill {
  display: block;
  padding: 12px 16px;
  font-size: 0.85rem;
  text-align: center;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.parent-info {
  margin-top: 8px;
}

.parent-info summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
}

.parent-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 0;
}

/* Section cards */
.section-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.section-link {
  display: block;
  font-size: 0.85rem;
  color: var(--accent-light);
  text-decoration: none;
  margin-bottom: 16px;
}

.section-link:hover {
  text-decoration: underline;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.video-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.video-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}

.video-card:hover {
  border-color: var(--border-strong);
}

.video-thumb {
  height: 120px;
  background: linear-gradient(135deg, #1a2744 0%, #2a3f5f 50%, #1a3050 100%);
}

.video-thumb-1 { background: linear-gradient(135deg, #2d1f3d, #4a3060, #1a2744); }
.video-thumb-2 { background: linear-gradient(135deg, #1f3d2d, #30604a, #1a2744); }
.video-thumb-3 { background: linear-gradient(135deg, #3d2d1f, #604a30, #1a2744); }

.video-thumb-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100px;
  font-weight: 600;
}

.tag-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.video-card p {
  padding: 12px 14px 4px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.video-meta {
  display: block;
  padding: 0 14px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.social-link {
  padding: 10px 16px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s;
}

.social-link:hover {
  background: var(--bg-card-hover);
}

.share-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-actions .btn {
  width: 100%;
}

.support-card a {
  color: var(--accent-light);
}

.site-footer {
  padding: 16px 4px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--accent-light);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-privacy,
.footer-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Play Mode */
#play {
  display: none !important;
  visibility: hidden !important;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-deep);
  touch-action: none;
  user-select: none;
}

body.playing #play {
  display: block !important;
  visibility: visible !important;
}

body.playing #welcome {
  display: none !important;
}

.sound-gate {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.88);
  touch-action: manipulation;
  cursor: pointer;
}

.sound-gate.hidden {
  display: none !important;
}

.sound-gate-card {
  text-align: center;
  padding: 28px 32px;
  border-radius: 24px;
  background: rgba(12, 21, 37, 0.95);
  border: 1px solid rgba(120, 160, 200, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  max-width: 280px;
}

.sound-gate-icon {
  font-size: 3.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.sound-gate-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.sound-gate-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.play canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#play-content {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.category-display {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  visibility: hidden;
}

.category-display.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  animation: category-pop 0.25s ease-out;
}

@keyframes category-pop {
  0% { transform: translate(-50%, -50%) scale(0.45); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.key-burst {
  position: absolute;
  font-weight: 800;
  font-size: clamp(48px, 12vw, 120px);
  line-height: 1;
  pointer-events: none;
  animation: burst-in 0.6s ease-out forwards;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  z-index: 2;
}

.key-burst.hold-once {
  animation: burst-hold 2s ease-out forwards;
}

.key-burst.category-burst {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: inherit;
  text-align: center;
  min-width: 100px;
  z-index: 5;
  transform: translate(-50%, -50%);
  animation: category-burst-hold 2.2s ease-out forwards !important;
}

.key-burst.category-burst.hold-once {
  animation: category-burst-hold 2.8s ease-out forwards;
}

.key-burst.glyph-burst .category-name {
  display: none;
}

.key-burst.glyph-burst .category-emoji {
  font-size: clamp(72px, 18vw, 128px);
  font-weight: 800;
  font-family: var(--font);
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
}

.category-emoji {
  font-size: clamp(56px, 14vw, 100px);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.category-name {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  padding: 4px 14px;
  background: rgba(10, 18, 30, 0.55);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.category-select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa8bc' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.category-select:focus {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.hero-category {
  margin-bottom: 16px;
}

.hero-minimal .hero-desc {
  text-align: center;
  margin-bottom: 24px;
}

.hero-minimal {
  padding: 24px 20px 28px;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mode-option-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: clamp(130px, 28vw, 168px);
  padding: 20px 14px;
  font-family: var(--font);
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(160deg, rgba(30, 48, 72, 0.95), rgba(12, 21, 37, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}

.mode-tile-icon {
  font-size: clamp(2.75rem, 10vw, 3.75rem);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.landing-menu .mode-tile-label {
  max-width: 14ch;
}

.mode-option-btn[data-category="animals"] {
  border-color: rgba(126, 200, 150, 0.35);
}

.mode-option-btn[data-category="fruits"] {
  border-color: rgba(255, 180, 100, 0.35);
}

.mode-option-btn[data-category="vehicles"] {
  border-color: rgba(126, 184, 247, 0.4);
}

.mode-option-btn[data-category="default"] {
  border-color: rgba(200, 160, 255, 0.35);
}

.mode-option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mode-option-btn.picked {
  animation: mode-pick-pop 0.45s ease-out;
  border-color: #7eb8f7;
  box-shadow: 0 0 0 3px rgba(126, 184, 247, 0.25);
}

@keyframes mode-pick-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.07); }
  100% { transform: scale(0.97); }
}

.mode-pick-burst {
  position: fixed;
  z-index: 200;
  font-size: 1.6rem;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: mode-pick-burst 0.55s ease-out forwards;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.mode-pick-ring {
  position: fixed;
  z-index: 199;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 3px solid rgba(126, 184, 247, 0.7);
  pointer-events: none;
  animation: mode-pick-ring 0.55s ease-out forwards;
}

@keyframes mode-pick-burst {
  0% {
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(1.15) rotate(20deg);
    opacity: 0;
  }
}

@keyframes mode-pick-ring {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(8);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-option-btn.picked {
    animation: none;
  }

  .mode-pick-burst,
  .mode-pick-ring {
    display: none;
  }
}

.category-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.category-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-screen-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-text {
  align-self: flex-start;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-text:hover {
  color: var(--text);
}

.category-screen-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-screen-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.category-screen-hero h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.category-screen-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.category-screen-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.category-screen-letter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.category-screen-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.category-screen-name {
  font-size: 0.65rem;
  color: var(--text);
  line-height: 1.2;
}

body.view-category #welcome-home,
body.view-category #welcome-rest {
  display: none !important;
}

body.view-category #category-screen {
  display: flex !important;
}

body.view-category #category-screen.hidden {
  display: none !important;
}

@media (min-width: 480px) {
  .category-screen-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.welcome-preview {
  margin-top: 14px;
  padding: 16px;
  text-align: center;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.welcome-preview.category-burst {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: none;
  opacity: 1;
  position: static;
}

.app-error {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 24px;
  background: #0a0e18;
  color: #e8edf5;
  font-family: var(--font);
  line-height: 1.5;
}

.app-error code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

@keyframes burst-in {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  40% { transform: scale(1.1) rotate(3deg); opacity: 1; }
  100% { transform: scale(0.8) rotate(0deg); opacity: 0; }
}

@keyframes burst-hold {
  0% { transform: scale(0.3); opacity: 0; }
  20% { transform: scale(1.05); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0; }
}

@keyframes category-burst-hold {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  55% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
}

.play-hud {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.play-hud .category-select,
.play-hud .score-bar {
  pointer-events: auto;
}

.play-category-select {
  width: auto;
  min-width: 168px;
  max-width: calc(100vw - 32px);
  padding: 8px 32px 8px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
  background-color: rgba(10, 18, 30, 0.9);
  backdrop-filter: blur(8px);
}

.score-bar {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(10, 18, 30, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.score-label {
  color: var(--text-muted);
}

.score-label strong {
  color: var(--text);
  font-weight: 700;
}

.chaos-badge {
  padding: 4px 10px;
  background: rgba(180, 200, 230, 0.9);
  color: #0a1520;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.parent-hold-zone {
  position: fixed;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  z-index: 105;
  cursor: default;
}

.sound-toggle-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 115;
  width: 52px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(10, 18, 30, 0.9);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sound-toggle-btn[aria-pressed="false"] {
  opacity: 0.55;
}

.sound-toggle-btn:active {
  transform: scale(0.94);
}

/* Dialogs */
dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
}

dialog::backdrop {
  background: rgba(5, 10, 20, 0.75);
  backdrop-filter: blur(4px);
}

.parent-panel-inner,
.smash-report-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: calc(100vw - 32px);
  margin: auto;
}

.parent-panel h2,
.smash-report h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.parent-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  cursor: pointer;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-light);
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-label {
  font-size: 0.95rem;
}

.theme-buttons,
.per-key-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-btn,
.per-key-btn {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-family: var(--font);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.theme-btn:hover,
.per-key-btn:hover {
  background: var(--bg-card-hover);
}

.theme-btn.active,
.per-key-btn.active {
  background: var(--cta-bg);
  border-color: var(--border-strong);
}

.parent-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.parent-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parent-actions .btn {
  width: 100%;
}

.report-stats {
  margin-bottom: 16px;
}

.report-stats p {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.report-stats strong {
  color: var(--text);
}

.report-message {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.report-brand {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.report-actions .btn {
  width: 100%;
  font-size: 0.88rem;
}

.report-link {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: var(--accent-light);
  text-decoration: none;
}

.report-link:hover {
  text-decoration: underline;
}

/* Theme backgrounds */
.play.theme-space { background: #050a18; }
.play.theme-underwater { background: #051828; }
.play.theme-bubbles { background: #081420; }
.play.theme-confetti { background: #0a0e18; }

@media (min-width: 600px) {
  .welcome-scroll {
    padding-top: 40px;
  }

  .feature-pills {
    grid-template-columns: 1fr 1fr;
  }

  .share-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .share-actions .btn {
    flex: 1;
    min-width: 140px;
  }
}
