@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

/* ── Playground View Container & Dreamy Kids Background ── */
#playground-view {
  font-family: 'Quicksand', 'Fredoka', sans-serif;
  padding: 110px 16px 100px;
  min-height: 100vh;
  position: relative;
  z-index: 5;
  transition: all 0.5s ease;
  overflow: hidden;

  /* Dreamy daylight sky background with rich gradient */
  background: linear-gradient(180deg, #b3e5fc 0%, #e1f5fe 40%, #fff9c4 80%, #ffecb3 100%);
  background-size: 100% 200%;
  animation: skyScroll 20s ease-in-out infinite alternate;
}

[data-theme="dark"] #playground-view {
  /* Deep space magical cosmic background */
  background: linear-gradient(180deg, #090a16 0%, #0e112a 40%, #1c1543 85%, #2a113e 100%);
  background-size: 100% 200%;
  animation: skyScroll 20s ease-in-out infinite alternate;
}

@keyframes skyScroll {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

/* Playful Typography Overrides */
#playground-view h1,
#playground-view h2,
#playground-view h3,
#playground-view h4 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── Drifting Background Vector Clouds ── */
.kids-sky-deco {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  user-select: none;
}

.cloud-left {
  top: 15%; left: -100px;
  font-size: 5rem;
  animation: driftRight 45s linear infinite;
}

.cloud-right {
  top: 45%; right: -100px;
  font-size: 6rem;
  animation: driftLeft 55s linear infinite;
  animation-delay: -10s;
}

.rainbow-deco {
  top: 5%; left: 50%;
  transform: translateX(-50%);
  font-size: 12rem;
  opacity: 0.15;
  animation: breatheRainbow 6s ease-in-out infinite alternate;
}

.hotair-balloon {
  top: 30%; left: 20%;
  font-size: 3.5rem;
  animation: balloonFloat 12s ease-in-out infinite alternate;
}

/* Animations for background items */
@keyframes driftRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes driftLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100vw - 200px)); }
}

@keyframes breatheRainbow {
  0% { transform: translateX(-50%) scale(0.95) rotate(-2deg); opacity: 0.12; }
  100% { transform: translateX(-50%) scale(1.05) rotate(2deg); opacity: 0.22; }
}

@keyframes balloonFloat {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-30px) rotate(4deg); }
}

/* ── Navbar Toggle Button Styling ── */
.kids-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  border: 3px solid #ff4757;
  background: linear-gradient(135deg, #ff6b81, #ff4757);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 71, 87, 0.35);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kids-toggle-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.5);
}

.kids-toggle-btn.active {
  background: linear-gradient(135deg, #2ed573, #20bf6b);
  border-color: #20bf6b;
  box-shadow: 0 6px 16px rgba(46, 213, 115, 0.35);
}

/* ── Dashboard (Magical Glassmorphism Box) ── */
.play-dashboard {
  max-width: 960px;
  margin: 0 auto 90px;
  background: rgba(255, 255, 255, 0.78);
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  padding: 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 50px rgba(99, 102, 241, 0.15), 
    inset 0 0 20px rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 10;
  transition: all 0.4s ease;
}

[data-theme="dark"] .play-dashboard {
  background: rgba(18, 20, 48, 0.78);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.45), 
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.play-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  background: linear-gradient(135deg, #ff4757, #ff6b81, #ff7f50, #ffa502);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  filter: drop-shadow(0 2px 4px rgba(255, 71, 87, 0.15));
}

/* Stats Cards (Mini Floating Capsules) */
.dashboard-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-bubble {
  background: #fff;
  border: 3px solid #eef2f6;
  border-radius: 20px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .stat-bubble {
  background: rgba(30, 33, 73, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.stat-bubble:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
}

.stat-emoji {
  font-size: 1.8rem;
  animation: wiggleNode 2s infinite alternate;
}

.stat-val {
  color: #ff4757;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.72rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-top: 2px;
}

[data-theme="dark"] .stat-lbl {
  color: #a5b4fc;
}

/* Progress bar inside Dashboard */
.quest-progress-container {
  width: 100%;
}

.quest-progress-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 8px;
}

[data-theme="dark"] .quest-progress-lbl {
  color: #cbd5e1;
}

.quest-progress-bar-bg {
  height: 22px;
  background: #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
  padding: 3px; /* border frame look */
}

[data-theme="dark"] .quest-progress-bar-bg {
  background: #181935;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.quest-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ed573, #20bf6b, #00d2d3);
  width: 0%;
  border-radius: 20px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Shimmer overlay */
.quest-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.4) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shine 2s infinite;
  background-size: 200% 100%;
}

/* ── Badges Section in Dashboard ── */
.badges-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.badges-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #4b5563;
  margin-bottom: 2px;
}

[data-theme="dark"] .badges-title {
  color: #cbd5e1;
}

.badges-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 16px;
  background: #e4e7eb;
  border: 2px solid #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9ca3af;
  transition: all 0.3s ease;
  user-select: none;
}

[data-theme="dark"] .badge-item {
  background: #181a38;
  border-color: #2b2e5a;
  color: #4b5563;
}

.badge-item.unlocked {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2px solid #f59e0b;
  color: #b45309;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .badge-item.unlocked {
  background: linear-gradient(135deg, #5c2c06, #3b1702);
  border-color: #d97706;
  color: #fef3c7;
}

/* ── Companion Selector ── */
.companion-selector {
  border-top: 3px dashed #cbd5e1;
  padding-top: 24px;
}

[data-theme="dark"] .companion-selector {
  border-color: #2b2e5a;
}

.companion-title {
  font-size: 1rem;
  font-weight: 800;
  color: #4b5563;
  margin-bottom: 14px;
}

[data-theme="dark"] .companion-title {
  color: #cbd5e1;
}

.companion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.comp-card {
  background: #fff;
  border: 3px solid #eef2f6;
  border-radius: 20px;
  padding: 16px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 12px rgba(0,0,0,0.02);
}

[data-theme="dark"] .comp-card {
  background: rgba(30, 33, 73, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
}

.comp-card:hover {
  transform: translateY(-6px) scale(1.05);
  border-color: #a78bfa;
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.18);
}

.comp-card.active {
  border-color: #8b5cf6;
  background: linear-gradient(180deg, #ffffff 0%, #f3ebff 100%);
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.25);
  transform: translateY(-4px);
}

[data-theme="dark"] .comp-card.active {
  border-color: #a78bfa;
  background: linear-gradient(180deg, #242757 0%, #1d1746 100%);
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.45);
}

.comp-avatar {
  font-size: 2.8rem;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.comp-card:hover .comp-avatar {
  transform: scale(1.22) rotate(-8deg);
}

.comp-card.active .comp-avatar {
  animation: bounceMini 1.8s infinite alternate;
}

.comp-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

[data-theme="dark"] .comp-name {
  color: #f1f5f9;
}

.comp-desc {
  font-size: 0.72rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.4;
}

[data-theme="dark"] .comp-desc {
  color: #cbd5e1;
}

/* ── The Winding Adventure Map (Floating Islands) ── */
.adventure-map {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 90px; /* spacing out islands */
}

/* Connecting Dashed Rainbow Road */
.path-svg-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.path-svg-line {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 14;
  stroke-dasharray: 18, 14;
  fill: none;
  stroke-linecap: round;
}

[data-theme="dark"] .path-svg-line {
  stroke: rgba(255, 255, 255, 0.1);
}

.path-svg-line-filled {
  stroke: #ff7f50;
  stroke-width: 12;
  stroke-dasharray: 18, 14;
  fill: none;
  stroke-linecap: round;
  animation: dashPlayground 20s linear infinite;
  filter: drop-shadow(0 2px 6px rgba(255, 127, 80, 0.4));
}

@keyframes dashPlayground {
  to { stroke-dashoffset: -1000; }
}

/* Map Zone (Styled like a floating fantasy island card) */
.map-zone {
  position: relative;
  border-radius: 40px;
  padding: 44px 32px 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid #fff;
  z-index: 2;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.05),
    inset 0 0 20px rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Add a beautiful grid texture background in light mode */
.map-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 36px;
  z-index: -1;
  opacity: 0.05;
  background-image: 
    radial-gradient(#000 15%, transparent 16%),
    radial-gradient(#000 15%, transparent 16%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  pointer-events: none;
}

[data-theme="dark"] .map-zone {
  background: rgba(23, 25, 55, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 20px rgba(255, 255, 255, 0.03);
}

.map-zone:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 
    0 32px 70px rgba(139, 92, 246, 0.12),
    inset 0 0 20px rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .map-zone:hover {
  box-shadow: 
    0 32px 70px rgba(0, 0, 0, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Zone header / Hanging wooden signpost */
.zone-signpost {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  color: #fff;
  border-radius: 24px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: rotate(-1.5deg) translateY(-60px);
  position: absolute;
  top: 0; left: 36px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-zone:hover .zone-signpost {
  transform: rotate(1deg) translateY(-64px) scale(1.06);
}

.zone-signpost-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.zone-track {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 52px;
  padding: 10px 0;
  position: relative;
}

/* Single app node (glowing 3D bubble) */
.map-node-wrapper {
  display: flex;
  position: relative;
  width: 100%;
}

.map-node {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* 3D Glass bubble reflections */
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, rgba(255, 255, 255, 0.7) 40%, rgba(0, 0, 0, 0.05) 100%);
}

[data-theme="dark"] .map-node {
  background: radial-gradient(circle at 35% 35%, #2a2d59 0%, rgba(30, 33, 73, 0.8) 50%, rgba(0, 0, 0, 0.2) 100%);
  border-color: #313568;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* Shiny gloss light reflection overlay */
.map-node::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px;
  width: 24px; height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transform: rotate(-20deg);
  pointer-events: none;
  z-index: 12;
}

.map-node:hover {
  transform: scale(1.22) rotate(-6deg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.map-node-emoji {
  font-size: 2.8rem;
  line-height: 1;
  transition: transform 0.3s ease;
  z-index: 11;
}

.map-node:hover .map-node-emoji {
  transform: scale(1.15) rotate(10deg);
  animation: wiggleNode 0.5s ease infinite alternate;
}

/* Winding layout positions */
.node-pos-left { justify-content: flex-start; padding-left: 12%; }
.node-pos-center { justify-content: center; }
.node-pos-right { justify-content: flex-end; padding-right: 12%; }

/* Speech bubble tooltip for app title */
.node-tooltip {
  position: absolute;
  bottom: 112px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1e293b;
  color: #fff;
  border-radius: 18px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 30;
}

.node-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #1e293b;
}

.map-node:hover .node-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Custom Zone Category Gradient Themes */
/* 📚 Learning - Study Safari */
.zone-learning .zone-signpost {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}
.zone-learning .map-node { border-color: #7c3aed; }
.zone-learning .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #ebdfff 80%);
}
[data-theme="dark"] .zone-learning .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #3e387c 20%, #201a4b 100%);
}
.zone-learning .node-tooltip { background: #7c3aed; }
.zone-learning .node-tooltip::after { border-top-color: #7c3aed; }

/* 🛡️ Safety - Shield Castle */
.zone-safety .zone-signpost {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.4);
}
.zone-safety .map-node { border-color: #0284c7; }
.zone-safety .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #dcf0fa 80%);
}
[data-theme="dark"] .zone-safety .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #183e60 20%, #10254b 100%);
}
.zone-safety .node-tooltip { background: #0284c7; }
.zone-safety .node-tooltip::after { border-top-color: #0284c7; }

/* 🌿 Health - Zen Zone */
.zone-health .zone-signpost {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
}
.zone-health .map-node { border-color: #059669; }
.zone-health .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #d8f8eb 80%);
}
[data-theme="dark"] .zone-health .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #195240 20%, #0d3527 100%);
}
.zone-health .node-tooltip { background: #059669; }
.zone-health .node-tooltip::after { border-top-color: #059669; }

/* 🏠 Values - Heart Haven */
.zone-values .zone-signpost {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
}
.zone-values .map-node { border-color: #d97706; }
.zone-values .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #fef2cc 80%);
}
[data-theme="dark"] .zone-values .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #593e1b 20%, #3a2205 100%);
}
.zone-values .node-tooltip { background: #d97706; }
.zone-values .node-tooltip::after { border-top-color: #d97706; }

/* 🎮 Fun & Games - Joy Jungle */
.zone-fun .zone-signpost {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.4);
}
.zone-fun .map-node { border-color: #0891b2; }
.zone-fun .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #dbf8fc 80%);
}
[data-theme="dark"] .zone-fun .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #184b5e 20%, #0d2f3d 100%);
}
.zone-fun .node-tooltip { background: #0891b2; }
.zone-fun .node-tooltip::after { border-top-color: #0891b2; }

/* 💼 Productivity - Focus Peak */
.zone-work .zone-signpost {
  background: linear-gradient(135deg, #f472b6, #db2777);
  box-shadow: 0 8px 20px rgba(219, 39, 119, 0.4);
}
.zone-work .map-node { border-color: #db2777; }
.zone-work .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #fff 20%, #fde4f2 80%);
}
[data-theme="dark"] .zone-work .map-node:hover {
  background: radial-gradient(circle at 35% 35%, #581d45 20%, #3b092a 100%);
}
.zone-work .node-tooltip { background: #db2777; }
.zone-work .node-tooltip::after { border-top-color: #db2777; }


/* Visited apps reward crown */
.map-node.visited::after {
  content: '👑';
  position: absolute;
  top: -8px; right: -8px;
  width: 32px; height: 32px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  z-index: 15;
  animation: crownPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes crownPop {
  0% { transform: scale(0) rotate(-30deg); }
  70% { transform: scale(1.3) rotate(20deg); }
  100% { transform: scale(1) rotate(15deg); }
}

/* ── Interactive Companion Buddy ( Levitate & Clouds ) ── */
.floating-companion-buddy {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transition: all 0.3s ease;
}

.companion-speech {
  background: #fff;
  border: 4px solid #ff4757;
  border-radius: 24px;
  padding: 14px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  max-width: 230px;
  color: #1e293b;
  box-shadow: 0 12px 32px rgba(255, 71, 87, 0.15);
  position: relative;
  pointer-events: auto;
  cursor: pointer;
  animation: speechFloat 4s ease-in-out infinite;
  transform-origin: bottom right;
}

[data-theme="dark"] .companion-speech {
  background: #181935;
  border-color: #ff6b81;
  color: #f1f5f9;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.companion-speech::after {
  content: '';
  position: absolute;
  top: 100%; right: 30px;
  border: 11px solid transparent;
  border-top-color: #ff4757;
}

[data-theme="dark"] .companion-speech::after {
  border-top-color: #ff6b81;
}

.companion-speech::before {
  content: '';
  position: absolute;
  top: calc(100% - 4px); right: 31px;
  border: 10px solid transparent;
  border-top-color: #fff;
  z-index: 2;
}

[data-theme="dark"] .companion-speech::before {
  border-top-color: #181935;
}

.companion-figure-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 20%, #ffeef0 80%);
  border: 4px solid #ff4757;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.6rem;
  box-shadow: 0 12px 32px rgba(255, 71, 87, 0.25);
  pointer-events: auto;
  cursor: pointer;
  animation: buddyFloat 3s ease-in-out infinite alternate;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .companion-figure-wrap {
  background: radial-gradient(circle at 35% 35%, #2a2d59 0%, #171837 100%);
  border-color: #ff6b81;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.companion-figure-wrap:hover {
  transform: scale(1.12) rotate(6deg);
  border-color: #ff4757;
  box-shadow: 0 16px 36px rgba(255, 71, 87, 0.4);
}

/* Animations for companion buddy */
@keyframes buddyFloat {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-14px) rotate(3deg) scale(1.02); }
  100% { transform: translateY(0) rotate(-3deg) scale(1); }
}

@keyframes speechFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.02); }
}

/* Cheering Animation */
.companion-cheer {
  animation: cheerBuddy 0.7s ease 2;
}

@keyframes cheerBuddy {
  0%, 100% { transform: translateY(0) scale(1) rotate(0); }
  50% { transform: translateY(-28px) scale(1.3) rotate(-15deg); }
}

/* ── Celebration / Badge Unlock Banner Overlay ── */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease both;
}

.celebration-card {
  background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
  border-radius: 40px;
  border: 5px solid #fbbf24;
  padding: 44px 36px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  animation: celebratePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
}

[data-theme="dark"] .celebration-card {
  background: linear-gradient(135deg, #171837 0%, #0d0e25 100%);
  border-color: #d97706;
}

.celeb-sparkles {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: spinSlow 12s linear infinite;
  display: inline-block;
}

.celeb-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.8rem;
  color: #d97706;
  margin-bottom: 12px;
}

.celeb-badge-icon {
  font-size: 6rem;
  line-height: 1;
  margin: 20px 0;
  display: inline-block;
  animation: bounceMini 1.2s infinite alternate;
  filter: drop-shadow(0 4px 10px rgba(245,158,11,0.3));
}

.celeb-badge-name {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  color: #1e293b;
  margin-bottom: 8px;
}

[data-theme="dark"] .celeb-badge-name {
  color: #f1f5f9;
}

.celeb-close-btn {
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
}

.celeb-close-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.6);
}

/* XP floating popups */
.xp-popup {
  position: fixed;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #2ed573;
  pointer-events: none;
  z-index: 10000;
  animation: xpFloat 1.2s cubic-bezier(0.25, 1, 0.50, 1) both;
  text-shadow: 0 3px 12px rgba(0,0,0,0.2), 0 0 1px #fff;
}

/* Animations */
@keyframes bounceMini {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px) scale(1.06); }
}

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

@keyframes wiggleNode {
  0% { transform: scale(1.1) rotate(-6deg); }
  100% { transform: scale(1.1) rotate(6deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #playground-view {
    padding-top: 100px;
  }
  .map-zone {
    padding: 36px 18px 24px;
    border-radius: 30px;
  }
  .zone-signpost {
    left: 20px;
    font-size: 0.95rem;
    padding: 10px 20px;
    transform: rotate(-1deg) translateY(-48px);
  }
  .map-zone:hover .zone-signpost {
    transform: rotate(1deg) translateY(-52px) scale(1.03);
  }
  .map-node {
    width: 80px; height: 80px;
  }
  .map-node-emoji {
    font-size: 2.2rem;
  }
  .map-node-label {
    font-size: 0.72rem;
    max-width: 100px;
  }
  .node-pos-left { padding-left: 0; }
  .node-pos-right { padding-right: 0; }
}

/* ── Activity Name Labels Below Bubble Circles ── */
.map-node-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4b5563;
  text-align: center;
  max-width: 130px;
  word-wrap: break-word;
  line-height: 1.3;
  margin-top: 4px;
  transition: all 0.3s ease;
  user-select: none;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .map-node-label {
  color: #d1d5db;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.map-node-container:hover .map-node-label {
  color: #ff4757;
  transform: scale(1.05);
}

[data-theme="dark"] .map-node-container:hover .map-node-label {
  color: #ff6b81;
}
