/* ==========================================================================
   Learning to Read the Clock - Playful Kids Theme System
   ========================================================================== */

:root {
  --font-fun: 'Fredoka', 'Nunito', system-ui, -apple-system, sans-serif;
  --font-comic: 'Comic Neue', cursive, sans-serif;

  /* Default / Blue Theme (Bluey & Friends) */
  --bg-sky: #cce5ff;
  --bg-gradient: linear-gradient(180deg, #60a5fa 0%, #93c5fd 40%, #e0f2fe 100%);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-border: #3b82f6;

  --theme-primary: #2563eb;
  --theme-secondary: #0284c7;
  --theme-accent: #f59e0b;
  --theme-accent-glow: rgba(245, 158, 11, 0.4);

  --clock-face: #ffffff;
  --clock-rim: #1d4ed8;
  --clock-rim-secondary: #3b82f6;
  --clock-hour-hand: #dc2626;      /* Bright Red for Hour Hand */
  --clock-minute-hand: #2563eb;    /* Bright Blue for Minute Hand */
  --clock-center-dot: #f59e0b;

  --text-main: #1e3a8a;
  --text-muted: #3b82f6;
  --btn-shadow: 0 6px 0 #1d4ed8;
  --mascot-bubble: #e0f2fe;

  --pattern-item: "🐾";
}

/* ==========================================================================
   Theme: Peppa Pig (Muddy puddles & sunshine!)
   ========================================================================== */
[data-theme="peppa"] {
  --bg-sky: #ffcbf2;
  --bg-gradient: linear-gradient(180deg, #70d6ff 0%, #a0c4ff 35%, #b9fbc0 70%, #90db98 100%);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-border: #ff70a6;

  --theme-primary: #ff477e;
  --theme-secondary: #ff70a6;
  --theme-accent: #ffd166;
  --theme-accent-glow: rgba(255, 209, 102, 0.5);

  --clock-face: #fff0f5;
  --clock-rim: #ff477e;
  --clock-rim-secondary: #ff99c8;
  --clock-hour-hand: #d90429;
  --clock-minute-hand: #0077b6;
  --clock-center-dot: #ffd166;

  --text-main: #590d22;
  --text-muted: #c9184a;
  --btn-shadow: 0 6px 0 #d90429;
  --mascot-bubble: #ffe5ec;

  --pattern-item: "🐷";
}

/* ==========================================================================
   Theme: Unicorns (Magical Rainbow & Stars!)
   ========================================================================== */
[data-theme="unicorn"] {
  --bg-sky: #f3e8ff;
  --bg-gradient: linear-gradient(180deg, #d8b4fe 0%, #f472b6 35%, #fbcfe8 70%, #e0e7ff 100%);
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-border: #c084fc;

  --theme-primary: #9333ea;
  --theme-secondary: #c084fc;
  --theme-accent: #f43f5e;
  --theme-accent-glow: rgba(244, 63, 94, 0.4);

  --clock-face: #fdf4ff;
  --clock-rim: #a855f7;
  --clock-rim-secondary: #f472b6;
  --clock-hour-hand: #e11d48;
  --clock-minute-hand: #7c3aed;
  --clock-center-dot: #fbbf24;

  --text-main: #4c1d95;
  --text-muted: #8b5cf6;
  --btn-shadow: 0 6px 0 #6b21a8;
  --mascot-bubble: #fae8ff;

  --pattern-item: "🦄";
}

/* ==========================================================================
   Theme: Lilo and Stitch (Tropical Hawaiian Vibes!)
   ========================================================================== */
[data-theme="stitch"] {
  --bg-sky: #e0f2fe;
  --bg-gradient: linear-gradient(180deg, #0ea5e9 0%, #38bdf8 30%, #5eead4 70%, #a7f3d0 100%);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-border: #0284c7;

  --theme-primary: #0369a1;
  --theme-secondary: #0284c7;
  --theme-accent: #f97316;
  --theme-accent-glow: rgba(249, 115, 22, 0.45);

  --clock-face: #f0fdfa;
  --clock-rim: #0284c7;
  --clock-rim-secondary: #f43f5e;
  --clock-hour-hand: #e11d48;
  --clock-minute-hand: #0284c7;
  --clock-center-dot: #facc15;

  --text-main: #0c4a6e;
  --text-muted: #0369a1;
  --btn-shadow: 0 6px 0 #075985;
  --mascot-bubble: #ccfbf1;

  --pattern-item: "🌺";
}

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

body {
  font-family: var(--font-fun);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.3s ease;
  position: relative;
}

/* Animated Rainbow Strike Backdrop */
.rainbow-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease, background 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: background, opacity, transform;
}

.rainbow-backdrop.active {
  opacity: 0.92;
}

.rainbow-backdrop.ripple {
  animation: rainbowFlashPulse 0.75s ease-out;
}

@keyframes rainbowFlashPulse {
  0% { transform: scale(0.98); filter: brightness(1.3) saturate(1.4); }
  40% { transform: scale(1.02); filter: brightness(1.15) saturate(1.2); }
  100% { transform: scale(1); filter: brightness(1) saturate(1); }
}

/* Background floating cute stickers / particles */
.floating-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float-item {
  position: absolute;
  font-size: 2.2rem;
  opacity: 0.35;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  animation: gentleFloat 12s infinite ease-in-out alternate;
  will-change: transform;
}

@keyframes gentleFloat {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-30px) rotate(15deg) scale(1.1); }
  100% { transform: translateY(-10px) rotate(-15deg) scale(0.95); }
}

/* Layout Container */
.app-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   Header & Theme Selector
   ========================================================================== */
.kids-header {
  background: var(--bg-card);
  border: 4px solid var(--bg-card-border);
  border-radius: 28px;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-title-icon {
  font-size: 2.5rem;
  animation: wiggle 3s infinite ease-in-out;
  display: inline-block;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

.site-title h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--theme-primary);
  text-shadow: 1px 2px 0 rgba(0,0,0,0.08);
}

.site-title p {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Theme buttons */
.theme-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.theme-pill-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.theme-btn {
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 22px;
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 0 #cbd5e1;
}

.theme-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #cbd5e1;
}

.theme-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cbd5e1;
}

.theme-btn.active {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: #ffffff;
  box-shadow: var(--btn-shadow);
  transform: scale(1.05);
}

/* Audio & Language tools */
.quick-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Controls row: Theme selector and tools on the same line */
.header-controls-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Audio & Language tools */
.quick-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

.tool-btn:hover {
  transform: scale(1.1) rotate(5deg);
}

.tool-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* Language Flag Dropdown - Same line as themes, flags only */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 24px;
  height: 48px;
  padding: 0 0.55rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
}

.lang-dropdown-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
}

.lang-dropdown-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.current-flag-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.dropdown-caret {
  font-size: 0.65rem;
  color: var(--theme-secondary);
  transition: transform 0.2s ease;
}

.lang-dropdown.open .dropdown-caret {
  transform: rotate(180deg);
}

/* Dropdown Menu Popup - Flags only, zero text */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 22px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.lang-dropdown.open .lang-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lang-menu-flag {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  padding: 0;
}

.lang-menu-flag:hover {
  transform: scale(1.2);
  background: #f1f5f9;
}

.lang-menu-flag.active {
  background: var(--theme-primary);
  border-color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: scale(1.15);
}

/* Mode Switcher Tabs (Play / Game / My Day) */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mode-tab-btn {
  background: var(--bg-card);
  border: 3px solid var(--bg-card-border);
  border-radius: 30px;
  padding: 0.75rem 1.6rem;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-tab-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.mode-tab-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.mode-tab-btn.active {
  background: var(--theme-primary);
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 15px rgba(0,0,0,0.2);
  transform: scale(1.06);
}

/* ==========================================================================
   Main Play Stage
   ========================================================================== */
.play-stage {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
}

/* Left Card: The Analog Clock */
.clock-card {
  background: var(--bg-card);
  border: 5px solid var(--bg-card-border);
  border-radius: 36px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
  position: relative;
}

/* Legend above clock */
.hands-legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  border: 2px dashed #cbd5e1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-swatch.hour-swatch {
  background: var(--clock-hour-hand);
}

.legend-swatch.minute-swatch {
  background: var(--clock-minute-hand);
}

/* Clock Dial Container */
.clock-dial-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  margin: 0.5rem auto 1.25rem;
  touch-action: none;
}

.clock-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
}

/* Clock Hand styling */
.clock-hand {
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.clock-hand:active {
  cursor: grabbing;
}

.hour-hand-line {
  stroke: var(--clock-hour-hand);
  stroke-width: 14;
  stroke-linecap: round;
}

.hour-hand-tip {
  fill: var(--clock-hour-hand);
}

.minute-hand-line {
  stroke: var(--clock-minute-hand);
  stroke-width: 9;
  stroke-linecap: round;
}

.minute-hand-tip {
  fill: var(--clock-minute-hand);
}

.clock-number {
  font-family: var(--font-fun);
  font-weight: 800;
  font-size: 28px;
  fill: var(--text-main);
  text-anchor: middle;
  dominant-baseline: central;
  cursor: pointer;
  transition: transform 0.15s ease, fill 0.15s ease;
}

.clock-number:hover {
  fill: var(--theme-primary);
  transform: scale(1.15);
  transform-origin: center;
}

.clock-minute-tick {
  stroke: #94a3b8;
  stroke-width: 2;
}

.clock-5minute-number {
  font-size: 13px;
  font-weight: 700;
  fill: #64748b;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Quick Control Buttons */
.clock-quick-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.controls-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.time-step-btn {
  background: #ffffff;
  border: 4px solid var(--theme-secondary);
  border-radius: 28px;
  padding: 0.85rem 1.35rem;
  min-height: 62px;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--theme-secondary);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.time-step-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 9px 0 var(--theme-secondary);
  background: #f0fdfa;
}

.time-step-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--theme-secondary);
}

.time-step-btn.btn-hour {
  flex: 1 1 150px;
  border-color: var(--clock-hour-hand);
  box-shadow: 0 6px 0 var(--clock-hour-hand);
  color: var(--clock-hour-hand);
  background: #fff8f8;
  font-size: 1.3rem;
}

.time-step-btn.btn-hour:hover {
  box-shadow: 0 9px 0 var(--clock-hour-hand);
  background: #ffebeb;
}

.time-step-btn.btn-hour:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--clock-hour-hand);
}

.time-step-btn.btn-minute {
  flex: 1 1 100px;
  border-color: var(--clock-minute-hand);
  box-shadow: 0 6px 0 var(--clock-minute-hand);
  color: var(--clock-minute-hand);
  background: #f8faff;
  font-size: 1.15rem;
}

.time-step-btn.btn-minute:hover {
  box-shadow: 0 9px 0 var(--clock-minute-hand);
  background: #eef4ff;
}

.time-step-btn.btn-minute:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--clock-minute-hand);
}

/* Right Card: Companion & Big Time Reading */
.companion-card {
  background: var(--bg-card);
  border: 5px solid var(--bg-card-border);
  border-radius: 36px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
  position: relative;
}

/* Mascot Display */
.mascot-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.mascot-bubble {
  background: var(--mascot-bubble);
  border: 3px solid var(--bg-card-border);
  border-radius: 24px;
  padding: 0.85rem 1.25rem;
  text-align: center;
  position: relative;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  width: 100%;
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 14px 12px 0;
  border-style: solid;
  border-color: var(--bg-card-border) transparent transparent;
}

.mascot-bubble-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.mascot-avatar-wrap {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--theme-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

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

.mascot-avatar-wrap:active {
  transform: scale(0.95);
}

.mascot-svg-icon {
  width: 95px;
  height: 95px;
}

.click-me-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--theme-accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
  animation: pulseBadge 2s infinite ease-in-out;
}

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

/* Time Announcement Banner */
.time-display-box {
  background: #ffffff;
  border: 4px solid var(--bg-card-border);
  border-radius: 26px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}

.time-spoken-main {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--theme-primary);
  line-height: 1.2;
}

.time-detail-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 700;
}

.strike-time-btn {
  width: 100%;
  background: var(--theme-accent);
  border: none;
  border-radius: 24px;
  padding: 0.85rem 1.25rem;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 5px 0 #b45309;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.15s ease;
}

.strike-time-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #b45309;
}

.strike-time-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.clock-strike-badge {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fef08a;
  border: 3px solid #eab308;
  color: #854d0e;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  animation: bellWobble 0.6s infinite alternate ease-in-out;
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.25);
}

.clock-strike-badge.active {
  display: inline-flex;
}

.bell-emoji {
  display: inline-block;
  font-size: 1.5rem;
  animation: bellRing 0.5s infinite alternate ease-in-out;
}

@keyframes bellRing {
  0% { transform: rotate(-18deg) scale(1); }
  100% { transform: rotate(18deg) scale(1.15); }
}

@keyframes bellWobble {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.04); }
}

.bell-striking {
  animation: centerCapPulse 0.5s ease-out;
}

@keyframes centerCapPulse {
  0% { r: 16; stroke-width: 4; fill: #fbbf24; }
  40% { r: 28; stroke-width: 8; fill: #f59e0b; }
  100% { r: 16; stroke-width: 4; fill: var(--clock-center-dot); }
}

/* Digital Mirror Card with Peek Toggle */
.digital-mirror-card {
  background: #f8fafc;
  border: 3px dashed #cbd5e1;
  border-radius: 20px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.digital-mirror-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.digital-mirror-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-night-toggle-btn {
  background: #ffffff;
  border: 2px solid var(--bg-card-border);
  border-radius: 14px;
  padding: 0.2rem 0.6rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-main);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
}

.day-night-toggle-btn:hover {
  transform: translateY(-1px);
  background: #f0fdfa;
}

.day-night-toggle-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.live-sync-indicator {
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.18rem 0.55rem;
  border-radius: 14px;
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #86efac;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  animation: pulseLive 2s infinite ease-in-out;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease;
}

.live-sync-indicator.manual {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
  animation: none;
}

.live-sync-indicator:hover {
  transform: scale(1.06);
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.96); }
}

.digital-colon {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.digital-colon.blink {
  opacity: 0.25;
}

.digit-hours, .digit-minutes {
  cursor: pointer;
  border-radius: 6px;
  padding: 0 0.15rem;
  transition: background 0.15s ease;
}

.digit-hours:hover, .digit-minutes:hover {
  background: rgba(37, 99, 235, 0.12);
}

.digital-time-digits {
  font-family: var(--font-fun);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: 0.05em;
  background: #ffffff;
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.digital-time-digits.hidden {
  filter: blur(8px);
  cursor: pointer;
}

.digital-toggle-btn {
  background: #ffffff;
  border: 2px solid #94a3b8;
  border-radius: 16px;
  padding: 0.35rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  color: #475569;
}

/* Day & Night Routine Card */
.routine-card {
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 22px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.routine-icon {
  font-size: 2.4rem;
}

.routine-info h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.routine-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Quiz & Game Mode UI
   ========================================================================== */
.quiz-section {
  display: none;
  background: var(--bg-card);
  border: 5px solid var(--bg-card-border);
  border-radius: 36px;
  padding: 2rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.quiz-section.active {
  display: flex;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 700px;
}

.quiz-score-badge {
  background: #fef08a;
  border: 3px solid #eab308;
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: #854d0e;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quiz-streak-stars {
  font-size: 1.4rem;
}

.quiz-question-box {
  background: var(--mascot-bubble);
  border: 4px solid var(--bg-card-border);
  border-radius: 28px;
  padding: 1.25rem 2rem;
  max-width: 600px;
  width: 100%;
}

.quiz-question-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--theme-primary);
  margin-bottom: 0.5rem;
}

.quiz-question-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 650px;
}

.quiz-option-btn {
  background: #ffffff;
  border: 4px solid var(--theme-secondary);
  border-radius: 24px;
  padding: 1.15rem;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--theme-secondary);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quiz-option-btn:hover {
  transform: translateY(-3px) scale(1.04);
  background: #f0fdfa;
}

.quiz-option-btn:active {
  transform: translateY(3px);
  box-shadow: none;
}

.quiz-option-btn.correct {
  background: #86efac !important;
  border-color: #16a34a !important;
  color: #14532d !important;
  box-shadow: 0 6px 0 #16a34a !important;
  animation: bounceCorrect 0.6s ease;
}

.quiz-option-btn.wrong {
  background: #fecaca !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
  box-shadow: 0 6px 0 #dc2626 !important;
  animation: shakeWrong 0.4s ease;
}

@keyframes bounceCorrect {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(3deg); }
}

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

/* ==========================================================================
   My Day / Routine Journey Section
   ========================================================================== */
.routine-section {
  display: none;
  background: var(--bg-card);
  border: 5px solid var(--bg-card-border);
  border-radius: 36px;
  padding: 2rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
  flex-direction: column;
  gap: 1.5rem;
}

.routine-section.active {
  display: flex;
}

.routine-title-box {
  text-align: center;
}

.routine-title-box h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--theme-primary);
}

.routine-timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.routine-step-card {
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 24px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
}

.routine-step-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--theme-accent);
  box-shadow: 0 8px 12px rgba(0,0,0,0.1);
}

.routine-step-icon {
  font-size: 2.8rem;
}

.routine-step-time {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--theme-primary);
  background: var(--mascot-bubble);
  padding: 0.2rem 0.75rem;
  border-radius: 12px;
}

.routine-step-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Easter Eggs, Jokes & Bottom Bar
   ========================================================================== */
.kids-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
}

.fun-btn {
  background: #ffffff;
  border: 3px solid var(--bg-card-border);
  border-radius: 28px;
  padding: 0.65rem 1.4rem;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 5px 0 var(--bg-card-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.fun-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--bg-card-border);
  background: #fdf2f8;
}

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

/* Joke Bubble Modal */
.joke-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.joke-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.joke-card {
  background: #ffffff;
  border: 6px solid var(--theme-accent);
  border-radius: 36px;
  padding: 2.25rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.joke-modal.open .joke-card {
  transform: scale(1);
}

.joke-icon {
  font-size: 3.5rem;
}

.joke-setup {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.joke-punchline {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--theme-primary);
  background: #fef08a;
  padding: 0.5rem 1rem;
  border-radius: 18px;
}

/* Confetti & Balloon Pop Canvas */
.reward-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 600;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

/* ==========================================================================
   Responsive adjustments
   ========================================================================== */
@media (max-width: 860px) {
  .play-stage {
    grid-template-columns: 1fr;
  }

  .clock-dial-wrapper {
    max-width: 320px;
  }

  .site-title h1 {
    font-size: 1.45rem;
  }
}
