/* Shared look for all Smart Games */
:root {
  --sky: #7fd3ff;
  --sky-deep: #3aa8e8;
  --sun: #ffd23f;
  --grass: #5cc85c;
  --ink: #23304a;
  --white: #ffffff;
  --pink: #ff6b9a;
  --orange: #ff9f43;
  --purple: #9b6bff;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  font-family: "Baloo 2", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  background: linear-gradient(var(--sky), #c9efff);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 18px;
  padding: 14px 28px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  background: var(--orange);
  box-shadow: var(--shadow);
  transition: transform 0.08s;
}
button:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
button.secondary { background: var(--purple); }
button.small { font-size: 1rem; padding: 8px 16px; border-radius: 12px; }

/* Top bar used in each game */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  z-index: 50;
  font-weight: 800;
  font-size: 1.3rem;
}
.hud .pill {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}
.hud a.pill { color: var(--ink); text-decoration: none; }

/* Start / game-over overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(35, 48, 74, 0.45);
  z-index: 100;
  padding: 16px;
}
.overlay.hidden { display: none; }
.card {
  background: var(--white);
  border-radius: 28px;
  padding: 28px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.15);
}
.card h1 { margin: 0 0 8px; font-size: 2.2rem; }
.card p { font-size: 1.2rem; margin: 8px 0 16px; }
.card .big { font-size: 3rem; font-weight: 900; margin: 4px 0; }
.card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.choice.selected { outline: 4px solid var(--ink); }

/* level picker on start screens */
#levelPick button { min-width: 54px; padding: 8px 12px; font-size: 1.2rem; background: var(--sky-deep); }
#levelPick button.selected { background: var(--orange); }

/* big "Level 3!" message */
.sg-banner {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center;
  font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 900; color: var(--sun);
  text-shadow: 0 5px 0 #3b2a7a; z-index: 90; pointer-events: none; white-space: nowrap; opacity: 0;
}
.sg-banner.show { animation: sgbanner 1.8s forwards; }
@keyframes sgbanner { 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 80% { opacity: 1; } 100% { opacity: 0; } }

.pop { animation: pop 0.3s ease-out; }
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.shake { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
