/* 
  Solar System Explorer - Design System and Styles
  Tailored for 7 and 9-year-olds: Cosmic dark theme, neon glows, glassmorphism panels, spinning planets, and giant friendly buttons.
*/

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fredoka-300.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fredoka-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 500;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fredoka-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fredoka-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-stretch: normal;
  font-display: swap;
  src: url('fonts/fredoka-700.ttf') format('truetype');
}

:root {
  --font-main: 'Fredoka', system-ui, -apple-system, sans-serif;
  
  /* Space Theme Color Palette */
  --bg-gradient: radial-gradient(circle at 50% 50%, #111236 0%, #060713 100%);
  --panel-bg: rgba(18, 19, 46, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  
  --primary: #9b5de5;
  --primary-hover: #833ab4;
  --secondary: #00f5d4;
  --accent-sun: #fee440;
  --accent-planet: #00bbf9;
  --accent-orange: #f15bb5;
  --success: #2ecc71;
  --danger: #ff5e62;
  --text-dark: #f8f9fa;
  --text-light: #ffffff;
  --text-muted: #a0a5cf;
  
  /* Shadows & Radius */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(155, 93, 229, 0.25);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  
  /* Transitions */
  --transition-bounce: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-smooth: all 0.2s ease;
}

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

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
  padding: 1rem;
  position: relative;
}

/* Subtle twinkling stars background effect using CSS */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 40px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
  animation: twinkling 30s linear infinite;
}

@keyframes twinkling {
  from { background-position: 0 0, 40px 60px, 130px 270px; }
  to { background-position: 550px 1100px, 390px 760px, 380px 870px; }
}

/* Header & Navigation */
header {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.logo-icon {
  font-size: 3rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 10px var(--primary));
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-light);
  text-shadow: 0 0 15px rgba(155, 93, 229, 0.6), 2px 2px 0px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
  text-align: center;
}

nav {
  display: flex;
  background: var(--panel-bg);
  padding: 0.5rem;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--panel-border);
  gap: 0.5rem;
  width: 100%;
  max-width: 600px;
  backdrop-filter: blur(15px);
}

nav button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 0.5rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

nav button.active {
  background: var(--primary);
  color: var(--text-light);
  box-shadow: 0 0 15px var(--primary);
  transform: scale(1.05);
}

nav button:hover:not(.active) {
  background: rgba(155, 93, 229, 0.15);
  color: var(--secondary);
}

/* Global Progress Stats Dashboard */
.progress-bar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--panel-bg);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--panel-border);
  flex-wrap: wrap;
  backdrop-filter: blur(15px);
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.stat-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 5px rgba(254, 228, 64, 0.5));
}

.star-count {
  color: var(--accent-sun);
  text-shadow: 0 0 8px rgba(254, 228, 64, 0.6);
}

.streak-count {
  color: var(--accent-orange);
}

/* Main Content Containers */
main {
  width: 100%;
  max-width: 900px;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.screen {
  width: 100%;
  display: none;
  animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.screen.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards & Layout Panels */
.card {
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
}

/* EXPLORE SCREEN: Solar System Map & Planet Cards */
.explore-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.explore-instructions {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* Horizontal Planetary Carousel */
.solar-system-belt {
  display: flex;
  overflow-x: auto;
  gap: 2rem;
  padding: 2rem 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  align-items: center;
}

.solar-system-belt::-webkit-scrollbar {
  height: 8px;
}
.solar-system-belt::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 10px;
}

.planet-node {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  padding: 1.5rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.planet-node:hover {
  transform: translateY(-10px) scale(1.05);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--secondary);
}

.planet-node.active-planet {
  background: rgba(155, 93, 229, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(155, 93, 229, 0.4);
}

.planet-visual-container {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.planet-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;
  z-index: 2;
  transition: var(--transition-bounce);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.planet-node:hover .planet-image {
  animation: spin 6s linear infinite;
}

/* Custom orbits and glows behind planets */
.planet-glow-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.2);
  z-index: 1;
  animation: spinSlow 15s linear infinite;
}

.planet-node.sun .planet-glow-ring {
  background: radial-gradient(circle, rgba(254, 228, 64, 0.4) 0%, transparent 70%);
  border: none;
}
.planet-node.saturn .planet-glow-ring {
  width: 100px;
  height: 40px;
  border: 2px solid rgba(254, 228, 64, 0.3);
  transform: rotate(-15deg);
  border-radius: 50%;
  animation: none;
}

.planet-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-light);
}

.planet-order-tag {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Planet detail card */
.planet-detail-panel {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem;
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.planet-detail-panel.visible {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media(min-width: 768px) {
  .planet-detail-panel.visible {
    grid-template-columns: 1fr 2fr;
  }
}

.detail-visual-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.detail-large-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 50%;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.25));
}

.detail-info-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary);
}

.audio-speak-btn {
  background: var(--primary);
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-bounce);
  font-weight: 600;
}

.audio-speak-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.detail-facts-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media(min-width: 600px) {
  .detail-facts-list {
    grid-template-columns: 1fr 1fr;
  }
  .detail-wide-fact {
    grid-column: span 2;
  }
}

.fact-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.fact-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
}

.fact-story-box {
  background: rgba(155, 93, 229, 0.1);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-dark);
}

/* GAMEPLAY / QUIZ SCREEN */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px dashed rgba(155, 93, 229, 0.2);
  padding-bottom: 1rem;
}

.back-btn {
  border: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-light);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-bounce);
  border: 1px solid rgba(255,255,255,0.1);
}

.back-btn:hover {
  background: var(--primary);
  transform: translateX(-4px);
  box-shadow: 0 0 10px var(--primary);
}

.level-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--secondary);
}

.round-progress {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.game-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media(min-width: 768px) {
  .game-body {
    grid-template-columns: 2fr 1fr;
  }
}

.left-play-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Round Progress Tracker Dots */
#round-dots-tracker {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.tracker-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
}

.tracker-dot-icon {
  font-size: 1rem;
  font-weight: 800;
}

.dot-correct {
  background: var(--success);
  border-color: #27ae60;
  color: white;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.dot-incorrect {
  background: var(--danger);
  border-color: #c0392b;
  color: white;
  box-shadow: 0 0 8px rgba(255, 94, 98, 0.4);
}

/* Question Area styling */
.question-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 2px dashed rgba(155, 93, 229, 0.3);
  text-align: center;
}

/* Dynamic quiz views container */
.quiz-interactive-zone {
  width: 100%;
  margin-top: 1rem;
}

/* Question Types styling */
.space-equation {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  color: var(--text-light);
}

.question-mascot-hint {
  font-size: 4rem;
  margin: 1rem 0;
  animation: float 4s ease-in-out infinite;
}

/* Multiple choice layout */
.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

@media(min-width: 480px) {
  .quiz-options-grid.two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.option-btn {
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem;
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.option-btn:hover {
  transform: translateY(-4px);
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.08);
}

.option-btn:active {
  transform: translateY(1px);
}

.option-btn.correct {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--success);
  color: #2ecc71;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

.option-btn.incorrect {
  background: rgba(255, 94, 98, 0.2);
  border-color: var(--danger);
  color: #ff5e62;
  box-shadow: 0 0 15px rgba(255, 94, 98, 0.3);
  animation: shake 0.5s ease;
}

/* Drag/Order game style */
.ordering-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.order-cards-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.draggable-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.2rem;
  cursor: grab;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  transition: var(--transition-bounce);
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.draggable-card:hover {
  transform: scale(1.05);
  border-color: var(--secondary);
}

.draggable-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

/* Specific keypad/input type question */
.solar-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.answer-slot {
  min-width: 100px;
  height: 80px;
  background: rgba(155, 93, 229, 0.15);
  border: 3px dashed var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  transition: var(--transition-bounce);
  font-weight: 700;
}

.answer-slot.filled {
  background: rgba(255,255,255,0.08);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-md);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.answer-slot.correct {
  border-color: var(--success);
  color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.answer-slot.incorrect {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 94, 98, 0.1);
  animation: shake 0.5s ease;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  margin: 1rem auto 0;
}

.key-btn {
  aspect-ratio: 1.4;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border-bottom: 4px solid rgba(255,255,255,0.1);
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.1);
  border-bottom-color: rgba(255,255,255,0.2);
}

.key-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.key-btn.action-btn {
  background: var(--accent-sun);
  color: #111;
  border-bottom-color: #ccaa00;
}

.key-btn.submit-btn {
  background: var(--success);
  color: white;
  border-bottom-color: #27ae60;
  grid-column: span 3;
  aspect-ratio: auto;
  padding: 0.8rem;
  font-size: 1.3rem;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.key-btn.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  border-bottom-width: 4px;
}

/* Explanation Box styling */
.explanation-box {
  display: none;
  background: rgba(254, 228, 64, 0.08);
  border: 2px solid var(--accent-sun);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  margin-top: 1rem;
  text-align: center;
  animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.explanation-box.visible {
  display: block;
}

.explanation-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-sun);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.explanation-visual {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-light);
}

.explanation-visual .step {
  display: block;
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.explanation-visual .emoji-row {
  display: block;
  font-size: 1.8rem;
  margin: 0.5rem 0;
}

.explanation-visual .answer-reveal {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.5rem;
  box-shadow: 0 0 10px var(--primary);
}

.explanation-next-btn {
  display: none;
  margin-top: 1.2rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-hover);
  transition: var(--transition-bounce);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.explanation-next-btn.visible {
  display: block;
}

.explanation-next-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #7b2cbf;
}

.explanation-next-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-hover);
}

/* Mascot Dialog/Speaking Box */
.mascot-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mascot-character {
  font-size: 5.5rem;
  animation: float 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.3));
}

.mascot-character:hover {
  transform: scale(1.1) rotate(5deg);
}

.speech-bubble {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: var(--shadow-md);
  font-size: 1.1rem;
  line-height: 1.5;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 220px;
  color: var(--text-dark);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px 12px 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.04) transparent;
  display: block;
  width: 0;
}

.speech-bubble-border {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 14px 14px 0;
  border-style: solid;
  border-color: rgba(255,255,255,0.08) transparent;
  z-index: -1;
}

/* STICKER ALBUM GRID */
.sticker-book-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sticker-header {
  text-align: center;
}

.sticker-header h2 {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.sticker-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.5rem;
}

.sticker-slot {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  position: relative;
  transition: var(--transition-bounce);
}

.sticker-slot.unlocked {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--accent-sun);
  box-shadow: var(--shadow-md);
  transform: rotate(var(--rotation, 0deg));
}

.sticker-slot.unlocked:hover {
  transform: scale(1.1) rotate(0deg);
  z-index: 2;
  box-shadow: 0 0 20px var(--accent-sun);
}

.sticker-visual {
  font-size: 3rem;
  filter: grayscale(100%) opacity(20%);
  transition: var(--transition-bounce);
}

.sticker-slot.unlocked .sticker-visual {
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
  animation: unlockPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sticker-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.sticker-slot.unlocked .sticker-name {
  color: var(--secondary);
}

.lock-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  width: 100%;
  height: 100%;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.lock-overlay:hover {
  background: rgba(0, 0, 0, 0.5);
}

.lock-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 5px black);
}

.lock-cost {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111;
  background: var(--accent-sun);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  box-shadow: var(--shadow-sm);
}

/* SETTINGS / PARENTS CORNER */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 1.5rem;
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-section h3 {
  font-size: 1.3rem;
  color: var(--secondary);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.setting-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-light);
}

.setting-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* iOS/Safari friendly Custom Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Button groups for settings selection */
.btn-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.3rem;
  border-radius: 50px;
  gap: 0.25rem;
  width: 100%;
  max-width: 400px;
}

.btn-group button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.6rem 0.8rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-group button.active {
  background: var(--primary);
  color: white;
}

/* Reset button stylings */
.reset-btn {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.reset-btn:hover {
  background: var(--danger);
  color: white;
  box-shadow: 0 0 10px var(--danger);
}

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

/* MODAL OVERLAYS & DIALOGS */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 7, 19, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1rem;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.overlay.active .modal {
  transform: translateY(0);
}

.modal-mascot {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 15px rgba(254, 228, 64, 0.3));
}

.modal-title {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.modal-desc {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.modal-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(254, 228, 64, 0.1);
  border: 2px solid var(--accent-sun);
  border-radius: 50px;
  padding: 0.5rem 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-sun);
  margin-bottom: 2rem;
  box-shadow: 0 0 10px rgba(254, 228, 64, 0.2);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-hover);
  transition: var(--transition-bounce);
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 7px 0 #7b2cbf;
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-hover);
}

.confirm-modal-buttons {
  display: flex;
  gap: 1rem;
}

.confirm-modal-buttons button {
  flex: 1;
}

/* KEYFRAMES & DYNAMIC ANIMATIONS */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

@keyframes unlockPop {
  0% { transform: scale(0.3); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* NEW CLASS IMAGES FOR QUIZZES */
.quiz-question-image {
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 50%;
  margin: 1rem auto 1.5rem;
  display: block;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  animation: float 4s ease-in-out infinite;
}

.explanation-image {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 50%;
  margin: 0.5rem auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
}

.tiny-planet-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 50%;
  vertical-align: middle;
}

/* CSP Compliance styles */
.quiz-explanation-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0.5rem 0;
  display: block;
}

.order-choice-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 0.8rem 0.5rem !important;
}

.order-choice-btn:disabled {
  opacity: 0.3 !important;
  transform: none !important;
}

.order-choice-btn .tiny-planet-icon {
  margin-bottom: 4px;
}

.answer-slot {
  width: 120px;
  height: 80px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.answer-slot img.tiny-planet-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 0;
}

.mt-15 {
  margin-top: 1.5rem !important;
}

.quiz-action-buttons {
  margin-top: 1.5rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 1rem;
}

/* Fix for the huge clear/check buttons in ordering quiz */
.quiz-action-buttons .key-btn {
  aspect-ratio: auto !important;
  height: 50px !important;
  font-size: 1.2rem !important;
  padding: 0.5rem 1rem !important;
  flex: 1;
}

/* Welcome Card and Mascot styles for CSP compliance */
.explore-container .welcome-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.welcome-mascot {
  font-size: 5rem;
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
}

.explore-container .welcome-card h2 {
  color: var(--secondary);
  font-size: 1.8rem;
}

/* Detail extra fact slot styled for CSP compliance */
#detail-extra-fact {
  background: rgba(0, 245, 212, 0.1);
  border-left-color: var(--secondary);
  margin-top: 0.75rem;
}


