:root {
  --ink: #fff8ff;
  --muted: rgba(255,255,255,.78);
  --panel: rgba(39, 10, 78, .58);
  --panel-strong: rgba(30, 6, 55, .76);
  --pink: #ff43bd;
  --purple: #7c3cff;
  --violet: #2a074d;
  --gold: #ffd55c;
  --cyan: #39e5ff;
  --danger: #ff5f7c;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #130020; color: var(--ink); font-family: Fredoka, Nunito Sans, system-ui, sans-serif; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }

.game-shell { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 10%, #4c1686 0, #19002d 52%, #070010 100%); }
.screen { position: absolute; inset: 0; display: none; overflow: hidden; }
.screen.active { display: block; }
.screen::before { content: ''; position: absolute; inset: -20%; background-image: radial-gradient(circle, rgba(255,255,255,.82) 0 1px, transparent 2px); background-size: 70px 70px; opacity: .24; animation: drift 16s linear infinite; pointer-events: none; }
.screen-overlay { position:absolute; inset:0; background: radial-gradient(circle at 72% 40%, rgba(255,77,218,.20), transparent 38%), linear-gradient(90deg, rgba(7,0,18,.74), rgba(37,5,85,.1)); pointer-events:none; }

.intro-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background: #140022 url('assets/images/intro-still.png') center/cover no-repeat; }
.intro-panel, .hero-copy { position:absolute; left: max(24px, env(safe-area-inset-left)); top: 50%; transform: translateY(-50%); width:min(470px, 46vw); z-index:3; }
.intro-panel.hidden { opacity:0; transform: translateY(-50%) scale(.96); pointer-events:none; transition: opacity .22s ease, transform .22s ease; }
.skip-intro-btn { position:absolute; left:max(16px, env(safe-area-inset-left)); bottom:max(14px, env(safe-area-inset-bottom)); z-index:8; display:none; min-height:38px; padding:9px 14px; border-radius:999px; font-weight:800; background:rgba(18,0,38,.58); border:1px solid rgba(255,255,255,.28); box-shadow:0 12px 28px rgba(0,0,0,.28); }
.skip-intro-btn.visible { display:block; }
.glass-panel { border: 1px solid rgba(255,255,255,.22); background: linear-gradient(135deg, rgba(58, 12, 102, .72), rgba(24, 0, 45, .62)); box-shadow: 0 24px 70px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.16); backdrop-filter: blur(14px); border-radius: 28px; padding: clamp(16px, 2.4vw, 28px); }
h1 { margin: 0 0 12px; font-size: clamp(34px, 6vw, 76px); line-height: .88; letter-spacing: -.04em; text-shadow: 0 4px 0 rgba(87, 15, 126, .8), 0 0 26px rgba(255, 97, 218, .5); }
h2 { margin:0 0 10px; font-size: clamp(24px, 3.4vw, 42px); line-height:1; }
p { margin: 0 0 16px; color: var(--muted); font-size: clamp(14px, 1.45vw, 18px); line-height:1.32; }
.eyebrow { margin:0 0 8px; color: var(--gold); font-weight:700; text-transform:uppercase; letter-spacing:.12em; font-size:12px; }
.button-row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.button-row.center { justify-content:center; }
.primary-btn, .ghost-btn, .small-btn, .control-btn, .boost-btn { min-height:44px; border-radius:999px; padding: 12px 18px; font-weight:800; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.primary-btn { background: linear-gradient(135deg, var(--pink), var(--purple) 55%, var(--cyan)); border: 1px solid rgba(255,255,255,.35); }
.primary-btn.big { font-size: 20px; padding: 15px 25px; }
.ghost-btn, .small-btn { background: rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.22); }
.small-btn { min-height:38px; padding:9px 14px; font-size:14px; }

.start-screen { background: url('assets/images/main-team-scene.png') center/cover no-repeat; }
.start-character { position:absolute; z-index:2; filter: drop-shadow(0 22px 24px rgba(0,0,0,.35)); pointer-events:none; }
.lincoln-float { right: 20vw; bottom: -4vh; height: 78vh; animation: bob 3s ease-in-out infinite; }
.daniel-float { right: 2vw; bottom: 6vh; height: 48vh; animation: bob 3.4s ease-in-out infinite .4s; }

.top-bar, .hud { position:absolute; left:max(14px, env(safe-area-inset-left)); right:max(14px, env(safe-area-inset-right)); top:max(10px, env(safe-area-inset-top)); height:48px; display:flex; align-items:center; justify-content:space-between; z-index:20; gap:10px; }
.game-title-pill, .hud-stat { border:1px solid rgba(255,255,255,.22); background:rgba(15,0,34,.5); backdrop-filter: blur(10px); border-radius:999px; padding:9px 16px; font-weight:800; }
.hud-stat strong { color: var(--gold); font-size: 1.15em; }
.map-screen { background: radial-gradient(circle at 70% 25%, rgba(255,67,189,.35), transparent 22%), radial-gradient(circle at 20% 75%, rgba(57,229,255,.18), transparent 25%), linear-gradient(160deg,#21003c,#10001d 60%,#050009); }
.map-stage { position:absolute; inset:70px 2vw 18px 2vw; }
.portal-glow { position:absolute; left:50%; top:50%; width:44vw; aspect-ratio:1; transform: translate(-50%,-50%); border-radius:50%; background: conic-gradient(from 40deg, transparent, rgba(255,67,189,.6), rgba(57,229,255,.28), rgba(255,213,92,.48), transparent); filter: blur(2px) drop-shadow(0 0 40px rgba(255,67,189,.5)); opacity:.62; animation: spin 10s linear infinite; }
.world-node { position:absolute; width: 22vw; min-width:190px; max-width:275px; border-radius: 28px; padding:16px; text-align:left; border:1px solid rgba(255,255,255,.24); background: linear-gradient(145deg, rgba(107,32,168,.88), rgba(29,4,65,.8)); box-shadow: 0 18px 45px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.16); }
.world-node strong { display:block; font-size: clamp(17px, 2vw, 25px); line-height:1; }
.world-node small { display:block; color:rgba(255,255,255,.75); margin-top:5px; }
.world-node .node-icon { font-size:32px; display:block; margin-bottom:8px; }
.world-node.unlocked { animation: pulse 2.8s ease-in-out infinite; }
.world-node.locked { filter: grayscale(.55); opacity:.72; }
.berry-node { left:7vw; top:10vh; }
.sound-node { right:8vw; top:18vh; }
.number-node { left:30vw; bottom:10vh; }
.treasure-node { right:24vw; bottom:7vh; }
.map-helper { position:absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); width:min(430px, 38vw); z-index:15; display:flex; align-items:center; gap:14px; padding:14px; }
.map-helper img { height:96px; object-fit:contain; filter: drop-shadow(0 10px 10px rgba(0,0,0,.35)); }
.map-helper h2 { font-size:24px; }
.map-helper p { font-size:14px; margin:0; }

.game-screen { background: #17002b; }
#berryCanvas { position:absolute; inset:0; width:100%; height:100%; display:block; background: url('assets/images/berry-dash-game-bg.png') center/cover no-repeat; image-rendering:auto; }
.touch-controls { position:absolute; left:0; right:0; bottom: max(8px, var(--safe-bottom)); display:flex; justify-content:space-between; align-items:center; z-index:30; pointer-events:none; padding:0 max(18px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-left)); }
.touch-controls button { pointer-events:auto; }
.control-cluster { display:flex; align-items:center; gap:8px; }
.left-cluster { margin-left:0; }
.right-cluster { margin-left:auto; }
.control-btn { width:58px; height:58px; font-size:27px; padding:0; background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.25); }
.mini-boost-btn { width:43px; height:43px; border-radius:999px; padding:0; font-size:19px; font-weight:900; background: linear-gradient(135deg,#ffd55c,#ff43bd,#7c3cff); border:1px solid rgba(255,255,255,.34); box-shadow:0 10px 24px rgba(0,0,0,.26); }
.boost-btn { min-width:180px; height:62px; background: linear-gradient(135deg,#ffd55c,#ff43bd,#7c3cff); border:1px solid rgba(255,255,255,.3); }
.game-modal { position:absolute; left:50%; top:50%; transform: translate(-50%,-50%); width:min(520px, 82vw); z-index:40; text-align:center; display:none; }
.game-modal.active { display:block; }

.sound-game { background: url('assets/sound-garden/backgrounds/garden_portal.png') center/cover no-repeat; }
.sound-stage { position:absolute; inset:64px 20px 18px; }
.garden-guide { position:absolute; left:2vw; bottom:0; height:min(54vh, 330px); filter:drop-shadow(0 18px 20px rgba(0,0,0,.35)); animation:bob 3s ease-in-out infinite; }
.sound-prompt { position:absolute; left:24vw; top:0; right:2vw; text-align:center; padding:14px 18px; }
.sound-prompt h2 span { color:var(--gold); font-size:1.35em; text-shadow:0 0 16px rgba(255,213,92,.9); }
.sound-items { position:absolute; left:26vw; right:5vw; top:38%; bottom:8%; display:grid; grid-template-columns: repeat(4, minmax(82px, 1fr)); gap:16px; align-items:center; }
.sound-item { height: min(24vh, 150px); border-radius:24px; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.16); backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; box-shadow:0 12px 30px rgba(0,0,0,.24); }
.sound-item img { max-width:86%; max-height:86%; object-fit:contain; filter: drop-shadow(0 10px 12px rgba(0,0,0,.25)); }
.sound-item.correct { outline: 4px solid rgba(255,213,92,.9); }
.sound-item.wrong { animation: shake .25s ease-in-out; }

.sound-cutscene { position:absolute; left:50%; top:52%; transform:translate(-50%,-50%); width:min(760px, 86vw); min-height:58vh; z-index:45; display:none; grid-template-columns:minmax(180px, .8fr) 1fr; align-items:center; gap:18px; text-align:left; }
.sound-cutscene.active { display:grid; }
.cutscene-art { position:relative; min-height:300px; }
.cutscene-lincoln { position:absolute; left:8%; bottom:0; height:min(50vh, 340px); object-fit:contain; filter:drop-shadow(0 18px 20px rgba(0,0,0,.34)); }
.cutscene-basket { position:absolute; right:2%; bottom:3%; width:min(24vw, 170px); object-fit:contain; filter:drop-shadow(0 12px 14px rgba(0,0,0,.28)); animation:bob 2.4s ease-in-out infinite; }
.cutscene-copy p:last-of-type { margin-bottom:18px; }


.rotate-prompt { display:none; position:fixed; inset:0; z-index:999; background: radial-gradient(circle,#51128e,#160027 60%,#06000c); place-items:center; padding:24px; text-align:center; }
.rotate-card { max-width:420px; border-radius:28px; padding:28px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22); box-shadow:0 20px 60px rgba(0,0,0,.35); }
.rotate-icon { font-size:58px; color:var(--gold); }
.rotate-card h1 { font-size:36px; line-height:1; }

@keyframes drift { to { transform: translate3d(70px,70px,0); } }
@keyframes bob { 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes pulse { 50% { transform: translateY(-4px) scale(1.02); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

@media (orientation: portrait) and (max-width: 900px) {
  .rotate-prompt { display:grid; }
  .game-shell { display:none; }
}
@media (max-height: 520px) {
  h1 { font-size: clamp(30px, 5vw, 54px); }
  .intro-panel, .hero-copy { width:min(440px, 48vw); }
  .lincoln-float { height:72vh; right:18vw; }
  .daniel-float { height:42vh; }
  .map-helper { display:none; }
  .world-node { padding:12px; border-radius:22px; min-width:170px; }
  .sound-items { grid-template-columns: repeat(4, minmax(68px, 1fr)); gap:10px; left:25vw; right:4vw; top:39%; }
  .sound-item { height: min(22vh, 116px); }
  .control-btn { width:52px; height:52px; font-size:24px; }
  .mini-boost-btn { width:39px; height:39px; }
  .sound-cutscene { min-height:62vh; }
  .cutscene-lincoln { height:min(50vh, 280px); }
}

/* v3 mobile polish fixes */
.intro-screen.playing .screen-overlay { opacity: 0; transition: opacity .2s ease; }
.intro-screen.playing .intro-video { filter: none; }

#berryCanvas { width:100%; height:100%; image-rendering:auto; }

.sound-stage { inset:64px 18px 18px; }
.word-prompt { left:22vw; right:3vw; top:0; padding:12px 16px; }
.word-card { position:absolute; left:24vw; right:4vw; top:31%; bottom:5%; display:grid; grid-template-columns:minmax(110px, .7fr) 1.3fr; grid-template-rows:auto 1fr; gap:12px 16px; align-items:center; padding:14px; }
.word-picture { grid-row:1 / span 2; height:100%; min-height:150px; border-radius:22px; background:linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.08)); border:1px solid rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.word-picture img { max-width:88%; max-height:88%; object-fit:contain; transform:translateY(-8%); filter:drop-shadow(0 12px 14px rgba(0,0,0,.28)) saturate(1.08) contrast(1.05); }
.word-slots { display:flex; justify-content:center; gap:8px; align-items:center; }
.word-slot { width:clamp(42px, 6vw, 72px); height:clamp(42px, 6vw, 72px); border-radius:18px; display:flex; align-items:center; justify-content:center; font-size:clamp(24px, 4vw, 42px); font-weight:900; color:#2a074d; background:rgba(255,255,255,.84); box-shadow:inset 0 -5px 0 rgba(124,60,255,.16), 0 10px 22px rgba(0,0,0,.18); border:2px solid rgba(255,213,92,.75); }
.word-slot.empty { color:rgba(42,7,77,.22); }
.letter-options { display:grid; grid-template-columns:repeat(4, minmax(54px, 1fr)); gap:10px; align-self:start; }
.letter-option { min-height:clamp(52px, 9vh, 78px); border-radius:20px; font-size:clamp(25px, 4.2vw, 44px); font-weight:900; color:#fff8ff; background:linear-gradient(135deg, rgba(255,67,189,.9), rgba(124,60,255,.88)); border:1px solid rgba(255,255,255,.32); box-shadow:0 12px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.24); }
.letter-option:disabled { opacity:.55; transform:scale(.97); }
.letter-option.correct { outline:4px solid rgba(255,213,92,.95); }
.letter-option.wrong { animation:shake .25s ease-in-out; }
.sound-popup { position:absolute; left:50%; top:52%; transform:translate(-50%, -50%) scale(.96); width:min(430px, 62vw); z-index:42; display:none; text-align:center; }
.sound-popup.active { display:block; animation:popupIn .18s ease-out forwards; }
.sound-popup h2 { color:var(--gold); }
.sound-popup p { margin-bottom:0; font-size:clamp(16px, 2vw, 22px); color:#fff; }
.sound-cutscene { width:min(820px, 88vw); grid-template-columns:minmax(210px, .85fr) 1fr; }
.cutscene-art { min-height:330px; }
.cutscene-lincoln { left:0; right:0; margin:auto; bottom:-6px; height:min(62vh, 430px); max-width:100%; }
.cutscene-basket { display:none; }

@keyframes popupIn { from { opacity:0; transform:translate(-50%, -50%) scale(.9); } to { opacity:1; transform:translate(-50%, -50%) scale(1); } }

@media (max-height: 520px) {
  .word-prompt { top:0; left:21vw; }
  .word-card { left:24vw; right:3vw; top:34%; bottom:4%; gap:8px 12px; padding:10px; }
  .word-picture { min-height:110px; }
  .letter-options { gap:8px; }
  .letter-option { min-height:48px; border-radius:16px; }
  .word-slot { border-radius:14px; }
  .sound-popup { width:min(390px, 64vw); }
  .cutscene-art { min-height:250px; }
  .cutscene-lincoln { height:min(60vh, 330px); }
}

/* v4 route + Sound Garden concept correction */
.berry-game .touch-controls { pointer-events:none; }
.berry-game .control-cluster { pointer-events:auto; }

.word-prompt h2 { font-size:clamp(22px, 3.1vw, 38px); }
.word-card { top:30%; }
.word-picture { position:relative; }
.word-picture img.hidden-picture { opacity:0; }
.word-picture:has(img.hidden-picture)::after { content:'?'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:clamp(70px, 12vw, 140px); font-weight:900; color:rgba(255,213,92,.95); text-shadow:0 0 22px rgba(255,77,218,.75), 0 8px 18px rgba(0,0,0,.35); }
.picture-options { display:grid; grid-template-columns:repeat(4, minmax(82px, 1fr)); gap:12px; align-self:stretch; }
.sound-picture-option { min-height:clamp(96px, 19vh, 150px); border-radius:22px; border:1px solid rgba(255,255,255,.30); background:linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.10)); box-shadow:0 12px 26px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.22); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:#fff; font:800 clamp(13px,1.7vw,18px)/1.05 Fredoka, sans-serif; text-transform:capitalize; }
.sound-picture-option img { max-width:78%; max-height:74%; object-fit:contain; filter:drop-shadow(0 10px 12px rgba(0,0,0,.25)) saturate(1.12) contrast(1.07); }
.sound-picture-option.correct { outline:4px solid rgba(255,213,92,.95); background:linear-gradient(135deg, rgba(255,213,92,.32), rgba(255,67,189,.16)); }
.sound-picture-option.wrong { animation:shake .25s ease-in-out; }
.sound-picture-option:disabled { opacity:.64; transform:scale(.98); }
.letter-option { display:none; }
.cutscene-lincoln { filter:saturate(1.15) contrast(1.08) drop-shadow(0 16px 18px rgba(0,0,0,.28)); }

@media (max-height: 520px) {
  .word-card { top:32%; }
  .picture-options { gap:8px; }
  .sound-picture-option { min-height:74px; border-radius:16px; font-size:12px; }
  .sound-picture-option img { max-height:70%; }
}


/* v5 control, sprite shape, Sound Garden reveal, and card-fit fixes */
.control-btn { width:68px; height:68px; font-size:32px; }
.mini-boost-btn { width:48px; height:48px; font-size:21px; }
.control-cluster { gap:10px; }
.touch-controls { bottom:max(14px, calc(var(--safe-bottom) + 10px)); }

.sound-picture-option { overflow:hidden; padding:8px 6px 7px; }
.sound-picture-option img { width:72%; height:62%; max-width:72%; max-height:62%; object-fit:contain; object-position:center; }
.sound-picture-option span { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.word-picture img { max-width:82%; max-height:78%; object-fit:contain; object-position:center; transform:translateY(-4%); }

.sound-reveal { position:absolute; left:50%; top:52%; transform:translate(-50%, -50%); width:min(720px, 84vw); min-height:min(390px, 72vh); z-index:44; display:none; grid-template-columns:minmax(190px, .82fr) 1fr; gap:18px; align-items:center; text-align:left; }
.sound-reveal.active { display:grid; animation:popupIn .18s ease-out forwards; }
.reveal-image-wrap { height:min(45vh, 300px); border-radius:24px; background:linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.08)); border:1px solid rgba(255,255,255,.22); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.reveal-image-wrap img { max-width:82%; max-height:82%; object-fit:contain; filter:drop-shadow(0 12px 16px rgba(0,0,0,.3)) saturate(1.1) contrast(1.05); }
.sound-reveal-word { margin:6px 0 12px; padding:10px 14px; display:inline-flex; border-radius:18px; background:rgba(255,255,255,.9); color:#2a074d; font-weight:900; font-size:clamp(34px, 5.5vw, 62px); letter-spacing:.08em; box-shadow:inset 0 -6px 0 rgba(124,60,255,.14), 0 14px 30px rgba(0,0,0,.2); }
.reveal-copy p { color:#fff; }

@media (max-height: 520px) {
  .control-btn { width:62px; height:62px; font-size:29px; }
  .mini-boost-btn { width:44px; height:44px; }
  .sound-picture-option img { width:68%; height:58%; max-width:68%; max-height:58%; }
  .sound-reveal { width:min(670px, 86vw); min-height:62vh; gap:12px; }
  .reveal-image-wrap { height:min(43vh, 240px); }
  .sound-reveal-word { font-size:clamp(28px, 5vw, 46px); }
}


/* v6 tuning: Berry Dash pace/catch feel + Sound Garden card positioning */
.word-picture img { max-width:80%; max-height:72%; transform:translateY(-14%); }
.word-picture img[src*="strawberry"] { transform:translateY(-22%); max-height:68%; }
.sound-picture-option img { width:68%; height:56%; max-width:68%; max-height:56%; object-fit:contain; object-position:center center; }
.sound-picture-option img[src*="strawberry"] { object-position:center 40%; transform:translateY(-8%); }
.reveal-image-wrap img { max-width:78%; max-height:76%; object-fit:contain; }
.reveal-image-wrap img[src*="strawberry"] { transform:translateY(-10%); max-height:70%; }
@media (max-height: 520px) {
  .word-picture img { max-height:68%; transform:translateY(-16%); }
  .word-picture img[src*="strawberry"] { transform:translateY(-24%); max-height:64%; }
  .sound-picture-option img { height:52%; max-height:52%; }
}


/* v7 child-reach controls + anti-camping gameplay support */
.touch-controls {
  bottom: max(64px, calc(var(--safe-bottom) + 58px));
  padding-left: max(26px, env(safe-area-inset-left));
  padding-right: max(26px, env(safe-area-inset-right));
}
.control-btn {
  width: 74px;
  height: 74px;
  font-size: 36px;
}
.mini-boost-btn {
  width: 52px;
  height: 52px;
  font-size: 22px;
}
.control-cluster {
  gap: 12px;
}
.left-cluster { transform: translateX(4px); }
.right-cluster { transform: translateX(-4px); }
@media (max-height: 520px) {
  .touch-controls { bottom: max(52px, calc(var(--safe-bottom) + 44px)); }
  .control-btn { width: 68px; height: 68px; font-size: 33px; }
  .mini-boost-btn { width: 48px; height: 48px; font-size: 20px; }
}

/* v8 quieter Berry Dash controls/audio + nicer arrows */
.control-btn {
  position: relative;
  color: transparent;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,.95), rgba(255,255,255,.20) 26%, rgba(255,255,255,0) 42%),
    linear-gradient(145deg, rgba(255,216,78,.98), rgba(255,96,197,.94) 52%, rgba(116,52,255,.96));
  border: 3px solid rgba(255,255,255,.72);
  box-shadow:
    0 12px 28px rgba(0,0,0,.34),
    inset 0 4px 0 rgba(255,255,255,.45),
    inset 0 -7px 0 rgba(56,0,95,.24),
    0 0 22px rgba(255,84,219,.28);
}
.control-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  border-top: 8px solid #fff9cf;
  border-left: 8px solid #fff9cf;
  filter: drop-shadow(0 3px 0 rgba(72,0,110,.36));
}
#laneLeftBtn::before { transform: translate(-36%, -50%) rotate(-45deg); }
#laneRightBtn::before { transform: translate(-64%, -50%) rotate(135deg); }
.control-btn:active {
  transform: translateY(3px) scale(.96);
  box-shadow:
    0 7px 16px rgba(0,0,0,.32),
    inset 0 2px 0 rgba(255,255,255,.34),
    inset 0 -4px 0 rgba(56,0,95,.24),
    0 0 18px rgba(255,84,219,.22);
}
.mini-boost-btn {
  background:
    radial-gradient(circle at 38% 26%, rgba(255,255,255,.92), rgba(255,255,255,.16) 30%, rgba(255,255,255,0) 50%),
    linear-gradient(145deg, rgba(255,226,84,.98), rgba(255,142,31,.95) 54%, rgba(235,59,139,.95));
  border: 2px solid rgba(255,255,255,.68);
  box-shadow: 0 10px 22px rgba(0,0,0,.30), inset 0 3px 0 rgba(255,255,255,.42), inset 0 -5px 0 rgba(94,20,92,.20);
}
.mini-boost-btn:active { transform: translateY(2px) scale(.95); }

/* v10 Berry Blast route/audio/power-up polish */
.boost-hud strong {
  min-width: 3.2em;
  display: inline-block;
  text-align: right;
}
.mini-boost-btn.cooling {
  filter: grayscale(.25) brightness(.82);
  opacity: .78;
}
.mini-boost-btn.charged {
  animation: boostReadyPulse .78s ease-in-out infinite alternate;
  box-shadow:
    0 0 0 4px rgba(255,255,255,.22),
    0 0 24px rgba(255,213,92,.88),
    0 0 42px rgba(255,67,189,.58),
    0 10px 22px rgba(0,0,0,.30),
    inset 0 3px 0 rgba(255,255,255,.48),
    inset 0 -5px 0 rgba(94,20,92,.22);
}
.mini-boost-btn.charged::after {
  content: 'READY';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #4b0879;
  font: 900 9px/1 Fredoka, sans-serif;
  letter-spacing: .08em;
  box-shadow: 0 7px 16px rgba(0,0,0,.22);
}
@keyframes boostReadyPulse {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-2px) scale(1.08); }
}
.mini-boost-btn { position: relative; }

/* v11 character select + clearer Berry Boost / Magnet feedback */
.character-select-screen {
  background:
    radial-gradient(circle at 50% 34%, rgba(255,213,92,.24), transparent 28%),
    radial-gradient(circle at 22% 24%, rgba(255,67,189,.28), transparent 28%),
    radial-gradient(circle at 80% 76%, rgba(57,229,255,.18), transparent 30%),
    linear-gradient(135deg, #240051, #7b2cff 48%, #160029);
}
.character-select-stage {
  position:absolute;
  inset:70px 18px 18px;
  display:grid;
  grid-template-columns: .9fr 1.45fr;
  grid-template-rows:auto 1fr;
  gap:16px;
  align-items:center;
}
.character-select-copy {
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:24px;
}
.character-select-copy h1 { margin:.1em 0; font-size:clamp(30px, 5vw, 54px); line-height:.95; }
.character-card-wrap {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  align-self:stretch;
}
.character-card {
  border:3px solid rgba(255,255,255,.32);
  border-radius:30px;
  background:rgba(255,255,255,.15);
  color:white;
  box-shadow:0 18px 44px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.28);
  display:grid;
  grid-template-rows:minmax(120px, 1fr) auto auto auto;
  place-items:center;
  text-align:center;
  padding:14px;
  gap:5px;
  font-family:Fredoka, sans-serif;
  touch-action:manipulation;
  overflow:hidden;
}
.character-card img {
  max-width:72%;
  max-height:190px;
  object-fit:contain;
  filter:drop-shadow(0 12px 18px rgba(0,0,0,.35));
}
.character-card strong { font-size:clamp(22px,3.1vw,34px); }
.character-card span { color:#fff4a3; font-weight:900; font-size:clamp(14px,1.9vw,22px); }
.character-card small { color:rgba(255,255,255,.82); font-size:clamp(11px,1.5vw,15px); max-width:24ch; }
.character-card.selected {
  border-color:#ffd55c;
  background:rgba(255,213,92,.18);
  box-shadow:0 0 0 5px rgba(255,213,92,.20), 0 22px 50px rgba(0,0,0,.32), 0 0 36px rgba(255,67,189,.28);
}
.character-card:active { transform:translateY(2px) scale(.985); }
.character-start-btn { grid-column:1 / -1; justify-self:center; min-width:min(420px, 62vw); }

@media (max-height: 520px) {
  .character-select-stage { inset:58px 14px 12px; grid-template-columns:.8fr 1.6fr; gap:10px; }
  .character-select-copy { padding:16px; }
  .character-card { border-radius:24px; padding:10px; }
  .character-card img { max-height:132px; max-width:66%; }
  .character-card small { display:none; }
  .character-start-btn { min-height:48px; padding:10px 18px; }
}

.mini-boost-btn.charged {
  filter:none;
  opacity:1;
  animation: boostReadyPulse .48s ease-in-out infinite alternate, boostTapFlash 1.05s ease-in-out infinite;
}
.mini-boost-btn.charged::before {
  content:'TAP';
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  color:#4b0879;
  font:900 10px/1 Fredoka, sans-serif;
  letter-spacing:.06em;
  text-shadow:0 1px 0 rgba(255,255,255,.62);
}
.mini-boost-btn.charged { color:transparent; }
.mini-boost-btn:not(.charged) { color:#fff8d8; }
@keyframes boostTapFlash {
  0%,100% { outline:0 solid rgba(255,213,92,0); }
  45% { outline:8px solid rgba(255,213,92,.34); }
}
