:root {
  --navy: #1b2a4d;
  --navy-2: #294875;
  --cream: #fff9f1;
  --gold: #c2a14a;
  --yellow: #ffd45e;
  --coral: #ff7d73;
  --coral-dark: #d95b54;
  --aqua: #5ac7d0;
  --mint: #83dcc8;
  --purple: #9e8be8;
  --pink: #ff9fc7;
  --ink: #283146;
  --muted: #66748a;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(27, 42, 77, .18);
  --soft-shadow: 0 12px 30px rgba(27, 42, 77, .11);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(255,125,115,.17), transparent 22%),
    radial-gradient(circle at 89% 9%, rgba(131,220,200,.23), transparent 25%),
    linear-gradient(160deg, #edf9fb, #fffaf3 48%, #f7eefc);
  font-family: Arial, Helvetica, sans-serif;
}
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
.is-hidden { display: none !important; }

.app-shell {
  position: relative;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}
.screen { padding: clamp(12px, 2vw, 28px); }
.home-screen { padding-bottom: 38px; }

.hero {
  position: relative;
  display: block;
  width: 100%;
  min-height: 460px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  border-radius: 34px;
  background: var(--navy);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero > img {
  display: block;
  width: 100%;
  height: clamp(470px, 64vw, 820px);
  object-fit: cover;
  object-position: center;
  transition: transform .55s ease, filter .55s ease;
}
.hero:hover > img { transform: scale(1.018); filter: saturate(1.05); }
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,23,48,.55), rgba(10,23,48,.08) 40%, rgba(10,23,48,.08) 60%, rgba(10,23,48,.48)),
    linear-gradient(0deg, rgba(10,23,48,.48), transparent 50%);
  pointer-events: none;
}
.hero-copy {
  position: absolute;
  left: 50%;
  top: 48%;
  display: grid;
  justify-items: center;
  width: min(640px, calc(100% - 40px));
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 14px rgba(17,30,56,.62);
}
.hero-copy .eyebrow {
  margin-bottom: 11px;
  padding: 7px 14px 6px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  color: var(--yellow);
  background: rgba(27,42,77,.88);
  box-shadow: 0 8px 24px rgba(10,23,48,.28), inset 0 1px rgba(255,255,255,.12);
  font-size: clamp(11px, 1.5vw, 15px);
  font-weight: 900;
  letter-spacing: .18em;
  line-height: 1.15;
  text-shadow: 0 2px 5px rgba(0,0,0,.28);
  text-transform: uppercase;
}
.hero-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 8vw, 104px);
  line-height: .9;
  letter-spacing: -.055em;
}
.hero-copy > span:not(.eyebrow) {
  max-width: 560px;
  margin-top: 16px;
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 800;
  line-height: 1.35;
}
.hero-copy b {
  margin-top: 22px;
  padding: 15px 34px;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ff978b, #ef6c64);
  box-shadow: 0 12px 30px rgba(29,35,69,.31), inset 0 1px rgba(255,255,255,.4);
  font-size: 18px;
  letter-spacing: .02em;
}

.setup-card, .how-card, .sticker-card {
  width: min(1180px, calc(100% - 12px));
  margin: 24px auto 0;
  padding: clamp(20px, 4vw, 42px);
  border: 1px solid rgba(27,42,77,.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(8px);
}
.section-heading { text-align: center; }
.section-heading .mini-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-heading h1, .section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.025em;
}
.section-heading h1 { font-size: clamp(34px, 5vw, 56px); }
.section-heading h2 { font-size: clamp(28px, 4vw, 42px); }
.section-heading p {
  width: min(720px, 100%);
  margin: 9px auto 0;
  color: var(--muted);
  line-height: 1.55;
}
.section-heading.compact { margin-bottom: 17px; }

.coach-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin-top: 26px;
}
.coach-card {
  display: grid;
  grid-template-rows: 210px auto auto;
  gap: 5px;
  min-width: 0;
  padding: 12px 10px 15px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 22px;
  color: var(--navy);
  background: linear-gradient(180deg, #f2fbfb, #fff);
  box-shadow: 0 8px 20px rgba(27,42,77,.08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.coach-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(27,42,77,.13); }
.coach-card.is-selected {
  border-color: var(--coral);
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255,125,115,.13), 0 14px 30px rgba(27,42,77,.12);
}
.coach-image-wrap {
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 28%, #fff 0 18%, transparent 19%),
    linear-gradient(160deg, #e9fafa, #f8efff);
}
.coach-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 9px 8px rgba(27,42,77,.14));
  transition: transform .2s ease;
}
.coach-card.is-selected .coach-image-wrap img { transform: translateY(-3px) scale(1.035); }
.coach-card strong { font-size: 15px; }
.coach-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.surprise-button {
  display: block;
  margin: 16px auto 0;
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid rgba(27,42,77,.16);
  border-radius: 999px;
  color: var(--navy);
  background: #fff7d7;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 7px 17px rgba(27,42,77,.08);
}
.surprise-button:hover { transform: translateY(-1px); }

.difficulty-block {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid rgba(27,42,77,.10);
}
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(840px, 100%);
  margin: 0 auto;
}
.difficulty-card {
  min-height: 116px;
  padding: 15px 12px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 19px;
  color: var(--navy);
  background: #edf8f8;
  box-shadow: 0 8px 20px rgba(27,42,77,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.difficulty-card:hover { transform: translateY(-3px); }
.difficulty-card.is-selected { border-color: var(--aqua); box-shadow: 0 0 0 5px rgba(90,199,208,.14), 0 12px 24px rgba(27,42,77,.10); background: #fff; }
.difficulty-card > span { display: block; margin-bottom: 5px; font-size: 28px; }
.difficulty-card strong { display: block; font-size: 16px; }
.difficulty-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.start-row {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 24px;
}
.best-score-card {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  width: min(390px, 100%);
  padding: 11px 15px;
  border-radius: 14px;
  color: #725815;
  background: #fff1bd;
  font-size: 12px;
}
.primary-button {
  display: block;
  width: min(390px, 100%);
  padding: 15px 22px;
  cursor: pointer;
  border: 1px solid var(--coral-dark);
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(180deg, #ff978b, #ef6c64);
  box-shadow: 0 10px 23px rgba(225,91,84,.27), inset 0 1px rgba(255,255,255,.42);
  font-weight: 900;
  font-size: 17px;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.primary-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.03); box-shadow: 0 14px 29px rgba(225,91,84,.31), inset 0 1px rgba(255,255,255,.42); }
.primary-button:disabled { cursor: progress; opacity: .55; filter: grayscale(.25); }
.load-status { margin: 0; color: var(--muted); text-align: center; font-size: 11px; }

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.how-grid article {
  padding: 17px 14px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(180deg, #f4fbfb, #fff7f3);
}
.how-grid article > span { display: block; margin-bottom: 6px; font-size: 30px; }
.how-grid strong { color: var(--navy); font-size: 14px; }
.how-grid p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.sticker-shelf {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.sticker {
  position: relative;
  padding: 14px 8px;
  border-radius: 17px;
  text-align: center;
  background: #f3f4f7;
  filter: grayscale(1);
  opacity: .54;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}
.sticker::after { content: "🔒"; position: absolute; right: 8px; top: 7px; font-size: 12px; }
.sticker.is-unlocked { filter: none; opacity: 1; background: linear-gradient(160deg, #fff7cf, #eefbfa); box-shadow: 0 8px 18px rgba(27,42,77,.08); }
.sticker.is-unlocked::after { content: "✓"; color: #208b77; font-weight: 900; }
.sticker.is-unlocked:hover { transform: translateY(-3px) rotate(-1deg); }
.sticker > span { display: block; font-size: 30px; }
.sticker strong { display: block; margin-top: 4px; color: var(--navy); font-size: 12px; }
.sticker small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.back-site-button {
  display: block;
  width: max-content;
  max-width: calc(100% - 20px);
  margin: 26px auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(27,42,77,.15);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255,255,255,.84);
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(27,42,77,.08);
}

.game-screen { min-height: 100vh; background: linear-gradient(160deg, #eefbfb, #fffaf3 55%, #f8effc); }
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1380px, 100%);
  margin: 0 auto 9px;
  padding: 10px 14px;
  border: 1px solid rgba(27,42,77,.10);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 20px rgba(27,42,77,.08);
}
.game-brand span { display: block; color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.game-brand strong { display: block; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.game-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.game-actions button {
  padding: 8px 11px;
  cursor: pointer;
  border: 1px solid rgba(27,42,77,.15);
  border-radius: 999px;
  color: var(--navy);
  background: #fff;
  font-size: 10px;
  font-weight: 900;
}
.game-actions button:hover { transform: translateY(-1px); background: #f4fbfb; }

.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(820px, 100%);
  margin: 0 auto 9px;
}
.hud > div {
  padding: 9px 7px;
  border: 1px solid rgba(27,42,77,.10);
  border-radius: 14px;
  text-align: center;
  background: rgba(255,255,255,.88);
  box-shadow: 0 6px 14px rgba(27,42,77,.06);
}
.hud span { display: block; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.hud strong { color: var(--navy); font-size: 19px; }
.hud b { font-weight: inherit; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(150px, 205px) minmax(0, 1fr) minmax(160px, 210px);
  gap: 11px;
  align-items: stretch;
  width: min(1380px, 100%);
  margin: 0 auto;
}
.coach-panel, .mission-panel {
  min-width: 0;
  border: 1px solid rgba(27,42,77,.10);
  border-radius: 21px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 24px rgba(27,42,77,.09);
}
.coach-panel { display: grid; grid-template-rows: auto minmax(340px, 1fr) auto; padding: 11px; }
.coach-name { padding: 7px 8px; border-radius: 999px; color: #fff; text-align: center; background: var(--navy); font-size: 11px; font-weight: 900; }
.coach-stage {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 340px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 21%, rgba(255,255,255,.95), transparent 22%),
    linear-gradient(180deg, #e8f9f8, #fff1ea);
}
.coach-stage::after {
  content: "";
  position: absolute;
  left: 14%; right: 14%; bottom: 8px;
  height: 14px;
  border-radius: 50%;
  background: rgba(27,42,77,.13);
  filter: blur(5px);
}
.coach-stage img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  max-height: 430px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 8px rgba(27,42,77,.16));
  transform-origin: center bottom;
  animation: coachIdle 2.8s ease-in-out infinite;
}
.coach-stage img.pose-pop { animation: coachPop .45s ease both; }
.speech-bubble {
  position: absolute;
  z-index: 4;
  left: 8px;
  right: 8px;
  top: 9px;
  padding: 10px 9px;
  border: 2px solid rgba(27,42,77,.12);
  border-radius: 15px 15px 15px 5px;
  color: var(--navy);
  text-align: center;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 17px rgba(27,42,77,.10);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
}
.speech-bubble::after { content: ""; position: absolute; left: 16px; bottom: -8px; border-width: 8px 8px 0 0; border-style: solid; border-color: #fff transparent transparent transparent; }
.coach-tip { margin-top: 8px; padding: 10px; border-radius: 14px; background: #fff3c7; }
.coach-tip span { color: #916d17; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.coach-tip p { margin: 3px 0 0; color: #705b27; font-size: 9px; line-height: 1.35; }

.play-column { min-width: 0; }
.game-message { min-height: 24px; padding: 4px 10px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 900; }
.canvas-shell {
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(27,42,77,.12);
  border-radius: 24px;
  background: #dff7f6;
  box-shadow: 0 18px 42px rgba(27,42,77,.15), inset 0 0 0 3px rgba(255,255,255,.5);
  touch-action: none;
  user-select: none;
}
#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  cursor: crosshair;
  touch-action: none;
}
.wave-banner {
  position: absolute;
  left: 50%; top: 50%;
  width: min(460px, calc(100% - 28px));
  padding: 17px 19px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 22px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, rgba(27,42,77,.96), rgba(41,72,117,.96));
  box-shadow: 0 18px 40px rgba(11,22,43,.29);
  pointer-events: none;
  animation: bannerPop .3s ease;
}
.wave-banner span { display: block; color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.wave-banner strong { display: block; margin: 3px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 5vw, 40px); }
.wave-banner small { color: #ddecff; font-size: 11px; }
.boss-hud {
  position: absolute;
  top: 11px; left: 50%;
  width: min(500px, calc(100% - 30px));
  padding: 8px 11px;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,.68);
  border-radius: 15px;
  background: rgba(27,42,77,.90);
  box-shadow: 0 8px 18px rgba(27,42,77,.23);
}
.boss-hud > span { display: block; margin-bottom: 5px; color: #fff; text-align: center; font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.boss-hud > div { overflow: hidden; height: 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
.boss-hud i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), var(--yellow)); transition: width .17s ease; }

.power-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.power-button {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 7px 9px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 17px;
  color: var(--navy);
  text-align: left;
  background: #fff;
  box-shadow: 0 8px 18px rgba(27,42,77,.09);
  transition: transform .15s ease, border-color .15s ease, opacity .15s ease;
}
.power-button:not(:disabled):hover { transform: translateY(-2px); border-color: var(--yellow); }
.power-button:disabled { cursor: not-allowed; opacity: .46; filter: grayscale(.3); }
.power-button img { width: 47px; height: 47px; object-fit: contain; }
.power-button strong { display: block; font-size: 11px; }
.power-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.power-button b { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; background: var(--navy); font-size: 11px; }
.brush-button { grid-template-columns: 48px minmax(0, 1fr); }
.brush-button em { grid-column: 1 / -1; overflow: hidden; height: 7px; margin-top: -3px; border-radius: 999px; background: #e7ecf3; }
.brush-button em i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--yellow), var(--coral)); transition: width .17s ease; }

.mission-panel { padding: 12px; }
.mission-heading span { display: block; color: var(--coral-dark); font-size: 8px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.mission-heading h2 { margin: 3px 0 12px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 23px; }
.mission-list { display: grid; gap: 8px; }
.mission-item {
  padding: 10px;
  border: 1px solid rgba(27,42,77,.08);
  border-radius: 14px;
  background: #f6f9fb;
}
.mission-item.is-complete { border-color: rgba(65,174,153,.35); background: #ebfaf6; }
.mission-item .mission-top { display: flex; align-items: center; gap: 7px; }
.mission-item .mission-icon { font-size: 19px; }
.mission-item strong { color: var(--navy); font-size: 10px; line-height: 1.25; }
.mission-item p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.35; }
.mission-progress { overflow: hidden; height: 6px; margin-top: 7px; border-radius: 999px; background: #e3e8ee; }
.mission-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--mint)); transition: width .2s ease; }
.mission-check { margin-left: auto; color: #258a77; font-size: 13px; font-weight: 900; }
.mission-reward { margin-top: 11px; padding: 10px; border-radius: 14px; text-align: center; background: #fff2c6; }
.mission-reward span { display: block; color: #8b6b1b; font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mission-reward strong { color: #d49b1d; font-size: 21px; letter-spacing: 2px; }

.overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18,31,58,.76);
  backdrop-filter: blur(7px);
}
.modal {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: clamp(22px, 5vw, 40px);
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 28px;
  text-align: center;
  background: linear-gradient(160deg, #fff, var(--cream));
  box-shadow: 0 28px 80px rgba(0,0,0,.30);
}
.modal-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: 0 auto 12px;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 10px 22px rgba(27,42,77,.20);
  font-size: 33px;
}
.modal h2 { margin: 0 0 8px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 5vw, 44px); }
.modal > p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal .primary-button { margin: 16px auto 0; }
.text-button {
  margin-top: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border: 0;
  color: var(--navy);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.help-list { display: grid; gap: 7px; margin: 16px 0 4px; text-align: left; }
.help-list p { display: grid; grid-template-columns: 30px 1fr; gap: 7px; margin: 0; padding: 9px 10px; border-radius: 12px; color: var(--muted); background: #f5f8fb; font-size: 11px; }
.help-list span { font-size: 20px; }
.help-list strong { color: var(--navy); }
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.end-modal { padding-top: 20px; }
.end-team-image { display: block; width: min(360px, 90%); max-height: 180px; margin: 0 auto -10px; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(27,42,77,.14)); }
.end-stars { margin: 5px 0 8px; color: #e5aa24; font-size: 34px; letter-spacing: 5px; text-shadow: 0 3px 8px rgba(194,145,31,.23); }
.end-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.end-stats > div { padding: 10px; border-radius: 14px; background: #eaf8f7; }
.end-stats span { display: block; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.end-stats strong { color: var(--navy); font-size: 20px; }
.new-best { margin: -2px 0 12px; color: #967017; font-size: 13px; font-weight: 900; }
.sticker-unlocks { margin: 12px 0; padding: 11px; border-radius: 14px; color: #6d5316; background: #fff1bc; font-size: 11px; font-weight: 900; }

@keyframes coachIdle { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(.5deg); } }
@keyframes coachPop { 0% { transform: scale(.86) translateY(8px); opacity: .5; } 70% { transform: scale(1.05) translateY(-4px); opacity: 1; } 100% { transform: scale(1) translateY(0); } }
@keyframes bannerPop { from { opacity: 0; transform: translate(-50%,-50%) scale(.82); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

@media (max-width: 1120px) {
  .coach-grid { grid-template-columns: repeat(3, 1fr); }
  .game-layout { grid-template-columns: 170px minmax(0, 1fr); }
  .mission-panel { grid-column: 1 / -1; }
  .mission-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .screen { padding: 6px 4px 10px; }
  .hero { min-height: 420px; border-radius: 22px; }
  .hero > img { height: 560px; object-position: center; }
  .hero-copy { top: 50%; }
  .hero-copy .eyebrow { padding: 7px 11px 6px; font-size: 10px; letter-spacing: .14em; }
  .hero-copy strong { font-size: clamp(48px, 14vw, 70px); }
  .setup-card, .how-card, .sticker-card { width: 100%; padding: 20px 13px; border-radius: 21px; }
  .coach-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .coach-card { grid-template-rows: 180px auto auto; }
  .difficulty-grid { grid-template-columns: 1fr; }
  .difficulty-card { min-height: 82px; display: grid; grid-template-columns: 44px 1fr; align-items: center; text-align: left; }
  .difficulty-card > span { grid-row: 1 / span 2; margin: 0; text-align: center; }
  .how-grid { grid-template-columns: 1fr 1fr; }
  .sticker-shelf { grid-template-columns: repeat(2, 1fr); }

  /* Compact mobile game chrome so the action begins much higher on screen. */
  .game-screen { padding-top: 4px; }
  .game-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 5px;
    padding: 6px 7px;
    border-radius: 14px;
  }
  .game-brand { display: flex; justify-content: center; align-items: baseline; }
  .game-brand span { display: none; }
  .game-brand strong { font-size: 16px; line-height: 1; }
  .game-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }
  .game-actions button {
    min-width: 0;
    padding: 6px 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 8px;
  }
  .hud { width: 100%; gap: 4px; margin-bottom: 5px; }
  .hud > div { padding: 6px 3px; border-radius: 11px; }
  .hud span { font-size: 6.5px; }
  .hud strong { font-size: 15px; }

  .game-layout { grid-template-columns: 1fr; gap: 5px; }
  .coach-panel {
    position: relative;
    display: block;
    min-height: 116px;
    height: 116px;
    padding: 6px;
    border-radius: 16px;
    overflow: hidden;
  }
  .coach-stage {
    position: absolute;
    inset: 6px;
    min-height: 0;
    margin: 0;
    border-radius: 12px;
  }
  .coach-stage img {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 92px;
    height: 104px;
    max-height: none;
    object-fit: contain;
    object-position: left bottom;
  }
  .coach-stage::after { left: 8px; right: auto; width: 76px; bottom: 3px; height: 10px; }
  .coach-name {
    position: absolute;
    z-index: 6;
    left: 103px;
    top: 7px;
    width: auto;
    max-width: calc(100% - 111px);
    padding: 4px 9px;
    text-align: left;
    font-size: 9px;
  }
  .speech-bubble {
    left: 98px;
    right: 1px;
    top: 31px;
    min-height: 36px;
    padding: 5px 7px;
    display: grid;
    align-items: center;
    border-radius: 10px;
    text-align: left;
    font-size: 8.5px;
    line-height: 1.2;
  }
  .speech-bubble::after { display: none; }
  .coach-tip {
    position: absolute;
    z-index: 6;
    left: 103px;
    right: 7px;
    bottom: 7px;
    min-height: 0;
    margin: 0;
    padding: 5px 7px;
    border-radius: 10px;
  }
  .coach-tip span { display: none; }
  .coach-tip p { margin: 0; font-size: 8px; line-height: 1.2; }

  .play-column { min-width: 0; }
  .game-message { min-height: 18px; padding: 1px 6px 3px; font-size: 9.5px; }
  .canvas-shell { border-width: 2px; border-radius: 17px; }
  .mission-panel { grid-column: auto; margin-top: 1px; }
  .mission-list { grid-template-columns: 1fr; }

  /* Keep all three power-ups together and available without a long scroll. */
  .power-row {
    position: sticky;
    z-index: 30;
    bottom: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
    padding: 4px;
    border: 1px solid rgba(27,42,77,.10);
    border-radius: 14px;
    background: rgba(238,251,251,.94);
    box-shadow: 0 8px 22px rgba(27,42,77,.12);
    backdrop-filter: blur(8px);
  }
  .power-button,
  .brush-button {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 37px auto auto;
    justify-items: center;
    align-content: start;
    gap: 1px;
    min-width: 0;
    min-height: 84px;
    padding: 4px 3px;
    border-radius: 11px;
    text-align: center;
  }
  .power-button img { width: 37px; height: 37px; }
  .power-button span { min-width: 0; }
  .power-button strong { font-size: 8.5px; line-height: 1.08; }
  .power-button small { margin-top: 1px; font-size: 6.7px; line-height: 1.1; }
  .power-button b {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 19px;
    height: 19px;
    font-size: 8px;
  }
  .brush-button em {
    grid-column: 1;
    width: calc(100% - 8px);
    height: 5px;
    margin: 2px auto 0;
  }
}

@media (max-width: 470px) {
  .hero > img { height: 500px; }
  .hero-copy > span:not(.eyebrow) { font-size: 13px; }
  .hero-copy b { margin-top: 15px; padding: 12px 24px; font-size: 15px; }
  .coach-card { grid-template-rows: 150px auto auto; padding: 8px 7px 11px; }
  .coach-card strong { font-size: 12px; }
  .coach-card small { font-size: 8px; }
  .how-grid p { display: none; }
  .game-actions button { font-size: 7.5px; }
  .coach-panel { height: 108px; min-height: 108px; }
  .coach-stage img { width: 84px; height: 96px; }
  .coach-stage::after { width: 68px; }
  .coach-name { left: 94px; max-width: calc(100% - 102px); }
  .speech-bubble { left: 89px; top: 30px; font-size: 8px; }
  .coach-tip { left: 94px; }
  .power-button,
  .brush-button { min-height: 80px; }
  .power-button strong { font-size: 8px; }
  .power-button small { font-size: 6.2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


/* V4 mobile play mode: taller game board, smaller controls, desktop unchanged. */
@media (max-width: 760px) {
  .game-screen { padding: 2px 2px 8px; }

  .game-header {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
    padding: 4px 5px;
    border-radius: 12px;
  }
  .game-brand { display: block; min-width: 0; }
  .game-brand span { display: none; }
  .game-brand strong {
    display: block;
    overflow: hidden;
    max-width: 118px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1;
  }
  .game-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    min-width: 0;
  }
  .game-actions button {
    min-width: 0;
    padding: 5px 1px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 7px;
    line-height: 1;
  }

  .hud { gap: 3px; margin-bottom: 3px; }
  .hud > div { padding: 4px 2px; border-radius: 9px; }
  .hud span { font-size: 5.7px; line-height: 1; }
  .hud strong { font-size: 13px; line-height: 1.05; }

  .game-layout { gap: 3px; }
  .coach-panel {
    height: 80px;
    min-height: 80px;
    padding: 4px;
    border-radius: 13px;
  }
  .coach-stage { inset: 4px; border-radius: 10px; }
  .coach-stage img {
    width: 64px;
    height: 72px;
  }
  .coach-stage::after { left: 4px; width: 57px; height: 8px; bottom: 2px; }
  .coach-name {
    left: 70px;
    top: 4px;
    max-width: calc(100% - 75px);
    padding: 3px 7px;
    font-size: 7.8px;
    line-height: 1;
  }
  .speech-bubble {
    left: 67px;
    right: 1px;
    top: 24px;
    bottom: 3px;
    min-height: 0;
    padding: 4px 6px;
    overflow: hidden;
    border-radius: 9px;
    font-size: 7.7px;
    line-height: 1.15;
    text-align: left;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .coach-tip { display: none; }

  .game-message {
    min-height: 15px;
    padding: 0 4px 2px;
    font-size: 8.5px;
    line-height: 1.15;
  }
  .canvas-shell { border-width: 1.5px; border-radius: 14px; }
  #gameCanvas { aspect-ratio: 1000 / 760; }

  .power-row {
    bottom: 2px;
    gap: 3px;
    margin-top: 4px;
    padding: 3px;
    border-radius: 12px;
  }
  .power-button,
  .brush-button {
    grid-template-rows: 30px auto 4px;
    gap: 0;
    min-height: 62px;
    padding: 3px 2px;
    border-radius: 9px;
  }
  .power-button img { width: 30px; height: 30px; }
  .power-button strong { font-size: 7.4px; line-height: 1.05; }
  .power-button small { display: none; }
  .power-button b {
    top: 2px;
    right: 2px;
    width: 17px;
    height: 17px;
    font-size: 7px;
  }
  .brush-button em {
    width: calc(100% - 6px);
    height: 4px;
    margin-top: 1px;
  }
  .mission-panel { margin-top: 3px; }
}

@media (max-width: 470px) {
  .game-brand strong { max-width: 105px; font-size: 12px; }
  .game-actions button { padding: 5px 0; font-size: 6.5px; }
  .coach-panel { height: 74px; min-height: 74px; }
  .coach-stage img { width: 58px; height: 66px; }
  .coach-stage::after { width: 51px; }
  .coach-name { left: 64px; max-width: calc(100% - 69px); font-size: 7.4px; }
  .speech-bubble { left: 61px; top: 23px; font-size: 7.3px; }
  .power-button,
  .brush-button { min-height: 58px; grid-template-rows: 28px auto 4px; }
  .power-button img { width: 28px; height: 28px; }
  .power-button strong { font-size: 6.9px; }
}
