/* Dr. Mow — toy-ink HUD (template docs/06 §1) brightened toward Super Monkey
   Ball / Super Mario 3D World: cream pills with thick ink borders and hard
   shadows over a sky-blue world. Reserved colours: red = danger, green = good /
   mowed, yellow/gold = reward and the primary action. */
:root {
  --ink: #3b2e5a;
  --edge: var(--ink);        /* outlines: ink in light mode, yellow in dark */
  --edge-shadow: var(--ink); /* the hard drop under buttons and cards */
  --cream: #fffdf8;
  --cream-a: #fffdf8ee;
  --well: #efe9f7;   /* bar / meter troughs */
  --tile: #e8f7ff;   /* level tiles */
  --muted: #d6d0e2;  /* disabled */
  --sky: #5ec8ff;
  --page: #55c98a;   /* the browser page around the game: the lawn's own grass green (THEMES sky.grass → base); index.html theme-color
                       matches the top; Settings › Page colour overrides both (main.js applyPageColor) */
  --page-low: #40b07a;
  --sky-deep: #2f8fd8;
  --red: #ee4b5e;
  --green: #3ddc84;
  --grass: #5cc85a;
  --yellow: #ffd45e;
  --gold: #ffc53a;
  --orange: #ff8a2a;
  --purple: #6e5ac8;
  --safe-top: max(10px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--page) linear-gradient(var(--page), var(--page-low)) fixed;
  font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif; color: var(--ink);
}
canvas { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; }
#game { touch-action: none; }
#overlay { pointer-events: none; }
.hidden { display: none !important; }
button { font: inherit; color: var(--ink); cursor: pointer; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
  padding: var(--safe-top) max(10px, env(safe-area-inset-right)) var(--safe-bottom) max(10px, env(safe-area-inset-left)); }
.hud-top { display: flex; align-items: center; gap: 8px; }
.pill {
  flex: none; background: var(--cream-a); border: 3px solid var(--edge); border-radius: 999px; padding: 3px 12px;
  font-weight: 900; font-size: 18px; display: flex; flex-direction: column; align-items: center; line-height: 1;
  box-shadow: 0 4px 0 var(--edge-shadow); font-variant-numeric: tabular-nums; min-width: 78px;
}
.pill .lbl, .mow .lbl { font-size: 10px; letter-spacing: 1.5px; opacity: .7; font-weight: 800; }
.pill .val { margin-top: 2px; }
.pill.over .val { color: #d4453a; }

/* The mowing meter: the game's one essential number, top centre. */
.mow {
  flex: 1 1 auto; min-width: 0; max-width: 420px; margin: 0 auto; position: relative;
  background: var(--cream-a); border: 3px solid var(--edge); border-radius: 16px; padding: 4px 44px 6px 10px;
  box-shadow: 0 4px 0 var(--edge-shadow);
}
.mow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.mow-head .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mow-head b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.mow-bar { position: relative; height: 12px; margin-top: 3px; border: 2px solid var(--edge); border-radius: 8px;
  background: repeating-linear-gradient(90deg, #3f9a45 0 6px, #368a3c 6px 12px); overflow: hidden; }
#mow-fill { position: absolute; top: 0; right: auto; bottom: 0; left: 0; width: 0; transition: width .12s linear;
  background: repeating-linear-gradient(90deg, #aee07a 0 10px, #86c95c 10px 20px); border-right: 2px solid var(--edge); }
.mow-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: #3b2e5a55; }
.side-bars { display: flex; gap: 3px; margin-top: 3px; }
.side-bars span { position: relative; flex: 1; height: 7px; border: 2px solid var(--edge); border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(90deg, #9fb23a 0 6px, #93a634 6px 12px); }
.side-bars i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; transition: width .12s linear; background: repeating-linear-gradient(90deg, #f0f5a0 0 10px, #dcec8c 10px 20px); }
.side-bars span.full i { background: linear-gradient(90deg, #ffe07a, var(--gold)); }
.hud-letters { display: flex; gap: 3px; margin-top: 3px; justify-content: center; }
.hud-letters span { font-weight: 900; font-size: 11px; line-height: 14px; width: 15px; text-align: center; border-radius: 4px; color: var(--edge); opacity: .4; box-shadow: inset 0 0 0 1.5px var(--edge); }
.hud-letters span.on { opacity: 1; color: #fff; background: #ff8a2a; box-shadow: 0 0 0 2px var(--edge); }
.hud-letters span.on:nth-child(n+3) { background: #4fbf3c; }
.letter-chips { display: inline-flex; gap: 3px; }
.letter-chips i { font-style: normal; font-weight: 900; font-size: 13px; line-height: 18px; width: 17px; text-align: center; border-radius: 5px; border: 2px solid var(--edge); opacity: .35; }
.letter-chips i.had { opacity: .7; border-style: dashed; }
.letter-chips i.on { opacity: 1; color: #fff; background: #ff8a2a; }
.letter-chips i.on:nth-child(n+3) { background: #4fbf3c; }
.res-letters { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; }
.res-letters.all small { color: var(--gold); font-weight: 900; }
.res-letters .letter-chips i { font-size: 16px; line-height: 22px; width: 22px; }
.mow.full { background: #fff4c7; }
.mow.full #mow-fill { background: linear-gradient(90deg, #ffe07a, var(--gold)); }
.mow.pop { animation: pop .35s ease-out; }
.mow .can { position: absolute; right: 6px; top: 50%; width: 30px; height: 33px; transform: translateY(-50%); }

.can { --can-fill: #d9d3e8; --can-ink: var(--ink); --can-x: #b9b1cf; }
.can.gold { --can-fill: var(--gold); --can-x: #fff0a8; }
.can.gold { filter: drop-shadow(0 0 6px #ffd24aaa); animation: pop .5s ease-out; }

.mini {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--edge);
  background: var(--cream); font-weight: 900; font-size: 16px; box-shadow: 0 3px 0 var(--edge-shadow);
  pointer-events: auto; touch-action: manipulation;
}
.mini:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge-shadow); }

.hud-sub { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.chip { background: var(--ink); color: var(--cream); font-weight: 900; font-size: 12px; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 10px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lives { display: flex; gap: 4px; }
.life { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--edge); background: var(--orange);
  box-shadow: inset -3px -3px 0 #e0661a; }
.life.lost { background: #cfc8dd; box-shadow: none; opacity: .6; }
.life.pop { animation: lose .5s ease-out; }
.life.bonus { background: #ff3b5c; }
.life.gain { animation: gain .6s ease-out; }
@keyframes gain { 0% { transform: scale(.2); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
.lives.last .life:not(.lost) { animation: pulse .45s infinite alternate; }
/* Shaken after a hit (sim.js hurt): the heart the next hit would cost shows a crack and throbs red; dimmed (still cracked,
   no throb) while the hit's immunity lasts */
.life.risk { position: relative; background-image: linear-gradient(118deg, transparent 40%, var(--edge) 41% 47%, transparent 48%), linear-gradient(62deg, transparent 52%, var(--edge) 53% 58%, transparent 59%);
  animation: risk .42s ease-in-out infinite alternate; }
.lives.last .life.risk { animation: risk .3s ease-in-out infinite alternate; }
.life.risk.dim { animation: none; box-shadow: inset -3px -3px 0 #e0661a, 0 0 0 2px #ff3b5c80; }
@keyframes risk { from { transform: scale(1); box-shadow: inset -3px -3px 0 #e0661a, 0 0 0 0 #ff3b5c; } to { transform: scale(1.25); box-shadow: inset -3px -3px 0 #e0661a, 0 0 9px 4px #ff3b5c; } }
/* Angel wings held (sim.js wingsSave): a small white wing by the lives, glowing softly till a miss spends it */
.hud-wings { margin-left: auto; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.hud-wings svg { width: 28px; height: 28px; fill: #fff; stroke: var(--edge); stroke-width: 16px; stroke-linejoin: round; animation: wingGlow 1.2s ease-in-out infinite alternate; }
.hud-wings.gain svg { animation: gain .6s ease-out, wingGlow 1.2s .6s ease-in-out infinite alternate; }
@keyframes wingGlow { from { filter: drop-shadow(0 0 1px #bfe6ff); transform: rotate(-4deg); } to { filter: drop-shadow(0 0 6px #bfe6ff); transform: rotate(6deg); } }

/* In-game popups: arcade callouts that ride with the farmer, a small HUD round the character. Bare outlined
   letters in a chunky display face (no boxes or banners). #pops is moved to his head's screen point every frame
   (placePops in main.js): the mowing milestones stamp just above his head, with the big moments and then the
   other callouts stacked above those. Outlines are stacked text-shadows, so they work on every browser the legacy
   bundle reaches. */
@font-face { font-family: 'Luckiest Guy'; src: url('../assets/fonts/LuckiestGuy.ttf') format('truetype'); font-display: swap; } /* Apache 2.0, bundled */
#hud { --pop-font: 'Luckiest Guy', 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif; --pop-ol: #2a1f45; --pop-o: 2px; --pop-x: 4px; }
#pops { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
#pops .pops-up { position: absolute; left: 0; bottom: 12px; width: min(92vw, 520px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
#mow-pops { display: flex; flex-direction: column; align-items: center; }
#toasts br { display: none; } #toasts, #big-pops { display: flex; flex-direction: column; align-items: center; }
.toast {
  --o: var(--pop-o); --mo: calc(var(--o) * -1); --ol: var(--pop-ol); --x: var(--pop-x);
  position: relative; display: inline-block; margin: 0 6px; max-width: 100%; white-space: normal; text-wrap: balance;
  font-family: var(--pop-font); font-weight: 400; font-size: 23px; line-height: 1.08; letter-spacing: 1px; color: #fff4c2; text-transform: uppercase;
  text-shadow: var(--o) 0 var(--ol), var(--mo) 0 var(--ol), 0 var(--o) var(--ol), 0 var(--mo) var(--ol),
    var(--o) var(--o) var(--ol), var(--mo) var(--o) var(--ol), var(--o) var(--mo) var(--ol), var(--mo) var(--mo) var(--ol),
    0 var(--x) 0 var(--ol), var(--o) var(--x) 0 var(--ol), var(--mo) var(--x) 0 var(--ol), 0 calc(var(--x) + 4px) 8px #0006;
  transform-origin: 50% 80%; animation: pop-in 1.6s ease-out forwards;
}
.toast .ic { filter: drop-shadow(2px 0 0 var(--ol)) drop-shadow(-2px 0 0 var(--ol)) drop-shadow(0 2px 0 var(--ol)) drop-shadow(0 -2px 0 var(--ol)) drop-shadow(0 4px 0 var(--ol)); vertical-align: -.12em; }
.toast small { display: block; margin-top: 2px; text-transform: none; font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .3px; color: #fff;
  text-shadow: 0 0 2px var(--ol), 0 0 3px var(--ol), 0 0 4px var(--ol), 0 2px 2px var(--ol); }
.toast.good { color: #fff06a; }
.toast.tip { font-size: 17px; letter-spacing: .5px; max-width: min(92vw, 460px); } /* tutorial tips (level.tips): longer lines, a size smaller */
.toast.bad { color: #ff6b78; animation-name: pop-bad; }
.toast.gold { color: #ffd23a; --ol: #4a2200; }
.toast:nth-of-type(even) { rotate: 2deg; } .toast:nth-of-type(odd) { rotate: -2deg; }
/* the big moments (GO!, READY?, MEGA MOW!, GOAL!, boss KOs): bigger, closest to his head */
.toast.big { font-size: clamp(30px, 8.5vw, 44px); letter-spacing: 1.5px; rotate: -3deg; --o: 3px; --x: 5px; margin: 2px 0; animation-name: pop-slam; }
.toast.big.good { color: #8dff5a; }
.toast.big.gold { color: #ffd23a; }
/* EXIT IS OPEN! (the flag's out at 50%): a slick heads-up by his head instead of a cutaway. Mint, slanted, it
   whips in from the left with a shine sweeping across, holds level (no wobble), then slips off upward. */
.toast.exit { font-size: clamp(26px, 7vw, 36px); letter-spacing: 2px; --ol: #0c3a2c; rotate: 0deg; font-style: italic;
  margin: 2px 0; padding: 0 .3em; white-space: nowrap; max-width: none; text-shadow: none; color: transparent; -webkit-text-fill-color: transparent;
  background: linear-gradient(105deg, #7dffc8 0 40%, #fff 50%, #7dffc8 60% 100%) no-repeat; background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(3px 0 0 var(--ol)) drop-shadow(-3px 0 0 var(--ol)) drop-shadow(0 3px 0 var(--ol)) drop-shadow(0 -3px 0 var(--ol)) drop-shadow(0 5px 0 var(--ol)) drop-shadow(0 8px 6px #0006);
  animation: pop-exit 2.8s cubic-bezier(.2, .9, .25, 1) forwards, exit-shine 2.8s ease-out forwards; }
.toast.exit .ic { filter: none; fill: #7dffc8; color: #7dffc8; -webkit-text-fill-color: #7dffc8; }
@keyframes pop-exit { 0% { transform: translateX(-60px) skewX(-18deg); opacity: 0; letter-spacing: 10px } 10% { transform: translateX(6px) skewX(-6deg); opacity: 1; letter-spacing: 1px }
  16% { transform: none; letter-spacing: 2px } 82% { opacity: 1; transform: none } 100% { transform: translateY(-22px); opacity: 0 } }
@keyframes exit-shine { 0%, 12% { background-position: 100% 0 } 45%, 100% { background-position: 0% 0 } } /* (kept within 0–100%: past that the no-repeat gradient leaves the text bare and it vanishes) */
/* GET SET… while he floats in place after the Golden Gas Can cutaway (main.js cutawayScale) */
.toast.ready { font-size: 24px; color: #fff; rotate: 0deg; letter-spacing: 3px; animation-name: pop-ready; }
@keyframes pop-ready { 0% { transform: scale(.6); opacity: 0 } 15% { transform: scale(1.05); opacity: 1 } 25% { transform: none } 85% { opacity: 1 } 100% { opacity: 0; transform: scale(1.3) } }
/* the level card */
.toast.title { font-size: 26px; color: #fff; rotate: 0deg; margin-bottom: 6px; }
/* the mowing milestones, stamped under the mower */
.toast.meter { font-size: 21px; color: #b6ff6a; rotate: 0deg; white-space: nowrap; max-width: none; --o: 3px; --x: 4px; animation-name: pop-stamp; }
@keyframes pop-in { 0% { transform: scale(2.4); opacity: 0 } 9% { transform: scale(.88); opacity: 1 } 16% { transform: scale(1.06) }
  22% { transform: scale(1) } 78% { opacity: 1; transform: none } 100% { transform: translateY(-26px) scale(.9); opacity: 0 } }
@keyframes pop-bad { 0% { transform: scale(2.2); opacity: 0 } 8% { transform: scale(1); opacity: 1 } 11% { transform: translateX(-9px) }
  14% { transform: translateX(8px) } 17% { transform: translateX(-6px) } 20% { transform: translateX(4px) } 23% { transform: none }
  80% { opacity: 1 } 100% { transform: translateY(16px); opacity: 0 } }
@keyframes pop-slam { 0% { transform: scale(3.2); opacity: 0 } 10% { transform: scale(.9); opacity: 1 } 15% { transform: scale(1.08) }
  20% { transform: scale(1) } 82% { opacity: 1; transform: scale(1) } 100% { transform: scale(1.5); opacity: 0 } }
@keyframes pop-stamp { 0% { transform: translateY(-34px) scale(1.8); opacity: 0 } 12% { transform: translateY(0) scale(.92); opacity: 1 }
  20% { transform: scale(1.04) } 26% { transform: none } 80% { opacity: 1 } 100% { transform: translateY(10px); opacity: 0 } }
  20% { transform: scale(1) } 80% { opacity: 1 } 100% { transform: translateY(-30px); opacity: 0 } }
@keyframes pop { 0% { transform: scale(1) } 40% { transform: scale(1.12) } 100% { transform: scale(1) } }
.mow .can.gold { animation: canpop .6s ease-out; }
@keyframes canpop { 0% { transform: translateY(-50%) scale(.5) } 50% { transform: translateY(-50%) scale(1.5) } 100% { transform: translateY(-50%) scale(1) } }
@keyframes pulse { to { transform: scale(1.15); } }
@keyframes lose { 0% { transform: scale(1.6); background: var(--red); } 100% { transform: scale(1); } }

/* Achievements: a trophy card that slides in at the top left, under the level chip, out of the callouts' way. */
#ach-toasts { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--safe-top) + 92px); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ach-toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; border: 3px solid var(--gold);
  border-radius: 12px 22px 22px 12px; padding: 5px 16px 6px 8px; box-shadow: 0 4px 0 #0005; animation: achin 3.2s ease-out forwards; max-width: 78vw; }
.ach-toast .ico { font-size: 24px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--ink); flex: none; }
.ach-toast small { display: block; font-family: var(--pop-font); font-size: 12px; letter-spacing: 1.5px; color: var(--gold); }
.ach-toast b { display: block; text-transform: uppercase; font-family: var(--pop-font); font-weight: 400; font-size: 18px; letter-spacing: .5px; line-height: 1.1; }
@keyframes achin { 0% { transform: translateX(-110%); opacity: 0 } 8% { transform: translateX(6px); opacity: 1 } 12% { transform: none } 88% { opacity: 1; transform: none } 100% { transform: translateX(-110%); opacity: 0 } }

.hop-hint { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: calc(var(--safe-bottom) + 30px);
  width: 86px; height: 86px; border-radius: 50%; border: 3px dashed #3b2e5a55; display: grid; place-items: center;
  text-align: center; font-weight: 900; font-size: 12px; color: #3b2e5a88; line-height: 1.1; transition: opacity .4s; }
.hop-hint.flash { background: var(--cream)66; }
@media (pointer: fine) { .hop-hint { display: none; } }

/* Chase-mode JUMP button: big, right thumb, acts on pointerdown (input.bindJump). */
.jump-btn { position: absolute; left: 50%; translate: -50% 0; bottom: calc(var(--safe-bottom) + 18px);
  /* bottom-centre and wide: either thumb reaches it without leaving its steering half */
  width: min(56vw, 300px); height: 92px; border-radius: 46px; border: 4px solid var(--edge); background: var(--yellow);
  font: inherit; font-weight: 900; font-size: 20px; letter-spacing: 1px; color: var(--ink);
  box-shadow: 0 6px 0 var(--edge-shadow); pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.jump-btn.down { transform: translateY(4px) scale(.96); box-shadow: 0 2px 0 var(--edge-shadow); }
@media (pointer: fine) { .jump-btn { width: 200px; height: 64px; font-size: 16px; opacity: .85; } }
.mini.cam { font-size: 18px; }
.mini.cam.chase { background: var(--yellow); }

/* Settings: segmented toggles */
.setting { text-align: left; margin: 12px 0; }
.setting > b { display: block; font-size: 14px; margin-bottom: 6px; }
.seg { display: flex; border: 3px solid var(--edge); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 0 var(--edge-shadow); }
.seg button { flex: 1; border: none; background: var(--cream); padding: 9px 6px; font-weight: 900; font-size: 14px; touch-action: manipulation; }
.seg button + button { border-left: 3px solid var(--edge); }
.seg button.on { background: var(--yellow); }
.setting p { margin: 6px 2px 0; font-size: 12.5px; line-height: 1.35; opacity: .85; }

/* ---------------------------------------------------------------- screens */
.screen {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: safe center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #dff6ff55, #2f8fd8aa); padding: calc(var(--safe-top) + 6px) 14px calc(var(--safe-bottom) + 6px);
  overflow-y: auto;
}
.screen.clear { background: transparent; }
.card {
  background: var(--cream); border: 4px solid var(--edge); border-radius: 24px; box-shadow: 0 8px 0 var(--edge-shadow);
  padding: 20px 20px 16px; max-width: 420px; width: 100%; text-align: center; margin: auto 0; animation: cardin .25s ease-out;
}
.card.wide { max-width: 640px; }
@keyframes cardin { from { transform: scale(.9); opacity: 0 } }
.card h1 { margin: 0; font-size: 34px; line-height: 1; color: var(--sky-deep); letter-spacing: 1px; }
.card h2 { margin: 0 0 8px; font-size: 26px; color: var(--purple); }
.card .tag { font-weight: 700; margin: 8px 0; }
.card .how { text-align: left; padding-left: 18px; margin: 8px 0 14px; font-size: 13.5px; line-height: 1.45; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.btn {
  font-weight: 900; font-size: 20px; padding: 10px 22px; border-radius: 16px; border: 3px solid var(--edge);
  background: var(--yellow); box-shadow: 0 5px 0 var(--edge-shadow); touch-action: manipulation;
}
.btn.alt { background: var(--cream); font-size: 17px; }
.btn.small { font-size: 14px; padding: 6px 12px; box-shadow: 0 3px 0 var(--edge-shadow); border-radius: 12px; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge-shadow); }
.small { font-size: 13px; opacity: .8; }

/* Wordmark */
.logo { font-size: 60px; font-weight: 900; line-height: .9; margin: 4px 0 2px; letter-spacing: 1px;
  color: var(--orange); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.logo span { color: var(--grass); }
.logo-sub { font-weight: 900; font-size: 14px; letter-spacing: 4px; color: var(--sky-deep); text-transform: uppercase; }

/* Level select */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.lvl { position: relative; border: 3px solid var(--edge); border-radius: 14px; background: var(--tile); padding: 8px 4px 6px;
  box-shadow: 0 4px 0 var(--edge-shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 92px; touch-action: manipulation; }
.lvl:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--edge-shadow); }
.lvl .n { font-size: 24px; font-weight: 900; line-height: 1; }
.lvl .nm { font-size: 10px; font-weight: 800; line-height: 1.1; min-height: 22px; }
.lvl .rk { font-size: 15px; font-weight: 900; }
.lvl .can { width: 18px; height: 20px; }
.lvl .meta { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.lvl:disabled { background: var(--muted); opacity: .75; }
.lvl:disabled .n::after { content: ''; display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: 1px; background: currentColor; /* Phosphor lock (see js/icons.js) */
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpath%20d%3D%22M208%2C76H180V56A52%2C52%2C0%2C0%2C0%2C76%2C56V76H48A20%2C20%2C0%2C0%2C0%2C28%2C96V208a20%2C20%2C0%2C0%2C0%2C20%2C20H208a20%2C20%2C0%2C0%2C0%2C20-20V96A20%2C20%2C0%2C0%2C0%2C208%2C76ZM100%2C56a28%2C28%2C0%2C0%2C1%2C56%2C0V76H100ZM204%2C204H52V100H204Zm-60-52a16%2C16%2C0%2C1%2C1-16-16A16%2C16%2C0%2C0%2C1%2C144%2C152Z%22/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpath%20d%3D%22M208%2C76H180V56A52%2C52%2C0%2C0%2C0%2C76%2C56V76H48A20%2C20%2C0%2C0%2C0%2C28%2C96V208a20%2C20%2C0%2C0%2C0%2C20%2C20H208a20%2C20%2C0%2C0%2C0%2C20-20V96A20%2C20%2C0%2C0%2C0%2C208%2C76ZM100%2C56a28%2C28%2C0%2C0%2C1%2C56%2C0V76H100ZM204%2C204H52V100H204Zm-60-52a16%2C16%2C0%2C1%2C1-16-16A16%2C16%2C0%2C0%2C1%2C144%2C152Z%22/%3E%3C/svg%3E") center / contain no-repeat; }
.rank-S { color: #e0a100; } .rank-A { color: #2f9e62; } .rank-B { color: var(--sky-deep); } .rank-C { color: var(--purple); } .rank-D { color: #8a7fa3; }

/* Results */
.rank-big { font-size: 96px; font-weight: 900; line-height: .9; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink); animation: rankin .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes rankin { from { transform: scale(2.4) rotate(-12deg); opacity: 0 } }
.rows { margin: 10px 0 6px; text-align: left; font-weight: 800; }
.rows div { display: flex; justify-content: space-between; padding: 5px 4px; border-bottom: 2px dashed #3b2e5a22; font-variant-numeric: tabular-nums; }
.rows div span:last-child { color: var(--purple); }
.rows .total { font-size: 20px; border-bottom: none; }
.gold-award { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; font-weight: 900;
  background: linear-gradient(#fff8d6, #ffe38a); border: 3px solid var(--edge); border-radius: 14px; padding: 6px 10px; }
.gold-award .can { width: 34px; height: 38px; }
.gold-award.miss { background: #efeaf6; font-weight: 700; font-size: 13px; }

/* Achievements */
.ach-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; text-align: left; }
.ach { display: flex; gap: 8px; align-items: center; border: 3px solid var(--edge); border-radius: 12px; padding: 6px 8px; background: #fff8e0; }
.ach .ico { font-size: 22px; }
.ach b { display: block; font-size: 13px; }
.ach span { font-size: 11px; line-height: 1.2; display: block; }
.ach .ach-pct { display: block; font-size: 11px; font-weight: 700; margin-top: 2px; }
.ach.locked { background: #ece8f3; opacity: .7; }
.ach.locked .ico { filter: grayscale(1); opacity: .5; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ach-list { grid-template-columns: 1fr; }
}
@media (max-height: 640px) {
  .card { padding: 12px 14px 10px; }
  .logo { font-size: 44px; }
  .card .how { font-size: 12px; line-height: 1.35; margin: 6px 0 8px; }
  .rank-big { font-size: 64px; }
  .lvl { min-height: 76px; padding: 4px; }
}
@media (max-width: 380px) {
  .pill { min-width: 64px; font-size: 15px; padding: 3px 8px; }
  .mow { padding-right: 38px; }
  .mow .can { width: 24px; height: 27px; }
}
.zoom-hint { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--cream); border: 3px solid var(--edge); border-radius: 12px; padding: 6px 12px; font-weight: 800; }
.tzg-zoomed .zoom-hint { display: block; }

/* Retro (PS1/N64) mode: the 3D canvas renders at ~240 lines; upscale with hard pixels. */
#game.retro { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------------------------------------------------------------- style meter + moé popups */
.style-meter { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(var(--safe-top) + 92px);
  background: var(--cream-a); border: 3px solid var(--edge); border-radius: 12px; padding: 3px 8px 5px; box-shadow: 0 3px 0 var(--edge-shadow);
  display: grid; grid-template-columns: auto auto; gap: 0 6px; align-items: baseline; min-width: 92px; }
.style-meter .lbl { font-size: 10px; letter-spacing: 1.5px; font-weight: 900; opacity: .7; }
.style-meter b { font-size: 16px; font-weight: 900; color: #e08a00; justify-self: end; font-variant-numeric: tabular-nums; }
.style-bar { grid-column: 1 / 3; height: 8px; border: 2px solid var(--edge); border-radius: 6px; overflow: hidden; background: var(--well); }
.style-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd45e, #ff8a2a, #ff5fa2); transition: width .15s linear; }
.style-meter.hot { animation: pulse .4s infinite alternate; }

.version { font-size: 11px; opacity: .6; margin-top: 8px; }

/* "Almost there" chip for trick achievements (shown past 50%) */
.ach-near { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(var(--safe-top) + 146px);
  background: #fff8e0f0; border: 2px solid var(--edge); border-radius: 10px; padding: 3px 7px 4px; font-size: 11px; font-weight: 800;
  box-shadow: 0 2px 0 var(--edge-shadow); max-width: 170px; font-variant-numeric: tabular-nums; }
.ach-near .bar { height: 5px; margin-top: 3px; border-radius: 4px; background: #e8dfc4; overflow: hidden; }
.ach-near .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd45e, #ff8a2a); }
.ach-near.close { animation: pulse .5s infinite alternate; }

/* ---------------------------------------------------------------- level editor (js/editor.js)
   Transparent over the live game scene: a top bar, a stage that takes the orbit / pick gestures, an info line
   and a thumb bar that changes with the selection. Menus are .modal sheets (the controller navigates them). */
.ws { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; flex-direction: column; pointer-events: none;
  padding: var(--safe-top) max(8px, env(safe-area-inset-right)) var(--safe-bottom) max(8px, env(safe-area-inset-left)); }
.ws > * { pointer-events: auto; }
.ws-top { flex: none; display: flex; gap: 6px; align-items: center; }
.ws-name { flex: 1; min-width: 0; font: inherit; font-weight: 900; font-size: 16px; padding: 7px 10px; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); color: var(--ink); }
.ws-stage { flex: 1 1 auto; min-height: 0; touch-action: none; }
.ws-info { flex: none; align-self: center; max-width: 100%; text-align: center; font-size: 12px; font-weight: 800; background: var(--cream-a); border: 2px solid var(--edge);
  border-radius: 999px; padding: 3px 12px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-bar { flex: none; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.ws-bar button { flex: 0 1 64px; min-width: 52px; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); font-weight: 800; font-size: 10px; padding: 4px 2px 3px;
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 var(--edge-shadow); touch-action: manipulation; }
.ws-bar button span { font-size: 20px; line-height: 1.15; }
.ws-bar button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge-shadow); }
.ws-bar button[data-ws=edit] { background: var(--yellow); }
/* editor menus: a side panel (bottom sheet on phones) over the live level, so every change shows as you make it */
.modal.ws-modal { background: transparent; pointer-events: none; align-items: stretch; justify-content: flex-end; padding: calc(var(--safe-top) + 58px) max(8px, env(safe-area-inset-right)) calc(var(--safe-bottom) + 4px) 8px; overflow: hidden; }
.ws-modal .ws-sheet { pointer-events: auto; }
.ws-sheet { width: min(96vw, 420px); max-height: 100%; display: flex; flex-direction: column; padding: 10px 12px 12px; text-align: left; }
@media (max-width: 760px) { .modal.ws-modal { align-items: flex-end; justify-content: center; padding-top: 30vh; } .ws-sheet, .ws-sheet.wide { width: 100%; max-height: 100%; } }
.ws-sheet.wide { width: min(96vw, 520px); }
.ws-sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-sheet-head h2 { margin: 0; font-size: 22px; }
.ws-sheet-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding: 2px 2px 4px; }
.ws-sheet section { border-top: 2px dashed var(--muted); padding: 8px 0 4px; }
.ws-sheet h3 { margin: 0 0 6px; font-size: 14px; color: var(--purple); }
.ws-sheet h4 { margin: 8px 0 4px; font-size: 12px; }
.ws-sheet .small { margin: 6px 2px 0; font-size: 12px; }
.ws-num { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.ws-num > span { flex: 1; font-size: 13px; font-weight: 800; }
.ws-num button { min-width: 40px; height: 36px; border: 3px solid var(--edge); border-radius: 10px; background: var(--cream); font-weight: 900; font-size: 18px; box-shadow: 0 2px 0 var(--edge-shadow); touch-action: manipulation; }
.ws-num .ws-val { min-width: 92px; font-size: 14px; background: var(--well); }
.ws-hex input[type=color] { width: 44px; height: 36px; border: 3px solid var(--edge); border-radius: 10px; padding: 0; background: none; }
.ws-hex input[type=text] { width: 92px; height: 30px; font: inherit; font-weight: 800; font-size: 14px; border: 3px solid var(--edge); border-radius: 10px; padding: 0 6px; background: var(--cream); color: var(--ink); }
.ws-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ws-chips button { border: 2px solid var(--edge); border-radius: 999px; background: var(--cream); font-weight: 800; font-size: 12.5px; padding: 5px 10px; touch-action: manipulation; }
.ws-chips button.on { background: var(--yellow); }
.ws-chips.ws-scroll { max-height: 150px; overflow-y: auto; padding: 2px; }
.ws-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; text-align: left; border: 2px solid var(--edge); border-radius: 12px; background: var(--cream); padding: 6px 8px; margin: 4px 0; font-weight: 800; font-size: 13px; }
.ws-toggle b { width: 22px; height: 22px; border: 2px solid var(--edge); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #fff; flex: none; }
.ws-toggle.on b { background: var(--green); }
.ws-toggle small { flex: 1 1 100%; font-weight: 600; opacity: .75; font-size: 11.5px; padding-left: 30px; }
.ws-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; margin: 6px 0; }
.ws-swatches button { display: flex; align-items: center; gap: 6px; border: 2px solid var(--edge); border-radius: 10px; background: var(--cream); padding: 4px 6px; font-weight: 800; font-size: 12px; text-align: left; }
.ws-swatches button.on { background: var(--yellow); }
.ws-swatches i { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--edge); flex: none; }
.ws-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; margin-top: 8px; }
.ws-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 3px solid var(--edge); border-radius: 12px; background: var(--tile); padding: 6px 4px; font-weight: 800; font-size: 12px; text-align: center; box-shadow: 0 3px 0 var(--edge-shadow); }
.ws-tile span { font-size: 26px; line-height: 1.1; }
.ws-tile img { width: 72px; height: 72px; object-fit: contain; image-rendering: auto; }
.ws-list .ws-row { display: flex; align-items: center; gap: 8px; }
.ws-list .ws-row img { width: 48px; height: 48px; flex: none; object-fit: contain; }
.ws-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.ws-list button { text-align: left; border: 2px solid var(--edge); border-radius: 10px; background: var(--cream); padding: 6px 10px; font-weight: 800; font-size: 13px; }
.ws-list small { display: block; font-weight: 600; opacity: .7; font-size: 11px; }
.ws-pad { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12.5px; }
.ws-code { width: 100%; min-height: 160px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
@media (max-width: 520px) { .ws-top { flex-wrap: wrap; } .ws-name { order: 10; flex: 1 1 100%; } .ws-bar button { flex-basis: 56px; min-width: 46px; } }
.lawn-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; text-align: left; max-height: 50vh; overflow-y: auto; }
.lawn-row { display: flex; align-items: center; gap: 6px; border: 3px solid var(--edge); border-radius: 12px; padding: 6px 8px; background: var(--tile); }
.lawn-row .btn { flex: none; padding: 4px 9px; font-size: 13px; box-shadow: 0 2px 0 var(--edge-shadow); }
.lawn-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lawn-info b, .lawn-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lawn-info small { font-size: 11px; font-weight: 700; opacity: .8; }
.lawn-info .num { display: inline-block; min-width: 18px; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--well); font-style: normal; font-size: 12px; text-align: center; }
.lawn-info .rk { font-weight: 900; }

/* My Lawns (js/main.js showLawns): built for lots of lawns and packs. Packs down the side (a scrolling row
   of tabs on a phone); the list scrolls inside the card so the search, tabs and bulk bar stay put. */
.card.lawns-card { position: relative; max-width: 980px; max-height: 100%; display: flex; flex-direction: column; text-align: left; }
.lawns-card > .close-x { position: absolute; top: 10px; right: 10px; margin: 0; }
.lawns-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-right: 50px; }
.lawns-head h2 { margin: 0; }
.lawns-head small { font-weight: 800; opacity: .75; }
.lawns-head .btn { margin-left: auto; }
.btns.lawns-actions { justify-content: flex-start; margin: 8px 0 10px; gap: 8px; }
.lawns-body { flex: 1; min-height: 0; display: flex; gap: 12px; }
.lawns-nav { flex: none; width: 220px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 2px 4px 6px 2px; }
.lawns-nav .tab { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; text-align: left; font-size: 13px; }
.lawns-nav .tab span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lawns-nav .tab small { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--well); font-size: 11px; }
.lawns-nav .tab.on small { background: #fff8; }
.lawns-nav .tab.add { justify-content: center; border-style: dashed; box-shadow: none; }
.lawns-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.lawns-main .lawn-list { flex: 1; min-height: 140px; max-height: none; margin: 8px 0 0; padding: 2px 4px 8px 2px; }
.lawns-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lawns-tools .btn.on { background: var(--yellow); }
body.dark .lawns-tools .btn.on { background: #6b5a1f; color: #fff4c7; }
.lawns-search { flex: 1 1 120px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); }
.lawns-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-weight: 800; font-size: 16px; padding: 6px 0; }
.seg.lawns-sort { flex: none; border-radius: 12px; box-shadow: 0 2px 0 var(--edge-shadow); }
.seg.lawns-sort button { padding: 6px 9px; font-size: 12px; }
.lawns-packbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; padding: 6px 8px; border: 3px dashed var(--edge-shadow); border-radius: 14px; }
.lawns-packbar b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.lawns-packbar small { font-size: 12px; font-weight: 700; opacity: .75; }
.lawns-packbar .btns { margin: 0; gap: 6px; }
.lawn-row.pick { width: 100%; font: inherit; color: var(--ink); text-align: left; cursor: pointer; touch-action: manipulation; }
.lawn-row.pick > .ic { flex: none; font-size: 22px; }
.lawn-row.pick.on { background: #fff1a8; }
.lawns-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 8px; border: 3px solid var(--edge); border-radius: 14px; background: var(--well); box-shadow: 0 3px 0 var(--edge-shadow); }
.lawns-bulk > b { margin-right: auto; }
.lawns-empty { padding: 14px 4px; }
@media (max-width: 760px) {
  .lawns-body { flex-direction: column; gap: 6px; }
  .lawns-nav { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 6px; }
  .lawns-nav .tab { flex: none; width: auto; max-width: 64vw; }
}
@media (max-width: 560px) { /* phones: the name gets the row (the meta line runs under the buttons), smaller buttons, icon-only bulk jobs */
  .card.lawns-card { padding: 14px 12px 10px; }
  .lawns-head h2 { font-size: 22px; }
  .lawns-head small { display: none; }
  .btns.lawns-actions { margin: 6px 0 8px; }
  .lawn-row:not(.pick) { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, auto); align-items: center; gap: 2px 5px; padding: 5px 6px 5px 8px; }
  .lawn-row:not(.pick) .lawn-info { display: contents; }
  .lawn-row:not(.pick) .lawn-info small { grid-column: 1 / -1; grid-row: 2; }
  .lawn-row .btn { padding: 4px 7px; }
  .lawns-packbar { padding: 5px 6px; }
  .lawns-packbar .btn.small { padding: 5px 8px; font-size: 13px; }
  .lawns-bulk { gap: 5px; padding: 6px; }
  .lawns-bulk .lbl { display: none; }
  .lawns-bulk .btn.small { padding: 6px 9px; }
}
@media (max-width: 400px) { .lawns-head .lbl { display: none; } }
@media (max-width: 760px) and (max-height: 700px), (max-height: 520px) { /* short screens: the whole card scrolls instead */
  .card.lawns-card { display: block; max-height: none; }
  .lawns-card > .close-x { position: sticky; float: right; top: 0; margin: -10px -10px 4px 8px; }
  .lawns-main .lawn-list { max-height: none; overflow: visible; }
  .lawns-bulk { position: sticky; bottom: 0; z-index: 2; }
}
/* the ⋯ sheet, Codes table and Enter codes (modals) */
.sheet-card { text-align: left; }
.sheet-card h2 { padding-right: 44px; overflow-wrap: anywhere; }
.sheet-card .setting > b { font-size: 13px; }
.code-box { margin: 8px 0; padding: 8px; border: 3px dashed var(--edge-shadow); border-radius: 14px; }
.code-box small { font-size: 11.5px; opacity: .8; }
.code-box .ws-code { min-height: 110px; margin-top: 6px; }
.sheet-card .ws-code { word-break: break-all; }
.ws-code.codes-out { min-height: 32vh; white-space: pre; overflow-wrap: normal; word-break: normal; overflow: auto; }
.codes-sum { margin: 10px 0 4px; }
.lawn-packs button.on { background: var(--yellow); }

.pack-name { width: 100%; font: inherit; font-weight: 900; font-size: 16px; padding: 8px 10px; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); color: var(--ink); margin-top: 6px; }
.btn:disabled { opacity: .45; }

/* Drop-in animated WebP reaction icons (see ICONS.md) anchored to the farmer's head */
.icon-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 5; }
.icon-react { position: absolute; width: 76px; height: 76px; translate: -50% -50%; animation: iconpop 1.3s ease-out forwards; }
.icon-react.big { width: 120px; height: 120px; }
@keyframes iconpop { 0% { scale: .3; opacity: 0 } 12% { scale: 1.2; opacity: 1 } 22% { scale: 1 } 85% { opacity: 1 } 100% { scale: .6; opacity: 0 } }

/* ---------------------------------------------------------------- slow-mo */
/* Round button on the right, above the hop zone; its ring is the meter (conic gradient on --m). */
.slow-btn { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: calc(var(--safe-bottom) + 150px);
  width: 92px; height: 92px; border-radius: 50%; border: 4px solid var(--edge); padding: 7px; box-shadow: 0 4px 0 var(--edge-shadow);
  /* ring = meter: blue to 100%, then a gold second lap for what's banked beyond (up to 200%) */
  background: conic-gradient(#ffc53a calc(var(--m2, 0) * 1turn), transparent 0), conic-gradient(#7cc8ff calc(var(--m, 0) * 1turn), #e9e4f2 0);
  pointer-events: auto; touch-action: none; font: inherit; user-select: none; -webkit-user-select: none; }
.slow-btn span { display: grid; place-items: center; align-content: center; width: 100%; height: 100%; border-radius: 50%; background: var(--cream); font-size: 30px; line-height: 1; }
.slow-btn small { font-size: 11px; font-weight: 900; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.slow-btn.empty { opacity: .45; }
.slow-btn.on { background: conic-gradient(#ffc53a calc(var(--m2, 0) * 1turn), transparent 0), conic-gradient(#ff5fa2 calc(var(--m, 0) * 1turn), #e9e4f2 0); transform: scale(1.08); }
.slow-btn.on span { background: #ffe9f4; }
.slow-vignette { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(ellipse at center, transparent 55%, #6b4bd566 100%); }
.slow-vignette.on { opacity: 1; }
.slow-vignette.god { background: radial-gradient(ellipse at center, transparent 50%, #12d45a55 85%, #04401cbb 100%); } /* Matrix God Mode (Settings › Cheats) */
body.chase .slow-btn { bottom: calc(var(--safe-bottom) + 124px); }
/* Joystick + chase cam on a tablet in landscape: the stick owns the left thumb, so JUMP sits right under
   slow-mo, flush with its right edge, where the right thumb already rests (bottom-centre was a long reach). */
@media (orientation: landscape) and (pointer: coarse) and (min-height: 500px) {
  body.stick-turn .jump-btn { left: auto; right: max(14px, env(safe-area-inset-right)); translate: none;
    bottom: calc(var(--safe-bottom) + 46px); width: 150px; height: 92px; }
}
/* One thumb (the phone-upright default with the isometric camera; Settings › Phone held upright): the button drops into the thumb's corner and grows; it is a tap toggle
   and a second stick (main.js). The thumb steers anywhere, so the TAP TO HOP corner hint goes. */
body.onehand .slow-btn { bottom: calc(var(--safe-bottom) + 22px); right: max(16px, env(safe-area-inset-right)); width: 104px; height: 104px; }
body.onehand .hop-hint { display: none; }

/* ---------------------------------------------------------------- gas gauge (bonus levels) */
.gas { display: flex; margin-top: 3px; align-items: center; gap: 4px; font-size: 13px; }
.gas-bar { flex: 1; height: 10px; border: 2px solid var(--edge); border-radius: 6px; overflow: hidden; background: var(--well); }
.gas-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff5a4d, #ffb03a); transition: width .1s linear; }
.gas.low .gas-bar i { background: #ff3b4d; animation: pulse .25s infinite alternate; }
.gas.plus { animation: pop .35s ease-out; }
#hud.has-gas .style-meter { top: calc(var(--safe-top) + 120px); }
#hud.has-gas .ach-near { top: calc(var(--safe-top) + 174px); }

/* Level-select pack tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin-top: 6px; scrollbar-width: none; }
.tab { flex: none; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); font: inherit; font-weight: 900; font-size: 12px; padding: 6px 10px; box-shadow: 0 3px 0 var(--edge-shadow); color: var(--ink); }
.tab.on { background: var(--yellow); }

/* Line rating (pro): heat map + breakdown on the results card */
.line-rate { cursor: pointer; display: flex; gap: 10px; align-items: center; margin: 8px 0 2px; text-align: left; }
.line-rate canvas { position: static; top: auto; right: auto; bottom: auto; left: auto; width: 116px; height: 116px; border: 3px solid var(--edge); border-radius: 10px; flex: none; image-rendering: auto; }
.line-info { flex: 1; font-size: 11px; }
.line-info b { font-size: 15px; } .line-info small { display: block; opacity: .6; margin-bottom: 3px; }
.lr-row { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 4px; margin: 2px 0; font-weight: 800; }
.lr-row i { height: 7px; border-radius: 4px; background: #e8dfc4; overflow: hidden; }
.lr-row em { display: block; height: 100%; background: linear-gradient(90deg, #7cc8ff, #ffd45e, #ff8a2a); }

/* Results peek: card slides away so the orbiting overview shows */
#screen.peek > * { opacity: 0; transform: translateY(40px); pointer-events: none; transition: opacity .25s, transform .25s; }
#screen.peek { background: transparent; }

/* Gold cinematic: letterbox bars slide in over everything */
body::before, body::after { content: ''; position: fixed; left: 0; right: 0; height: 0; background: #120d20; z-index: 40; pointer-events: none; transition: height .35s ease; }
body::before { top: 0; } body::after { bottom: 0; }
body.cine::before, body.cine::after { height: 12vh; }
body.cine #hud > :not(#pops), body.cine #overlay, body.cine .hop-hint { opacity: 0 !important; transition: opacity .2s; }
body.cine #pops { z-index: 41; }
/* A pack's opening cutscene (js/barnintro.js): the letterbox stays up, nothing under it takes a tap, a skip hint sits in the bottom bar */
body.intro #hud, body.intro #overlay, body.intro #screen { pointer-events: none; }
.skip-hint { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(6vh - .6em); z-index: 42; font-family: 'Luckiest Guy', 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif; font-size: 12px; letter-spacing: .14em; color: rgba(255, 228, 170, .8); opacity: 0; transition: opacity .5s; pointer-events: none; }
.skip-hint.on { opacity: 1; }
/* The pack's name in the top bar while an opening plays (js/packintros.js) */
.intro-cap { position: fixed; left: 0; right: 0; top: 0; height: 12vh; z-index: 42; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; text-align: center; pointer-events: none; opacity: 0; transform: translateY(-6px); transition: opacity .6s, transform .6s; color: #ffe4aa; }
.intro-cap.on { opacity: 1; transform: none; }
.intro-cap b { font-family: 'Luckiest Guy', 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif; font-weight: 400; font-size: clamp(16px, 4.4vh, 34px); letter-spacing: .1em; text-transform: uppercase; line-height: 1; text-shadow: 0 2px 0 #2a1f45; }
.intro-cap small { font-size: clamp(10px, 1.9vh, 14px); letter-spacing: .05em; opacity: .82; padding: 0 16px; }

/* Garage */
.garage { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.mower-card { border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); padding: 8px; text-align: left; font: inherit; color: var(--ink); box-shadow: 0 3px 0 var(--edge-shadow); display: flex; flex-direction: column; gap: 3px; }
.mower-card.on { background: var(--yellow); }
.mower-card:disabled { background: #e3dded; opacity: .8; }
.mower-card b { font-size: 13px; } .mower-card small { font-size: 10px; line-height: 1.2; opacity: .8; }
.mower-card .sw { display: flex; gap: 3px; } .mower-card .sw i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--edge); }
.mower-card:disabled .sw i { filter: grayscale(1) brightness(1.3); }


/* Pause diorama: no modal. A status strip up top, buttons floating mid-board, drag anywhere else. */
.screen.pause-dio { display: block; background: transparent; touch-action: none; cursor: grab; }
.pause-top { position: absolute; top: calc(var(--safe-top) + 4px); right: max(10px, env(safe-area-inset-right)); text-align: right; background: var(--cream-a); border: 3px solid var(--edge);
  border-radius: 14px; box-shadow: 0 3px 0 var(--edge-shadow); padding: 6px 12px; font-weight: 900; font-size: 14px; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.pause-top div { font-weight: 800; font-size: 12px; opacity: .8; }
.pause-top { max-width: calc(100% - 150px) !important; }
.pause-logo { position: absolute; top: calc(var(--safe-top) + 8px); left: max(12px, env(safe-area-inset-left)); font-size: 28px; -webkit-text-stroke: 2px var(--ink); text-shadow: 0 3px 0 var(--ink); margin: 0; transform: rotate(-4deg); pointer-events: none; }
.pause-btns .btn { white-space: nowrap; }
.pause-btns .rate .btn.on { background: var(--yellow); } .pause-btns .rate .btn.on.bad { background: #ffc2cc; }
.lvl .fb { position: absolute; top: 3px; right: 5px; font-size: 12px; }
.note-box { width: 100%; min-height: 140px; font: inherit; font-size: 14px; border: 3px solid var(--edge); border-radius: 12px; padding: 8px; background: var(--cream); color: var(--ink); resize: vertical; }
.pause-btns { position: absolute; left: 50%; top: 74%; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: auto; }
.pause-btns .row { display: flex; gap: 8px; }
.pause-btns .btn { box-shadow: 0 5px 0 var(--edge-shadow), 0 8px 20px #0003; }
.pause-hint { position: absolute; bottom: calc(var(--safe-bottom) + 10px); left: 0; right: 0; text-align: center; font-weight: 800; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #0008; pointer-events: none; }
/* landscape (tablets, phones on their side): the buttons run down to the bottom edge, so the hint moves to the bottom-left corner, clear of the centred column (the rate row is at most 560 px wide) */
@media (orientation: landscape) { .pause-hint { left: max(12px, env(safe-area-inset-left)); right: auto; max-width: max(110px, calc(50% - 300px)); text-align: left; } }

.line-rate::after { content: 'Tap for details ›'; font-size: 10px; font-weight: 900; opacity: .6; align-self: flex-end; white-space: nowrap; }
/* Line detail modal */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; background: #1b1430aa; display: flex; align-items: safe center; justify-content: center; padding: 12px; overflow-y: auto; }
.line-detail h2 small { font-size: 12px; opacity: .6; font-weight: 800; }
.line-detail canvas { position: static; width: min(80vw, 360px); height: min(80vw, 360px); border: 3px solid var(--edge); border-radius: 12px; display: block; margin: 6px auto; }
.line-detail .legend { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-wrap: wrap; }
.line-detail .legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .c1 { background: #3cc8f0; } .legend .c2 { background: #e8ff60; } .legend .c3 { background: #ff4a00; }
.ld-row { text-align: left; margin: 8px 0; }
.ld-head { display: flex; justify-content: space-between; font-size: 13px; }
.ld-row > i { display: block; height: 8px; border-radius: 4px; background: #e8dfc4; overflow: hidden; margin: 3px 0; }
.ld-row em { display: block; height: 100%; background: linear-gradient(90deg, #7cc8ff, #ffd45e, #ff8a2a); }
.ld-row small { display: block; font-size: 11px; opacity: .8; } .ld-row .tip { opacity: .65; }

/* Replay */
.replay-bar { position: fixed; top: calc(var(--safe-top) + 6px); left: 50%; translate: -50% 0; z-index: 50; display: flex; align-items: center; gap: 8px;
  background: var(--cream-a); border: 3px solid var(--edge); border-radius: 14px; box-shadow: 0 3px 0 var(--edge-shadow); padding: 4px 6px 4px 10px; white-space: nowrap; }
.replay-bar .rec { font-weight: 900; color: #e8394d; animation: pulse .6s infinite alternate; }
.replay-bar b { font-size: 13px; }
.line-title { font-weight: 900; font-style: italic; color: var(--purple); margin: 2px 0 4px; }
.line-detail .line-title { font-size: 18px; } .line-detail .line-title small { font-size: 12px; color: var(--ink); opacity: .8; }
.pause-top { white-space: normal !important; max-width: calc(100% - 175px) !important; }
.daynight { display: flex; justify-content: center; gap: 6px; margin: 4px 0 0; }
.daynight button { font: inherit; font-weight: 900; font-size: 12px; border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); padding: 4px 12px; color: var(--ink); }
.daynight button.on { background: #2c2a66; color: #fff; }
.lvl.night { background: #d8d4f4; }

/* ---------------------------------------------------------------- toy logo */
@font-face { font-family: 'Lilita One'; src: url('../assets/fonts/LilitaOne.ttf') format('truetype'); font-display: swap; } /* OFL, bundled */
.logo.toy { font-family: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif; font-weight: 400; font-size: 76px; line-height: 1;
  letter-spacing: 2px; position: relative; display: inline-flex; gap: 1px; transform: rotate(-4deg); margin: 6px 0 4px;
  -webkit-text-stroke: 0; text-shadow: none; overflow: visible; }
.logo.toy span { display: inline-block; color: var(--c); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink), 0 6px 0 var(--ink), 0 9px 0 #2a1f44, 0 12px 14px #0005; /* chunky 3D extrude */
  animation: toybounce 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); transform-origin: 50% 90%; }
.logo.toy .l0, .logo.toy .l1, .logo.toy .l2 { --c: #ff8a2a; } /* DR. in one orange */
.logo.toy .l2 { transform: translateY(6px); }
.logo.toy .l3, .logo.toy .l4, .logo.toy .l5 { --c: #5fd35a; } /* MOW all grass green */
.logo.toy span { background: none; }
/* MOW is made of lawn: a mown-stripe grass fill clipped to the letter, with tufts sprouting on top */
.logo.toy .l3, .logo.toy .l4, .logo.toy .l5 { position: relative; }
.logo.toy .l3::after, .logo.toy .l4::after, .logo.toy .l5::after { content: attr(data-c); position: absolute; left: 0; top: 0;
  -webkit-text-stroke: 0; text-shadow: none; color: transparent; pointer-events: none;
  background: repeating-linear-gradient(97deg, #12582273 0 2px, transparent 2px 6px), repeating-linear-gradient(83deg, #d2ffa080 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #b6f58f 0%, #62d354 40%, #2e9a3e 100%);
  -webkit-background-clip: text; background-clip: text; }
.logo.toy .l3::before, .logo.toy .l4::before, .logo.toy .l5::before { content: ''; position: absolute; left: 6%; right: 6%; top: -.2em; height: .3em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 20' preserveAspectRatio='none'%3E%3Cg stroke='%233b2e5a' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M2 20L5 6L9 20Z' fill='%233fae45'/%3E%3Cpath d='M9 20L13 2L16 20Z' fill='%238fe06a'/%3E%3Cpath d='M16 20L19 9L23 20Z' fill='%2362d354'/%3E%3Cpath d='M23 20L27 4L30 20Z' fill='%233fae45'/%3E%3Cpath d='M30 20L34 8L37 20Z' fill='%238fe06a'/%3E%3Cpath d='M37 20L40 3L44 20Z' fill='%2362d354'/%3E%3Cpath d='M44 20L48 7L51 20Z' fill='%233fae45'/%3E%3Cpath d='M51 20L54 4L58 20Z' fill='%238fe06a'/%3E%3C/g%3E%3C/svg%3E") center bottom / 100% 100% no-repeat; }
.logo.toy .l4::before { top: -.17em; transform: scaleX(-1); }
@keyframes toybounce { 0%, 70%, 100% { transform: translateY(0) rotate(0) scale(1); } 78% { transform: translateY(-12px) rotate(-6deg) scale(1.08, .94); } 86% { transform: translateY(2px) scale(1.06, .9); } 92% { transform: translateY(-3px) rotate(3deg); } }
.logo.toy.pause-logo { font-size: 34px; position: absolute; }
.logo.toy.pause-logo span { -webkit-text-stroke: 3px var(--ink); text-shadow: 0 2px 0 var(--ink), 0 4px 0 var(--ink), 0 6px 8px #0005; }
@media (max-height: 560px) { .logo.toy { font-size: 52px; } }
@media (prefers-reduced-motion: reduce) { .logo.toy span { animation: none; } }

/* Ads: menu screens only. Empty (and invisible) until AdSense is switched on in js/ads.js. */
.ad-slot { display: none; }
.ad-slot.on { display: block; margin: 10px auto 0; max-width: 100%; min-height: 60px; }
.ad-slot small { display: block; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: .5; margin-bottom: 2px; }
.site-links a { color: inherit; opacity: .75; }

/* ---------------------------------------------------------------- dark UI theme
   Deep indigo surfaces with light "ink" outlines: the same chunky toy buttons, lit up.
   body.dark is set from Settings (Auto follows the phone's theme). */
body.dark {
  --ink: #ece6ff;
  --edge: #ffd45e;           /* yellow outlines: every button and card reads against the dark */
  --edge-shadow: #8a6a12;
  --cream: #231d3d;
  --cream-a: #231d3dee;
  --well: #3a3160;
  --tile: #2d2750;
  --muted: #1a1530;
  --purple: #b9a6ff;
  --sky-deep: #7cc8ff;
  color-scheme: dark;
}
body.dark .screen { background: radial-gradient(circle at 50% 35%, #2a2350aa, #0c0a1ccc); }
body.dark .screen.clear { background: transparent; }
body.dark .card, body.dark .pill, body.dark .mow, body.dark .mini, body.dark .btn.alt, body.dark .style-meter, body.dark .pause-top,
body.dark .tab, body.dark .lvl, body.dark .mower-card, body.dark .ach-near, body.dark .replay-bar, body.dark .slow-btn span, body.dark .note-box,
body.dark .ws-name, body.dark .ws-bar button, body.dark .ws-info, body.dark .ws-sheet button, body.dark .daynight button { color: var(--ink); }
body.dark .btn:not(.alt) { color: #231d3d; }                /* yellow primary buttons keep dark text */
body.dark .btn:not(.alt), body.dark .jump-btn { --ink-shadow: #0c0a1c; }
body.dark .mow.full, body.dark .ach-near { background: #3b3320f0; }
body.dark .lvl.night { background: #1a1740; }
body.dark .lvl:disabled { background: var(--muted); opacity: .8; }
body.dark .mower-card:disabled { background: #1a1530; }
body.dark .tab.on, body.dark .mower-card.on, body.dark .pause-btns .rate .btn.on { background: #6b5a1f; color: #fff4c7; }
body.dark .daynight button.on { background: #7cc8ff; color: #0c0a1c; }
body.dark .gold-award { background: #3b3320; } body.dark .gold-award.miss { background: #2d2750; }
body.dark .site-links a, body.dark a { color: #9fd8ff; }
body.dark .line-rate canvas, body.dark .line-detail canvas { border-color: var(--ink); }
/* the logo keeps its dark outline so the candy letters still pop */
body.dark .logo.toy span { -webkit-text-stroke-color: #120d20; text-shadow: 0 3px 0 #120d20, 0 6px 0 #120d20, 0 9px 0 #000, 0 12px 14px #0008; }
body.dark .logo-sub { color: #7cc8ff; }
body.dark .ws-bar button, body.dark .ws-sheet button, body.dark .ws-info, body.dark .ws-name { background: var(--cream); }
body.dark .ws-chips button.on, body.dark .ws-swatches button.on, body.dark .ws-bar button[data-ws=edit] { background: #6b5a1f; color: #fff4c7; }
body.dark .modal { background: #05030cc0; }
/* light-background pieces keep dark text in dark mode (reward cards), and the
   achievement list gets dark cards instead of cream ones */
body.dark .ach { background: var(--tile); }
body.dark .ach.locked { background: #1a1530; opacity: .85; }
body.dark .ach.locked b, body.dark .ach.locked span { color: #b8b0d4; }
body.dark .ach-near { background: #3b3320f0; }
body.dark .slow-btn.on span { background: #5a2a48; }
body.dark .lawn-row.pick.on { background: #4a3f16; }
body.dark .lawns-nav .tab.on small { background: #0005; }
body.dark .pause-btns .rate .btn.on.bad { background: #7a2a3a; color: #ffe0e6; }
body.dark .mow .lbl, body.dark .pill .lbl { opacity: .85; }
/* pause rating/tools row: 5 buttons, wrap on phones instead of running off-screen */
.pause-btns .row.rate { flex-wrap: wrap; justify-content: center; max-width: min(94vw, 560px); }

/* ---------------------------------------------------------------- stencil bonus */
.stencil-card { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--safe-top) + 96px); width: 120px; height: 120px;
  border-radius: 14px; box-shadow: 0 3px 0 var(--edge-shadow); background: var(--cream-a); image-rendering: pixelated; position: absolute; pointer-events: none; }
.stencil-result { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 8px; }
.stencil-result canvas { width: 180px; height: 180px; border-radius: 14px; position: static; }
.stencil-result small { display: flex; gap: 5px; align-items: center; font-weight: 800; white-space: nowrap; }
.stencil-result i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid var(--edge); }
.stencil-result .k-in { background: #46c95a; } .stencil-result .k-miss { background: #fff4c8; } .stencil-result .k-out { background: #ff5a4a; }
.stencil-finish { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--safe-top) + 224px); width: 120px; height: 40px;
  font: 900 15px/1 inherit; letter-spacing: 1px; color: var(--ink); background: linear-gradient(#b6f58f, #5fd35a); border: 3px solid var(--edge);
  border-radius: 12px; box-shadow: 0 3px 0 var(--edge-shadow); cursor: pointer; pointer-events: auto; }
.stencil-finish:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge-shadow); }
.stencil-finish:disabled { opacity: .45; }
.lvl-tag { display: block; margin-top: 2px; font-size: 9px; letter-spacing: 1px; font-weight: 900; color: #b8408a; }
body.dark .lvl-tag { color: #ff8ac8; }
.replace-drag, .replay-drag { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; touch-action: none; cursor: grab; display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(env(safe-area-inset-bottom) + 18px); }
.replay-drag span { background: var(--cream-a); border: 2px solid var(--edge); border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 12px; pointer-events: none; }
/* rush: the trailing edge of the frame is about to sweep you away */
/* (its own element: body::after is the cinematic letterbox) */
.rush-vignette { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity .15s;
  box-shadow: inset 0 0 90px 30px rgba(255, 40, 60, .55); }
body.rush-danger .rush-vignette { opacity: 1; animation: rushpulse .45s ease-in-out infinite alternate; }
@keyframes rushpulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.rush-danger .rush-vignette { animation: none; } }
/* gamepad: the focused menu item, and the controller table in Settings */
.pad-focus { outline: 4px solid #ffd23a !important; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(59, 46, 90, .55) !important; }
.pad-map { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.pad-map td { padding: 5px 6px; border-bottom: 1px dashed var(--muted, #bbb); vertical-align: middle; }
.pad-map td:last-child { text-align: right; white-space: nowrap; }
#game:focus { outline: none; }

/* Older Safari (iOS 13-14.0, the legacy bundle) has no flexbox gap: space the children with margins instead. */
html.legacy .hud-top > *,
html.legacy .mow-head > *,
html.legacy .hud-sub > *,
html.legacy .lives > *,
html.legacy #ach-toasts > *,
html.legacy .ach-toast > *,
html.legacy .btns > *,
html.legacy .lvl meta > *,
html.legacy .gold-award > *,
html.legacy .ach > *,
html.legacy .ws-top > *,
html.legacy .ws-bar > *,
html.legacy .ws-chips > *,
html.legacy .ws-num > *,
html.legacy .lawn-list > *,
html.legacy .lawn-row > *,
html.legacy .lawns-head > *,
html.legacy .lawns-body > *,
html.legacy .lawns-nav > *,
html.legacy .lawns-tools > *,
html.legacy .lawns-search > *,
html.legacy .lawns-packbar > *,
html.legacy .lawns-bulk > *,
html.legacy .gas > *,
html.legacy .tabs > *,
html.legacy .line-rate > *,
html.legacy .mower-card > *,
html.legacy .pause-btns > *,
html.legacy .pause-btns .row > *,
html.legacy .line-detail .legend > *,
html.legacy .replay-bar > *,
html.legacy .daynight > *,
html.legacy .stencil-result > * { margin: 3px; }

/* Title: no panel. The animated logo and the buttons float straight over the live attract scene. */
.card.title-card { background: none; border: 0; box-shadow: none; padding-top: 0; max-width: 520px; }
.title-card .logo.toy { font-size: min(104px, 19vw); }
@media (max-height: 560px) { .title-card .logo.toy { font-size: 64px; } }
.title-card .logo-sub { color: #fff; -webkit-text-stroke: 5px #3b2e5a; paint-order: stroke fill; font-size: 16px; text-shadow: 0 3px 0 #3b2e5a; } /* (ink in both themes: it sits on the scene, not a panel) */
.title-card .play-btn { font-size: 28px; padding: 12px 44px; }
.title-card .mode-btns { gap: 10px; }
.title-card .mode-btns .play-btn { font-size: 26px; padding: 12px 22px; min-width: 210px; }
.title-card .survivors-btn { background: linear-gradient(#ff9a3a, #e8661a); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; min-width: 430px; } /* Survivors mode (survivors.html) */
@media (max-width: 480px) { .title-card .survivors-btn { min-width: 210px; } }
.title-card .title-pill { display: inline-block; margin: 12px 0 0; padding: 3px 12px; border-radius: 999px; background: var(--cream-a); border: 2px solid var(--edge); }
.title-card .site-links { font-size: 12px; }
body.dark .title-card .logo-sub { color: #fff; }

/* 3D logo (js/logo3d.js): its canvas takes the CSS logo's place once WebGL is up */
.logo3d { position: relative; width: calc(100% + 32px); margin: 0 -16px; height: calc(min(104px, 19vw) * 1.55); display: flex; align-items: center; justify-content: center; }
.logo3d .logo3d-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; } /* (inside the box: the screen scrolls, so anything past it was clipped) */
.logo3d.on .logo.toy { visibility: hidden; }
@media (max-height: 560px) { .logo3d { height: 96px; } }

/* ---------------------------------------------------------------- UX pass: close at the top, primary first */
/* ✕ pinned to the top-right of every menu card and modal; sticky, so it stays in reach while a long card scrolls */
.close-x { position: sticky; top: 0; float: right; z-index: 3; margin: -10px -10px 4px 8px; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 3px solid var(--edge); background: var(--cream); color: var(--ink); font-weight: 900; font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 3px 0 var(--edge-shadow); touch-action: manipulation; }
.close-x:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge-shadow); }
.modal .close-x { top: 4px; }
body.dark .close-x { background: #2d2548; color: #fff4c7; }
.btns.tight { margin-top: 2px; }
/* results: the grade, the score and the next step up top; the breakdown underneath */
.res-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 2px 0 4px; }
.res-head .rank-big { margin: 0; }
.res-score { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.res-score small { font-weight: 900; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }
.res-score b { font-size: 40px; line-height: 1; }
.res-gold { font-weight: 900; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.res-gold .can { width: 16px; height: 17px; }
/* pause: RESUME big and first; the lawn extras (rate, notes, remix, code) small and last */
.pause-btns .btn.resume { font-size: 26px; padding: 14px 52px; }
.pause-btns .row.extras { align-items: center; gap: 6px; margin-top: 6px; opacity: .9; }
.pause-btns .row.extras .btn { padding: 5px 10px; font-size: 14px; box-shadow: 0 3px 0 var(--edge-shadow); }
.extras-lbl { font-weight: 900; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px #000a; }
.pause-btns .row.extras { max-width: 300px; }
.extras-lbl { flex-basis: 100%; text-align: center; }

/* Anime art style: manga speed lines round the screen edge (slow-mo, big beats), flickering like cels */
.speedlines { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity .12s;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #fff0 0deg 2.1deg, #fffffff0 2.1deg 2.5deg, #fff0 2.5deg 4.4deg, #ffffffb0 4.4deg 4.6deg, #fff0 4.6deg 7deg);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, transparent 38%, #000 78%); mask-image: radial-gradient(ellipse at 50% 50%, transparent 38%, #000 78%); }
.speedlines.on { opacity: .9; animation: speedflick .14s steps(1) infinite; }
@keyframes speedflick { 50% { transform: rotate(1.7deg) scale(1.03); } }
body.anime .toast { font-style: italic; letter-spacing: .5px; }

/* Free mow HUD: FINISH (same pill as the stencil's) and a ⚡ POWER-UP button with a small drop-up menu */
.free-hud { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: calc(var(--safe-bottom) + 130px); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: auto; }
.free-hud .stencil-finish { position: static; }
.free-power { font: inherit; font-weight: 900; font-size: 15px; padding: 8px 14px; border-radius: 999px; border: 3px solid var(--edge); background: var(--yellow); box-shadow: 0 4px 0 var(--edge-shadow); color: #231d3d; }
.free-menu { display: flex; flex-direction: column; gap: 6px; }
.free-menu button { font: inherit; font-weight: 800; font-size: 14px; text-align: left; padding: 7px 12px; border-radius: 12px; border: 3px solid var(--edge); background: var(--cream); box-shadow: 0 3px 0 var(--edge-shadow); color: var(--ink); }
html.legacy .free-hud > *, html.legacy .free-menu > * { margin: 3px; }

/* UI icons (js/icons.js, Phosphor): inline SVGs that take the size and colour of the text they sit in */
.ic { display: inline-block; width: 1.15em; height: 1.15em; fill: currentColor; vertical-align: -0.2em; flex: none; }
.ic-orange { fill: #ff9a3c; } .ic-cyan { fill: #34c6e0; } .ic-green { fill: #3fbf6a; } .ic-red { fill: #ff4d5e; }
.btn .ic, .tab .ic { margin-right: 0.12em; }
.btn > .ic:only-child { margin-right: 0; }
.slow-btn .ic { width: 26px; height: 26px; }
.mini .ic { vertical-align: -0.22em; }
.ach .ico .ic { color: var(--purple); } .ach-toast .ico .ic { color: var(--ink); }
.lvl .n .ic { vertical-align: -0.15em; }

/* S++: every last blade mowed (js/sim.js mowShownPct / 'every'). Past 100% the meter turns gold and flows;
   at every blade it glows. S++ levels get a gold tile in level select. */
.mow.over { background: #fff4c7; }
.mow.over #mow-fill { background: linear-gradient(90deg, #f5b400, #ffe98a 50%, #f5b400) 0 0 / 48px 100% repeat-x; animation: goldflow .8s linear infinite; }
.mow.over .mow-head b { color: #c98600; }
.mow.over .mow-head .lbl { color: #9a6a00; opacity: 1; }
.mow.every { border-color: #b88400; animation: everyglow 1.2s ease-in-out infinite alternate; }
.mow.every #mow-fill { animation-duration: .45s; }
@keyframes goldflow { to { background-position: 48px 0; } }
@keyframes everyglow { from { box-shadow: 0 4px 0 var(--edge-shadow), 0 0 0 0 #ffd23a00; } to { box-shadow: 0 4px 0 var(--edge-shadow), 0 0 14px 4px #ffd23acc; } }
body.dark .mow.over { background: #3b3320f0; }
body.dark .mow.over .mow-head b, body.dark .mow.over .mow-head .lbl { color: #ffd45a; }
.rank-Spp { color: #ff9d00; letter-spacing: -0.04em; }
.rank-big.rank-Spp { background: linear-gradient(180deg, #fff3a6, #ffc21a 55%, #e08a00); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 84px; -webkit-text-stroke-width: 3px; text-shadow: none; filter: drop-shadow(0 5px 0 var(--ink)); }
.every-note { margin: 6px 0 0; font-weight: 900; font-size: 14px; letter-spacing: 1px; color: #c98600; text-transform: uppercase; }
.lvl.spp, body.dark .lvl.spp { border-color: #b88400; background: linear-gradient(150deg, #fff6c2, #ffd84d 55%, #ffe58f); box-shadow: 0 4px 0 #9a6f00, 0 0 12px #ffd23a88; color: #3b2e5a; }
.lvl.spp .rk { color: #b35f00; }
.lvl.spp.night, body.dark .lvl.spp.night { background: linear-gradient(150deg, #5a4a1a, #b8860b 55%, #6b5316); color: #fff6d8; }
.lvl.spp.night .rk { color: #ffe27a; }

/* Level feedback on the results card: rate, notes, suggest a swap (js/main.js feedbackRow / showSwap) */
.fb-box { margin: 8px 0 2px; padding: 6px 8px 8px; border: 2px dashed var(--edge-shadow); border-radius: 12px; }
.fb-box > small { display: block; font-size: 10px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.fb-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fb-row .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a logged vote (Love it / Meh, also a saved note or swap) wears the RESUME button's colours, on the results card
   and the pause menu, in light and dark, with a tick so it reads as chosen at a glance */
.fb-row .btn.on, body.dark .fb-row .btn.on, body.dark .pause-btns .rate .btn.on { background: var(--yellow); color: #231d3d; border-color: var(--edge); }
.fb-row .btn.on.bad, body.dark .fb-row .btn.on.bad, body.dark .pause-btns .rate .btn.on.bad { background: #ff8fa3; color: #231d3d; }
.fb-row .btn.on[data-go=rate]::after { content: ' \2713'; font-weight: 900; }
.fb-row:has(.btn.on[data-go=rate]) .btn[data-go=rate]:not(.on) { opacity: .6; }
.swap-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 40vh; overflow: auto; margin: 6px 0; }

/* ---------------------------------------------------------------- music player (Settings › Music) + playlist */
.mplayer .np, .playlist .np { margin: 4px 0 8px; }
.mplayer .np small { display: block; font-size: 12px; opacity: .75; margin-top: 2px; }
.new-tag { background: var(--yellow); color: var(--ink); border-radius: 6px; padding: 0 5px; font-weight: 900; font-size: 11px; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pchips.kinds { margin-top: 12px; }
.pchip { border: 3px solid var(--edge); border-radius: 999px; background: var(--cream); color: var(--ink); font: inherit; font-weight: 900; font-size: 13px; padding: 4px 11px; box-shadow: 0 2px 0 var(--edge-shadow); cursor: pointer; touch-action: manipulation; }
.pchips.kinds .pchip { font-size: 15px; padding: 6px 14px; }
.pchip.on { background: var(--yellow); }
.pchip small { opacity: .7; font-size: 11px; }
.song-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.song-row { display: flex; align-items: center; gap: 6px; border: 3px solid var(--edge); border-radius: 12px; padding: 4px 6px; background: var(--tile); }
.song-row.on { background: #fff1a8; }
.song-row.banned .song-play b { text-decoration: line-through; opacity: .6; }
.song-play { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: none; background: none; font: inherit; color: var(--ink); text-align: left; padding: 4px 2px; cursor: pointer; touch-action: manipulation; }
.song-play > .ic { flex: none; font-size: 20px; }
.song-play span { min-width: 0; }
.song-play b, .song-play small { display: block; overflow: hidden; text-overflow: ellipsis; }
.song-play small { font-size: 12px; opacity: .75; }
.song-row .song-ban { flex: none; padding: 4px 9px; box-shadow: 0 2px 0 var(--edge-shadow); }
.sfx-group { margin: 10px 2px 0; font-size: 15px; }
body.dark .song-row.on { background: #4a3f16; }

/* Time Trial (v0.100): the ghost chip, medals, the results card, the ghost settings */
.ghost-chip { flex: 0 1 auto; min-width: 0; }
.ghost-chip b { margin-left: 4px; }
.ghost-chip .ahead, .tt-res .ahead { color: #7dff8a; }
.ghost-chip .behind, .tt-res .behind { color: #ff7a7a; }
.medal { display: inline-flex; align-items: center; gap: 3px; font-weight: 900; }
.medal .ic { width: 18px; height: 18px; }
.medal.m-gold { color: #e9b100; } .medal.m-silver { color: #9aa7b4; } .medal.m-bronze { color: #c87533; }
.lvl .meta .tt { font-weight: 900; font-size: 11px; opacity: .85; }
.tt-res { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--cream); text-align: left; }
.tt-res > .medal { font-size: 15px; flex: none; }
.tt-res > .medal .ic { width: 30px; height: 30px; }
.tt-res > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-res b { font-size: 22px; }
.tt-res .ahead, .tt-res .behind { font-weight: 900; font-size: 13px; }
.tt-res small { font-size: 11px; opacity: .85; }
.ghost-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ghost-set label { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; }
.ghost-set input[type=color] { width: 40px; height: 28px; padding: 0; border: 2px solid var(--edge); border-radius: 8px; background: none; }
.ghost-set input[type=range] { width: 110px; }
.page-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.page-set input[type=color] { width: 44px; height: 32px; padding: 0; border: 2px solid var(--edge); border-radius: 8px; background: none; }
.page-set input[type=text] { width: 92px; font: 800 16px ui-monospace, Menlo, monospace; padding: 5px 8px; border: 2px solid var(--edge); border-radius: 8px; background: #fff; color: var(--ink); text-transform: lowercase; }
.page-set input[type=text].bad { border-color: var(--red); }
.page-sw { display: flex; gap: 6px; flex-wrap: wrap; }
.page-sw button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--edge); padding: 0; touch-action: manipulation; }
.page-sw button.on { outline: 3px solid var(--gold); outline-offset: 1px; }
body.dark .ghost-chip .ahead, body.dark .tt-res .ahead { color: #12813a; }
body.dark .ghost-chip .behind, body.dark .tt-res .behind { color: #c0262d; }

/* ---------------------------------------------------------------- level select (v0.100) */
/* Classic / Adventure: which menu of packs the chips below show */
.ls-modes { display: flex; justify-content: center; gap: 0; margin: 2px auto 8px; width: fit-content; border: 3px solid var(--edge); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 0 var(--edge-shadow); }
.ls-mode { border: 0; background: var(--cream); color: var(--ink); font: inherit; font-weight: 900; font-size: 14px; padding: 7px 16px; display: inline-flex; align-items: center; gap: 6px; touch-action: manipulation; }
.ls-mode + .ls-mode { border-left: 3px solid var(--edge); }
.ls-mode.on { background: var(--yellow); }
/* pack chips: icon, name and how many you've cleared */
.ls-tabs .tab { display: inline-flex; align-items: center; gap: 5px; }
.ls-tabs .tab small { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--well); font-weight: 800; }
.ls-tabs .tab.on small { background: #fff9; }
.ls-tabs .tab.rated { border-style: dashed; }
.ls-tabs .tab.rated + .tab:not(.rated) { margin-left: 8px; }
.ls-empty { padding: 24px 10px; text-align: center; }
/* the open pack's banner: icon, progress (cleared + gold), the day / night slider */
.ls-pack { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; padding: 8px 10px; border: 3px solid var(--edge); border-radius: 16px;
  background: linear-gradient(120deg, #e8f7ff, #fff6d8); box-shadow: 0 4px 0 var(--edge-shadow); text-align: left; transition: background .3s; }
.ls-pack.night { background: linear-gradient(120deg, #1b1a4a, #3b2f7a); color: #f2eeff; }
.ls-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--yellow); border: 3px solid var(--edge); font-size: 22px; color: var(--ink); }
.ls-ico .ic { width: 24px; height: 24px; }
.ls-pack.night .ls-ico { background: #7cc8ff; }
.ls-info { flex: 1; min-width: 0; }
.ls-info b { display: block; font-size: 17px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-info small { font-size: 11px; font-weight: 700; opacity: .85; white-space: nowrap; }
.ls-info .can { width: 12px; height: 13px; vertical-align: -2px; }
.ls-bar { position: relative; height: 8px; margin: 4px 0 3px; border-radius: 99px; background: var(--well); overflow: hidden; border: 2px solid var(--edge); }
.ls-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); border-radius: 99px; }
.ls-bar i.g { background: var(--gold); }
/* the slider: a pill track, Day | Night, with a knob that slides across */
.dn-switch { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; align-items: center; width: 150px; height: 38px; padding: 0;
  border: 3px solid var(--edge); border-radius: 999px; background: #bfe6ff; box-shadow: 0 3px 0 var(--edge-shadow); font-weight: 900; font-size: 12px; overflow: hidden;
  transition: background .25s; touch-action: manipulation; }
.dn-switch .dn-lbl { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 3px; transition: color .2s, opacity .2s; }
.dn-switch .dn-lbl .ic { width: 14px; height: 14px; }
.dn-switch .dn-knob { position: absolute; z-index: 2; top: 3px; left: 3px; width: calc(50% - 6px); height: calc(100% - 6px); border-radius: 999px; background: var(--yellow);
  border: 2px solid var(--edge); display: grid; place-items: center; transition: transform .19s cubic-bezier(.3, 1.4, .5, 1), background .2s; }
.dn-switch .dn-knob .ic { width: 18px; height: 18px; }
.dn-switch:not(.night) .dn-day, .dn-switch.night .dn-night { opacity: 0; }
.dn-switch.night { background: #2c2a66; color: #fff; }
.dn-switch.night .dn-knob { transform: translateX(calc(100% + 6px)); background: #d8e4ff; color: #2c2a66; }
.dn-switch.locked:not(.night) .dn-night { opacity: .6; }
.dn-switch:active .dn-knob { width: calc(50% + 2px); }
.dn-switch.night:active .dn-knob { transform: translateX(calc(100% - 2px)); }
/* level tiles: a picture of the lawn, number badge, best rank on the picture, name under it */
.ls-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ls-grid .lvl { padding: 4px 4px 6px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: center; transition: transform .12s; }
.ls-grid .lvl:hover:not(:disabled) { transform: translateY(-2px); }
.lvl .th { position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 9px; overflow: hidden; border: 2px solid var(--edge); background: linear-gradient(#bfe6ff, #eaf7ff); }
.lvl.night .th { background: linear-gradient(#0a1233, #2c2a66); }
.th-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.th-img.in { opacity: 1; }
.lvl .th .n { position: absolute; top: 3px; left: 3px; min-width: 22px; padding: 1px 5px; font-size: 13px; line-height: 18px; border-radius: 8px; background: var(--cream); border: 2px solid var(--edge); color: var(--ink); }
.lvl.night .th .n { background: #2c2a66; color: #fff; }
.lvl .th .meta { position: absolute; right: 3px; bottom: 3px; min-height: 0; padding: 0 4px; border-radius: 8px; background: #fffdf8e6; color: #3b2e5a; }
.lvl .th .meta:empty { display: none; }
.lvl .th .fb { top: 3px; right: 3px; padding: 1px 3px; border-radius: 6px; background: #fffdf8e6; color: #3b2e5a; }
.lvl .th .lk { position: absolute; inset: 0; display: grid; place-items: center; background: #2a2240aa; color: #fff; }
.lvl .th .lk .ic { width: 26px; height: 26px; }
.ls-grid .lvl.locked .th-img, .ld-pic.locked .th-img { filter: grayscale(1) brightness(.75); }
.ls-grid .lvl.gold { border-color: var(--gold); box-shadow: 0 4px 0 #b8860b; }
.ls-grid .lvl .nm { min-height: 0; font-size: 11px; padding: 0 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ls-grid .lvl .nm small.lvl-tag { display: block; }
.ls-grid .lvl.locked { opacity: .9; }
.ls-grid .lvl.locked .n::after { content: none; }
@media (max-width: 560px) { .ls-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; } .ls-grid .lvl .nm { font-size: 10px; } .lvl .th .n { font-size: 11px; line-height: 15px; min-width: 18px; } .dn-switch { width: 128px; height: 36px; font-size: 11px; } .ls-pack { gap: 8px; padding: 7px 8px; } .ls-ico { width: 36px; height: 36px; } }
@media (max-width: 340px) { .ls-grid { grid-template-columns: repeat(2, 1fr); } }
.card.ls, .card.ld { max-width: 760px; }
.card.ld { max-width: 600px; }
@media (max-height: 640px) { .ls-grid .lvl { min-height: 0; } }
/* level detail card */
.ld .ld-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 34px 8px 0; }
.ld .ld-where { font-weight: 900; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.ld .ld-nav { padding: 4px 10px; }
.ld .ld-nav:disabled { opacity: .35; }
.ld-pic { position: relative; aspect-ratio: 3 / 2; border: 3px solid var(--edge); border-radius: 16px; overflow: hidden; background: linear-gradient(#bfe6ff, #eaf7ff); box-shadow: 0 4px 0 var(--edge-shadow); }
.ld-pic.night { background: linear-gradient(#0a1233, #2c2a66); }
.ld-pic .th-img { animation: ldin .3s ease-out; }
.ld-pic .lk { position: absolute; inset: 0; display: grid; place-items: center; background: #2a224099; color: #fff; }
.ld-pic .lk .ic { width: 44px; height: 44px; }
@keyframes ldin { from { transform: scale(1.04); } }
/* the Level Graveyard: grey tiles, and a tombstone in place of PLAY on the detail card */
.lvl-tag .ic { width: 10px; height: 10px; vertical-align: -1px; }
.lvl-tag.grave-tag { color: #6d6585; }
body.dark .lvl-tag.grave-tag { color: #b7afcf; }
.ls-grid .lvl.grave .th-img { filter: grayscale(1) brightness(.85); }
.ld-pic.grave .th-img { filter: grayscale(1) brightness(.6); }
.ld-pic .tomb { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%); width: min(56%, 230px); padding: 18px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; color: #3a3548;
  background: linear-gradient(#c9c6d2, #9e9aab); border: 3px solid #4a4558; border-radius: 48% 48% 10px 10px / 34% 34% 10px 10px;
  box-shadow: 0 5px 0 #4a4558, inset 0 -6px 0 #0000001a; }
.ld-pic .tomb b { font-size: 20px; letter-spacing: 3px; }
.ld-pic .tomb .tomb-name { font-weight: 900; font-size: 14px; line-height: 1.15; margin: 2px 0 4px; }
.ld-pic .tomb small { font-size: 11px; font-weight: 700; }
.ld-pic .tomb .tomb-ver { opacity: .7; }
.ld-kind { margin: 6px 0 0; text-align: left; }
.ld-kind .lvl-tag { display: inline-block; font-size: 11px; letter-spacing: .5px; }
.ld-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; text-align: left; }
.ld-row h2 { margin: 0; font-size: 24px; line-height: 1.1; min-width: 0; }
.ld-sub { margin: 6px 0 0; font-size: 13.5px; font-weight: 700; text-align: left; }
.ld-sub .ic { width: 15px; height: 15px; vertical-align: -2px; }
.ld-hint { margin: 4px 0 0; text-align: left; opacity: .8; }
.ld-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin-top: 10px; }
.ld-stat { border: 3px solid var(--edge); border-radius: 12px; padding: 4px 6px; background: var(--well); }
.ld-gold { color: var(--gold); }
.ld-stat.ld-letters { grid-column: span 2; }
.ld-stat.ld-letters.all small { color: var(--gold); opacity: 1; }
.ld-stat small { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; opacity: .75; }
.ld-stat b { font-size: 18px; display: inline-flex; align-items: center; justify-content: center; min-height: 24px; }
.ld-stat .can { width: 20px; height: 22px; }
.ld .play-btn:disabled { opacity: .5; }
@media (max-width: 420px) { .ld-row { flex-wrap: wrap; } .ld-row h2 { font-size: 21px; } }
body.dark .ls-pack:not(.night) { background: linear-gradient(120deg, #2d2750, #3b3320); }
body.dark .dn-switch:not(.night) { background: #4a6a8a; color: var(--ink); }
body.dark .ld-pic, body.dark .lvl .th { border-color: var(--edge); }

/* ---------------------------------------------------------------- UI fixes (v0.99.60, UI lead plan P0) */
/* Mow meter: the empty part of the bar is a plain track, so only what you've mowed reads as green (it looked full at 0%). */
.mow-bar { background: #e9e3d3; }
body.dark .mow-bar { background: #3a3352; }
/* Phones: the meter's label (FLAG AT 50%, EXIT IS OPEN!, 12 TO GO…) wraps onto two small lines instead of being cut to "EXI…". */
@media (max-width: 520px) {
  .mow-head { align-items: center; }
  .mow-head .lbl { white-space: normal; font-size: 9px; letter-spacing: .5px; line-height: 1.05; text-overflow: clip;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .hud-sub .chip { letter-spacing: .5px; }
}
/* The smallest phones (iPhone SE, 320 px): the gas-can icon steps aside so the label still has room. */
@media (max-width: 350px) {
  .mow { padding-right: 10px; } .mow .can { display: none; }
  .mow-head b { font-size: 15px; } .mow-head { gap: 4px; } .mow-head .lbl .ic { display: none; }
  #hud .hud-sub .ghost-chip { font-size: 11px; letter-spacing: 0; max-width: 72%; }
}
/* Time Trial: the GHOST chip keeps its time and split; the level chip is the one that gives way. */
.hud-sub .ghost-chip { flex: 0 0 auto; max-width: 62%; }
.hud-sub #hud-level { flex: 0 1 auto; min-width: 0; }
/* Results / fail card: the run's HUD steps out from behind the card; achievement cards ride over the top of it. */
body.card-up #hud { z-index: 45; }
body.card-up #hud > :not(#ach-toasts) { visibility: hidden !important; }
/* Upright: centred along the bottom, clear of the rank and NEXT. Sideways: they keep their corner, a size smaller, by the card. */
@media (orientation: portrait) { body.card-up #ach-toasts { left: 0; right: 0; top: auto; bottom: calc(var(--safe-bottom) + 10px); align-items: center; } }
@media (orientation: landscape) { body.card-up #ach-toasts { top: calc(var(--safe-top) + 8px); transform: scale(.8); transform-origin: top left; } }
/* Line rating on narrow cards: each name sits over its bar (the 88 px name column left the bars no room). */
@media (max-width: 520px) {
  .lr-row { grid-template-columns: 1fr; gap: 1px; margin: 3px 0 4px; }
  .lr-row i { display: block; }
}
/* Pause, phone held upright: the buttons sit on the bottom (clear of the hint) instead of centred at 74% (the stack
   ran off the screen), and the status strip drops under the logo instead of running into it. */
@media (orientation: portrait) {
  .pause-btns { top: auto; bottom: calc(var(--safe-bottom) + 34px); translate: -50% 0; }
}
@media (orientation: portrait) and (max-width: 520px) {
  .pause-top { top: calc(var(--safe-top) + 62px); max-width: calc(100% - 20px) !important; }
}
@media (orientation: portrait) and (max-height: 620px) {
  .pause-btns { gap: 5px; bottom: calc(var(--safe-bottom) + 28px); }
  .pause-btns .btn.resume { padding-top: 8px; padding-bottom: 8px; }
  .pause-logo { font-size: 26px !important; }
}
/* ---------------------------------------------------------------- Versus: 2 players, split screen (js/versus.js) */
.vs-title-btn { font-size: 16px !important; }
#vs-hud { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; display: grid; grid-template-rows: 1fr 1fr; }
#vs-hud.wide { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
.vs-pane { position: relative; overflow: hidden; box-shadow: inset 0 0 0 3px var(--c); }
.vs-pane.p1 { --c: var(--p1); } .vs-pane.p2 { --c: var(--p2); }
.vs-pane.ahead { box-shadow: inset 0 0 0 5px var(--c); }
.vs-tag { position: absolute; left: max(10px, env(safe-area-inset-left)); top: var(--safe-top); background: var(--c); color: #fff; font-weight: 900; font-size: 18px;
  padding: 2px 10px; border-radius: 10px; border: 3px solid var(--edge); box-shadow: 0 3px 0 var(--edge-shadow); }
.vs-score { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(var(--safe-top) + 40px); display: flex; align-items: center; gap: 8px;
  background: var(--cream-a); border: 3px solid var(--edge); border-radius: 999px; padding: 2px 10px 2px 12px; box-shadow: 0 3px 0 var(--edge-shadow); }
.vs-score b { font-size: 20px; font-weight: 900; min-width: 46px; font-variant-numeric: tabular-nums; }
.vs-score i, .vs-row i { display: block; width: 110px; height: 12px; border-radius: 6px; background: #0002; overflow: hidden; }
.vs-score i span, .vs-row i span { display: block; height: 100%; width: 0; background: var(--c); border-radius: 6px; }
.vs-pane.p2 .vs-tag, .vs-pane.p2 .vs-score { left: auto; right: max(10px, env(safe-area-inset-right)); }
#vs-hud:not(.wide) .vs-pane.p2 .vs-tag { top: 10px; } #vs-hud:not(.wide) .vs-pane.p2 .vs-score { top: 50px; }
.vs-big { position: absolute; left: 0; right: 0; top: 38%; text-align: center; font: 900 44px/1 var(--pop-font, system-ui); color: #fff; opacity: 0;
  -webkit-text-stroke: 3px #2a1f45; paint-order: stroke fill; text-shadow: 0 4px 0 #2a1f45; }
.vs-big.pop { animation: vsbig 1.1s ease-out; }
.vs-big.good { color: #8dff5a; } .vs-big.bad { color: #ff7a8a; } .vs-big.gold { color: #ffd45e; }
.vs-big svg { width: .8em; height: .8em; vertical-align: -.05em; }
@keyframes vsbig { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.1); } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.vs-pane.win::after, .vs-pane.lose::after, .vs-pane.draw::after { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font: 900 48px/1 var(--pop-font, system-ui);
  -webkit-text-stroke: 3px #2a1f45; paint-order: stroke fill; text-shadow: 0 4px 0 #2a1f45; }
.vs-pane.win::after { content: 'WIN!'; color: #ffd45e; } .vs-pane.lose::after { content: 'SO CLOSE'; color: #fff; font-size: 34px; } .vs-pane.draw::after { content: 'DRAW'; color: #fff; }
.vs-mid { position: absolute; left: 50%; top: var(--safe-top); translate: -50% 0; display: flex; gap: 6px; align-items: center; }
#vs-hud:not(.wide) .vs-mid { top: 50%; translate: -50% -50%; }
.vs-clock { min-width: 70px; }
.vs-clock.over .val { color: #d4453a; }
.vs-pause { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--edge); background: var(--cream-a); box-shadow: 0 3px 0 var(--edge-shadow);
  display: grid; place-items: center; padding: 0; }
.vs-pause svg { width: 20px; height: 20px; }
.vs-stick { position: absolute; left: 0; top: 0; width: 124px; height: 124px; border-radius: 50%; border: 3px solid #fff8; background: #0001; display: none; }
.vs-stick.on { display: block; }
.vs-stick span { position: absolute; left: 37px; top: 37px; width: 50px; height: 50px; border-radius: 50%; background: #fffc; border: 3px solid var(--c); }
.vs-card .vs-who { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.vs-card .vs-who span { border: 3px solid var(--c); border-radius: 12px; padding: 4px 10px; font-weight: 800; font-size: 14px; }
.vs-card .vs-who b { background: var(--c); color: #fff; border-radius: 6px; padding: 0 6px; margin-right: 4px; }
.vs-card .vs-maps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 6px; }
.vs-card .btn.on { background: var(--yellow); }
.vs-card .vs-note { font-size: 12px; }
.vs-card .btns.col { flex-direction: column; align-items: stretch; }
.vs-winner { color: var(--c) !important; font-size: 32px !important; }
.vs-row { display: grid; grid-template-columns: auto 1fr auto 20px; gap: 8px; align-items: center; margin: 6px 0; }
.vs-row i { width: auto; height: 16px; }
.vs-row b:first-child { background: var(--c); color: #fff; border-radius: 6px; padding: 0 6px; }
.vs-row svg { width: 18px; height: 18px; color: #e0a100; }
body.dark .vs-card .btn.on { background: #6b5a1f; color: #fff4c7; }
.vs-gas { font-style: normal; font-weight: 900; font-size: 15px; display: flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.vs-gas svg { width: 16px; height: 16px; } .vs-gas.low { color: #d4453a; }
.vs-card .vs-maps .btn { font-size: 13px; padding: 4px 9px; }
@media (max-width: 520px) { .vs-card .vs-maps { display: grid; grid-template-columns: 1fr 1fr; } .vs-card .vs-maps .btn { font-size: 12px; padding: 4px 6px; } }

/* ---------------------------------------------------------------- Settings tabs */
.set-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.set-tabs button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 6px 10px;
  border: 3px solid var(--edge); border-radius: 12px; background: var(--cream); box-shadow: 0 3px 0 var(--edge-shadow);
  font-weight: 900; font-size: 14px; touch-action: manipulation; }
.set-tabs button.on { background: var(--yellow); }
body.dark .set-tabs button.on { background: #6b5a1f; color: #fff4c7; }

/* Level detail: PLAY on the picture itself (owner: get into a level without scrolling, esp. on a controller; it takes the pad's first focus) */
.ld-pic .ld-play { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px 9px 16px;
  font: inherit; font-weight: 900; font-size: 20px; letter-spacing: 1px; color: var(--ink); background: var(--yellow);
  border: 3px solid var(--edge); border-radius: 999px; box-shadow: 0 4px 0 var(--edge-shadow); touch-action: manipulation; cursor: pointer; }
.ld-pic .ld-play .ic { width: 22px; height: 22px; }
.ld-pic .ld-play:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--edge-shadow); }
@media (max-width: 420px) { .ld-pic .ld-play { right: 8px; bottom: 8px; font-size: 17px; padding: 7px 16px 7px 13px; } }
/* Short landscape screens (phones held sideways): picture left, name / stats / buttons right, so PLAY is on screen without scrolling */
@media (orientation: landscape) and (max-height: 520px) {
  .card.ld { max-width: 860px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 14px; align-content: start; padding-top: 10px; padding-bottom: 10px; }
  .card.ld > * { grid-column: 2; }
  .card.ld { position: relative; } .card.ld > .close-x { position: absolute; top: 6px; right: 8px; margin: 0; }
  .card.ld > .ld-top { grid-column: 1 / -1; grid-row: 1; margin-bottom: 6px; }
  .card.ld > .ld-pic { grid-column: 1; grid-row: 2 / span 7; align-self: start; max-height: calc(100dvh - 110px); }
  .card.ld > .ld-row { grid-row: 2; } .card.ld > .ld-sub { grid-row: 3; } .card.ld > .ld-hint { grid-row: 4; } .card.ld > .ld-stats { grid-row: 5; }
  .card.ld > .btns { grid-row: 6; }
  .card.ld > .ld-row { margin-top: 0; }
  .card.ld .ld-row h2 { font-size: 20px; }
  .card.ld .ld-stats { gap: 6px; }
}

/* ---------------------------------------------------------------- Garage (js/garage.js): a Tony Hawk 3 skate-shop menu over the 3D room */
.screen.garage-on { display: block; padding: 0; }
.card.gar-card { position: absolute; margin: 0; text-align: left; color: #fff8e6; background: linear-gradient(160deg, #2a2240ee, #3b2e5aee);
  border: 4px solid #12101c; border-radius: 6px; box-shadow: 8px 8px 0 #12101c88; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
@media (orientation: landscape) { .card.gar-card { right: max(14px, env(safe-area-inset-right)); top: calc(var(--safe-top) + 14px); bottom: calc(var(--safe-bottom) + 14px); width: min(400px, 44vw); max-width: none; } }
@media (orientation: portrait) { .card.gar-card { left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 10px); max-height: 54%; max-width: none; width: auto; } }
.card.gar-card .close-x { position: absolute; top: 8px; right: 8px; margin: 0; }
.gar-head { margin: -14px -16px 0; padding: 10px 16px 8px; background: #ffd23a; color: #2a2240; transform: skewX(-8deg); transform-origin: left bottom; border-bottom: 4px solid #12101c; margin-right: 46px; }
.gar-title { display: inline-flex; align-items: center; gap: 8px; font: italic 900 30px/1 system-ui, sans-serif; letter-spacing: 2px; transform: skewX(8deg); }
.gar-title .ic { width: 26px; height: 26px; }
.gar-tabs { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.gar-tabs button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; font: italic 900 16px/1.1 system-ui, sans-serif; letter-spacing: .5px; color: #fff8e6cc; border-radius: 4px; touch-action: manipulation; }
.gar-tabs button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .7; }
.gar-tabs button.on { background: #ffd23a; color: #2a2240; transform: skewX(-8deg); }
.gar-tabs button.on::before { opacity: 1; }
.gar-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px 4px 2px 0; }
.gar-row { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 4px; font-weight: 800; font-size: 15px; color: #fff8e6; background: #ffffff10; touch-action: manipulation; }
.gar-row span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.gar-row small { font-size: 11px; font-weight: 700; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.gar-row.on { background: #ffd23a; color: #2a2240; box-shadow: inset 4px 0 0 #ff7a2a; }
.gar-row:not(.on):hover { background: #ffffff22; }
.gar-row:disabled { cursor: default; opacity: .55; }
.gar-row .ic { width: 15px; height: 15px; }
.gar-sw { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #12101c; flex: none; }
.gar-soon { margin: 6px 2px 0; font-size: 12px; opacity: .7; font-style: italic; }
.gar-info { border-top: 3px solid #ffffff22; padding-top: 7px; display: flex; flex-direction: column; gap: 2px; }
.gar-info b { font: italic 900 18px/1.1 system-ui, sans-serif; color: #ffd23a; }
.gar-info small { font-size: 12.5px; line-height: 1.3; opacity: .9; }
.gar-hint { margin: 0; opacity: .55; font-size: 11px; }
.gar-row.pad-focus, .gar-tabs button.pad-focus { outline-offset: 1px; }
@media (orientation: portrait) {
  .card.gar-card { max-height: 58%; gap: 6px; padding-top: 12px; }
  .gar-title { font-size: 22px; } .gar-row { padding: 6px 9px; font-size: 14px; }
  .gar-tabs { flex-wrap: nowrap; } .gar-tabs button { font-size: 14px; padding: 4px 8px 4px 6px; white-space: nowrap; }
  .gar-info small { display: none; } /* (just the name on a phone: the list gets the room) */
  .gar-turn small { display: none; } .gar-turn { position: absolute; right: 14px; bottom: 10px; gap: 6px; } .gar-rot { width: 32px; height: 32px; }
  .gar-info { padding-right: 80px; min-height: 32px; justify-content: center; } .gar-info b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Golden Clock badge: the S++ "every blade" gold tile from level select, with a moving shine */
.medal.gclock { position: relative; overflow: hidden; justify-content: center; padding: 3px; border: 2px solid #b88400; border-radius: 9px; color: #7a4a00;
  background: linear-gradient(150deg, #fff6c2, #ffd84d 55%, #ffe58f); box-shadow: 0 2px 0 #9a6f00, 0 0 10px #ffd23a88; animation: everyglow 1.2s ease-in-out infinite alternate; }
.medal.gclock::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, #ffffffcc 50%, transparent 65%) -150% 0 / 200% 100% no-repeat; animation: gclockshine 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes gclockshine { 0%, 40% { background-position: 150% 0; } 100% { background-position: -150% 0; } }
.tt-res > .medal.gclock { padding: 5px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .medal.gclock, .medal.gclock::after { animation: none; } }
.gar-turn { display: flex; align-items: center; gap: 8px; }
.gar-turn small { flex: 1; text-align: center; font-size: 11px; opacity: .6; line-height: 1.2; }
.gar-rot { all: unset; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #ffffff1a; color: #fff8e6; touch-action: manipulation; flex: none; }
.gar-rot:hover, .gar-rot.pad-focus { background: #ffd23a; color: #2a2240; }
.gar-rot .ic { width: 20px; height: 20px; }
@media (orientation: portrait) { .gar-turn small { font-size: 10px; } }
.gar-sub { margin: 6px 2px 1px; font: italic 900 12px/1 system-ui, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; color: #ffd23a; opacity: .9; }
.gar-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gar-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 4px; font-weight: 800; font-size: 13px; color: #fff8e6; background: #ffffff10; touch-action: manipulation; }
.gar-chip.on { background: #ffd23a; color: #2a2240; box-shadow: inset 0 -3px 0 #ff7a2a; }
.gar-chip:not(.on):hover { background: #ffffff22; }
.gar-chips.hair .gar-chip span { display: none; } /* hair: swatches only (the name shows as a tooltip) */
.gar-chips.hair .gar-chip { padding: 5px; }

/* ---- Dr. Mow Pro: worlds menu, rank badges, callout art ---- */
.title-card .big-play { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.05; }
.title-card .big-play small { font-size: 13px; font-weight: 800; letter-spacing: .3px; opacity: .8; }
.title-card .worlds-btn { font-size: 20px; padding: 9px 30px; }
.rank-badge { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 1px 0 #0003); }
.rank-badge.big { width: 44px; height: 44px; }
.rank-badge.huge { width: 132px; height: 132px; animation: badge-slam .5s both; } /* (not pop-slam: that toast animation ends faded out, and `both` kept the results badge invisible) */
@keyframes badge-slam { 0% { transform: scale(3.2); opacity: 0 } 50% { transform: scale(.9); opacity: 1 } 75% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
.rank-big:has(.rank-badge) { -webkit-text-stroke: 0; background: none; font-size: 0; line-height: 1; }
.ls-tabs .tab .tab-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 999px; background: var(--tint, var(--yellow)); color: #1c1633; font-size: 11px; font-weight: 900; }
.ls-tabs .tab.shut { opacity: .6; }
.ls-pack .ls-blurb { display: block; font-size: 12px; font-weight: 700; opacity: .85; margin: 1px 0 3px; }
.ls-pack .ls-ico { background: var(--tint, var(--yellow)); }
.lvl .nm .lvl-tag { display: block; font-size: 10px; opacity: .8; }
.gold-award small { display: block; font-size: 12px; font-weight: 800; margin-top: 2px; }
.toast.art { background: none; text-shadow: none; -webkit-text-stroke: 0; padding: 0; }
.toast.art img.callout { height: clamp(44px, 12vw, 70px); width: auto; display: block; filter: drop-shadow(0 4px 0 #0002); }
.toast.big.art img.callout { height: clamp(70px, 20vw, 120px); }
.toast.meter.art img.callout { height: clamp(52px, 13vw, 78px); }

/* ---- Sketchbook (js/sketchbook.js): the stencil drawings, a mode of their own ---- */
.title-card .sketch-btn { font-size: 20px; padding: 9px 30px; background: linear-gradient(#7fb8ff, #4a7fe0); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; } /* the title's SKETCHBOOK */
.ls-tabs .tab.sketch-tab { margin-left: 10px; border-style: dashed; background: #fff4c8; } /* its tab: set apart at the end of the worlds row */
.ls-tabs .tab.sketch-tab.on { background: var(--yellow); border-style: solid; }
body.dark .ls-tabs .tab.sketch-tab:not(.on) { background: #3a3450; }
.th-img.sketch-pic { object-fit: contain; background: #f6efd9; }
.lvl .meta .match-chip { font-size: 11px; font-weight: 900; }

/* NEW MODES: the title button and its menu of cards (js/main.js showNewModes) */
.title-card .modes-btn { font-size: 20px; padding: 9px 30px; background: linear-gradient(#ff9ec0, #e0527f); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; }
.mode-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.mode-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 16px; border: 3px solid var(--ink); border-radius: 16px; background: color-mix(in srgb, var(--tint) 22%, var(--card, #fffdf4)); box-shadow: 0 4px 0 var(--ink); cursor: pointer; font: inherit; color: inherit; }
.mode-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.mode-ico { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--tint); border: 3px solid var(--ink); flex: none; }
.mode-txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.mode-txt b { font-size: 19px; }
.mode-txt small { font-size: 13px; line-height: 1.3; opacity: 0.85; }
.mode-n { font-weight: 800; flex: none; }
