/* Nunito (SIL OFL 1.1, see vendor/nunito/OFL.txt) — served from this site */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap; src: url(vendor/nunito/nunito-latin.woff2) format('woff2'); }

/* Plane Parking's look: cream cards with a warm wood border */
:root {
  --cream: rgba(255, 249, 236, 0.9);
  --wood: #c99b6b;
  --ink: #5b3a1e;
  --ink-soft: #8a6646;
  --accent: #6aa84f;
  --accent-soft: #e4f3d6;
  --glow: #ffd84a;
  --heart: #e2483c;
  --shadow: 0 3px 0 rgba(120, 80, 40, 0.22), 0 10px 24px rgba(60, 40, 20, 0.16);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #cfe9f7; color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'PingFang TC', sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; transition: filter 1.2s ease; }
#game.grey { filter: grayscale(1) brightness(0.9); }

button { font: inherit; color: inherit; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.card { background: var(--cream); border: 2px solid var(--wood); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.eyebrow { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 3px;
  border-radius: 6px; border: 1.5px solid var(--wood); background: #fffdf6; box-shadow: 0 2px 0 var(--wood);
  font: 800 12px/1 'Nunito', sans-serif; color: var(--ink);
}

/* ---------- in-flight display ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.stat-card {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
}
/* the plane's health: its own card at the bottom middle, just over the Space button, where the eye already is */
.hp-card {
  position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); transform: translateX(-50%);
  display: flex; align-items: center; padding: 6px 12px; max-width: calc(100vw - 24px);
}
.timer { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.timer.overtime { color: #ffd84a; }
.lives { display: inline-flex; align-items: center; gap: 6px; line-height: 1; color: var(--heart); }
/* health: a bar with a notch at every unit (an ordinary hit), and the points beside it */
.hp { position: relative; display: block; height: 14px; max-width: calc(100vw - 110px); border-radius: 7px; background: #e9dcc6; box-shadow: inset 0 0 0 2px rgba(91, 58, 30, 0.35); overflow: hidden; }
.hp-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px 3px 3px 7px; background: linear-gradient(#ff7a6a, #e2483c 55%, #c63a30); transition: width 0.18s ease-out; }
.hp-ticks { position: absolute; inset: 0; background-image: linear-gradient(to right, transparent calc(100% - 2px), rgba(91, 58, 30, 0.45) calc(100% - 2px)); background-repeat: repeat-x; }
.hp-num { min-width: 2.2em; font-size: 15px; font-weight: 900; color: var(--ink, #5b3a1e); font-variant-numeric: tabular-nums; }
.lives.low .hp-fill { animation: hp-low 0.7s ease-in-out infinite; }
@keyframes hp-low { 50% { filter: brightness(1.5); } }
.lives.broken .hp { animation: heart-break 0.5s ease-out both; }
@media (prefers-reduced-motion: reduce) { .lives.low .hp-fill, .lives.broken .hp { animation: none; } .hp-fill { transition: none; } }
.heart.lost { color: #d8cbb6; }
.lives.broken .heart { animation: heart-break 0.5s ease-out both; }
@keyframes heart-break { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-12deg); } 100% { transform: scale(0.8) rotate(8deg); } }

.xp-card {
  position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; width: min(420px, calc(100vw - 24px));
}
.level { font-size: 16px; font-weight: 900; white-space: nowrap; }
.xp-bar { flex: 1; height: 10px; border-radius: 5px; background: #ece0c8; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: #ffd84a; transition: width 0.15s linear; }
.kills { font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
/* the soar (Space): a bar that fills while it recharges; the card is also a button for touch screens */
.air-card {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; width: min(260px, calc(100vw - 24px));
  pointer-events: auto; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; transition: opacity 0.15s ease, border-color 0.15s ease;
}
.air-card kbd { margin: 0; }
.air-name { font-size: 14px; font-weight: 900; }
.air-bar { flex: 1; height: 10px; border-radius: 5px; background: #ece0c8; overflow: hidden; }
.air-bar i { display: block; height: 100%; width: 100%; border-radius: 5px; background: #e0a43a; }
.air-card:not(.ready) { opacity: 0.8; cursor: default; }
.air-card.ready { border-color: var(--accent); }
.air-card.ready .air-bar i { background: var(--accent); }
.air-card.ready:hover { background: #fff8e0; }
/* in mid-air with a second hop left: the card lights up */
.air-card.again { opacity: 1; cursor: pointer; border-color: var(--glow); box-shadow: 0 0 0 4px rgba(255, 216, 74, 0.55), var(--shadow); }
.air-card.again .air-name { color: #b06a00; }
.air-card.again .air-bar i { background: var(--glow); }
/* at the very top: the moment to press */
.air-card.top { border-color: #ff4f9a; box-shadow: 0 0 0 6px rgba(255, 79, 154, 0.5), var(--shadow); scale: 1.06; }
.air-card.top .air-name { color: #e0257a; }
.air-card.top .air-bar i { background: #ff4f9a; }
@media (pointer: coarse) { .air-card kbd { display: none; } }

/* bosses: a name and health for each on the field, under the experience bar (they pile up when not beaten in
   time); an arrow at the screen edge for each out of sight */
.boss-bars {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 54px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; width: min(420px, calc(100vw - 24px)); pointer-events: none;
}
.boss-card { display: flex; align-items: center; gap: 10px; padding: 6px 14px; }
.boss-name { font-size: 14px; font-weight: 900; white-space: nowrap; }
.boss-hp { flex: 1; height: 12px; border-radius: 6px; background: #ece0c8; overflow: hidden; }
.boss-hp i { display: block; height: 100%; width: 100%; border-radius: 6px; background: var(--heart); transition: width 0.15s linear; }
/* a boss that is several (the brothers): a short bar each, its hat beside it; grey once that one is down */
.boss-parts { flex: 1; display: flex; gap: 8px; min-width: 0; }
.boss-part { flex: 1; display: flex; align-items: center; gap: 3px; min-width: 0; transition: opacity 0.3s ease; }
.boss-hat { flex: none; width: 20px; height: 20px; }
.boss-part.down { opacity: 0.35; }
.boss-part.down .boss-hat { filter: grayscale(1); }
.boss-pin { position: absolute; width: 0; height: 0; }
.boss-arrow {
  position: absolute; left: -24px; top: -24px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--cream); border: 2px solid var(--wood); box-shadow: var(--shadow); animation: pin-pulse 0.9s ease-in-out infinite;
}
.boss-arrow svg { width: 28px; height: 28px; fill: var(--heart); }
/* a map pickup out of sight: its badge, and an arrowhead outside it pointing the way (hud.js pickupPins) */
.item-pin { position: absolute; width: 0; height: 0; pointer-events: none; }
.item-badge {
  position: absolute; left: -22px; top: -22px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--cream); border: 3px solid var(--tint); box-shadow: 0 0 0 3px #fff8, 0 0 16px var(--tint), var(--shadow);
  animation: pin-pulse 1.1s ease-in-out infinite;
}
.item-badge svg { width: 28px; height: 28px; }
.item-way { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.item-way i { position: absolute; left: 25px; top: -9px; width: 0; height: 0; border-left: 14px solid var(--tint); border-top: 9px solid transparent; border-bottom: 9px solid transparent; filter: drop-shadow(0 1px 1px #0005); }
@keyframes pin-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.15; } }
/* narrower than this, the time card (about 190px from the left; 280px or so with the Practice tag and a big purse) would run into the
   level bar in the middle: the level bar and the boss bars move down under it */
@media (max-width: 1039px) {
  .xp-card { top: calc(max(12px, env(safe-area-inset-top)) + 56px); }
  .boss-bars { top: calc(max(12px, env(safe-area-inset-top)) + 106px); }
}

/* the landing slam: a white blink over the whole screen, and damage numbers that pop out of what was hit */
.hit-flash { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; }
.hit-flash.on { animation: hit-flash 0.2s ease-out; }
@keyframes hit-flash { 0% { opacity: 0.55; } 100% { opacity: 0; } }
.pops { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
/* the damage numbers (dmgnums.js): drawn on a canvas of their own, over the game and under everything else */
.dmg-nums { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* a move's name: slams in from the left, holds for a beat, leaves to the right */
.move-banner {
  position: fixed; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none; opacity: 0; white-space: nowrap; overflow: hidden; padding: 12px 0;
  font: 900 clamp(30px, 7.5vw, 76px)/1 'Nunito', sans-serif; letter-spacing: -0.01em; text-transform: uppercase; font-style: italic;
  color: var(--tone, #ffb81f); -webkit-text-stroke: clamp(6px, 1vw, 11px) #fff; paint-order: stroke fill;
  filter: drop-shadow(0 5px 0 rgba(60, 30, 10, 0.75));
}
.move-banner.on { animation: move-banner 1.15s cubic-bezier(0.2, 1.3, 0.3, 1) both; }
@keyframes move-banner {
  0% { opacity: 0; transform: translateX(-40%) skewX(-18deg) scale(1.6); }
  16% { opacity: 1; transform: translateX(0) skewX(-8deg) scale(1); }
  72% { opacity: 1; transform: translateX(2%) skewX(-8deg) scale(1.03); }
  100% { opacity: 0; transform: translateX(45%) skewX(-18deg) scale(0.9); }
}
@media (prefers-reduced-motion: reduce) { .move-banner.on { animation: move-banner-calm 1.15s linear both; } }
@keyframes move-banner-calm { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
.pop {
  position: absolute; translate: -50% -50%; white-space: nowrap;
  font: 900 30px/1 'Nunito', sans-serif; letter-spacing: -0.02em; color: #ffb81f;
  -webkit-text-stroke: 7px #fff; paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 #a8541a);
  animation: pop 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.pop.mid { font-size: 36px; color: #ff8a1e; filter: drop-shadow(0 3px 0 #9a3d0c); }
.pop.big { font-size: 44px; color: #ff4f9a; filter: drop-shadow(0 3px 0 #9c1f5c); }
/* how well the second hop was timed */
.pop.good, .pop.great, .pop.perfect { font-size: 24px; letter-spacing: 0.04em; -webkit-text-stroke-width: 6px; }
.pop.good { color: #8a9aa8; filter: drop-shadow(0 2px 0 #4b5661); }
.pop.great { color: #39b6e8; filter: drop-shadow(0 2px 0 #176a91); }
.pop.perfect { font-size: 32px; color: #ffcf24; filter: drop-shadow(0 3px 0 #b3541e); }
@keyframes pop {
  0% { transform: translateY(8px) scale(0.2) rotate(-8deg); opacity: 1; }
  22% { transform: translateY(-22px) scale(1.25) rotate(4deg); opacity: 1; }
  40% { transform: translateY(-30px) scale(1) rotate(0deg); opacity: 1; }
  80% { transform: translateY(-46px) scale(1); opacity: 1; }
  100% { transform: translateY(-58px) scale(0.9); opacity: 0; }
}

/* speed lines during a soar: thin white rays, only near the screen edge */
.rush {
  position: fixed; inset: -25%; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0) 0deg 4.6deg, rgba(255, 255, 255, 0.75) 5deg 5.5deg, rgba(255, 255, 255, 0) 5.9deg 9deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 52%, #000 95%);
  mask-image: radial-gradient(closest-side, transparent 52%, #000 95%);
}
.hurt-flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 10px rgba(226, 72, 60, 0.55), inset 0 0 90px rgba(226, 72, 60, 0.45); }
.hurt-flash.on { animation: hurt 0.45s ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- cards that cover the game ---------- */
.overlay {
  position: fixed; inset: 0; display: grid; place-items: safe center; padding: 16px;
  background: rgba(50, 35, 20, 0.28); backdrop-filter: blur(2px);
  overflow-y: auto; overscroll-behavior: contain;
}
.dialog { width: min(380px, 100%); padding: 22px 22px 20px; text-align: center; outline: none; }
.dialog h1 { margin: 0 0 8px; font-size: 34px; font-weight: 900; }
.dialog h2 { margin: 0 0 8px; font-size: 26px; font-weight: 900; }
.sub { margin: 0 0 14px; font-weight: 700; color: var(--ink-soft); }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 0 0 4px; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.keys span { white-space: nowrap; }
/* which steering hint shows: the mouse (default) or A and D (?controls=keys) */
.hint-mouse { display: none; }
body.ctl-mouse .hint-mouse { display: inline; }
body.ctl-mouse .hint-keys { display: none; }
body.ctl-mouse #game { cursor: none; }
/* mouse steering: a big pointer that shows on any ground, in one of the looks of src/reticle.js (practice panel: Aim ring).
   .rt is drawn round its own middle; the game's #reticle moves it to the pointer, the panel shows a small one on each button. */
.reticle { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; }
.reticle[data-look='invert'] { mix-blend-mode: difference; }
.rt { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.rt > i { position: absolute; display: block; box-sizing: border-box; }
/* the white ring (the first look) */
.rt-classic > i {
  left: -29px; top: -29px; width: 58px; height: 58px; border-radius: 50%;
  border: 4px solid #fff; box-shadow: 0 0 0 2.5px rgba(91, 58, 30, 0.8), inset 0 0 0 2.5px rgba(91, 58, 30, 0.8);
  animation: reticle 1.1s ease-in-out infinite;
}
.rt-classic > i::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2.5px rgba(91, 58, 30, 0.8);
}
/* hot pink: a thick magenta ring edged in black, four ticks outside it, a black dot */
.rt-pink > i:first-child {
  left: -27px; top: -27px; width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid #ff2fd0; box-shadow: 0 0 0 2.5px #1a0d14, inset 0 0 0 2.5px #1a0d14;
}
.rt-pink > i:first-child::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: #1a0d14; box-shadow: 0 0 0 2px #ff2fd0;
}
.rt-pink > i:not(:first-child) { width: 6px; height: 14px; margin: -7px 0 0 -3px; background: #ff2fd0; border: 2px solid #1a0d14; border-radius: 2px; }
.rt-pink > i:nth-child(2) { transform: translateY(-38px); }
.rt-pink > i:nth-child(3) { transform: translateY(38px); }
.rt-pink > i:nth-child(4) { transform: translateX(-38px) rotate(90deg); }
.rt-pink > i:nth-child(5) { transform: translateX(38px) rotate(90deg); }
/* spinning brackets: four black-and-yellow corners turning slowly round a yellow dot */
.rt-spin > i:first-child { left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #ffe100; border: 2.5px solid #111; }
.rt-spin > i:not(:first-child) {
  left: -30px; top: -30px; width: 60px; height: 60px; border: 6px solid transparent; border-radius: 6px;
  animation: rt-turn 2.4s linear infinite;
}
.rt-spin > i:not(:first-child)::before {
  content: ''; position: absolute; inset: -9px; border-radius: 7px; border: 9px solid #111;
  clip-path: polygon(0 0, 36% 0, 36% 13%, 13% 13%, 13% 36%, 0 36%);
}
.rt-spin > i:not(:first-child)::after {
  content: ''; position: absolute; inset: -6px; border-radius: 5px; border: 4px solid #ffe100;
  clip-path: polygon(0 0, 31% 0, 31% 8%, 8% 8%, 8% 31%, 0 31%);
}
.rt-spin > i:nth-child(3) { animation-delay: -0.6s; }
.rt-spin > i:nth-child(4) { animation-delay: -1.2s; }
.rt-spin > i:nth-child(5) { animation-delay: -1.8s; }
@keyframes rt-turn { to { transform: rotate(360deg); } }
/* always contrast: a white ring and dot drawn as "difference", so it is dark on light ground and light on dark */
.rt-invert > i:first-child { left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%; border: 7px solid #fff; }
.rt-invert > i:last-child { left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
/* lines across: a dark line each way across the whole screen through the pointer, and a small ring where they cross */
.rt-lines > i:nth-child(1) { left: -200vw; top: -2px; width: 400vw; height: 4px; background: rgba(32, 16, 48, 0.62); border-top: 1px solid rgba(255, 255, 255, 0.7); border-bottom: 1px solid rgba(255, 255, 255, 0.7); }
.rt-lines > i:nth-child(2) { top: -200vh; left: -2px; height: 400vh; width: 4px; background: rgba(32, 16, 48, 0.62); border-left: 1px solid rgba(255, 255, 255, 0.7); border-right: 1px solid rgba(255, 255, 255, 0.7); }
.rt-lines > i:nth-child(3) { left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; border: 4px solid #ffe100; box-shadow: 0 0 0 2.5px #20102f, inset 0 0 0 2.5px #20102f; }
/* dark halo: the ground round the pointer dimmed, and a bright yellow ring in the calm */
.rt-halo > i:nth-child(1) { left: -80px; top: -80px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(closest-side, rgba(18, 10, 36, 0.5), rgba(18, 10, 36, 0.38) 55%, rgba(18, 10, 36, 0) 100%); }
.rt-halo > i:nth-child(2) { left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 5px solid #ffe14a; box-shadow: 0 0 10px 2px rgba(255, 225, 74, 0.7); animation: reticle 1.1s ease-in-out infinite; }
.rt-halo > i:nth-child(3) { left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #ffe14a; }
@keyframes reticle { 0%, 100% { scale: 1; } 50% { scale: 0.88; } }
/* the practice panel's small one on each Aim ring button: a bit of busy field with the look over it */
.pp-rt-demo {
  position: relative; flex: none; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 30% 35%, #fff 0 3px, transparent 4px), radial-gradient(circle at 70% 70%, #fff9c4 0 4px, transparent 5px), radial-gradient(circle at 75% 25%, #ffffffcc 0 6px, transparent 9px), #8cc96b;
}
.pp-rt-demo > .rt { left: 50%; top: 50%; transform: scale(0.62); }
.pp-rt-demo > .rt-invert { mix-blend-mode: difference; }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.btn {
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--wood); background: #fffdf6; cursor: pointer;
  font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--wood); transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { background: #fff3d6; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood); }
.btn.primary { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 70%, #000); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }

.stats { display: flex; justify-content: center; gap: 22px; margin: 6px 0 0; }
.stats dt { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* level-up: three cards side by side, stacked on a narrow screen */
.pick-dialog { width: min(660px, 100%); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pick-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 150px; padding: 16px 12px 14px;
  border: 2px solid var(--wood); border-radius: 14px; background: #fffdf6; box-shadow: 0 3px 0 var(--wood); cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.pick-card:hover { background: #fff3d6; transform: translateY(-2px); }
.pick-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood); }
.pick-icon { font-size: 34px; line-height: 1; }
/* the paper icons (papericons.js): a picture of cut paper stacked up in place of the emoji; 48 px on a phone */
.pick-card.paper .pick-icon { position: relative; }
.pick-icon .paper-icon { display: block; width: 64px; height: 64px; }
.pick-name { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pick-title { font-size: 17px; font-weight: 900; }
.pick-zh { font-size: 13px; font-weight: 800; line-height: 1.35; color: #8a5a2b; }
.pick-zh:empty { display: none; }
.pick-text { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pick-card kbd { position: absolute; top: 8px; left: 8px; margin: 0; }
@media (pointer: coarse) { .pick-card kbd, .keys { display: none; } }
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .pick-card { flex-direction: row; text-align: left; min-height: 64px; padding: 10px 12px 10px 14px; gap: 12px; }
  .pick-card .pick-name { flex: 1; align-items: flex-start; min-width: 0; }
  .pick-card kbd { position: static; order: 9; margin-left: auto; }
  .pick-icon .paper-icon { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  #game, .btn, .pick-card, .xp-bar i { transition: none; }
  .hurt-flash.on, .lives.broken .heart, .boss-arrow, .item-badge { animation: none; }
  .rush, .hit-flash { display: none; }
  .rt > i, .rt > i::before, .rt > i::after { animation: none; }
  .pop { animation-timing-function: linear; }
}

/* ================= coins, results and the shop ================= */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the coin, drawn rather than an emoji so it looks the same everywhere: gold face, darker rim, a star */
.coin {
  position: relative; display: inline-block; flex: none; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.14em;
  background: #ffd23f; border: 0.13em solid #e39b17; box-shadow: inset 0 -0.09em 0 rgba(160, 90, 0, 0.28), 0 0.06em 0 rgba(120, 80, 40, 0.3);
}
.coin::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.52em; line-height: 1; color: #c47f0a; }

/* in flight: the count sits with the timer and hearts; it jumps when a coin lands in it */
.coin-count { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding-left: 10px; border-left: 2px solid rgba(201, 155, 107, 0.5); font-size: 18px; }
.coin-count b { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 1.2ch; }
.coin-count.bump { animation: coin-bump 0.28s ease-out; }
@keyframes coin-bump { 0% { scale: 1; } 40% { scale: 1.32; } 100% { scale: 1; } }
/* a coin flying from where it was picked up to the count */
.fly-coins { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.fly-coin { position: absolute; left: 0; top: 0; font-size: 22px; will-change: transform; transition: transform 0.5s cubic-bezier(0.5, -0.3, 0.7, 0.6), opacity 0.5s ease-in; }
.fly-coin.big { font-size: 30px; }
/* the experience bar blinks when a star goes in */
.xp-bar.gain i { animation: xp-gain 0.3s ease-out; }
@keyframes xp-gain { 0% { filter: brightness(1.7); } 100% { filter: brightness(1); } }
.pop.word { font-size: 34px; color: #39b6e8; filter: drop-shadow(0 3px 0 #176a91); letter-spacing: 0.04em; }
.pop.coins { font-size: 30px; color: #ffcf3a; filter: drop-shadow(0 3px 0 #a8641a); }

/* purse and rank chips (start card, shop) */
.wallet { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 12px 0 2px; }
.purse { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; background: #fffdf6; border: 2px solid var(--wood); font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.purse.big { font-size: 22px; padding: 6px 16px 6px 10px; box-shadow: 0 3px 0 var(--wood); }
.purse.spend { animation: coin-bump 0.28s ease-out; }
.rank-chip { padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: #3f6f2b; font-size: 13px; font-weight: 800; }
.rank-chip b { font-weight: 900; }
.plane-chip { background: #fbeccd; color: var(--ink-soft); }
.plane-chip b { color: var(--ink); }
.wallet { flex-wrap: wrap; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; vertical-align: 1px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.dialog-actions.two { flex-direction: row; }
.dialog-actions.two .btn { flex: 1; }

/* pilot rank: a round wooden badge and a bar toward the next rank */
.rank-row { display: flex; align-items: center; gap: 12px; text-align: left; }
.rank-badge {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: #f4d9a8; border: 3px solid var(--wood); box-shadow: 0 3px 0 #9b6d43, inset 0 0 0 3px #fff6df; font-size: 20px; font-weight: 900; color: var(--ink);
}
.rank-badge.up { animation: rank-up 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); background: var(--glow); }
@keyframes rank-up { 0% { scale: 1; rotate: 0deg; } 40% { scale: 1.45; rotate: -10deg; } 100% { scale: 1; rotate: 0deg; } }
.rank-meter { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rank-text { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.rank-text b { color: var(--ink); font-weight: 900; }
.rank-bar { height: 12px; border-radius: 6px; background: #ece0c8; overflow: hidden; }
.rank-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--accent); }
.rank-news { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: #3f6f2b; font-size: 13px; font-weight: 800; text-align: left; }
.rank-news b { font-weight: 900; }

/* ---------- results: the run is added up line by line ---------- */
.results { width: min(440px, 100%); }
.results .stats { margin-bottom: 14px; }
.ledger { list-style: none; margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 253, 246, 0.85); border: 2px dashed rgba(201, 155, 107, 0.7); text-align: left; }
.ledger li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 14px; font-weight: 800; color: var(--ink-soft); animation: ledger-in 0.28s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.ledger li b { margin-left: auto; font-size: 16px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.ledger li.new { color: #3f6f2b; }
.ledger li.new::before { content: 'NEW'; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; }
.ledger li.none { justify-content: center; font-weight: 700; }
@keyframes ledger-in { 0% { opacity: 0; transform: translateX(-14px); } 100% { opacity: 1; transform: none; } }
.ledger-total { display: flex; align-items: center; justify-content: space-between; margin: 10px 2px 14px; font-size: 15px; font-weight: 900; }
.ledger-total b { display: inline-flex; align-items: center; gap: 8px; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.ledger-total b.land { animation: coin-bump 0.35s ease-out; }
.skip-hint { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: var(--ink-soft); min-height: 1.2em; }
@media (pointer: coarse) { .skip-hint { display: none; } }

/* level-up: the redraw button under the cards */
.pick-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pick-tools:not(:has(button:not([hidden]))) { display: none; }
#banish-btn[aria-pressed='true'] { border-color: #c2452f; background: #ffe6df; }
/* choosing a card to send away: the cards say so, and the ones that cannot go step back */
.pick-dialog.banishing .pick-card:not(.fixed) { border-style: dashed; border-color: #c2452f; }
.pick-dialog.banishing .pick-card:not(.fixed):hover, .pick-dialog.banishing .pick-card:not(.fixed):focus-visible { background: #ffe6df; }
.pick-dialog.banishing .pick-card:not(.fixed) .pick-icon::after { content: '🚫'; position: absolute; font-size: 0.6em; translate: -0.5em 0.9em; }
.pick-dialog.banishing .pick-card.paper:not(.fixed) .pick-icon::after { right: -6px; bottom: -4px; font-size: 22px; translate: none; }
.pick-dialog.banishing .pick-card.fixed { opacity: 0.45; cursor: not-allowed; }
.reroll kbd { margin: 0 2px 0 4px; }
.reroll-left { color: var(--ink-soft); font-weight: 800; }
@media (pointer: coarse) { .reroll kbd { display: none; } }

/* ---------- the shop ---------- */
.shop-overlay { place-items: center; background: rgba(50, 35, 20, 0.4); }
.shop { background: #fff8ea; backdrop-filter: none; display: flex; flex-direction: column; gap: 12px; width: min(960px, 100%); max-height: min(720px, calc(100dvh - 32px)); padding: 18px 20px 16px; outline: none; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-head h2 { margin: 0; font-size: 26px; font-weight: 900; }
.tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--wood); padding: 0 4px; }
.tab {
  position: relative; top: 2px; min-height: 44px; padding: 0 18px; border: 2px solid transparent; border-bottom: none; border-radius: 12px 12px 0 0;
  background: none; cursor: pointer; font-size: 15px; font-weight: 800; color: var(--ink-soft);
}
.tab:hover { color: var(--ink); background: rgba(255, 253, 246, 0.6); }
.tab[aria-selected='true'] { background: #fffdf6; border-color: var(--wood); color: var(--ink); font-weight: 900; }
.shop-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px; align-content: start; padding: 4px 4px 8px; outline: none; }
.item {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 12px; border-radius: 14px; background: #fffdf6; border: 2px solid var(--wood); box-shadow: 0 3px 0 rgba(155, 109, 67, 0.55);
}
.item-top { display: flex; align-items: center; gap: 10px; }
.item-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fbeccd; border: 2px solid var(--wood); font-size: 22px; line-height: 1; }
/* a thing with a cut-paper picture (shoppaper.js): the picture alone, no round plate behind it */
.item-icon.paper { width: 56px; height: 56px; border: 0; border-radius: 0; background: none; }
.item-icon .paper-icon, .pack-icon .paper-icon { display: block; width: 100%; height: 100%; }
.item-top > div { flex: 1; min-width: 0; }
.item-name { font-size: 16px; font-weight: 900; line-height: 1.15; }
.pips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pip { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #ece0c8; border: 2px solid var(--wood); }
.pip.on { background: var(--glow); border-color: #c98a12; }
.pip.fresh { animation: coin-bump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
/* a plane's level: 99 of them, so a number and a bar */
.plane-level { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.plane-level .level-of { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.level-bar { flex: 1; align-self: center; min-width: 30px; height: 8px; border-radius: 999px; background: #ece0c8; border: 2px solid var(--wood); overflow: hidden; }
.level-bar i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--glow); }
.level-bar i.fresh { animation: coin-bump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
/* a button with two lines: what it does, and the price under it */
.buy.stack { flex-direction: column; gap: 1px; padding: 5px 8px; line-height: 1.15; font-size: 13px; }
.item-row .buy.stack { flex: 1; min-width: 0; }
.item-text { margin: 0; min-height: 2.5em; font-size: 13px; font-weight: 700; color: var(--ink-soft); line-height: 1.25; }
.item-text b { color: var(--ink); font-weight: 900; }
.buy {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: auto; padding: 0 12px; border-radius: 12px; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #000); background: var(--accent); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000);
  font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; transition: transform 0.12s ease, background 0.12s ease;
}
.buy:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 60%, #000); }
/* cannot be bought yet: plainly not a live button, with the reason written on it */
.buy[aria-disabled='true'] { cursor: default; background: #efe6d2; border-color: #cdbb9d; color: #8a6646; box-shadow: none; font-size: 13px; font-weight: 800; }
.buy[aria-disabled='true']:active { transform: none; }
.buy .price { display: inline-flex; align-items: center; gap: 5px; }
/* a locked button: what is in the way on the first line, the price under it */
.buy[aria-disabled='true'] { flex-direction: column; gap: 1px; padding: 5px 10px; line-height: 1.15; }
.buy .lock-why { font-weight: 900; color: var(--ink); }
.buy .lock-price { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; opacity: 0.85; }
.item.max { background: #fff6da; border-color: #d9a43a; }
.item-max { display: grid; place-items: center; min-height: 44px; margin-top: auto; border-radius: 12px; background: var(--glow); color: #7a4b00; font-size: 14px; font-weight: 900; letter-spacing: 0.08em; }
.item.bought { animation: item-bought 0.5s ease-out; }
@keyframes item-bought { 0% { box-shadow: 0 0 0 0 rgba(255, 216, 74, 0.9), 0 3px 0 rgba(155, 109, 67, 0.55); } 100% { box-shadow: 0 0 0 16px rgba(255, 216, 74, 0), 0 3px 0 rgba(155, 109, 67, 0.55); } }
.shop-toast { margin: 0; min-height: 1.3em; font-size: 13px; font-weight: 800; color: #3f6f2b; text-align: center; }
.shop-foot { display: flex; align-items: center; gap: 10px; }
.shop-foot .grow { flex: 1; }
.shop-foot .btn { min-width: 120px; }
/* items: what is packed for the next run, then a card for each item with Buy and Pack */
.pack { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); border: 2px dashed color-mix(in srgb, var(--accent) 60%, #fff); }
.pack-title { font-size: 14px; font-weight: 900; color: #3f6f2b; }
.pack-slots { display: flex; gap: 8px; }
.pack-slot { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px dashed #b9cfa6; color: #7f9a6c; font-size: 13px; font-weight: 800; }
.pack-slot.full { border-style: solid; border-color: var(--accent); background: #fffdf6; color: var(--ink); }
.pack-icon { font-size: 18px; line-height: 1; }
.pack-icon.paper { flex: none; width: 30px; height: 30px; }
.pack-hint { flex: 1 1 220px; font-size: 12px; font-weight: 700; color: #5d7f4a; }
.item-what { margin: 0; font-size: 12px; font-weight: 700; color: var(--ink-soft); line-height: 1.25; }
.item-row .item-max { flex: 1.2; margin-top: 0; }
.item-have { margin-top: 3px; font-size: 12px; font-weight: 900; color: #3f6f2b; }
.item-have.none { color: var(--ink-soft); font-weight: 800; }
.item.packed { border-color: var(--accent); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.item-row { display: flex; gap: 8px; margin-top: auto; }
.item-row .buy { flex: 1.2; margin-top: 0; }
.item-row .buy[aria-disabled='true'] { font-size: 12px; }
.pack-btn {
  flex: 1; min-height: 44px; padding: 0 8px; border-radius: 12px; cursor: pointer; border: 2px solid var(--wood); background: #fffdf6; box-shadow: 0 3px 0 var(--wood);
  font-size: 14px; font-weight: 900; line-height: 1.1; transition: transform 0.12s ease, background 0.12s ease;
}
.pack-btn:hover { background: #fff3d6; }
.pack-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood); }
.pack-btn[aria-pressed='true'] { white-space: nowrap; font-size: 13px; background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000); color: #2f5a1e; }
.pack-btn[aria-disabled='true'] { cursor: default; background: #efe6d2; border-color: #cdbb9d; color: #8a6646; box-shadow: none; font-size: 12px; font-weight: 800; }
.pack-btn[aria-disabled='true']:active { transform: none; }
/* the start card says what is packed */
.packed-line { margin: 10px 0 0; font-size: 13px; font-weight: 800; color: #3f6f2b; }

/* in flight: the items taken on this run, under the timer; one that has been used goes pale */
.run-items { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 58px); left: max(12px, env(safe-area-inset-left)); display: flex; gap: 6px; }
.run-item { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 10px; border-radius: 999px; background: var(--cream); border: 2px solid var(--wood); box-shadow: var(--shadow); font-size: 18px; line-height: 1; }
.run-item.used { opacity: 0.4; filter: grayscale(1); box-shadow: none; }
.run-item.used kbd { display: none; }
button.run-item { pointer-events: auto; cursor: pointer; min-height: 44px; padding: 0 12px; touch-action: none; }
button.run-item:not(.used) { border-color: var(--heart); animation: bomb-ready 1.4s ease-in-out infinite; }
@keyframes bomb-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 72, 60, 0.45), var(--shadow); } 50% { box-shadow: 0 0 0 6px rgba(226, 72, 60, 0), var(--shadow); } }
.run-item kbd { margin: 0; }
.run-count { font-size: 13px; font-weight: 900; color: var(--ink); }
/* the Bomb Cloud while the next bomb is on its way: only the icon goes pale, so the seconds stay easy to read */
.run-item.waiting { opacity: 1; filter: none; }
.run-item.waiting .run-icon { opacity: 0.4; filter: grayscale(1); }
.run-wait { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: #8a6646; }
@media (pointer: coarse) { .run-item kbd { display: none; } }
@media (max-width: 720px) { .run-items { top: calc(max(12px, env(safe-area-inset-top)) + 112px); } }

/* a rainbow (rare) card: gold. Its badge says what it does more (rareBadge in upgrades.js): ×2, or on a weapon's track 突破 +1 / +2 級 */
.pick-card.rare { border-color: #d9a43a; background: #fff6da; box-shadow: 0 3px 0 #c98a12, 0 0 0 4px rgba(255, 216, 74, 0.5); }
.pick-card.rare.no-badge::after { display: none; }
.pick-card.rare::after { content: attr(data-badge); position: absolute; top: -10px; right: -8px; padding: 3px 9px; border-radius: 999px; background: var(--glow); border: 2px solid #c98a12; color: #7a4b00; font-size: 13px; font-weight: 900; rotate: 8deg; }
.pick-dialog.lucky h2 { color: #b06a00; }

@media (max-width: 640px) {
  .shop-overlay { padding: 0; }
  .shop { width: 100%; max-height: none; height: 100dvh; border-radius: 0; border-width: 0; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .shop-head h2 { font-size: 22px; }
  .shop-grid { grid-template-columns: 1fr; }
  .item-text { min-height: 0; }
  .tab { flex: 1; padding: 0 8px; }
  .shop-foot .btn { min-width: 0; flex: 1; }
  .dialog-actions.two { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  button.run-item:not(.used) { animation: none; }
  .coin-count.bump, .purse.spend, .rank-badge.up, .ledger li, .ledger-total b.land, .pip.fresh, .level-bar i.fresh, .item.bought, .xp-bar.gain i { animation: none; }
  .fly-coin { transition-duration: 0.01s; }
}

/* ================= the practice panel (bottom-right) ================= */
/* the release (tools/build.sh, src/release.js): no practice panel for the players */
html[data-release='1'] #practice { display: none !important; }
.practice { position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 5; }
.practice-toggle { min-height: 44px; padding: 0 14px; cursor: pointer; font-size: 14px; font-weight: 900; }
.practice-toggle:hover { background: #fff3d6; }
.practice-toggle[aria-expanded='true'] { border-color: var(--accent); background: var(--accent-soft); }
.practice-panel { width: min(300px, calc(100vw - 24px)); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px 14px; background: #fff8ea; backdrop-filter: none; font-size: 13px; }
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pp-head b { font-size: 17px; font-weight: 900; }
.pp-note { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: right; }
/* the practice panel's tabs: they stay at the top while the page under them scrolls */
.pp-tabs { position: sticky; top: -12px; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 4px -4px 2px; padding: 8px 4px 6px; background: #fff8ea; }
.pp-tab { min-height: 32px; padding: 2px 4px; border-radius: 10px; border: 2px solid #c99b6b; background: #fffdf6; color: #5b3a1e; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.pp-tab:hover { background: #f3ead8; }
.pp-tab[aria-selected='true'] { background: #6aa84f; border-color: #4f8a3a; color: #fff; }
.pp-tab:focus-visible { outline: 3px solid #6aa84f; outline-offset: 2px; }
@media (pointer: coarse) { .pp-tab { min-height: 44px; font-size: 13px; } }
.pp-lead { margin: 4px 0 6px; padding: 6px 8px; border-radius: 8px; background: #eef6e2; color: #3f6b2c; font-weight: 800; }
.pp-page > .pp-section:first-child { margin-top: 2px; padding-top: 4px; border-top: 0; }
.pp-section { margin-top: 10px; padding-top: 8px; border-top: 2px dashed rgba(201, 155, 107, 0.55); }
.pp-title { margin: 0 0 6px; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.pp-planes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.pp-plane, .pp-act { min-height: 40px; padding: 2px 4px; border-radius: 10px; border: 2px solid var(--wood); background: #fffdf6; cursor: pointer; font-size: 12px; font-weight: 800; line-height: 1.15; }
.pp-plane { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; }
.pp-plane .pp-icon { font-size: 18px; }
.pp-plane:hover, .pp-act:hover { background: #fff3d6; }
.pp-act.pp-danger { border-color: #c2553f; color: #a23a26; } /* (Reset everything: it cannot be undone) */
.pp-act.pp-danger:hover { background: #fde6df; }
.pp-plane[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: #2f5a1e; font-weight: 900; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.pp-name { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.pp-icon { font-size: 16px; line-height: 1; }
/* a name with its Chinese line under it */
.pp-words { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pp-zh { font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--ink-soft); }
.pp-ability .pp-move:has(> .pp-zh) { flex-wrap: wrap; row-gap: 0; }
.pp-zh { display: block; }
.pp-has-zh { flex-wrap: wrap; row-gap: 0; padding-bottom: 4px; }
.pp-zh-row { order: 9; flex-basis: 100%; box-sizing: border-box; margin-top: -4px; padding-left: 22px; }
.pp-ability .pp-bin { margin-left: auto; }
.pp-has-zh .pp-name { flex: 1 1 0; min-width: 0; } /* a long name wraps; the buttons stay on one line at the right */
.pp-has-zh .pp-step, .pp-has-zh .pp-picks, .pp-has-zh .pp-bin { flex: none; }
.pp-step { display: inline-flex; align-items: center; gap: 4px; }
.pp-btn { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--wood); background: #fffdf6; box-shadow: 0 2px 0 var(--wood); cursor: pointer; font-size: 18px; font-weight: 900; line-height: 1; }
.pp-btn:hover { background: #fff3d6; }
.pp-btn:active { transform: translateY(2px); box-shadow: none; }
.pp-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.pp-num { min-width: 2ch; text-align: center; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pp-weapon .pp-num { min-width: 4ch; }
.pp-num.pp-broke { color: #b07d00; text-shadow: 0 0 6px rgba(255, 200, 40, 0.6); } /* one past the top: a rainbow card's level */
.pp-weapon > .pp-hint { margin: 0 0 4px; }
.pp-weapon .pp-row { padding-left: 4px; }
.pp-weapon-bin { margin-top: 4px; align-self: flex-start; }
.pp-check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 800; cursor: pointer; }
.pp-check input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.pp-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
/* moves and abilities: folded by group, so a hundred of them stay findable */
.pp-stop b { font-variant-numeric: tabular-nums; font-weight: 900; }
.pp-hint { margin: 0 0 6px; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.pp-fold { border-radius: 10px; margin-bottom: 4px; }
.pp-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 8px; border-radius: 10px; cursor: pointer; font-weight: 900; list-style: none; background: #fbf0d9; }
.pp-fold > summary::-webkit-details-marker { display: none; }
.pp-fold > summary::after { content: '▸'; color: var(--ink-soft); }
.pp-fold[open] > summary::after { content: '▾'; }
.pp-fold > summary:hover { background: #fff3d6; }
.pp-fold > summary:focus-visible, .pp-move:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.pp-fold .pp-count { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.pp-fold > .pp-actions, .pp-fold > .pp-abilities { padding: 6px 0 4px; }
/* a value ticked from a row of numbers (hops in a row) */
/* the name on a line of its own, the numbers across the whole width under it (they used to squeeze the name to nothing and cover it) */
.pp-pick-row { flex-wrap: wrap; row-gap: 6px; }
.pp-pick-row .pp-name { flex: 1 1 100%; }
.pp-pick-row .pp-picks { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; box-sizing: border-box; padding-left: 22px; }
.pp-pick { position: relative; display: grid; place-items: center; height: 34px; cursor: pointer; }
.pp-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pp-pick span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 10px; border: 2px solid var(--wood); background: #fffdf6; font-weight: 900; font-variant-numeric: tabular-nums; }
.pp-pick:hover span { background: #fff3d6; }
.pp-pick input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.pp-pick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .pp-pick { height: 44px; } .pp-pick-row .pp-picks { gap: 4px; padding-left: 0; } }
.pp-moves { display: grid; gap: 6px; padding: 6px 0 4px; }
/* the HD-2D page: a slider a row — name and number on top, what it does, the slider across the whole width */
.pp-slider { display: grid; gap: 2px; padding: 4px 6px 6px; margin: 0 -6px 2px; border-radius: 8px; }
.pp-slider.pp-changed { background: #eef6e2; box-shadow: inset 3px 0 0 var(--accent); }
.pp-slider-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pp-slider-name { font-weight: 800; cursor: pointer; }
.pp-slider-num { font-size: 13px; min-width: 4ch; text-align: right; }
.pp-slider-right { display: flex; align-items: center; gap: 6px; }
.pp-slider-back { min-width: 52px; height: 28px; padding: 0 8px; border-radius: 8px; border: 2px solid var(--wood); background: #fffdf6; color: inherit; font: inherit; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.pp-slider-back:hover:not(:disabled) { background: #fff3d6; }
.pp-slider-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pp-slider-back:disabled { opacity: 0.4; cursor: default; }
.pp-slider-top { align-items: center; }
.pp-slider input[type='range'] { width: 100%; height: 28px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pp-slider input[type='range']:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (pointer: coarse) { .pp-slider input[type='range'] { height: 44px; } .pp-slider-back { height: 44px; min-width: 60px; } }
.pp-move-row { display: flex; align-items: center; gap: 8px; }
/* under a move that has levels: a button for each level */
.pp-move-levels { display: flex; gap: 4px; margin: -2px 0 4px; }
.pp-level { flex: 1 1 0; min-width: 0; padding: 4px 2px; font-size: 12px; white-space: nowrap; }
.pp-level[aria-pressed='true'] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (pointer: coarse) { .pp-level { min-height: 44px; } }
/* the new sounds not heard yet, and the slots not chosen in yet: pink (the user, 2026-11-16) */
.pp-fold.pp-fresh > summary { background: #ffe0ef; box-shadow: inset 4px 0 0 #d63c8f; }
.pp-fold.pp-fresh > summary:hover { background: #ffd0e6; }
.pp-fold.pp-fresh .pp-count { color: #b0236f; }
.pp-move-row.pp-fresh .pp-move { border-color: #e98abb; background: #fff0f7; }
/* a move unticked on the Moves page: not a level-up card, still there to try */
.pp-moves .pp-tick { accent-color: #2f8a4a; }
.pp-move-row.pp-off .pp-move { opacity: 0.55; }
.pp-new { flex: none; margin-left: auto; padding: 1px 6px; border-radius: 999px; background: #d63c8f; color: #fff; font-size: 10px; font-weight: 900; line-height: 1.5; }
.pp-sub .pp-new { margin-left: 4px; vertical-align: 1px; }
.pp-fresh-note { color: #b0236f; }
.pp-tick { flex: none; width: 20px; height: 20px; accent-color: #c2452f; cursor: pointer; }
.pp-tick:disabled { cursor: default; opacity: 0.4; }
.pp-want { accent-color: #4f9a3a; }
.pp-bin, .pp-store, .pp-many { flex: none; min-width: 40px; padding: 4px 8px; }
@media (pointer: coarse) { .pp-bin, .pp-store, .pp-many { min-width: 44px; min-height: 44px; } }
.pp-tabs .pp-tab:last-child:nth-child(3n + 1) { grid-column: 1 / -1; } /* Storage, alone on the last line, takes it all */
.pp-empty { padding: 6px 0; }
.pp-sub { margin: 8px 0 2px; font-size: 13px; color: var(--soft, #8a6646); }
.pp-want:disabled { cursor: default; opacity: 0.6; }
.pp-copy { flex: none; min-width: 56px; padding: 4px 8px; font-size: 12px; }
.pp-copy-done { color: #3f7f2e; border-color: #8cc46e; background: #eef8e6; }
@media (pointer: coarse) { .pp-copy { min-width: 56px; min-height: 44px; } }
.pp-move { flex: 1; display: flex; align-items: center; gap: 6px; text-align: left; padding: 4px 8px; }
.pp-delete-bar { display: grid; gap: 6px; margin-top: 8px; }
.pp-act:disabled { opacity: 0.5; cursor: default; }
.pp-said:empty { display: none; }
.pp-said { margin-top: 6px; }
@media (pointer: coarse) { .pp-tick { width: 28px; height: 28px; margin: 8px; } }
.pp-move[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.pp-boss-moves { display: grid; gap: 4px; margin: -2px 0 6px 28px; padding-left: 10px; border-left: 2px solid #ead9bd; }
.pp-boss-move .pp-move { font-size: 13px; padding: 3px 8px; }
.pp-boss-move .pp-tick:disabled { cursor: default; opacity: 0.4; }
.pp-move-text { flex: 1; min-width: 0; padding: 3px 8px; font-size: 13px; color: var(--soft, #8a6646); }
.pp-gone .pp-move, .pp-gone .pp-move-text { text-decoration: line-through; }
.pp-boss-info { margin: -2px 0 4px 28px; font-size: 12px; }
.pp-move:has(> .pp-zh) { flex-wrap: wrap; row-gap: 0; }
.pp-move > .pp-zh { display: block; flex-basis: 100%; font-size: 0.86em; font-weight: 500; opacity: 0.72; white-space: nowrap; }
.pp-boss-order { font-size: 12px; }
.pp-move-two, .pp-move-text { flex-direction: column; align-items: flex-start; gap: 1px; }
.pp-move-text { display: flex; }
.pp-hit { font-size: 11px; font-weight: 600; color: #a2452c; }
.pp-gone .pp-hit { text-decoration: none; }
@media (pointer: coarse) { .pp-boss-info { margin-left: 14px; } }
@media (pointer: coarse) { .pp-boss-moves { margin-left: 14px; } }
.pp-ability { align-items: flex-start; padding: 4px 2px; min-height: 0; }
.pp-ability input { flex: none; margin-top: 1px; }
.pp-ability b { display: block; font-weight: 900; }
.pp-ability small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); line-height: 1.25; }
@media (pointer: coarse) { .pp-fold > summary { min-height: 44px; } .pp-ability { min-height: 44px; } }
.pp-normal { width: 100%; margin-top: 12px; }
/* where the plane is (hud.js coordsOf), under the time card: practice runs only */
.coords { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 54px); left: max(12px, env(safe-area-inset-left)); padding: 4px 10px; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink, #5b3a1e); white-space: nowrap; }
.coords[hidden] { display: none; }
/* narrower, the level bar and the boss bars fill the top (see the max-width: 1039px rule): down to the bottom left, over the item button */
@media (max-width: 1039px) { .coords { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px); } }
@media (max-width: 640px) { .coords { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 150px); } } /* (a phone: the item button sits higher, over the health bar) */
.practice-tag { padding: 3px 8px; border-radius: 999px; background: #ffe7a6; border: 2px solid #d9a43a; color: #7a4b00; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
/* on a phone the closed Practice button would sit on the level-up card's buttons: it steps aside while the card is up */
@media (max-width: 720px) { body:has(#levelup:not([hidden])) .practice-toggle[aria-expanded='false'] { visibility: hidden; } }
/* a phone: the Space button and the health bar fill the bottom middle, so the practice button goes up above the health
   bar (level with the weapons on the left) as just its icon */
@media (max-width: 720px) {
  .practice { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 102px); }
  .practice-panel { max-height: calc(100dvh - 190px); }
  .practice-toggle { width: 44px; padding: 0; font-size: 20px; }
  .practice-word { display: none; }
}
@media (pointer: coarse) { .pp-btn { width: 44px; height: 44px; } .pp-plane, .pp-act, .pp-check { min-height: 44px; } }

/* ================= the card pool ================= */
/* in flight, bottom-left: what the plane carries — weapons, passives, landing magic — each with its level */
.loadout { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px; max-width: min(46vw, 520px); }
.lo-group { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--cream); border: 2px solid var(--wood); box-shadow: var(--shadow); }
.lo-chip { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fffdf6; font-size: 18px; line-height: 1; }
.lo-chip b { position: absolute; right: -3px; bottom: -4px; min-width: 16px; padding: 1px 3px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.lo-chip.fresh { animation: coin-bump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@media (max-width: 720px) { .loadout { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 102px); max-width: calc(100vw - 24px); } .lo-chip { width: 30px; height: 30px; font-size: 16px; } }

/* a level-up card says what kind of thing it is, and whether it is new or which level it becomes */
.pick-card { padding-top: 26px; }
.pick-kind { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.pick-card[data-kind='weapon'] .pick-kind, .pick-card[data-kind='track'] .pick-kind { color: #b0601a; }
.pick-card.rare:not(.no-badge) .pick-kind { right: auto; left: 34px; } /* (the badge sits where the kind is) */
.pick-card[data-kind='magic'] .pick-kind { color: #7a3fc4; }
.pick-card[data-kind='hop'] .pick-kind { color: #1f7f8c; }
.pick-card[data-kind='move'] .pick-kind { color: #c2452f; }
.pick-card[data-kind='ability'] .pick-kind { color: #2f66b8; }
/* an evolution: gold, but without the ×2 of a lucky card */
.pick-card[data-kind='evolve'] { border-color: #c98a12; background: linear-gradient(#fffaf0, #ffe9a8); }
.pick-card[data-kind='evolve'] .pick-kind { color: #a05a00; }
.pick-card[data-kind='evolve'] .pick-tag { background: #c98a12; color: #fff; }
.lo-chip.evolved { background: #ffe9a8; box-shadow: inset 0 0 0 2px #d9a43a; }
.lo-chip.evolved b { background: #c98a12; }
.pick-card[data-kind='instant'] .pick-kind { color: #2f7d4a; }
.pick-tag { padding: 2px 9px; border-radius: 999px; background: #efe6d2; color: var(--ink-soft); font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pick-tag.new { background: var(--accent); color: #fff; letter-spacing: 0.06em; }
.pick-tag:empty { display: none; }
@media (max-width: 560px) { .pick-card { padding-top: 22px; flex-wrap: wrap; } .pick-kind { top: 5px; } .pick-card .pick-text { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .lo-chip.fresh { animation: none; } }

/* ================= the home screen (#start): the farm behind, the logo, take off ================= */
/* the game itself flies behind it (main.js: the plane circles, nothing comes); a soft veil keeps the words easy to read */
.home { --spring: cubic-bezier(0.32, 0.72, 0, 1); --pop: cubic-bezier(0.34, 1.56, 0.64, 1); background: none; backdrop-filter: none; padding: 0; place-items: stretch; }
.home-veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 250, 236, 0.72) 0%, rgba(255, 250, 236, 0.18) 55%, transparent 75%),
    linear-gradient(to top, rgba(76, 49, 22, 0.42) 0%, rgba(76, 49, 22, 0) 38%);
}
.home-wrap {
  position: relative; width: 100%; min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 18px;
}
.home-eyebrow {
  display: inline-block; padding: 5px 14px; border-radius: 999px; background: rgba(255, 253, 246, 0.82); border: 1px solid rgba(91, 58, 30, 0.18);
  font-size: 11px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-soft);
  box-shadow: 0 6px 20px -8px rgba(91, 58, 30, 0.35); animation: home-rise 0.9s var(--spring) both;
}
/* the logo: drawn as one picture so it scales as a whole */
.logo { margin: -6px 0 0; width: min(580px, 94vw, 72dvh); line-height: 0; }
.logo-art { width: 100%; height: auto; overflow: visible; font-family: 'Nunito', sans-serif; font-weight: 900; }
.logo-art text { text-anchor: middle; paint-order: stroke fill; stroke-linejoin: round; }
.t-jump { font-size: 96px; fill: url(#lg-jump); stroke: #5b3a1e; stroke-width: 15px; letter-spacing: 2px; }
.t-shade { font-size: 96px; fill: #5b3a1e; stroke: #5b3a1e; stroke-width: 15px; letter-spacing: 2px; }
.t-boom { font-size: 136px; fill: url(#lg-boom); stroke: #3b2412; stroke-width: 18px; letter-spacing: 1px; }
.t-boom-shade { font-size: 136px; fill: #3b2412; stroke: #3b2412; stroke-width: 18px; letter-spacing: 1px; }
.burst-back { fill: #3b2412; }
.burst-core { fill: url(#lg-burst); stroke: #fffbe6; stroke-width: 5px; stroke-linejoin: round; }
.logo-word, .logo-burst, .logo-burst-spin { transform-box: fill-box; transform-origin: 50% 100%; }
.logo-burst, .logo-burst-spin { transform-origin: 50% 50%; }
/* coming in: Jump (a hop), Jump (a hop), BOOM (slammed down, the burst flaring behind it); then a gentle idle */
.logo-j1 { animation: logo-hop 0.75s var(--pop) 0.1s both, logo-idle 2.6s ease-in-out 1.6s infinite; }
.logo-j2 { animation: logo-hop 0.75s var(--pop) 0.38s both, logo-idle 2.6s ease-in-out 2.9s infinite; }
.logo-boom { animation: logo-slam 0.55s var(--pop) 0.72s both; }
.logo-burst { animation: logo-flare 0.7s var(--pop) 0.78s both; }
.logo-burst-spin { animation: logo-sway 6s ease-in-out 1.6s infinite; }
.home-wrap.slam { animation: home-shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.92s both; }
@keyframes logo-hop { 0% { opacity: 0; transform: translateY(-70px) scale(0.9, 1.1); } 55% { opacity: 1; transform: translateY(6px) scale(1.08, 0.9); } 100% { opacity: 1; transform: none; } }
@keyframes logo-idle { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-7px); } 90% { transform: translateY(1px) scale(1.03, 0.97); } }
@keyframes logo-slam { 0% { opacity: 0; transform: scale(2.3); } 60% { opacity: 1; transform: scale(0.94); } 100% { opacity: 1; transform: none; } }
@keyframes logo-flare { 0% { opacity: 0; transform: scale(0.2) rotate(-25deg); } 100% { opacity: 1; transform: none; } }
@keyframes logo-sway { 0%, 100% { transform: rotate(-2.5deg) scale(1); } 50% { transform: rotate(2.5deg) scale(1.03); } }
@keyframes home-shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -1px); } }
@keyframes home-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.home-sub { margin: 0 auto 12px; max-width: 34ch; text-align: center; font-weight: 800; font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
/* the gap between the logo and the panel is where the plane flies */
.home-shell {
  margin-top: auto; width: min(420px, 100%); padding: 6px; border-radius: 30px;
  background: rgba(255, 249, 236, 0.38); border: 1px solid rgba(255, 255, 255, 0.55); backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px -24px rgba(59, 36, 18, 0.55); animation: home-rise 0.9s var(--spring) 1.1s both;
}
.home-core {
  padding: 16px 16px 18px; border-radius: 24px; background: #fff9ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(201, 155, 107, 0.45);
}
.home-core .wallet { margin: 0 0 4px; flex-wrap: wrap; }
.home-actions { display: flex; gap: 10px; margin-top: 14px; }
/* take off: a pill, with its arrow in a little island of its own */
.home-go {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 8px 0 24px;
  border: 0; border-radius: 999px; cursor: pointer; color: #fff; font: 900 19px/1 'Nunito', sans-serif; letter-spacing: 0.01em;
  background: linear-gradient(#7cc05e, #5a9e40); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #3f7a2b, 0 14px 28px -12px rgba(63, 122, 43, 0.8);
  transition: transform 0.45s var(--spring), box-shadow 0.45s var(--spring), filter 0.3s var(--spring);
}
.home-go-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); transition: transform 0.45s var(--spring); }
.home-go-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.home-go:hover { filter: brightness(1.05); }
.home-go:hover .home-go-icon { transform: translateX(3px) scale(1.06); }
.home-go:active { transform: translateY(3px) scale(0.985); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 #3f7a2b, 0 6px 14px -8px rgba(63, 122, 43, 0.8); }
.home-go:focus-visible, .home-btn:focus-visible { outline: 3px solid #ffd84a; outline-offset: 3px; }
.home-btn { min-height: 56px; padding: 0 22px; border-radius: 999px; transition: transform 0.45s var(--spring), background 0.3s var(--spring); }
.home-keys { margin: 0; max-width: 560px; color: #fffdf6; text-shadow: 0 1px 2px rgba(59, 36, 18, 0.7); animation: home-rise 0.9s var(--spring) 1.2s both; }
.home-keys kbd { text-shadow: none; }
@media (max-width: 520px) {
  .home-wrap { gap: 12px; padding-top: max(64px, env(safe-area-inset-top)); } /* (below the sound and language buttons in the corner) */
  .home-sub { font-size: 13px; }
  .home-keys { display: none; }
  .home-eyebrow { font-size: 10px; letter-spacing: 0.14em; }
}
/* a phone: the home panel fills the bottom, so the practice button waits at the top right (its panel opening below it) */
@media (max-width: 720px) {
  body:has(#start:not([hidden])) .practice { bottom: auto; top: max(12px, env(safe-area-inset-top)); flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-j1, .logo-j2, .logo-boom, .logo-burst, .logo-burst-spin, .home-wrap.slam, .home-eyebrow, .home-shell, .home-keys { animation: none; }
}

/* ================= the villain jeering: his face in a round window at the left edge (hud.js jeer) ================= */
.jeer {
  position: absolute; left: max(12px, env(safe-area-inset-left)); top: 42%; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 24px); pointer-events: none;
  opacity: 0; transform: translateX(-120%); transition: opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1), transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.jeer.on { opacity: 1; transform: none; }
.jeer-face { flex: none; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; box-shadow: 0 10px 24px -10px rgba(30, 18, 40, 0.7); }
.jeer-face svg { display: block; width: 100%; height: 100%; }
.jeer.on .jeer-head { transform-box: view-box; transform-origin: 50% 90%; animation: jeer-laugh 0.16s steps(2) infinite; }
@keyframes jeer-laugh { 50% { transform: translateY(-3px) rotate(-3deg); } }
.jeer-line {
  position: relative; padding: 8px 14px; border-radius: 16px; background: #fffaf0; border: 2px solid #3a2f4a; color: #3a2f4a;
  font-size: 18px; font-weight: 900; line-height: 1.2; min-width: 0; overflow-wrap: anywhere;
}
.jeer-line::before { content: ''; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; translate: 0 -50%; rotate: 45deg; background: #fffaf0; border-left: 2px solid #3a2f4a; border-bottom: 2px solid #3a2f4a; }
@media (max-width: 640px) { .jeer-face { width: 68px; height: 68px; } .jeer-line { font-size: 15px; padding: 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .jeer { transition: none; } .jeer.on .jeer-head { animation: none; } }

/* ================= a boss beaten: the trophy card at the top middle (hud.js trophy) ================= */
.trophy-toast {
  --spring: cubic-bezier(0.32, 0.72, 0, 1); --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  position: absolute; left: 50%; top: 120px; width: min(400px, calc(100vw - 24px)); translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 16px 12px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(#fffaf0, #fff1d2); border: 2px solid #e2b24a;
  box-shadow: 0 0 0 5px rgba(255, 216, 74, 0.35), 0 22px 44px -18px rgba(59, 36, 18, 0.6);
  opacity: 0; transform: translateY(-24px) scale(0.92); transition: opacity 0.35s var(--spring), transform 0.35s var(--spring);
  pointer-events: none; text-align: center;
}
.trophy-toast.on { opacity: 1; transform: none; animation: tt-in 0.6s var(--pop) both; }
@keyframes tt-in { 0% { opacity: 0; transform: translateY(-34px) scale(0.85); } 100% { opacity: 1; transform: none; } }
/* soft gold rays turning slowly behind the words */
.tt-rays {
  position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: 0; opacity: 0.35;
  background: repeating-conic-gradient(from 0deg, rgba(255, 216, 74, 0.55) 0deg 9deg, transparent 9deg 22deg);
  mask-image: radial-gradient(circle, #000 18%, transparent 62%); animation: tt-spin 9s linear infinite;
}
@keyframes tt-spin { to { rotate: 360deg; } }
.trophy-toast > :not(.tt-rays) { position: relative; z-index: 1; }
.tt-eyebrow { padding: 3px 11px; border-radius: 999px; background: #5b3a1e; color: #ffe7a6; font-size: 10px; font-weight: 900; letter-spacing: 0.2em; text-transform: uppercase; }
.tt-boss { font-size: 24px; font-weight: 900; line-height: 1.15; color: var(--ink); }
.tt-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.75); box-shadow: inset 0 0 0 1px rgba(201, 155, 107, 0.45); text-align: left; }
.tt-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff3d1; box-shadow: inset 0 0 0 2px #e2b24a; font-size: 22px; }
.tt-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tt-name { font-size: 15px; font-weight: 900; color: var(--ink); }
.tt-text { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.tt-pips { flex: none; display: flex; gap: 4px; }
.tt-pips i { width: 12px; height: 12px; border-radius: 50%; background: #ece0c8; box-shadow: inset 0 0 0 1.5px rgba(91, 58, 30, 0.25); }
.tt-pips i.on { background: radial-gradient(circle at 35% 35%, #fff3a8, #ffb02e); box-shadow: inset 0 0 0 1.5px #b77a12; }
.tt-line { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.trophy-toast.up .tt-line { color: #3f7a2b; }
.tt-pips i.new { animation: tt-pip 0.9s var(--pop) 0.35s both; }
@keyframes tt-pip { 0% { transform: scale(0.2); } 60% { transform: scale(1.5); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .trophy-toast.on, .tt-rays, .tt-pips i.new { animation: none; } }

/* the home screen's buttons: Take off across the top, the others under it, each as wide as what it says (a wide one,
   Trophies with its count, takes more) and the room left shared out; never wider than the panel */
.home-actions { display: flex; flex-wrap: wrap; gap: 10px 6px; }
.home-actions .home-go { flex: 1 1 100%; }
.home-btn { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; white-space: nowrap; }
.home-count { padding: 1px 7px; border-radius: 999px; background: #f3e6c8; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ================= the trophy wall (trophyview.js) ================= */
.trophies-overlay { --spring: cubic-bezier(0.32, 0.72, 0, 1); background: rgba(50, 35, 20, 0.45); backdrop-filter: blur(6px); }
.trophies { position: relative; width: min(980px, 100%); padding: 22px 20px 20px; text-align: left; animation: trophies-in 0.5s var(--spring) both; }
@keyframes trophies-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
.trophies-head { text-align: center; padding: 0 44px; }
.trophies-head h2 { margin: 8px 0 4px; font-size: 28px; }
.trophies-head .sub { margin: 0 auto 16px; max-width: 46ch; }
.trophies-x {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #f3e6c8; cursor: pointer; transition: background 0.3s var(--spring), transform 0.3s var(--spring);
}
.trophies-x svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.trophies-x:hover { background: #ecd9b0; transform: rotate(90deg); }
.trophies-x:focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; }
.trophy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* each one: a frame round a lighter card (the picture on the left, the words on the right) */
.trophy-card {
  display: flex; gap: 12px; padding: 10px; border-radius: 20px; background: #fff9ec;
  box-shadow: inset 0 0 0 1px rgba(201, 155, 107, 0.55), 0 10px 24px -18px rgba(59, 36, 18, 0.6);
}
.trophy-pic {
  position: relative; flex: none; width: 92px; height: 92px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #fff6d8, #f3dfb0 70%, #e7c98a); box-shadow: inset 0 0 0 1px rgba(201, 155, 107, 0.6);
}
.trophy-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.trophy-badge {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: #5b3a1e; color: #ffe7a6;
  font-size: 11px; font-weight: 900; letter-spacing: 0.04em;
}
.trophy-card.locked .trophy-pic { background: radial-gradient(circle at 50% 38%, #e9e2d3, #d6ccb8 75%); }
.trophy-card.locked .trophy-pic img { filter: brightness(0) opacity(0.32); }
.trophy-card.locked .trophy-badge { background: #b8ab92; color: #fffaf0; }
.trophy-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trophy-when { font-size: 10.5px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.trophy-boss { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.15; color: var(--ink); }
.trophy-ability { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 13.5px; color: var(--ink); }
.trophy-icon { font-size: 15px; }
.trophy-text { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--ink-soft); }
.trophy-levels { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.trophy-levels li { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; border-radius: 999px; background: #f7efdd; font-size: 11.5px; font-weight: 800; white-space: nowrap; color: #a58c6e; }
.trophy-levels .tl-n { flex: none; min-width: 2.2em; padding: 0 5px; border-radius: 999px; background: #f1e6cf; font-size: 10.5px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.trophy-levels li.got { color: var(--ink); background: #fff1c4; }
.trophy-levels li.got .tl-n { background: radial-gradient(circle at 35% 35%, #fff3a8, #ffc23e); color: #5b3a1e; }
.trophy-levels li.next { color: var(--ink-soft); box-shadow: inset 0 0 0 1px rgba(201, 155, 107, 0.6); }
/* the practice button stays out of the way while the wall is up */
body:has(#trophies:not([hidden])) .practice { display: none; }
.trophy-status { margin: 3px 0 0; font-size: 11.5px; font-weight: 800; color: #6aa84f; }
.trophy-card.locked .trophy-status { color: #a58c6e; }
@media (max-width: 900px) { .trophy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .trophies { padding: 18px 12px 14px; }
  .trophies-head { padding: 0 40px; }
  .trophy-grid { grid-template-columns: 1fr; }
  .trophy-pic { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) { .trophies { animation: none; } .trophies-x:hover { transform: none; } }

/* ================= the story cards (storyview.js) ================= */
.story { --spring: cubic-bezier(0.32, 0.72, 0, 1); --pop: cubic-bezier(0.34, 1.56, 0.64, 1); display: block; padding: 0; background: #241a2e; backdrop-filter: none; overflow: hidden; }
.story-wrap {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  -webkit-user-select: none; user-select: none; animation: story-in 0.9s var(--spring) both;
}
@keyframes story-in { from { opacity: 0; } to { opacity: 1; } }
#story-canvas, #wake-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* a film's letterbox: dark at the top and the bottom, so the words read over any sky */
.story-wrap::before, .story-wrap::after { content: ''; position: absolute; left: 0; right: 0; pointer-events: none; }
.story-wrap::before { top: 0; height: 22%; background: linear-gradient(rgba(28, 18, 30, 0.55), transparent); }
.story-wrap::after { bottom: 0; height: 46%; background: linear-gradient(transparent, rgba(28, 18, 30, 0.72)); }
/* waking up after a run (wakeview.js): in quickly, the caption in the middle */
.wake .story-wrap { animation-duration: 0.25s; }
.wake .story-cap { top: max(28px, env(safe-area-inset-top)); bottom: auto; text-align: center; } /* (at the top, in the sky: the farmer sits low in the picture) */
.wake .story-wrap::before { height: 30%; }
.wake .story-text { margin-left: auto; margin-right: auto; }
.story-flash { position: absolute; inset: 0; z-index: 1; background: #fffbe6; opacity: 0; pointer-events: none; }
/* lines rushing past, from the edges in (the dive); turned a little every frame so they flicker */
.story-speed {
  position: absolute; inset: -50%; z-index: 1; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, transparent 0deg 3deg, rgba(255, 252, 240, 0.75) 3deg 3.5deg, transparent 3.5deg 6.5deg, rgba(255, 252, 240, 0.4) 6.5deg 6.8deg, transparent 6.8deg 11deg);
  -webkit-mask-image: radial-gradient(circle at center, transparent 22%, #000 46%); mask-image: radial-gradient(circle at center, transparent 22%, #000 46%);
}
.story-bars { position: absolute; z-index: 2; top: max(16px, env(safe-area-inset-top)); left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); display: flex; gap: 6px; }
.story-bars i { flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 248, 230, 0.26); overflow: hidden; }
.story-bars b { display: block; height: 100%; border-radius: inherit; background: #fff4d6; transform: scaleX(0); transform-origin: left; }
.story-cap { position: absolute; z-index: 2; left: clamp(20px, 7vw, 96px); right: clamp(20px, 7vw, 96px); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 72px); pointer-events: none; }
.story-num {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font: 800 11px/1 'Nunito', sans-serif; letter-spacing: 0.22em; color: #fff3d2;
  background: rgba(255, 246, 225, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 246, 225, 0.22); font-variant-numeric: tabular-nums;
}
.story-text {
  margin: 12px 0 0; max-width: 19ch; min-height: 2.16em; font: 900 clamp(28px, 4.8vw, 58px)/1.08 'Nunito', sans-serif; color: #fffaf0; letter-spacing: -0.01em;
  text-shadow: 0 2px 0 rgba(80, 45, 20, 0.6), 0 8px 28px rgba(25, 12, 20, 0.6);
}
.story-text.typing::after { content: ''; display: inline-block; width: 0.09em; height: 0.82em; margin-left: 0.06em; border-radius: 2px; background: #ffd84a; vertical-align: -0.06em; animation: story-caret 0.8s steps(1) infinite; }
@keyframes story-caret { 50% { opacity: 0; } }
/* the last card: the three words in the middle, big, one on each hop and the boom */
.story-last .story-cap { left: 16px; right: 16px; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 70px); text-align: center; } /* (low: the plane goes up and comes down through the top of the picture) */
.story-last .story-num { display: none; }
.story-last .story-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.28em; max-width: none; min-height: 0; margin: 0; font-size: clamp(48px, 11vw, 132px); }
.story-word { display: inline-block; animation: story-hop 0.55s var(--pop) both; }
.story-word.boom { color: #ff5a36; text-shadow: 0 3px 0 #9e2418, 0 0 0 #fff, 0 10px 40px rgba(255, 190, 60, 0.75); animation: story-slam 0.5s var(--pop) both, story-throb 0.9s ease-out 0.5s both; }
@keyframes story-throb { 0% { transform: rotate(-3deg) scale(1.08); } 100% { transform: rotate(-3deg) scale(1); } }
@keyframes story-hop { 0% { opacity: 0; transform: translateY(0.6em) scale(0.8, 1.15); } 60% { opacity: 1; transform: translateY(-0.12em) scale(1.06, 0.94); } 100% { opacity: 1; transform: none; } }
@keyframes story-slam { 0% { opacity: 0; transform: scale(2.4) rotate(-6deg); } 60% { opacity: 1; transform: scale(0.92) rotate(2deg); } 100% { opacity: 1; transform: rotate(-3deg); } }
.story-ctl { position: absolute; z-index: 4; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px; }
.story-hint { font: 800 13px/1 'Nunito', sans-serif; color: rgba(255, 248, 230, 0.78); text-shadow: 0 1px 2px rgba(25, 12, 20, 0.6); }
.story-hint kbd { text-shadow: none; }
.story-skip {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 7px 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  font: 900 16px/1 'Nunito', sans-serif; color: #fffaf0; background: rgba(36, 24, 36, 0.42); box-shadow: inset 0 0 0 1px rgba(255, 246, 225, 0.32), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px); transition: transform 0.45s var(--spring), background 0.3s var(--spring);
}
.story-skip-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 246, 225, 0.16); transition: transform 0.45s var(--spring); }
.story-skip-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.story-skip:hover { background: rgba(36, 24, 36, 0.6); }
.story-skip:hover .story-skip-icon { transform: translateX(2px) scale(1.06); }
.story-skip:active { transform: scale(0.97); }
.story-skip:focus-visible { outline: 3px solid #ffd84a; outline-offset: 3px; }
body:has(#story:not([hidden])) .practice { display: none; }
/* the home screen's buttons: Shop, Trophies and Story side by side under Take off (above: .home-actions) */
@media (max-width: 520px) {
  .story-hint { display: none; }
  .story-cap { bottom: calc(max(20px, env(safe-area-inset-bottom)) + 84px); }
  .home-actions .home-btn { padding: 0 8px; font-size: 15px; gap: 4px; }
  .home-actions .home-btn > span[aria-hidden="true"] { display: none; } /* (no room for the pictures beside the words) */
}
@media (prefers-reduced-motion: reduce) {
  .story-wrap, .story-word, .story-word.boom, .story-text.typing::after { animation: none; }
  .story-word.boom { transform: rotate(-3deg); }
}

/* the story's Play button: when the browser holds the sound back until the player clicks */
.story-gate { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at center, rgba(36, 24, 36, 0.35), rgba(36, 24, 36, 0.7)); cursor: default; }
.story-gate[hidden] { display: none; }
.story-gated .story-cap, .story-gated .story-hint { visibility: hidden; }
.story-go {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 30px 0 9px; border: 0; border-radius: 999px; cursor: pointer;
  font: 900 21px/1 'Nunito', sans-serif; color: #fff; background: linear-gradient(#7cc05e, #5a9e40);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 0 #3f7a2b, 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.45s var(--spring), filter 0.3s var(--spring); animation: story-go-in 0.7s var(--pop) 0.2s both;
}
.story-go-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, 0.24); transition: transform 0.45s var(--spring); }
.story-go-icon svg { width: 20px; height: 20px; margin-left: 3px; fill: #fff; }
.story-go:hover { filter: brightness(1.05); }
.story-go:hover .story-go-icon { transform: scale(1.08); }
.story-go:active { transform: translateY(3px) scale(0.985); }
.story-go:focus-visible { outline: 3px solid #ffd84a; outline-offset: 4px; }
.story-gate-note { font: 800 12px/1 'Nunito', sans-serif; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 248, 230, 0.75); }
@keyframes story-go-in { from { opacity: 0; transform: translateY(10px) scale(0.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .story-go { animation: none; } }

/* the sound switch: the home screen's, top left (a round speaker; with "Sound on" beside it while the browser keeps
   the sound shut), and the pause card's */
/* (the home screen's sound switch and language switch side by side in the top left corner) */
.home-corner { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); z-index: 2; display: flex; align-items: center; gap: 10px; }
.sound-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 900; cursor: pointer;
  animation: sound-in 0.6s cubic-bezier(0.32, 0.72, 0, 1) 1.4s both;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), background 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.sound-btn:not([data-mode='start']) { width: 44px; padding: 0; font-size: 18px; }
.sound-word { display: none; }
.sound-btn[data-mode='start'] .sound-word { display: inline; }
.sound-btn[data-mode='off'] { background: #efe3cc; }
.sound-btn:hover { background: #fff3d6; }
.sound-btn:active { transform: scale(0.97); }
.sound-btn:focus-visible { outline: 3px solid #ffd84a; outline-offset: 3px; }
@keyframes sound-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .sound-btn { animation: none; } }
/* a phone: just the speaker, round, clear of the line under the logo */
@media (max-width: 480px) {
  .sound-btn { width: 44px; padding: 0; font-size: 18px; }
  .sound-btn[data-mode='start'] .sound-word { display: none; }
}
.pause-sound { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pause-sound .sound-state { min-width: 2.2em; text-align: left; }
/* the pause card's two sliders: the music, the game's sounds (src/volume.js) */
.vol-box { display: grid; grid-template-columns: auto minmax(0, 1fr) 3.2em; grid-auto-rows: minmax(36px, auto); align-items: center; gap: 2px 8px; padding: 6px 12px; border: 2px solid var(--wood); border-radius: 12px; background: #fffdf6; text-align: left; }
.vol-row { display: contents; } /* (one grid for both rows, so the two sliders line up whatever the words) */
.vol-row label { font-size: 14px; font-weight: 800; color: var(--ink); }
.vol-row output { font-size: 13px; font-weight: 900; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.vol { --fill: 100%; appearance: none; -webkit-appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.vol::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; border: 2px solid var(--wood); background: linear-gradient(to right, #ffd84a var(--fill), #efe3c4 var(--fill)); box-sizing: content-box; }
.vol::-moz-range-track { height: 8px; border-radius: 999px; border: 2px solid var(--wood); background: #efe3c4; }
.vol::-moz-range-progress { height: 8px; border-radius: 999px; background: #ffd84a; }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--wood); background: #fffdf6; box-shadow: 0 2px 0 var(--wood); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.vol::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--wood); background: #fffdf6; box-shadow: 0 2px 0 var(--wood); }
.vol:hover::-webkit-slider-thumb { transform: scale(1.1); }
.vol:focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; border-radius: 999px; }
.vol:disabled { cursor: default; opacity: 0.45; }
.vol:disabled:hover::-webkit-slider-thumb { transform: none; }
@media (max-width: 640px) { .vol-box { grid-auto-rows: minmax(44px, auto); } .vol { height: 44px; } } /* (fingers) */
/* the loading screen (index.html #boot, html.booting; taken off by main.js after the first picture): the home screen
   and the panel wait (display: none, so their entrance plays from the start once they show); a little plane flies
   over the farm with a bar filling under it; when the game is in, the bar fills and the screen fades off the farm */
html.booting #start, html.booting #practice, html.boot-hold #start, html.boot-hold #practice { display: none; }
.boot {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(#bfe2f6, #dff1fa 62%, #eaf6fb); color: var(--ink);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.5s;
}
html.booting .boot, html.boot-hold .boot { opacity: 1; visibility: visible; pointer-events: auto; transition: none; } /* (at once, from the first picture: nothing shows through it, not even the page reloaded from) */
.boot-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-hill-back { fill: #a9d982; }
.boot-hill-front { fill: #8cc865; }
.boot-cloud { fill: #fffdf6; opacity: 0.85; }
.boot-cloud-a { animation: boot-drift 26s linear infinite; }
.boot-cloud-b { animation: boot-drift 34s linear -15s infinite; opacity: 0.7; }
@keyframes boot-drift { from { transform: translate(1320px, 170px); } to { transform: translate(-140px, 170px); } }
.boot-cloud-b { animation-name: boot-drift-b; }
@keyframes boot-drift-b { from { transform: translate(1320px, 300px); } to { transform: translate(-140px, 300px); } }
.boot-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(340px, 100%); margin-top: -6vh; }
.boot-eyebrow {
  padding: 4px 12px; border-radius: 999px; background: rgba(255, 253, 246, 0.85); color: var(--ink-soft);
  font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
}
.boot-stage { position: relative; width: 220px; height: 120px; }
.boot-plane { position: absolute; left: 50%; top: 50%; width: 170px; margin: -55px 0 0 -72px; overflow: visible; animation: boot-fly 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite; transform-origin: 60% 55%; }
@keyframes boot-fly { 0%, 100% { transform: translateY(-6px) rotate(-4deg); } 50% { transform: translateY(8px) rotate(3deg); } }
.boot-prop { transform-box: fill-box; transform-origin: center; animation: boot-prop 0.16s linear infinite; }
@keyframes boot-prop { 50% { transform: scaleY(0.15); } }
.boot-puff { position: absolute; left: 30px; top: 50px; width: 18px; height: 18px; border-radius: 50%; background: #fffdf6; box-shadow: 0 2px 0 rgba(90, 58, 44, 0.12); opacity: 0; animation: boot-puff 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) infinite; }
.boot-puff:nth-child(2) { animation-delay: 0.5s; }
.boot-puff:nth-child(3) { animation-delay: 1s; }
@keyframes boot-puff { 0% { opacity: 0.95; transform: translate(10px, 0) scale(0.5); } 100% { opacity: 0; transform: translate(-60px, -14px) scale(1.5); } }
.boot-bar { width: 100%; height: 18px; padding: 3px; border: 3px solid var(--wood); border-radius: 999px; background: #fffdf6; box-shadow: 0 4px 0 rgba(90, 58, 44, 0.2); overflow: hidden; }
.boot-bar i {
  display: block; height: 100%; border-radius: 999px; transform-origin: left center; transform: scaleX(0.02); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0 8px, transparent 8px 16px), linear-gradient(90deg, #7fc35a, var(--accent));
  background-size: 22.6px 100%, 100% 100%; animation: boot-stripes 0.8s linear infinite;
}
@keyframes boot-stripes { to { background-position: 22.6px 0, 0 0; } }
.boot-text { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.boot-text b { margin-left: 4px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .boot-cloud, .boot-plane, .boot-puff, .boot-bar i { animation: none; }
  .boot-prop { animation-duration: 0.6s; }
}
/* the home screen's volume pop-up (main.js openVol): under the speaker; on a phone, up from the bottom */
.vol-btn { animation-delay: 1.45s; }
.vol-btn[aria-expanded='true'] { background: #fff3d6; }
.vol-shade { position: fixed; inset: 0; z-index: 5; background: transparent; }
.vol-shade[hidden], .home-vol[hidden] { display: none; }
.home-vol {
  position: fixed; z-index: 6; top: calc(max(14px, env(safe-area-inset-top)) + 54px); left: max(14px, env(safe-area-inset-left));
  width: min(320px, calc(100vw - 28px)); padding: 12px; text-align: left; border: 3px solid var(--wood); border-radius: 18px; background: #fff8ea;
  box-shadow: 0 6px 0 rgba(90, 58, 44, 0.25), 0 18px 40px rgba(60, 36, 20, 0.18); overscroll-behavior: contain;
  animation: vol-in 0.35s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes vol-in { from { opacity: 0; transform: translateY(-6px); } }
.home-vol-head { display: flex; flex-direction: column; gap: 2px; margin: 0 2px 8px; font-size: 15px; font-weight: 900; color: var(--ink); }
.home-vol-note { display: none; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.home-vol.muted .home-vol-note { display: block; }
@media (max-width: 640px) {
  .vol-shade { background: rgba(40, 24, 16, 0.28); }
  .home-vol { top: auto; left: 0; right: 0; bottom: 0; width: auto; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); border-width: 3px 0 0; border-radius: 20px 20px 0 0; animation-name: vol-up; }
}
@keyframes vol-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .home-vol { animation: none; } }
/* the pause card's aim ring picker (main.js): six small fields, each with its look over it; the chosen one ringed in yellow */
.aim-box { padding: 8px 12px 10px; border: 2px solid var(--wood); border-radius: 12px; background: #fffdf6; text-align: left; }
.aim-box[hidden] { display: none; }
.aim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 800; color: var(--ink); }
.aim-name { font-size: 13px; font-weight: 800; color: var(--ink-soft); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aim-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.aim-opt {
  position: relative; aspect-ratio: 1; min-height: 36px; padding: 0; border: 2px solid var(--wood); border-radius: 10px; overflow: hidden; isolation: isolate; cursor: pointer;
  background: radial-gradient(circle at 30% 35%, #fff 0 3px, transparent 4px), radial-gradient(circle at 70% 70%, #fff9c4 0 4px, transparent 5px), radial-gradient(circle at 75% 25%, #ffffffcc 0 6px, transparent 9px), #8cc96b;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.aim-opt > .rt { left: 50%; top: 50%; transform: scale(0.5); }
.aim-opt > .rt-invert { mix-blend-mode: difference; }
.aim-opt:hover { transform: translateY(-2px); }
.aim-opt:active { transform: scale(0.96); }
.aim-opt[aria-checked='true'] { border-color: #e0a800; box-shadow: 0 0 0 3px #ffd84a; }
.aim-opt[aria-checked='true']::after { content: '✓'; position: absolute; right: 2px; bottom: 0; z-index: 1; font-size: 12px; font-weight: 900; line-height: 1.2; color: #fff; text-shadow: 0 0 2px #3a2410, 0 0 2px #3a2410; }
.aim-opt:focus-visible { outline: 3px solid #5a3a22; outline-offset: 2px; }
@media (max-width: 640px) { .aim-opt { min-height: 44px; } } /* (fingers) */
@media (prefers-reduced-motion: reduce) { .aim-opt { transition: none; } .aim-opt:hover { transform: none; } }
/* the language switch (src/i18n.js): a plain select dressed as a pill (the browser's own list opens from it) */
.lang-pick {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 14px;
  border: 2px solid var(--wood); border-radius: 999px; background: #fffdf6; box-shadow: 0 3px 0 var(--wood); color: var(--ink);
  font-weight: 800; font-size: 15px; cursor: pointer; transition: background 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.lang-pick:hover { background: #fff3d6; }
.lang-pick:focus-within { outline: 3px solid #ffd84a; outline-offset: 3px; }
.lang-icon { font-size: 17px; line-height: 1; }
.lang-select {
  appearance: none; -webkit-appearance: none; border: 0; outline: none; margin: 0; min-height: 40px; padding: 0 20px 0 0;
  background: transparent no-repeat right center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a3a22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  font: inherit; color: inherit; cursor: pointer;
}
.home-lang { animation: sound-in 0.6s cubic-bezier(0.32, 0.72, 0, 1) 1.5s both; }
@media (prefers-reduced-motion: reduce) { .home-lang { animation: none; } }
.pause-lang { justify-content: center; border-radius: 12px; }
@media (max-width: 480px) { .home-lang .lang-icon { display: none; } }
/* each language its own letters where Nunito has none (the page's lang is set by src/i18n.js) */
html:lang(ja) body { font-family: 'Nunito', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', system-ui, sans-serif; }
html:lang(ko) body { font-family: 'Nunito', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif; }
html:lang(zh-Hans) body { font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; }
html:lang(zh-Hant) body { font-family: 'Nunito', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', system-ui, sans-serif; }

/* ---------- pause: the cards taken this run and what the plane can do now (src/runsheet.js, screens.js sheet()) ---------- */
.pause-dialog {
  width: min(1200px, 100%); display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 14px 22px; align-items: start; text-align: left;
}
/* the buttons, then the plane's numbers under them; the cards taken fill the rest */
.pause-side { grid-column: 1; grid-row: 1; }
.pause-now { grid-column: 1; grid-row: 2; }
.pause-held { grid-column: 2; grid-row: 1 / span 2; }
.pause-side { text-align: center; }
/* (a little tighter than the other cards, so the buttons and the plane's numbers fit a laptop screen together) */
.pause-dialog { padding-top: 16px; padding-bottom: 16px; }
.pause-dialog h2 { margin-bottom: 4px; }
.pause-dialog .dialog-actions { gap: 8px; margin-top: 10px; }
.pause-dialog .dialog-actions .btn, .pause-dialog .pause-lang { min-height: 40px; }
.pause-dialog .pause-lang .lang-select { min-height: 36px; }
.pause-sheet { min-width: 0; }
.sheet-title { margin: 2px 0 8px; font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.held-list { display: grid; gap: 12px; }
.held-group { display: grid; gap: 6px; }
.held-head { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 15px; font-weight: 900; color: var(--ink); }
.held-room { font-size: 12px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.held-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px; }
.held-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 7px 10px 7px 7px; border-radius: 12px; background: #fffdf6; border: 1.5px solid rgba(201, 155, 107, 0.45);
}
.held-icon { display: grid; place-items: center; width: 40px; height: 40px; font-size: 24px; line-height: 1; }
.held-icon .paper-icon { display: block; width: 40px; height: 40px; }
.held-body { display: grid; gap: 2px; min-width: 0; }
.held-name { font-size: 14px; font-weight: 900; color: var(--ink); line-height: 1.2; }
.held-tag { display: inline-block; padding: 0 6px; border-radius: 6px; background: #f3e6cf; color: var(--ink-soft); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.kind-weapon .held-tag { background: #ffe9a8; color: #8a5a0a; }
.held-text { font-size: 12px; font-weight: 700; color: var(--ink-soft); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.held-tracks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.held-track { padding: 1px 6px; border-radius: 6px; background: #f1ebe0; color: #a08a72; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.held-track.up { background: var(--accent-soft); color: #3f7a2a; }
.held-track.top { background: #ffe9a8; color: #8a5a0a; }
.held-level { display: grid; justify-items: end; gap: 4px; }
.held-level b { font-size: 13px; font-weight: 900; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.held-level small { font-size: 11px; color: var(--ink-soft); }
.held-dots { display: flex; gap: 3px; }
.held-dots i { width: 7px; height: 7px; border-radius: 50%; background: #e6dccb; }
.held-dots i.on { background: var(--accent); }
.held-none { margin: 2px 0 0; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.now-list { margin: 0; display: grid; gap: 2px; padding: 6px 12px; border-radius: 12px; background: #fffdf6; border: 1.5px solid rgba(201, 155, 107, 0.45); }
.now-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed rgba(201, 155, 107, 0.4); }
.now-row:last-child { border-bottom: 0; }
.now-row dt { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.now-row dd { margin: 0; font-size: 14px; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.now-row.up dd { color: #3f7a2a; }
.now-row.down dd { color: var(--heart); }
/* a phone: one column — the buttons first, then the cards, then the numbers (the card scrolls with the page) */
@media (max-width: 640px) {
  .pause-dialog { width: min(420px, 100%); grid-template-columns: 1fr; gap: 14px; }
  .pause-held, .pause-now { grid-column: 1; grid-row: auto; }
  .pause-dialog .dialog-actions .btn, .pause-dialog .pause-lang { min-height: 44px; } /* (fingers) */
}
