/* ===== LEARNING DASH - Kid Friendly Theme (scoped, site-safe) ===== */
.dash-stage, .dash-stage * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.dash-stage h1, .dash-stage h2, .dash-stage p { margin: 0; padding: 0; }
.dash-stage {
  font-family: 'Comic Neue', 'Bubblegum Sans', cursive;
  background: linear-gradient(180deg, #06121f 0%, #0b3d66 50%, #1f7a8c 80%, #7ce0d3 100%);
  border-radius: 24px; user-select: none; padding: 8px;
}
#dash-container { display: flex; flex-direction: column; min-height: max(560px, min(96vh, 960px)); max-width: 1100px; margin: 0 auto; padding: 8px; gap: 8px; }
#dash-container button { font-family: inherit; }
#dash-container .game-header, #dash-container .game-main, #dash-container .game-footer { margin: 0; }

.game-header {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.94); border-radius: 22px; padding: 8px 16px;
  border: 4px solid #fff; box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 30px rgba(0,0,0,0.25);
  flex-wrap: wrap;
}
.game-title {
  font-family: 'Bubblegum Sans', cursive; font-size: 1.6rem; letter-spacing: 1px;
  background: linear-gradient(90deg,#7ce0d3,#4dd0ff,#ffd93d,#ff9a3d,#ff5b8a);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbowText 4s linear infinite;
}
@keyframes rainbowText { to { background-position: 300% 0; } }
.level-badge {
  display: inline-block; background: linear-gradient(135deg,#0b3d66,#06121f); color: #fff;
  font-weight: bold; padding: 2px 14px; border-radius: 20px; margin-top: 4px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}
.prompt-badge {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg,#e0faf5,#b8f0e2);
  border: 3px solid #14b8a6; border-radius: 18px; padding: 4px 16px 4px 10px;
  box-shadow: 0 4px 0 #0f766e;
}
.prompt-label { font-weight: bold; font-size: 0.8rem; color: #0f766e; }
.prompt-text {
  font-family: 'Bubblegum Sans'; font-size: 1.5rem; color: #083f39; white-space: nowrap;
}
.stats-bar { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 6px; font-weight: bold; color: #1a1a3a; }
.stat-icon { font-size: 1.35rem; animation: bounce 1.5s ease-in-out infinite; }
.stat:nth-child(2) .stat-icon { animation-delay: 0.15s; } .stat:nth-child(3) .stat-icon { animation-delay: 0.3s; } .stat:nth-child(4) .stat-icon { animation-delay: 0.45s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.stat-label { font-size: 0.62rem; opacity: 0.6; letter-spacing: 1px; }
.stat-value { font-size: 1.35rem; font-family: 'Bubblegum Sans'; min-width: 30px; }
.lives-container { display: flex; gap: 2px; font-size: 1.25rem; }
.lives-container .lost { filter: grayscale(1); opacity: 0.3; transform: scale(0.8); }
.header-left { display: flex; flex-direction: column; }
.header-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }

.game-main { position: relative; flex: 1; border-radius: 24px; overflow: hidden;
  border: 5px solid #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  background: #06121f; min-height: 520px; }
#dash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#dash-canvas.shake { animation: dShake 0.35s; }
@keyframes dShake { 0%,100%{transform:translate(0,0);} 20%{transform:translate(-8px,4px);} 40%{transform:translate(7px,-5px);} 60%{transform:translate(-5px,-3px);} 80%{transform:translate(4px,3px);} }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(4,14,24,0.74); backdrop-filter: blur(6px); z-index: 20; padding: 16px;
  opacity: 1; transition: opacity 0.3s; }
.overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-content {
  background: linear-gradient(160deg, #fff 0%, #e8faf5 100%); border-radius: 28px; padding: 26px 32px;
  text-align: center; max-width: 560px; width: 100%; max-height: 92%; overflow-y: auto;
  border: 5px solid #14b8a6; box-shadow: 0 12px 0 rgba(0,0,0,0.2), 0 20px 60px rgba(0,0,0,0.4);
  animation: overlayPop 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes overlayPop { 0% { transform: scale(0.5) rotate(-4deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.overlay-content h2 { font-family: 'Bubblegum Sans'; font-size: 2.1rem; color: #0f766e; margin-bottom: 6px; }
.subtitle { font-size: 1.05rem; color: #666; } .instruction { font-size: 1.15rem; font-weight: bold; color: #0d9488; margin: 8px 0 12px; }
.opt-row { display: flex; gap: 8px; margin: 10px 0; justify-content: center; flex-wrap: wrap; }
.opt-label { width: 100%; font-weight: bold; color: #0f766e; font-size: 0.9rem; }
.mode-btn { border: 3px solid #a8e6dd; background: #f0fdfa; border-radius: 16px; padding: 10px 16px; font-family: inherit;
  font-weight: bold; font-size: 0.95rem; cursor: pointer; transition: all 0.15s; color: #0f766e; }
.mode-btn:hover { transform: translateY(-2px) scale(1.03); border-color: #14b8a6; }
.mode-btn.active { background: linear-gradient(135deg,#14b8a6,#0d9488); color: #fff; border-color: #083f39;
  box-shadow: 0 4px 0 #04211e; transform: scale(1.03); }
.start-btn, .resume-btn {
  font-family: 'Bubblegum Sans'; font-size: 1.55rem; letter-spacing: 2px; color: #fff; border: none; cursor: pointer;
  background: linear-gradient(180deg,#6bff8f,#22cc66); padding: 12px 44px; border-radius: 50px; margin-top: 12px;
  box-shadow: 0 6px 0 #159a4c, 0 10px 20px rgba(0,0,0,0.3); transition: all 0.12s;
  animation: btnGlow 1.6s ease-in-out infinite;
}
@keyframes btnGlow { 0%,100%{ box-shadow: 0 6px 0 #159a4c, 0 0 15px #6bff8f;} 50%{ box-shadow: 0 6px 0 #159a4c, 0 0 35px #6bff8f;} }
.start-btn:hover, .resume-btn:hover { transform: translateY(-3px) scale(1.05); }
.start-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #159a4c; }
.menu-btn { display: block; margin: 10px auto 0; background: #eee; border: 2px solid #ccc; border-radius: 30px;
  padding: 8px 26px; font-family: inherit; font-weight: bold; cursor: pointer; color: #666; }
.menu-btn:hover { background: #ddd; }
.controls-hint { margin-top: 12px; font-size: 0.85rem; color: #888; }
.controls-hint kbd { background: #0f766e; color: #fff; border-radius: 6px; padding: 2px 8px; font-family: inherit; margin: 0 2px; box-shadow: 0 2px 0 #083f39; }
.final-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.final-stat { background: linear-gradient(135deg,#f0fdfa,#d6f5ec); border-radius: 16px; padding: 10px; border: 2px solid #a8e6dd; }
.final-value { display: block; font-family: 'Bubblegum Sans'; font-size: 1.8rem; color: #0f766e; }
.final-label { font-size: 0.62rem; letter-spacing: 1px; color: #888; font-weight: bold; }
.rank { font-size: 1.25rem; font-weight: bold; background: linear-gradient(90deg,#ffd93d,#ff9a3d); display: inline-block;
  padding: 6px 22px; border-radius: 30px; margin: 6px 0; animation: bounce 1s infinite; border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25); }

.game-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.94); border-radius: 18px; padding: 8px 16px; border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12); flex-wrap: wrap; }
.jump-btn { flex: 1; min-width: 200px; border-radius: 16px; border: none; padding: 14px; font-family: 'Bubblegum Sans';
  font-size: 1.4rem; letter-spacing: 1px; color: #fff; cursor: pointer; background: linear-gradient(180deg,#2dd4bf,#0d9488);
  box-shadow: 0 5px 0 #083f39; }
.jump-btn:active { transform: translateY(3px); box-shadow: none; }
.tool-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-btn { border-radius: 14px; border: 3px solid #0f766e; background: linear-gradient(180deg,#fff,#d6f5ec);
  font-family: inherit; font-weight: bold; font-size: 0.95rem; padding: 10px 14px; cursor: pointer;
  box-shadow: 0 4px 0 #083f39; color: #0f766e; }
.foot-btn:active { transform: translateY(3px); box-shadow: none; }

/* fit-to-screen hardening */
@media (max-width: 700px) {
  .game-header { padding: 6px 10px; gap: 6px; }
  .game-main { min-height: 420px; }
  .stat-label { display: none; }
  .stat-icon { font-size: 1.1rem; }
  .overlay-content h2 { font-size: 1.6rem; }
  .prompt-text { font-size: 1.15rem; }
  .game-title { font-size: 1.05rem; }
  .overlay-content { padding: 18px; }
  .controls-hint { display: none; }
  #dash-container { padding: 4px; }
}
@media (max-height: 500px) {
  .game-main { min-height: 360px; }
}
