:root {
  --ink: #243056;
  --blue: #2f6fed;
  --blue-d: #1d4bb5;
  --red: #D4A017;
  --gold: #D4A017;
  --gold-hi: #F5C542;
  --gold-d: #A67C00;
  --green: #1f9d57;
  --green-d: #147243;
  --cream: #fff8ee;
  --amber: #ffd45a;
  --card: #ffffff;
  --line: rgba(36, 48, 86, 0.16);
  --shadow: 0 8px 0 rgba(36, 48, 86, 0.12);
  --app-h: 100%;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  background: #9fd4ff;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

button, input { font-family: inherit; color: inherit; }

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus, input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }

.app {
  height: var(--app-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding:
    calc(6px + env(safe-area-inset-top, 0px))
    calc(10px + env(safe-area-inset-right, 0px))
    calc(6px + env(safe-area-inset-bottom, 0px))
    calc(10px + env(safe-area-inset-left, 0px));
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, #8ecdf8 0%, #fff1d2 58%, #ffd7ae 100%);
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  position: relative;
}

.warn-banner {
  flex: 0 0 auto;
  background: var(--amber);
  color: var(--ink);
  text-align: center;
  font-weight: 800;
  border-radius: 14px;
  padding: 6px 12px;
  margin-bottom: 6px;
  font-size: 18px;
}

.warn-banner[hidden] { display: none; }

.big-btn, .alt-btn, .choice, .key, .level-tile, .profile-pick, .obj, .bundle-btn {
  border-radius: 22px;
  font-weight: 800;
}

.big-btn, .alt-btn {
  min-height: 76px;
  padding: 10px 22px;
  font-size: 32px;
  border-radius: 24px;
  box-shadow: 0 6px 0 var(--blue-d);
}

.big-btn {
  background: var(--blue);
  color: white;
  box-shadow: 0 6px 0 var(--blue-d), 0 0 0 3px var(--gold-hi);
}

.alt-btn {
  background: white;
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(36, 48, 86, 0.18);
  font-size: 26px;
}

.big-btn:active, .alt-btn:active, .choice:active, .key:active, .obj:active, .level-tile:active, .profile-pick:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(36, 48, 86, 0.2);
}

.icon-btn {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.icon-btn svg { width: 36px; height: 36px; }

.eyebrow {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3d527f;
}

h1, h2, p { margin: 0; }

h1 { font-size: 40px; line-height: 1; }

.lede, .hint, .note { font-size: 20px; font-weight: 700; color: #3d527f; }

.cloud {
  position: absolute;
  background: white;
  border-radius: 40px;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.cloud:before, .cloud:after {
  content: "";
  position: absolute;
  background: white;
  border-radius: 50%;
}

.cloud.c1 { width: 90px; height: 28px; top: 18px; left: 8%; }
.cloud.c1:before { width: 36px; height: 36px; left: 14px; top: -18px; }
.cloud.c1:after { width: 28px; height: 28px; left: 42px; top: -12px; }
.cloud.c2 { width: 70px; height: 22px; top: 46px; right: 6%; }
.cloud.c2:before { width: 28px; height: 28px; left: 12px; top: -14px; }

.bob { animation: none; }

.title-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 12px;
}

.bolt-img { display: block; }
picture.bolt-robot, picture.bolt-truck, picture.bolt-bust { display: block; }

.title-hero, .title-copy { position: relative; z-index: 1; min-width: 0; }

.title-hero { display: grid; place-items: center; height: 100%; }
.title-hero .bolt-svg, .title-hero .bolt-img {
  height: min(460px, 64vh);
  width: auto;
  max-width: 100%;
  filter: drop-shadow(0 0 16px rgba(245, 197, 66, 0.7)) drop-shadow(0 6px 0 rgba(166, 124, 0, 0.22));
}

.title-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.title-copy h1 {
  font-size: clamp(28px, 4.6vw, 52px);
  letter-spacing: -0.6px;
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: break-word;
  color: #6b4e00;
  text-shadow: 0 1px 0 rgba(255, 248, 220, 0.95), 0 0 16px rgba(245, 197, 66, 0.45);
}
.title-copy .big-btn { min-width: 240px; font-size: 40px; min-height: 92px; }

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 64px;
}

.profile-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-card {
  min-height: 0;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow), 0 0 0 3px rgba(212, 160, 23, 0.85);
}

.profile-card.is-resting { background: rgba(255, 255, 255, 0.5); }

.name-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
  color: #3d527f;
}

.name-label input, .settings-screen input {
  min-height: 52px;
  border-radius: 16px;
  border: 3px solid var(--line);
  background: white;
  font-size: 22px;
  font-weight: 800;
  padding: 0 12px;
}

.profile-pick {
  flex: 1;
  min-height: 0;
  background: white;
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(36, 48, 86, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
}

.profile-pick .avatar { height: min(210px, 30vh); width: auto; display: flex; align-items: flex-end; justify-content: center; }
.profile-pick .avatar picture { display: block; height: 100%; }
.profile-pick .avatar .bolt-svg, .profile-pick .avatar .bolt-img { height: 100%; width: auto; }
.profile-pick strong { font-size: 32px; }
.profile-pick span { font-size: 18px; font-weight: 800; color: #3d527f; }

.grownups {
  align-self: center;
  min-height: 52px;
  min-width: 180px;
  padding: 6px 16px 8px;
  border-radius: 999px;
  border: 2px solid rgba(36, 48, 86, 0.28);
  background: rgba(255, 255, 255, 0.55);
  font-size: 16px;
  font-weight: 800;
  color: #3d527f;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.hold-label { font-size: 12px; font-weight: 700; }

.hold-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 5px;
  border-radius: 99px;
  background: rgba(36, 48, 86, 0.12);
  overflow: hidden;
}

.hold-fill { display: block; height: 100%; width: 0; background: var(--blue); }

.home-bar, .play-bar {
  display: grid;
  align-items: center;
  gap: 8px;
}

.home-bar {
  grid-template-columns: auto 1fr auto;
  min-height: 72px;
}

.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who strong { display: block; font-size: 24px; }
.who span, .time-pill { font-size: 16px; font-weight: 800; color: #3d527f; }

.avatar.sm { width: auto; height: 72px; }
.avatar.sm picture { display: block; height: 100%; }
.avatar.sm .bolt-svg, .avatar.sm .bolt-img { width: auto; height: 72px; }

.home-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 12px;
}

.mission-card, .side-card, .panel {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
  min-height: 0;
  overflow: hidden;
}

.mission-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.mission-card h2 { font-size: 36px; line-height: 1.05; }
.mission-card p { font-size: 20px; font-weight: 700; }
.mission-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mission-actions .big-btn, .mission-actions .alt-btn { flex: 1 1 180px; }

.text-btn {
  align-self: flex-start;
  min-height: 44px;
  font-size: 16px;
  font-weight: 800;
  color: #3d527f;
  text-decoration: underline;
}

.side-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.side-card .alt-btn { width: 100%; }

.sticker-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sticker-row svg { width: 42px; height: 42px; }
.sticker-empty { font-size: 16px; font-weight: 700; color: #3d527f; }

.level-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

.level-tile {
  background: white;
  box-shadow: var(--shadow);
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px;
}

.level-tile[data-group="big"] { background: #e7f1ff; }
.level-tile .range { font-size: 32px; font-weight: 800; line-height: 1; }
.level-tile strong { font-size: 16px; text-align: center; }
.level-tile .lock, .level-tile .done-flag { font-size: 14px; font-weight: 800; }
.level-tile.is-locked { opacity: 0.72; }
.level-tile svg { width: 28px; height: 28px; }

.play-bar {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "home robot bubble meter time";
  min-height: 78px;
}

.play-bar .icon-btn { grid-area: home; }
.play-bar .avatar { grid-area: robot; }
.bubble { grid-area: bubble; background: white; border-radius: 18px; padding: 8px 12px; box-shadow: var(--shadow), 0 0 0 2px rgba(212, 160, 23, 0.55); min-width: 0; }
.bubble .q-count { display: block; font-size: 13px; font-weight: 800; color: #3d527f; }
.bubble p { font-size: 24px; font-weight: 800; line-height: 1.15; }
.meter { grid-area: meter; display: flex; gap: 4px; }
.time-pill { grid-area: time; background: white; border-radius: 999px; padding: 8px 10px; white-space: nowrap; }

.pip {
  width: 18px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 2px rgba(36, 48, 86, 0.15);
}

.pip.is-on { background: var(--amber); box-shadow: inset 0 0 0 2px var(--ink); }

.stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.object-grid, .mini-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 8px;
  width: 100%;
}

.obj {
  width: 84px;
  height: 84px;
  background: white;
  box-shadow: 0 5px 0 rgba(36, 48, 86, 0.14);
  display: grid;
  place-items: center;
  padding: 6px;
}

.obj svg, .bundle-btn svg { width: 100%; height: 100%; }
.obj.small { width: 64px; height: 64px; }
.obj.is-on, .bundle-btn.is-on { background: #e5f8ea; box-shadow: inset 0 0 0 4px var(--green); }
.obj.is-replay, .bundle-btn.is-replay { transform: scale(1.06); box-shadow: 0 0 0 4px var(--amber); }

.bundle-btn {
  width: 128px;
  height: 96px;
  background: white;
  box-shadow: 0 5px 0 rgba(36, 48, 86, 0.14);
  padding: 4px;
}

.count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 800;
}

.count-badge[hidden] { display: none; }

.object-grid[data-size="few"] .obj { width: 112px; height: 112px; }
.object-grid[data-size="some"] .obj { width: 92px; height: 92px; }
.object-grid[data-size="many"] {
  display: grid;
  grid-template-columns: repeat(4, 104px);
  justify-content: center;
}
.object-grid[data-size="many"] .obj { width: 104px; height: 104px; }
.object-grid[data-kind="bundles"] {
  display: grid;
  grid-template-columns: repeat(5, 132px);
  justify-content: center;
}

.give {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.give-bolt { width: 110px; flex: 0 0 auto; }
.give-bolt .bolt-svg, .give-bolt .bolt-img { width: auto; height: 168px; filter: drop-shadow(0 0 10px rgba(245, 197, 66, 0.45)); }
.give-cols { flex: 1; min-width: 0; display: flex; gap: 8px; }
.give-col {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 20px;
  padding: 8px;
}
.give-col p { font-size: 16px; font-weight: 800; margin-bottom: 6px; }

.listen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.listen .bolt-svg, .listen .bolt-img { height: min(210px, 30vh); width: auto; }

.dock {
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.choices {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.choice {
  min-height: 96px;
  background: var(--blue);
  color: white;
  font-size: 52px;
  box-shadow: 0 6px 0 var(--blue-d);
}

.choice.is-hint { animation: hintpulse 0.9s ease-in-out infinite; }

@keyframes hintpulse {
  0%, 100% { box-shadow: 0 6px 0 var(--blue-d), 0 0 0 0 var(--amber); }
  50% { box-shadow: 0 6px 0 var(--blue-d), 0 0 0 6px var(--amber); }
}

.dock .big-btn { min-width: 240px; }
.success-line { font-size: 22px; font-weight: 800; }

.scene {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #b9e4ff 0%, #fff6df 70%);
}

.actor {
  position: absolute;
  left: 50%;
  z-index: 2;
}

.actor picture { display: block; }
.actor .bolt-img { display: block; }

.actor-robot {
  top: 46%;
  transform: translate(-50%, -50%);
}
.actor-robot .bolt-img { height: min(500px, 62vh); width: auto; }
.actor-robot:after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 8%;
  bottom: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0) 0%, rgba(120, 200, 255, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.actor-car { opacity: 0; top: 54%; transform: translate(-50%, -50%); }
.actor-car .bolt-img { width: min(640px, 78vw); height: auto; }

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}

.speed-lines { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.speed-lines span {
  position: absolute;
  left: 6%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(36, 48, 86, 0.15);
  opacity: 0;
}

.scene.is-go .actor-robot {
  animation: robot-power 0.7s linear forwards, robot-spinout 0.34s linear 0.68s forwards;
}
.scene.is-go .actor-robot:after { animation: halo 0.7s linear forwards; }
.scene.is-go .flash { animation: bolt-flash 0.32s linear 0.72s forwards; }
.scene.is-go .actor-car { animation: truck-go 4.1s linear 0.9s forwards; }
.scene.is-go .speed-lines span { animation: streak 0.45s linear 1.15s 6; }

@keyframes halo {
  0% { opacity: 0; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1); background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(90, 190, 255, 0.55) 42%, rgba(90, 190, 255, 0) 72%); }
  100% { opacity: 1; transform: scale(1.2); background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.7) 36%, rgba(90, 190, 255, 0) 70%); }
}

@keyframes robot-power {
  0% { filter: brightness(1) drop-shadow(0 0 0 rgba(120, 200, 255, 0)); transform: translate(-50%, -50%) scale(1); }
  55% { filter: brightness(1.35) drop-shadow(0 0 18px rgba(80, 180, 255, 0.95)); transform: translate(-50%, -50%) scale(1.05); }
  100% { filter: brightness(2) drop-shadow(0 0 28px rgba(255, 255, 255, 0.95)); transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes robot-spinout {
  0% { opacity: 1; filter: brightness(2.1); transform: translate(-50%, -50%) scale(1.08) rotate(0deg); }
  100% { opacity: 0; filter: brightness(3); transform: translate(-50%, -50%) scale(0.18) rotate(210deg); }
}

@keyframes bolt-flash {
  0% { opacity: 0; }
  30% { opacity: 0.92; }
  100% { opacity: 0; }
}

@keyframes truck-go {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.58); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  74% { opacity: 1; transform: translate(calc(-50% + 58vw), -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes streak {
  0% { opacity: 0; transform: translateX(0); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: translateX(52vw); }
}

.road {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 16%;
  height: 14px;
  background: #5c6b89;
  border-radius: 8px;
  z-index: 1;
}

.road:after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 5px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #fff 0 18px, transparent 18px 36px);
}

.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 12px;
  height: 18px;
  border-radius: 4px;
  opacity: 0;
  animation: fall 2.8s ease-in 1.2s forwards;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0.9; transform: translateY(68vh) rotate(180deg); }
}

.reward-caption {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  min-height: 36px;
}

.reward-actions { min-height: 84px; display: flex; justify-content: center; align-items: center; }
.reward { gap: 6px; }
.reward-kicker { text-align: center; font-size: 18px; font-weight: 800; color: #3d527f; }

.park-screen, .gate-screen, .settings-screen, .confirm-screen {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.park-car { width: min(460px, 80vw); }
.park-car picture { display: block; }
.park-car .bolt-svg, .park-car .bolt-img { width: 100%; height: auto; }
.park-screen h1, .gate-screen h1 { font-size: 48px; }

.gate-display {
  min-width: 180px;
  min-height: 64px;
  border-radius: 18px;
  background: white;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.keypad {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.key {
  min-height: 64px;
  background: white;
  font-size: 30px;
  box-shadow: 0 5px 0 rgba(36, 48, 86, 0.16);
}

.key.ok { background: var(--green); color: white; box-shadow: 0 5px 0 var(--green-d); }

.settings-screen, .confirm-screen { justify-content: flex-start; padding-top: 4px; }
.settings-screen { width: min(640px, 100%); margin: 0 auto; }
.settings-screen h1, .confirm-screen h1 { font-size: 32px; }
.seg { display: flex; gap: 8px; width: 100%; }
.voice-seg { margin: 6px 0 10px; }
.seg button {
  flex: 1;
  min-height: 56px;
  border-radius: 16px;
  background: white;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(36, 48, 86, 0.12);
}
.seg button[aria-pressed="true"], .swatch[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}
.stack-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  background: white;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(36, 48, 86, 0.12);
}

.garage-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
}

.preview-card, .gear-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.preview-card picture { display: block; }
.preview-card .bolt-svg, .preview-card .bolt-img { width: min(280px, 40vh); height: auto; }
.gear-card { align-items: stretch; overflow: hidden; }
.gear-card h2 { font-size: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  min-height: 64px;
  min-width: 112px;
  border-radius: 16px;
  background: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 0 rgba(36, 48, 86, 0.12);
  padding: 6px 8px;
}
.swatch small { display: block; font-size: 12px; }
.swatch.is-locked { opacity: 0.7; }
.chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: inline-block;
}

@media (orientation: portrait) {
  .title-screen { grid-template-columns: 1fr; grid-template-rows: 1.15fr auto; }
  .title-copy { align-items: center; text-align: center; }
  .title-copy h1 { font-size: clamp(28px, 6.4vw, 44px); }
  .title-hero .bolt-svg, .title-hero .bolt-img { height: min(420px, 46vh); width: auto; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-pick .avatar { height: min(150px, 18vh); }
  .home-main { grid-template-columns: 1fr; grid-template-rows: 1.25fr 0.75fr; }
  .level-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
  .play-bar {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "home robot meter time"
      "bubble bubble bubble bubble";
  }
  .give { flex-direction: column; justify-content: center; }
  .give-bolt .bolt-svg, .give-bolt .bolt-img { width: auto; height: 120px; }
  .give-bolt { width: auto; }
  .garage-layout { grid-template-columns: 1fr; grid-template-rows: 0.7fr 1.1fr; }
  .object-grid[data-size="many"] { grid-template-columns: repeat(4, 100px); }
  .object-grid[data-size="many"] .obj { width: 100px; height: 100px; }
  .object-grid[data-kind="bundles"] { grid-template-columns: repeat(4, 120px); }
  .mission-card h2 { font-size: 32px; }
  .park-screen h1 { font-size: 40px; }
}

@media (max-height: 800px) and (orientation: landscape) {
  .title-copy h1 { font-size: clamp(24px, 4.2vw, 40px); }
  .title-hero .bolt-svg, .title-hero .bolt-img { height: min(430px, 60vh); width: auto; }
  .big-btn, .alt-btn { min-height: 64px; font-size: 28px; }
  .choice { min-height: 84px; font-size: 46px; }
  .dock { flex-basis: 100px; }
  .object-grid[data-size="few"] .obj { width: 104px; height: 104px; }
  .object-grid[data-size="many"] { grid-template-columns: repeat(4, 100px); }
  .object-grid[data-size="many"] .obj { width: 100px; height: 100px; }
  .profile-pick .avatar { height: min(190px, 30vh); }
  .bubble p { font-size: 20px; }
  .mission-card h2 { font-size: 30px; }
  .play-bar { min-height: 68px; }
  .give-bolt .bolt-svg, .give-bolt .bolt-img { height: 150px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .bob, .confetti i, .choice.is-hint { animation: none; }
  .scene.is-go .flash, .scene.is-go .speed-lines span, .scene.is-go .actor-robot:after { animation: none; }
  .scene.is-go .actor-robot { animation: fade-out 0.25s forwards; }
  .scene.is-go .actor-car {
    animation: fade-in 0.3s 0.15s forwards;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { to { opacity: 1; } }

/* ---------- v2: garage background, growth, truck build, buddies, juicy feedback ---------- */

body[data-screen="play"] .app,
body[data-screen="home"] .app,
body[data-screen="garage"] .app,
body[data-screen="levels"] .app,
body[data-screen="profiles"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.62) 0%, rgba(255, 248, 235, 0.5) 55%, rgba(255, 244, 225, 0.66) 100%),
    url("../img/garage-bg.jpg") center / cover no-repeat,
    #e8d7b6;
}
html.webp body[data-screen="play"] .app,
html.webp body[data-screen="home"] .app,
html.webp body[data-screen="garage"] .app,
html.webp body[data-screen="levels"] .app,
html.webp body[data-screen="profiles"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.62) 0%, rgba(255, 248, 235, 0.5) 55%, rgba(255, 244, 225, 0.66) 100%),
    url("../img/garage-bg.webp") center / cover no-repeat,
    #e8d7b6;
}

.stage-pic, .part-pic, .hero-pic { display: block; }
.stage-pic .bolt-img, .part-pic .bolt-img, .hero-pic .bolt-img { display: block; }
.is-silhouette .bolt-img { filter: brightness(0) opacity(0.28); }

/* Growth meter */
.growth { display: flex; align-items: center; gap: 8px; width: 100%; }
.grow-now .bolt-img { height: 64px; width: auto; }
.grow-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.grow-label { font-size: 15px; font-weight: 800; color: #3d527f; }
.grow-bar { display: block; height: 14px; border-radius: 99px; background: rgba(36, 48, 86, 0.14); overflow: hidden; box-shadow: inset 0 0 0 2px rgba(36, 48, 86, 0.12); }
.grow-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f6fed, #44b6ff 60%, #ffd45a); transition: width 0.6s ease; }
.grow-next .bolt-img { height: 54px; width: auto; }
.grow-next.is-max svg { width: 40px; height: 40px; }
.growth.is-compact { max-width: 300px; }
.growth.is-compact .grow-next .bolt-img { height: 42px; }
.profile-pick .growth { margin-top: 4px; }

/* Avatars now show the growth stage */
.avatar.sm .stage-pic { height: 72px; }
.avatar.sm .stage-pic .bolt-img { height: 72px; width: auto; filter: drop-shadow(0 2px 4px rgba(36, 48, 86, 0.25)); }
.profile-pick .avatar .stage-pic { height: 100%; }
.profile-pick .avatar .stage-pic .bolt-img { height: 100%; width: auto; filter: drop-shadow(0 6px 10px rgba(36, 48, 86, 0.25)); }

/* Hero / buddy picker */
.hero-picker { display: flex; flex-direction: column; gap: 4px; }
.hero-row { display: flex; gap: 6px; }
.hero-btn {
  flex: 1;
  min-height: 112px;
  min-width: 0;
  border-radius: 18px;
  background: white;
  box-shadow: 0 4px 0 rgba(36, 48, 86, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 4px;
  font-weight: 800;
}
.hero-btn .bolt-img { height: 72px; width: auto; }
.hero-btn strong { font-size: 13px; line-height: 1.1; }
.hero-btn small { font-size: 10px; line-height: 1.1; color: #3d527f; text-align: center; }
.hero-btn[aria-pressed="true"] { box-shadow: 0 4px 0 var(--blue-d), 0 0 0 4px var(--gold-hi); background: #eaf2ff; }
.hero-btn.is-locked { background: rgba(255, 255, 255, 0.6); }
.hero-none { font-size: 15px; margin: auto 0; }
.side-card { justify-content: flex-start; overflow: auto; }

/* Truck build rail */
.play-bar .build { grid-area: meter; }
.build { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.82); border-radius: 18px; padding: 4px 8px; box-shadow: var(--shadow); }
.build-truck { position: relative; width: 136px; height: 84px; flex: 0 0 auto; }
.build-truck > span { position: absolute; inset: 0; display: block; }
.build-truck .bolt-img { width: 136px; height: auto; position: absolute; bottom: 0; left: 0; }
.truck-ghost .bolt-img { filter: brightness(0) opacity(0.22); }
.truck-color { transition: clip-path 0.7s ease 0.45s, -webkit-clip-path 0.7s ease 0.45s; }
.slots { display: grid; grid-template-columns: repeat(3, 38px); gap: 4px; }
.slot { width: 38px; height: 38px; border-radius: 9px; background: rgba(36, 48, 86, 0.08); box-shadow: inset 0 0 0 2px rgba(36, 48, 86, 0.18); display: grid; place-items: center; padding: 2px; }
.slot.is-on { background: #fff3c4; box-shadow: inset 0 0 0 2px #d4a017; }
.slot .part-pic, .slot .bolt-img { width: 100%; height: 100%; object-fit: contain; }
.slot.is-new { animation: snap-in 0.45s cubic-bezier(.2, 1.6, .4, 1) 0.5s both; }
@keyframes snap-in {
  0% { transform: scale(0.2); opacity: 0; }
  70% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

/* Counting parts: bigger pictures, playful tilt, pop on tap */
.obj { transform: rotate(var(--tilt, 0deg)); transition: transform 0.15s ease; }
.obj .part-pic { width: 100%; height: 100%; display: block; overflow: hidden; }
.obj .part-pic .bolt-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(36, 48, 86, 0.25)); pointer-events: none; }
.obj.is-on { transform: rotate(0deg) scale(0.96); }
.obj.is-pop { animation: pop 0.38s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes pop {
  0% { transform: scale(0.8); }
  55% { transform: scale(1.22) rotate(-4deg); }
  100% { transform: scale(0.96); }
}
.give-bolt .stage-pic .bolt-img, .listen .stage-pic .bolt-img { height: 168px; width: auto; filter: drop-shadow(0 6px 10px rgba(36, 48, 86, 0.3)); }
.listen .stage-pic .bolt-img { height: min(240px, 32vh); }

.choice.is-right { animation: right-pop 0.5s ease forwards; background: var(--green); box-shadow: 0 6px 0 var(--green-d), 0 0 0 6px var(--amber); }
@keyframes right-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1.04); } }
.choice.is-wobble { animation: wobble 0.5s ease; }
@keyframes wobble {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-8px) rotate(-3deg); }
  40% { transform: translateX(7px) rotate(3deg); }
  60% { transform: translateX(-5px) rotate(-2deg); }
  80% { transform: translateX(3px) rotate(1deg); }
}

/* Effects layer */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.spark { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; animation: spark 0.7s ease-out forwards; }
.spark svg { width: 100%; height: 100%; }
@keyframes spark {
  0% { transform: translate(0, 0) scale(0.3) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(180deg); opacity: 0; }
}
.flyer { position: absolute; display: block; }
.flyer .part-pic, .flyer .bolt-img { width: 100%; height: 100%; object-fit: contain; }

/* Buddy on the play stage */
.buddy { position: absolute; left: 6px; bottom: 0; z-index: 3; pointer-events: none; }
.buddy .hero-pic .bolt-img { height: min(170px, 24vh); width: auto; filter: drop-shadow(0 6px 8px rgba(36, 48, 86, 0.3)); }
.buddy .cheer {
  position: absolute; left: 70%; top: -6px; white-space: nowrap;
  background: white; border-radius: 16px; padding: 6px 10px; font-size: 18px; font-weight: 800;
  box-shadow: var(--shadow), 0 0 0 2px rgba(212, 160, 23, 0.6); opacity: 0; transform: scale(0.6);
}
.buddy.is-cheer .cheer { animation: cheer 1.4s ease forwards; }
@keyframes cheer { 0% { opacity: 0; transform: scale(0.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.shield-fx {
  position: absolute; left: 10px; top: 40%; width: 54px; height: 54px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #2f6fed 0 22%, #fff 23% 40%, #d63a3a 41% 60%, #fff 61% 78%, #d63a3a 79% 100%);
  box-shadow: 0 0 0 2px #243056;
}
.buddy-captain[data-cheer='shield-toss'].is-cheer .shield-fx { animation: shield-throw 1.1s ease-in-out forwards; }
.buddy-captain[data-cheer='shield-toss'].is-cheer .hero-pic { animation: hero-bounce 0.6s ease; }
@keyframes shield-throw {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  50% { opacity: 1; transform: translate(220px, -80px) rotate(540deg); }
  100% { opacity: 0; transform: translate(0, 0) rotate(1080deg); }
}
.repulsor-fx {
  position: absolute; left: 50%; bottom: 0; width: 120px; height: 60px; margin-left: -60px; opacity: 0; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(170, 235, 255, 0.95) 0%, rgba(90, 190, 255, 0.6) 40%, rgba(90, 190, 255, 0) 70%);
}
.buddy-iron[data-cheer='jet-hover'].is-cheer .hero-pic { animation: fly-up 1.2s ease; }
.buddy-iron[data-cheer='jet-hover'].is-cheer .repulsor-fx { animation: repulse 1.2s ease; }
.buddy-iron[data-cheer='jet-hover'].is-cheer .hero-pic .bolt-img { animation: glow 1.2s ease; }
@keyframes fly-up { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-46px); } 70% { transform: translateY(-38px); } }
@keyframes repulse { 0%, 100% { opacity: 0; transform: scale(0.6); } 30% { opacity: 1; transform: scale(1.2); } 70% { opacity: 0.8; } }
@keyframes glow {
  0%, 100% { filter: drop-shadow(0 6px 8px rgba(36, 48, 86, 0.3)); }
  40% { filter: drop-shadow(0 0 18px rgba(120, 220, 255, 1)) brightness(1.15); }
}
@keyframes hero-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px); } }

/* Garage: Bolt with buddy */
.garage-crew { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.garage-crew .stage-pic .bolt-img { height: min(260px, 36vh); width: auto; }
.buddy.is-garage { position: static; }
.buddy.is-garage .hero-pic .bolt-img { height: min(200px, 28vh); }
.preview-card .garage-crew .bolt-img { width: auto; }

/* Grow-up celebration */
.grow-screen { gap: 6px; }
.grow-scene {
  flex: 1; min-height: 0; position: relative; overflow: hidden; border-radius: 28px;
  background: radial-gradient(circle at 50% 55%, #fff8d6 0%, #ffe28a 30%, #8fd0ff 75%, #4f8fe8 100%);
}
.grow-rays {
  position: absolute; left: 50%; top: 55%; width: 1400px; height: 1400px; margin: -700px 0 0 -700px; opacity: 0.35;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.9) 0deg 8deg, rgba(255, 255, 255, 0) 8deg 20deg);
}
.grow-scene.is-go .grow-rays { animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grow-old, .grow-new { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 2; }
.grow-old .bolt-img { height: min(300px, 40vh); width: auto; }
.grow-new .bolt-img { height: min(430px, 56vh); width: auto; filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.95)); }
.grow-new { opacity: 0; }
.grow-scene.is-go .grow-old { animation: grow-charge 1.3s ease-in forwards; }
.grow-scene.is-go .grow-new { animation: grow-in 0.9s cubic-bezier(.2, 1.4, .4, 1) 1.3s forwards; }
.grow-scene.is-go .flash { animation: bolt-flash 0.5s linear 1.15s forwards; }
.grow-scene.is-go .confetti i { animation-delay: 1.5s; }
@keyframes grow-charge {
  0% { filter: brightness(1); transform: translateX(-50%) scale(1); }
  60% { filter: brightness(1.6) drop-shadow(0 0 20px #fff); transform: translateX(-50%) scale(1.05); }
  100% { filter: brightness(3) drop-shadow(0 0 40px #fff); transform: translateX(-50%) scale(1.15); opacity: 0; }
}
@keyframes grow-in {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
.grow-hero { position: absolute; right: 4%; bottom: 6%; z-index: 2; display: flex; flex-direction: column; align-items: center; opacity: 0; }
.grow-hero .bolt-img { height: min(220px, 30vh); width: auto; }
.grow-hero strong { background: white; border-radius: 14px; padding: 4px 10px; font-size: 18px; box-shadow: var(--shadow); }
.grow-scene.is-go .grow-hero { animation: fade-in 0.6s ease 2.4s forwards; }

/* Settings: voice list */
.voice-list { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; justify-content: center; }
.voice-list button { min-height: 52px; padding: 0 14px; border-radius: 16px; background: white; font-size: 17px; font-weight: 800; box-shadow: 0 4px 0 rgba(36, 48, 86, 0.12); }
.voice-list button[aria-pressed="true"] { background: var(--blue); color: white; }
.settings-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; gap: 8px; }
.voice-list .voice-test { background: var(--green); color: white; box-shadow: 0 4px 0 var(--green-d); }
.settings-screen .note { font-size: 15px; }

@media (orientation: portrait) {
  .home-main { grid-template-rows: minmax(0, 1fr) auto; }
  .buddy .hero-pic .bolt-img { height: min(190px, 20vh); }
  .slots { grid-template-columns: repeat(6, 36px); }
  .slot { width: 36px; height: 36px; }
  .build-truck { width: 120px; height: 74px; }
  .build-truck .bolt-img { width: 120px; }
}

@media (orientation: landscape) {
  .object-grid[data-size="many"] { grid-template-columns: repeat(5, 100px); }
  .object-grid[data-size="many"] .obj { width: 100px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .obj.is-pop, .choice.is-wobble, .choice.is-right, .slot.is-new, .grow-scene.is-go .grow-rays { animation: none; }
  .grow-scene.is-go .grow-old { animation: fade-out 0.2s forwards; }
  .grow-scene.is-go .grow-new { animation: fade-in 0.3s 0.2s forwards; }
  .buddy.is-cheer .hero-pic, .buddy.is-cheer .shield-fx, .buddy.is-cheer .repulsor-fx, .buddy-iron.is-cheer .hero-pic .bolt-img { animation: none; }
}

/* Bigger give-tray targets for small fingers */
.give .obj.small { width: 88px; height: 88px; }

/* ---------- v3: game hub, Bolt's Letters, character picker, hero suits, crates of ten ---------- */

body[data-screen="hub"] .app,
body[data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.62) 0%, rgba(255, 248, 235, 0.5) 55%, rgba(255, 244, 225, 0.66) 100%),
    url("../img/garage-bg.jpg") center / cover no-repeat,
    #e8d7b6;
}
html.webp body[data-screen="hub"] .app,
html.webp body[data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.62) 0%, rgba(255, 248, 235, 0.5) 55%, rgba(255, 244, 225, 0.66) 100%),
    url("../img/garage-bg.webp") center / cover no-repeat,
    #e8d7b6;
}

.bar-btns { display: flex; gap: 8px; }
.bar-btns .alt-btn { min-height: 60px; font-size: 22px; padding: 6px 16px; }

/* Hub */
.hub-main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 0.85fr;
  gap: 12px;
}
.game-card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  box-shadow: 0 8px 0 rgba(36, 48, 86, 0.14), 0 0 0 3px var(--gold-hi);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 14px; min-height: 0; text-align: center;
}
.game-card:active { transform: translateY(4px); }
.game-card strong { font-size: 40px; line-height: 1; }
.game-card > span:last-child { font-size: 19px; font-weight: 700; color: #3d527f; }
.game-pic { display: grid; place-items: center; height: min(220px, 30vh); width: 100%; }
.game-pic .bolt-img { max-height: min(200px, 28vh); width: auto; max-width: 100%; margin: 0 auto; }
.letters-pic { display: flex; align-items: center; justify-content: center; gap: 8px; }
.letters-pic span {
  display: grid; place-items: center; width: 92px; height: 104px; border-radius: 20px;
  font-size: 72px; font-weight: 800; color: white; box-shadow: 0 6px 0 rgba(36, 48, 86, 0.25);
}
.lt-a { background: var(--blue); transform: rotate(-6deg); }
.lt-b { background: var(--gold); transform: translateY(-10px); }
.lt-c { background: #C8262B; transform: rotate(6deg); }
.hub-side { overflow: auto; }

/* Character picker */
.char-btn .stage-pic .bolt-img, .char-btn .hero-pic .bolt-img { height: 72px; width: auto; }
.char-btn small { min-height: 22px; }

/* Letters home */
.letters-card { justify-content: flex-start; gap: 10px; }
.l-level-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.ltile-level { gap: 4px; padding: 8px; }
.ltile-level .range { font-size: 40px; color: var(--blue); }
.ltile-level strong { font-size: 20px; }
.lv-blurb { font-size: 14px; font-weight: 700; color: #3d527f; text-align: center; }
.lv-next { font-size: 14px; font-weight: 800; color: var(--gold-d); }
.set-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.set-chip { font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: rgba(36, 48, 86, 0.08); }
.set-chip.is-done { background: var(--gold-hi); box-shadow: inset 0 0 0 2px var(--gold-d); }
.l-continue { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff3c4; border-radius: 18px; padding: 8px 12px; }
.l-continue span { font-size: 18px; font-weight: 700; flex: 1 1 200px; }
.l-continue .big-btn { min-height: 56px; font-size: 24px; }
.found-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.found { display: grid; place-items: center; height: 28px; border-radius: 7px; font-size: 16px; font-weight: 800; background: rgba(36, 48, 86, 0.07); color: rgba(36, 48, 86, 0.35); }
.found.is-on { background: var(--gold-hi); color: var(--ink); }

/* Letters play */
.lsolo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kw-card {
  background: white; border-radius: 28px; box-shadow: var(--shadow), 0 0 0 3px rgba(212, 160, 23, 0.6);
  display: flex; flex-direction: column; align-items: center; padding: 12px 22px; gap: 4px; position: relative;
}
.kw-card.is-solved { box-shadow: var(--shadow), 0 0 0 5px var(--green); animation: right-pop 0.5s ease; }
.kw-pic { display: grid; place-items: center; width: min(250px, 30vh); height: min(220px, 28vh); }
.kw-pic .part-pic, .kw-pic .stage-pic { width: 100%; height: 100%; display: grid; place-items: center; }
.kw-pic .bolt-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(36, 48, 86, 0.25)); }
.kw-svg { width: 100%; height: 100%; }
.emoji { font-size: min(170px, 22vh); line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.kw-word { font-size: 44px; font-weight: 800; letter-spacing: 1px; }
.kw-first { display: inline-block; min-width: 0.8em; text-align: center; color: var(--blue); border-bottom: 4px dashed var(--gold); }
.kw-card.is-solved .kw-first { color: #C8262B; border-bottom-color: transparent; }
.kw-letters { position: absolute; left: -14px; top: -14px; background: var(--blue); color: white; border-radius: 22px; padding: 4px 14px; font-size: 52px; font-weight: 800; box-shadow: 0 5px 0 var(--blue-d); }
.kw-letters small { font-size: 40px; margin-left: 6px; color: var(--gold-hi); }
.big-letter-card { width: min(230px, 30vh); height: min(230px, 30vh); display: grid; place-items: center; background: white; border-radius: 32px; font-size: min(180px, 24vh); font-weight: 800; color: var(--blue); box-shadow: var(--shadow), 0 0 0 4px var(--gold-hi); }
.listen.lsolo .stage-pic .bolt-img { height: min(240px, 32vh); width: auto; }
.again-btn { min-height: 56px; font-size: 22px; }
.ltile { font-size: 64px; font-family: "Avenir Next", "Trebuchet MS", sans-serif; min-height: 104px; }
.ltiles.is-word { grid-template-columns: repeat(5, 1fr); }
.ltile.is-used { opacity: 0.3; }
.lword-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.word-card .kw-pic { height: min(190px, 25vh); }
.wslots { display: flex; gap: 12px; }
.wslot { width: 96px; height: 104px; border-radius: 20px; background: rgba(255, 255, 255, 0.7); box-shadow: inset 0 0 0 3px rgba(36, 48, 86, 0.25); display: grid; place-items: center; font-size: 68px; font-weight: 800; }
.wslot.is-on { background: #fff3c4; box-shadow: inset 0 0 0 3px var(--gold); }
.wslot.is-next { animation: hintpulse 1.2s ease-in-out infinite; }
.wslot.is-pop { animation: pop 0.38s cubic-bezier(.2, 1.8, .4, 1); }
.lslot { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1; }
.lslot.is-word { font-size: 12px; }
.charge-bot { width: 84px; height: 76px; }
.charge-bot .bolt-img { width: 84px; height: auto; }
.letter-flyer { display: grid; place-items: center; font-size: 48px; font-weight: 800; color: white; background: var(--green); border-radius: 22px; z-index: 50; }

/* Hero suit build rail */
.build-suit { width: 52px; height: 84px; }
.build-suit .bolt-img { width: auto !important; height: 84px; left: 50% !important; transform: translateX(-50%); }
.suit-scene .grow-new .bolt-img { filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 30px rgba(120, 210, 255, 0.8)); }
.suit-scene .grow-old .bolt-img { height: min(430px, 56vh); }

/* Crates of ten: 10 pictures of the round's item in a 2 x 5 rack */
.bundle-btn { width: 188px; height: 128px; padding: 0; background: none; box-shadow: none; }
.crate {
  position: relative; display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(0deg, #d29a5c 0 14px, #c0864a 14px 16px);
  border: 4px solid #7a4a1c; border-radius: 14px; padding: 6px;
  box-shadow: 0 5px 0 rgba(36, 48, 86, 0.22);
}
.crate-rack { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr 1fr; gap: 4px; width: 100%; height: 100%; }
.crate-cell { display: grid; place-items: center; background: rgba(255, 252, 244, 0.92); border-radius: 7px; min-width: 0; min-height: 0; overflow: hidden; }
.crate-cell .part-pic { width: 100%; height: 100%; display: grid; place-items: center; }
.crate-cell .bolt-img { max-width: 92%; max-height: 92%; width: auto; height: auto; object-fit: contain; }
.crate-tag { position: absolute; top: -12px; right: -10px; background: var(--gold-hi); color: var(--ink); font-size: 18px; font-weight: 800; border-radius: 99px; padding: 1px 9px; box-shadow: 0 0 0 3px #7a4a1c; }
.bundle-btn.is-on .crate { border-color: var(--green); box-shadow: 0 0 0 4px var(--green), 0 5px 0 rgba(36, 48, 86, 0.22); }
.bundle-btn.is-on .crate-cell { background: #e5f8ea; }
.bundle-btn.is-replay .crate { box-shadow: 0 0 0 5px var(--amber); }
.object-grid[data-kind="bundles"] { grid-template-columns: repeat(5, 188px); gap: 14px 10px; }
/* Keep the hero buddy clear of the crates. */
.object-grid[data-kind="bundles"] ~ .buddy { left: auto; right: 6px; }
.object-grid[data-kind="bundles"] ~ .buddy .hero-pic .bolt-img { height: min(130px, 15vh); }
.object-grid[data-kind="bundles"] ~ .buddy .cheer { right: 100%; left: auto; }

@media (orientation: portrait) {
  .hub-main { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .hub-side { grid-column: 1 / -1; }
  .object-grid[data-kind="bundles"] { grid-template-columns: repeat(4, 170px); }
  .bundle-btn { width: 170px; height: 114px; }
  .l-level-grid { grid-template-columns: 1fr 1fr; }
  .found-strip { grid-template-columns: repeat(13, 1fr); }
  .ltile { font-size: 56px; min-height: 96px; }
  .wslot { width: 88px; height: 96px; font-size: 60px; }
}

@media (max-height: 800px) and (orientation: landscape) {
  .ltile { min-height: 90px; font-size: 56px; }
  .kw-word { font-size: 38px; }
  .game-card strong { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .wslot.is-next, .wslot.is-pop, .kw-card.is-solved { animation: none; }
}

/* ---------- v26: themes (Captain USA, Iron Dude, Spider Kid, Opto-Miss) ---------- */
body[data-theme="captain"] { --blue: #2f6fed; --blue-d: #1d4bb5; --gold: #D63A3A; --gold-hi: #ff9a9a; --gold-d: #a31f1f; --red: #D63A3A; }
body[data-theme="iron"] { --blue: #C8102E; --blue-d: #860a1e; --gold: #D4A017; --gold-hi: #F5C542; --gold-d: #A67C00; --red: #C8102E; }
body[data-theme="spider"] { --blue: #E0242C; --blue-d: #9c1218; --gold: #1f4fd1; --gold-hi: #9db8ff; --gold-d: #163a9e; --red: #E0242C; }
body[data-theme="smash"] { --blue: #2E9A4C; --blue-d: #1f7a3a; --gold: #7A3CBD; --gold-hi: #d7b8ff; --gold-d: #54248a; --red: #7A3CBD; }

/* A soft color wash over each screen (painted above the background, under the content). */
body[data-theme="captain"] .app { box-shadow: inset 0 0 0 2000px rgba(47, 111, 237, 0.10); }
body[data-theme="iron"] .app { box-shadow: inset 0 0 0 2000px rgba(200, 16, 46, 0.10); }
body[data-theme="spider"] .app { box-shadow: inset 0 0 0 2000px rgba(224, 36, 44, 0.08); }
body[data-theme="smash"] .app { box-shadow: inset 0 0 0 2000px rgba(46, 154, 76, 0.10); }

body[data-theme="captain"] .grow-fill { background: linear-gradient(90deg, #2f6fed, #ffffff 55%, #D63A3A); }
body[data-theme="iron"] .grow-fill { background: linear-gradient(90deg, #C8102E, #F5C542 70%, #8ee6ff); }
body[data-theme="spider"] .grow-fill { background: linear-gradient(90deg, #1f4fd1, #E0242C 70%, #ff8a8f); }
body[data-theme="smash"] .grow-fill { background: linear-gradient(90deg, #2E9A4C, #7A3CBD 70%, #d7b8ff); }

/* Theme badge in the corner: web, star, or power core. Decoration only. */
body[data-theme="spider"]::after,
body[data-theme="captain"]::after,
body[data-theme="iron"]::after,
body[data-theme="smash"]::after {
  content: ""; position: fixed; top: 0; right: 0; width: 110px; height: 110px; pointer-events: none; z-index: 5; opacity: 0.32;
  background-repeat: no-repeat; background-position: top right; background-size: 110px 110px;
}
body[data-theme="spider"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150' fill='none' stroke='%23243056' stroke-width='2'%3E%3Cpath d='M150 0 L0 0 M150 0 L20 75 M150 0 L75 130 M150 0 L150 150 M150 0 L60 20'/%3E%3Cpath d='M110 0 Q118 18 130 23 Q140 30 150 40'/%3E%3Cpath d='M70 0 Q85 30 100 48 Q120 70 150 80'/%3E%3Cpath d='M30 0 Q55 40 75 70 Q100 100 150 120'/%3E%3C/svg%3E");
}
body[data-theme="captain"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Cpolygon points='105,15 116,48 150,48 123,68 133,101 105,81 77,101 87,68 60,48 94,48' fill='%23ffffff' stroke='%232f6fed' stroke-width='5'/%3E%3C/svg%3E");
}
body[data-theme="iron"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Ccircle cx='110' cy='40' r='30' fill='%238ee6ff' stroke='%23D4A017' stroke-width='8'/%3E%3Ccircle cx='110' cy='40' r='12' fill='%23ffffff'/%3E%3C/svg%3E");
}
body[data-theme="smash"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 150'%3E%3Cpath d='M150 8 L138 40 L150 48 L128 58 L140 90 L110 70 L92 98 L96 62 L70 58 L98 46 L94 20 Z' fill='%233BB15A' stroke='%237A3CBD' stroke-width='5' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Hero picker: 3 + 2 big buttons that wrap on the iPad. */
.theme-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.theme-btn { flex: 1 1 calc(33.33% - 8px); min-width: 130px; max-width: calc(50% - 8px); min-height: 118px; padding: 6px 4px; }
.theme-btn strong { font-size: 15px; }
.theme-btn small { font-size: 12px; }
.theme-btn .stage-pic .bolt-img, .theme-btn .hero-pic .bolt-img { height: 70px; }
.theme-btn.theme-captain[aria-pressed="true"] { background: #eaf2ff; box-shadow: 0 4px 0 #1d4bb5, 0 0 0 4px #D63A3A; }
.theme-btn.theme-iron[aria-pressed="true"] { background: #fff1d6; box-shadow: 0 4px 0 #860a1e, 0 0 0 4px #F5C542; }
.theme-btn.theme-spider[aria-pressed="true"] { background: #ffecec; box-shadow: 0 4px 0 #9c1218, 0 0 0 4px #1f4fd1; }
.theme-btn.theme-bolt[aria-pressed="true"] { background: #fff6dc; box-shadow: 0 4px 0 #A67C00, 0 0 0 4px #2f6fed; }
.theme-btn.theme-smash[aria-pressed="true"] { background: #e8f8ec; box-shadow: 0 4px 0 #1f7a3a, 0 0 0 4px #7A3CBD; }
.theme-btn:active { transform: translateY(3px); }

/* Spider Kid's cheer: a web flies out. */
.web-fx {
  position: absolute; left: 30px; top: 30%; width: 70px; height: 70px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 70' fill='none' stroke='%23ffffff' stroke-width='3'%3E%3Cpath d='M35 2 V68 M2 35 H68 M11 11 L59 59 M59 11 L11 59'/%3E%3Ccircle cx='35' cy='35' r='10'/%3E%3Ccircle cx='35' cy='35' r='21'/%3E%3Ccircle cx='35' cy='35' r='31'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 2px #243056) drop-shadow(0 0 1px #243056);
}
.buddy-spider[data-cheer='web-swing'].is-cheer .web-fx { animation: web-shoot 1.1s ease-out forwards; }
.buddy-spider[data-cheer='web-swing'].is-cheer .hero-pic { animation: hero-swing 0.9s ease; }
@keyframes web-shoot {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); }
  20% { opacity: 1; }
  70% { opacity: 1; transform: translate(200px, -90px) scale(1.4); }
  100% { opacity: 0; transform: translate(220px, -100px) scale(1.5); }
}
@keyframes hero-swing { 0%, 100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-8deg) translateY(-18px); } 60% { transform: rotate(6deg) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .buddy-spider.is-cheer .web-fx, .buddy-spider.is-cheer .hero-pic { animation: none; }
}

/* Letters power rail with a hero: the suit fills from the boots up. */
.lbuild.is-suit .charge-bot { width: 52px; height: 84px; }
.lbuild.is-suit .charge-bot .bolt-img { width: auto !important; height: 84px; left: 50%; transform: translateX(-50%); }
.park-hero .bolt-img { width: auto; height: min(360px, 46vh); margin: 0 auto; filter: saturate(0.85); }

/* ---------- v27: themed letter cards ---------- */
body[data-theme="captain"] .kw-card, body[data-theme="iron"] .kw-card, body[data-theme="spider"] .kw-card, body[data-theme="smash"] .kw-card {
  box-shadow: var(--shadow), 0 0 0 5px var(--blue), 0 0 0 9px var(--gold-hi);
}
body[data-theme="captain"] .kw-card.is-solved, body[data-theme="iron"] .kw-card.is-solved, body[data-theme="spider"] .kw-card.is-solved, body[data-theme="smash"] .kw-card.is-solved {
  box-shadow: var(--shadow), 0 0 0 5px var(--green), 0 0 0 9px var(--gold-hi);
}
.kw-hero { position: absolute; right: -26px; bottom: -10px; pointer-events: none; }
.kw-hero .stage-pic, .kw-hero picture { display: block; }
.kw-hero .bolt-img { height: min(120px, 15vh); width: auto; filter: drop-shadow(0 4px 4px rgba(36, 48, 86, 0.3)); }
body[data-theme="spider"] .kw-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 70px; height: 70px; pointer-events: none; opacity: 0.35; border-top-left-radius: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 70' fill='none' stroke='%23243056' stroke-width='1.6'%3E%3Cpath d='M0 0 L70 0 M0 0 L60 35 M0 0 L35 60 M0 0 L0 70'/%3E%3Cpath d='M18 0 Q16 10 9 16 Q4 19 0 20'/%3E%3Cpath d='M38 0 Q34 20 22 32 Q12 40 0 40'/%3E%3Cpath d='M58 0 Q52 30 34 48 Q18 60 0 60'/%3E%3C/svg%3E") top left / 70px 70px no-repeat;
}
body[data-theme="smash"] .kw-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 70px; height: 70px; pointer-events: none; opacity: 0.4; border-top-left-radius: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 70' fill='none' stroke='%237A3CBD' stroke-width='2'%3E%3Cpath d='M4 8 L22 28 M8 4 L30 30 M16 2 L28 22' stroke-linecap='round'/%3E%3Cpath d='M2 36 L26 14 L38 32 L22 48 Z' fill='%233BB15A' fill-opacity='0.5'/%3E%3C/svg%3E") top left / 70px 70px no-repeat;
}
body[data-theme="captain"] .kw-first, body[data-theme="iron"] .kw-first, body[data-theme="spider"] .kw-first, body[data-theme="smash"] .kw-first { color: var(--blue); border-bottom-color: var(--gold); }

/* ---------- v28: themed rooms + no answer-hint glow ---------- */
body[data-theme="captain"][data-screen="play"] .app,
body[data-theme="captain"][data-screen="home"] .app,
body[data-theme="captain"][data-screen="garage"] .app,
body[data-theme="captain"][data-screen="levels"] .app,
body[data-theme="captain"][data-screen="profiles"] .app,
body[data-theme="captain"][data-screen="hub"] .app,
body[data-theme="captain"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.50) 0%, rgba(255, 248, 235, 0.40) 55%, rgba(255, 244, 225, 0.55) 100%),
    url("../img/garage-captain.jpg") center / cover no-repeat,
    #e8d7b6;
}
html.webp body[data-theme="captain"][data-screen="play"] .app,
html.webp body[data-theme="captain"][data-screen="home"] .app,
html.webp body[data-theme="captain"][data-screen="garage"] .app,
html.webp body[data-theme="captain"][data-screen="levels"] .app,
html.webp body[data-theme="captain"][data-screen="profiles"] .app,
html.webp body[data-theme="captain"][data-screen="hub"] .app,
html.webp body[data-theme="captain"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.50) 0%, rgba(255, 248, 235, 0.40) 55%, rgba(255, 244, 225, 0.55) 100%),
    url("../img/garage-captain.webp") center / cover no-repeat,
    #e8d7b6;
}
body[data-theme="iron"][data-screen="play"] .app,
body[data-theme="iron"][data-screen="home"] .app,
body[data-theme="iron"][data-screen="garage"] .app,
body[data-theme="iron"][data-screen="levels"] .app,
body[data-theme="iron"][data-screen="profiles"] .app,
body[data-theme="iron"][data-screen="hub"] .app,
body[data-theme="iron"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.50) 0%, rgba(255, 248, 235, 0.40) 55%, rgba(255, 244, 225, 0.55) 100%),
    url("../img/garage-iron.jpg") center / cover no-repeat,
    #e8d7b6;
}
html.webp body[data-theme="iron"][data-screen="play"] .app,
html.webp body[data-theme="iron"][data-screen="home"] .app,
html.webp body[data-theme="iron"][data-screen="garage"] .app,
html.webp body[data-theme="iron"][data-screen="levels"] .app,
html.webp body[data-theme="iron"][data-screen="profiles"] .app,
html.webp body[data-theme="iron"][data-screen="hub"] .app,
html.webp body[data-theme="iron"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.50) 0%, rgba(255, 248, 235, 0.40) 55%, rgba(255, 244, 225, 0.55) 100%),
    url("../img/garage-iron.webp") center / cover no-repeat,
    #e8d7b6;
}
body[data-theme="spider"][data-screen="play"] .app,
body[data-theme="spider"][data-screen="home"] .app,
body[data-theme="spider"][data-screen="garage"] .app,
body[data-theme="spider"][data-screen="levels"] .app,
body[data-theme="spider"][data-screen="profiles"] .app,
body[data-theme="spider"][data-screen="hub"] .app,
body[data-theme="spider"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.45) 0%, rgba(255, 248, 235, 0.35) 55%, rgba(255, 244, 225, 0.50) 100%),
    url("../img/garage-spider.jpg") center / cover no-repeat,
    #e8d7b6;
}
html.webp body[data-theme="spider"][data-screen="play"] .app,
html.webp body[data-theme="spider"][data-screen="home"] .app,
html.webp body[data-theme="spider"][data-screen="garage"] .app,
html.webp body[data-theme="spider"][data-screen="levels"] .app,
html.webp body[data-theme="spider"][data-screen="profiles"] .app,
html.webp body[data-theme="spider"][data-screen="hub"] .app,
html.webp body[data-theme="spider"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.45) 0%, rgba(255, 248, 235, 0.35) 55%, rgba(255, 244, 225, 0.50) 100%),
    url("../img/garage-spider.webp") center / cover no-repeat,
    #e8d7b6;
}

body[data-theme="smash"][data-screen="play"] .app,
body[data-theme="smash"][data-screen="home"] .app,
body[data-theme="smash"][data-screen="garage"] .app,
body[data-theme="smash"][data-screen="levels"] .app,
body[data-theme="smash"][data-screen="profiles"] .app,
body[data-theme="smash"][data-screen="hub"] .app,
body[data-theme="smash"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(232, 248, 236, 0.50) 0%, rgba(235, 248, 232, 0.35) 55%, rgba(225, 244, 230, 0.50) 100%),
    url("../img/garage-smash.jpg") center / cover no-repeat,
    #d8eec8;
}
html.webp body[data-theme="smash"][data-screen="play"] .app,
html.webp body[data-theme="smash"][data-screen="home"] .app,
html.webp body[data-theme="smash"][data-screen="garage"] .app,
html.webp body[data-theme="smash"][data-screen="levels"] .app,
html.webp body[data-theme="smash"][data-screen="profiles"] .app,
html.webp body[data-theme="smash"][data-screen="hub"] .app,
html.webp body[data-theme="smash"][data-screen="lhome"] .app {
  background:
    linear-gradient(180deg, rgba(232, 248, 236, 0.50) 0%, rgba(235, 248, 232, 0.35) 55%, rgba(225, 244, 230, 0.50) 100%),
    url("../img/garage-smash.webp") center / cover no-repeat,
    #d8eec8;
}




/* ---------- v29: 6 short correct-answer celebrations per hero ---------- */
.buddy { transform-origin: bottom center; }
.buddy .pose-truck { position: absolute; left: 0; bottom: 0; opacity: 0; pointer-events: none; }
.buddy .pose-truck .bolt-img { height: min(150px, 22vh); width: auto; }
.buddy-bolt .hero-pic .bolt-img, .buddy-bolt .stage-pic .bolt-img { height: min(170px, 24vh); width: auto; filter: drop-shadow(0 6px 8px rgba(36, 48, 86, 0.3)); }

.stars-fx, .flag-fx, .medal-fx, .blast-fx, .thumbs-fx, .chest-fx, .burst-fx, .thwip-fx,
.lights-fx, .horn-fx, .wheels-fx { position: absolute; pointer-events: none; opacity: 0; }

/* Captain USA */
.stars-fx {
  left: 10px; top: -8px; width: 90px; height: 70px;
  background:
    radial-gradient(circle, #ffd45a 0 40%, transparent 42%) 8px 20px / 16px 16px no-repeat,
    radial-gradient(circle, #ffd45a 0 40%, transparent 42%) 40px 0 / 20px 20px no-repeat,
    radial-gradient(circle, #fff6b0 0 40%, transparent 42%) 64px 24px / 14px 14px no-repeat;
}
.flag-fx {
  left: 72%; top: 8px; width: 36px; height: 48px;
  background:
    linear-gradient(#2f6fed, #2f6fed) 0 0 / 4px 48px no-repeat,
    linear-gradient(#d63a3a 0 38%, #fff 38% 62%, #d63a3a 62% 100%) 4px 2px / 28px 20px no-repeat;
  transform-origin: 2px 0;
}
.medal-fx {
  left: 58%; top: 18px; width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd45a 45%, #d4a017 80%);
  box-shadow: 0 0 0 2px #243056, 0 0 12px rgba(255, 212, 90, 0.8);
}

.buddy-captain[data-cheer="salute-stars"].is-cheer .hero-pic { animation: salute 1.2s ease; }
.buddy-captain[data-cheer="salute-stars"].is-cheer .stars-fx { animation: stars-up 1.2s ease forwards; }
.buddy-captain[data-cheer="jump"].is-cheer .hero-pic { animation: hero-jump 1.15s ease; }
.buddy-captain[data-cheer="flag-wave"].is-cheer .hero-pic { animation: sway 1.2s ease; }
.buddy-captain[data-cheer="flag-wave"].is-cheer .flag-fx { animation: flag-wave 1.2s ease forwards; }
.buddy-captain[data-cheer="medal-shine"].is-cheer .hero-pic { animation: hero-bounce 1s ease; }
.buddy-captain[data-cheer="medal-shine"].is-cheer .medal-fx { animation: medal-shine 1.2s ease forwards; }
.buddy-captain[data-cheer="partner-spin"].is-cheer .hero-pic { animation: partner-spin 1.2s ease; }

@keyframes salute {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-8deg) translateY(-6px); }
  55% { transform: rotate(-8deg) translateY(-6px); }
}
@keyframes stars-up {
  0% { opacity: 0; transform: translateY(10px) scale(0.6); }
  25% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-36px) scale(1.15); }
}
@keyframes hero-jump {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-52px) scale(1.04); }
  55% { transform: translateY(-8px) scale(1); }
  70% { transform: translateY(-18px); }
}
@keyframes sway {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-10deg); }
  60% { transform: rotate(8deg); }
}
@keyframes flag-wave {
  0% { opacity: 0; transform: rotate(-16deg); }
  15% { opacity: 1; }
  40% { transform: rotate(12deg); }
  65% { transform: rotate(-10deg); }
  100% { opacity: 0; transform: rotate(8deg); }
}
@keyframes medal-shine {
  0% { opacity: 0; transform: scale(0.4); }
  30% { opacity: 1; transform: scale(1.15); }
  60% { transform: scale(1); opacity: 1; }
  100% { opacity: 0; transform: scale(1.2); }
}
@keyframes partner-spin {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(-20deg) scale(1.06); }
  75% { transform: rotate(360deg) scale(1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Iron Dude */
.blast-fx {
  left: 50%; top: 10%; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 20%, #8ee6ff 30%, rgba(90, 190, 255, 0) 70%);
}
.thumbs-fx {
  right: -8px; top: 20%; width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle, #fff6b0, #ffd45a 55%, rgba(255, 212, 90, 0) 70%);
  box-shadow: 0 0 14px #ffd45a;
}
.chest-fx {
  left: 50%; top: 38%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: radial-gradient(circle, #fff, #8ee6ff 50%, #2f6fed 80%);
  box-shadow: 0 0 16px #8ee6ff;
}

.buddy-iron[data-cheer="power-blast"].is-cheer .hero-pic { animation: blast-kick 1.15s ease; }
.buddy-iron[data-cheer="power-blast"].is-cheer .blast-fx { animation: power-blast 1.15s ease forwards; }
.buddy-iron[data-cheer="suit-flash"].is-cheer .hero-pic .bolt-img { animation: suit-flash 1.2s ease; }
.buddy-iron[data-cheer="spin"].is-cheer .hero-pic { animation: hero-spin 1.2s ease; }
.buddy-iron[data-cheer="thumbs-glow"].is-cheer .hero-pic { animation: nod 1.15s ease; }
.buddy-iron[data-cheer="thumbs-glow"].is-cheer .thumbs-fx { animation: thumbs-glow 1.2s ease forwards; }
.buddy-iron[data-cheer="systems-pulse"].is-cheer .hero-pic { animation: hero-bounce 1.1s ease; }
.buddy-iron[data-cheer="systems-pulse"].is-cheer .chest-fx { animation: chest-pulse 1.2s ease forwards; }

@keyframes blast-kick {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(6px); }
}
@keyframes power-blast {
  0% { opacity: 0; transform: scale(0.2); }
  25% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(2.2); }
}
@keyframes suit-flash {
  0%, 100% { filter: drop-shadow(0 6px 8px rgba(36, 48, 86, 0.3)); }
  20%, 60% { filter: drop-shadow(0 0 20px rgba(142, 230, 255, 1)) brightness(1.25); }
  40%, 80% { filter: drop-shadow(0 0 6px rgba(142, 230, 255, 0.5)); }
}
@keyframes hero-spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}
@keyframes nod {
  0%, 100% { transform: rotate(0) translateY(0); }
  30% { transform: rotate(6deg) translateY(-8px); }
  60% { transform: rotate(-4deg) translateY(0); }
}
@keyframes thumbs-glow {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.6) translateY(-16px); }
}
@keyframes chest-pulse {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  25%, 65% { opacity: 1; transform: scale(1.3); }
  45% { opacity: 0.7; transform: scale(0.9); }
}

/* Spider Kid */
.burst-fx {
  left: 20%; top: 10%; width: 120px; height: 120px;
  background:
    linear-gradient(#fff, #fff) center / 4px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 4px no-repeat,
    linear-gradient(45deg, transparent 46%, #fff 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #fff 46% 54%, transparent 54%);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.thwip-fx {
  left: 60%; top: 20%; width: 18px; height: 18px; border-radius: 50%;
  background: #ffd45a;
  box-shadow: 0 0 10px #ffd45a;
}

.buddy-spider[data-cheer="web-burst"].is-cheer .hero-pic { animation: hero-bounce 1.1s ease; }
.buddy-spider[data-cheer="web-burst"].is-cheer .burst-fx { animation: web-burst 1.15s ease forwards; }
.buddy-spider[data-cheer="flip"].is-cheer .hero-pic { animation: hero-flip 1.2s ease; }
.buddy-spider[data-cheer="wall-crawl"].is-cheer .hero-pic { animation: wall-crawl 1.25s ease; }
.buddy-spider[data-cheer="thwip-star"].is-cheer .hero-pic { animation: thwip-kick 1.15s ease; }
.buddy-spider[data-cheer="thwip-star"].is-cheer .web-fx { animation: web-shoot 1.1s ease-out forwards; }
.buddy-spider[data-cheer="thwip-star"].is-cheer .thwip-fx { animation: thwip-star 1.2s ease forwards; }
.buddy-spider[data-cheer="web-hang"].is-cheer .hero-pic { animation: web-hang 1.25s ease; }
.buddy-spider[data-cheer="web-hang"].is-cheer .web-fx { animation: hang-line 1.25s ease forwards; }

@keyframes web-burst {
  0% { opacity: 0; transform: scale(0.2) rotate(0); }
  30% { opacity: 1; transform: scale(1) rotate(20deg); }
  100% { opacity: 0; transform: scale(1.6) rotate(40deg); }
}
@keyframes hero-flip {
  0% { transform: rotate(0) translateY(0); }
  45% { transform: rotate(180deg) translateY(-40px); }
  100% { transform: rotate(360deg) translateY(0); }
}
@keyframes wall-crawl {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-10px, -28px) rotate(-18deg); }
  55% { transform: translate(-6px, -46px) rotate(-8deg); }
  75% { transform: translate(0, -24px) rotate(8deg); }
}
@keyframes thwip-kick {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg) translateY(-8px); }
  50% { transform: rotate(8deg); }
}
@keyframes thwip-star {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  30% { opacity: 1; transform: translate(90px, -50px) scale(1.2); }
  100% { opacity: 0; transform: translate(130px, -70px) scale(0.8); }
}
@keyframes web-hang {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-36px) rotate(-12deg); }
  60% { transform: translateY(-36px) rotate(10deg); }
}
@keyframes hang-line {
  0% { opacity: 0; transform: translate(0, 0) scale(0.2); }
  25% { opacity: 1; transform: translate(20px, -70px) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(20px, -70px) scale(1); }
}

/* Opto-Miss */
.lights-fx {
  left: 8px; top: 42%; width: 100%; height: 24px;
  background:
    radial-gradient(circle, #fff6b0 0 40%, rgba(255, 212, 90, 0) 70%) 8px 0 / 24px 24px no-repeat,
    radial-gradient(circle, #fff6b0 0 40%, rgba(255, 212, 90, 0) 70%) 48px 0 / 24px 24px no-repeat;
}
.horn-fx {
  left: 70%; top: 16%; width: 36px; height: 28px;
  background:
    radial-gradient(circle at 0 50%, transparent 8px, #243056 8px 10px, transparent 11px) 0 0 / 16px 28px no-repeat,
    radial-gradient(circle at 0 50%, transparent 14px, #243056 14px 16px, transparent 17px) 8px 0 / 22px 28px no-repeat;
}
.wheels-fx { left: 6px; bottom: 0; width: 110px; height: 36px; opacity: 0; }
.wheels-fx i {
  position: absolute; bottom: 0; width: 32px; height: 32px; border-radius: 50%;
  background:
    radial-gradient(circle, #d5deee 0 22%, #243056 23% 100%);
  box-shadow: inset 0 0 0 4px #243056;
}
.wheels-fx i:first-child { left: 8px; }
.wheels-fx i:last-child { left: 58px; }

.buddy-bolt[data-cheer="truck-time"].is-cheer .pose-robot { animation: hide-robot 1.3s ease forwards; }
.buddy-bolt[data-cheer="truck-time"].is-cheer .pose-truck { animation: show-truck 1.3s ease forwards; }
.buddy-bolt[data-cheer="horn-lights"].is-cheer .hero-pic { animation: honk-bounce 1.15s ease; }
.buddy-bolt[data-cheer="horn-lights"].is-cheer .horn-fx { animation: horn-pop 1.15s ease forwards; }
.buddy-bolt[data-cheer="horn-lights"].is-cheer .lights-fx { animation: light-flash 1.15s ease forwards; }
.buddy-bolt[data-cheer="wheel-spin"].is-cheer .hero-pic { animation: sway 1.2s ease; }
.buddy-bolt[data-cheer="wheel-spin"].is-cheer .wheels-fx { animation: wheels-show 1.2s ease forwards; }
.buddy-bolt[data-cheer="wheel-spin"].is-cheer .wheels-fx i { animation: wheel-spin 1.2s linear; opacity: 1; }
.buddy-bolt[data-cheer="robot-wave"].is-cheer .hero-pic { animation: robot-wave 1.2s ease; }
.buddy-bolt[data-cheer="headlight"].is-cheer .hero-pic { animation: hero-bounce 1.1s ease; }
.buddy-bolt[data-cheer="headlight"].is-cheer .lights-fx { animation: light-flash 1.2s ease forwards; }
.buddy-bolt[data-cheer="nice-build"].is-cheer .hero-pic { animation: hero-jump 1.15s ease; }

@keyframes hide-robot {
  0% { opacity: 1; transform: scale(1); }
  35% { opacity: 0; transform: scale(0.7) rotate(-8deg); }
  75% { opacity: 0; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes show-truck {
  0% { opacity: 0; transform: scale(0.7) rotate(8deg); }
  35% { opacity: 1; transform: scale(1) rotate(0); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.85); }
}
@keyframes honk-bounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.08); }
  50% { transform: scale(1); }
  70% { transform: scale(1.06); }
}
@keyframes horn-pop {
  0% { opacity: 0; transform: translateX(-6px) scale(0.6); }
  25%, 70% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; }
}
@keyframes light-flash {
  0%, 100% { opacity: 0; }
  20%, 45%, 70% { opacity: 1; }
  35%, 55% { opacity: 0.2; }
}
@keyframes wheels-show {
  0%, 100% { opacity: 0; }
  15%, 80% { opacity: 1; }
}
@keyframes wheel-spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}
@keyframes robot-wave {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg); }
  50% { transform: rotate(12deg); }
  75% { transform: rotate(-8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .buddy.is-cheer .hero-pic,
  .buddy.is-cheer .hero-pic .bolt-img,
  .buddy.is-cheer [class$="-fx"],
  .buddy.is-cheer .wheels-fx i,
  .buddy.is-cheer .pose-truck,
  .buddy.is-cheer .pose-robot { animation: none !important; }
  .buddy.is-cheer .cheer { animation: cheer-still 1.2s ease forwards; }
  .buddy.is-cheer [class$="-fx"] { opacity: 0; }
}
@keyframes cheer-still {
  0% { opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- v30: Green Smash celebrations ---------- */
.crack-fx, .lift-fx, .roar-fx { position: absolute; pointer-events: none; opacity: 0; }
.crack-fx {
  left: 0; bottom: -4px; width: 130px; height: 40px;
  background:
    linear-gradient(90deg, transparent, #243056, transparent) 10% 60% / 80% 3px no-repeat,
    linear-gradient(20deg, transparent 40%, #243056 40% 55%, transparent 55%) 0 0 / 50% 100% no-repeat,
    linear-gradient(-25deg, transparent 40%, #243056 40% 55%, transparent 55%) 50% 0 / 50% 100% no-repeat;
}
.lift-fx {
  left: 55%; top: 0; width: 36px; height: 30px; border-radius: 40% 50% 45% 40%;
  background: #8a8f96; box-shadow: inset -4px -3px 0 #6c7178, 0 0 0 2px #243056;
}
.roar-fx {
  left: 70%; top: 18%; width: 40px; height: 36px;
  background:
    radial-gradient(circle at 0 50%, transparent 8px, #7A3CBD 8px 10px, transparent 11px) 0 0 / 16px 36px no-repeat,
    radial-gradient(circle at 0 50%, transparent 14px, #7A3CBD 14px 16px, transparent 17px) 8px 0 / 24px 36px no-repeat;
}

.buddy-smash[data-cheer="ground-smash"].is-cheer .hero-pic { animation: ground-smash 1.2s ease; }
.buddy-smash[data-cheer="ground-smash"].is-cheer .crack-fx { animation: crack-pop 1.2s ease forwards; }
.buddy-smash[data-cheer="flex"].is-cheer .hero-pic { animation: smash-flex 1.2s ease; }
.buddy-smash[data-cheer="chest-pound"].is-cheer .hero-pic { animation: chest-pound 1.15s ease; }
.buddy-smash[data-cheer="boulder-lift"].is-cheer .hero-pic { animation: lift-pose 1.25s ease; }
.buddy-smash[data-cheer="boulder-lift"].is-cheer .lift-fx { animation: boulder-lift 1.25s ease forwards; }
.buddy-smash[data-cheer="big-jump"].is-cheer .hero-pic { animation: hero-jump 1.2s ease; }
.buddy-smash[data-cheer="roar-smile"].is-cheer .hero-pic { animation: roar-sway 1.25s ease; }
.buddy-smash[data-cheer="roar-smile"].is-cheer .roar-fx { animation: roar-pop 1.25s ease forwards; }

@keyframes ground-smash {
  0% { transform: translateY(0); }
  30% { transform: translateY(-42px); }
  55% { transform: translateY(4px) scaleY(0.92); }
  75% { transform: translateY(-8px) scaleY(1); }
  100% { transform: translateY(0); }
}
@keyframes crack-pop {
  0%, 40% { opacity: 0; transform: scaleX(0.2); }
  55% { opacity: 1; transform: scaleX(1.1); }
  100% { opacity: 0; transform: scaleX(1); }
}
@keyframes smash-flex {
  0%, 100% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.08) rotate(-6deg); }
  60% { transform: scale(1.1) rotate(6deg); }
}
@keyframes chest-pound {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-6px) scale(1.04); }
  40% { transform: translateX(6px) scale(1.06); }
  60% { transform: translateX(-4px) scale(1.03); }
}
@keyframes lift-pose {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-18px) rotate(-4deg); }
  70% { transform: translateY(-10px); }
}
@keyframes boulder-lift {
  0% { opacity: 0; transform: translateY(24px) scale(0.6); }
  35% { opacity: 1; transform: translateY(-20px) scale(1); }
  75% { opacity: 1; transform: translateY(-28px) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.8); }
}
@keyframes roar-sway {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-8deg) scale(1.06); }
  55% { transform: rotate(8deg) scale(1.04); }
  75% { transform: rotate(-3deg) scale(1); }
}
@keyframes roar-pop {
  0% { opacity: 0; transform: translateX(-8px) scale(0.6); }
  25%, 65% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(8px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .buddy-smash.is-cheer .hero-pic,
  .buddy-smash.is-cheer [class$="-fx"] { animation: none !important; }
}
