/* ShipDuel site. Palette from the game's UiStyle.cs; type is Lilita One (the game's font) over Nunito. */
:root {
  --wood: #6b3a1e;
  --wood-dark: #422210;
  --wood-in: #4a2812;
  --cream: #f3ddb3;
  --paper: #f7e2b7;
  --ink: #2a160b;
  --orange: #f28a1a;
  --gold: #ffc629;
  --amber: #d68c14;
  --blue: #1e9bf0;
  --ice: #7be3ff;
  --green: #5bd24a;
  --red: #e2412f;
  --coral: #ff8c73;
  --navy: #0d1d3f;
  --deep: #0a3a66;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: max(16px, 5vw);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #59b8ee;
  color: #fff;
  font: 700 18px/1.45 var(--text);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- the world: fixed layers behind the story ---------- */
#world { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(#3e9ee4, #8fd3f5 60%, #59b8ee); z-index: 0; }
#world > * { position: absolute; pointer-events: none; user-select: none; }
#world img { max-width: none; }
.w-sky { left: -6%; top: -4%; width: 112%; height: 80%; object-fit: cover; transform-origin: 50% 100%; will-change: transform; }
.w-islands, .w-coast { left: 0; top: 0; width: 100%; transform-origin: 0 0; will-change: transform; }
#sea-back, #sea-front, #ships { inset: 0; width: 100%; height: 100%; }
.w-harbor { inset: 0; will-change: transform, opacity; }
.w-harbor img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
#fx { inset: 0; }
.w-pier { left: 50%; bottom: -1vh; width: max(120vw, 1180px); max-width: none; transform: translateX(-50%); will-change: transform; }
.w-frost { inset: 0; opacity: 0; background:
  radial-gradient(120% 90% at 50% 50%, transparent 40%, rgba(190, 240, 255, 0.55) 80%, rgba(230, 250, 255, 0.85)),
  linear-gradient(rgba(150, 220, 255, 0.18), rgba(150, 220, 255, 0.18)); }
.w-sunset { left: 0; right: 0; top: 0; opacity: 0; background: radial-gradient(60% 70% at 62% 100%, #ffe08a 0%, #ffb15a 22%, rgba(255, 140, 90, 0) 60%),
  linear-gradient(#3c3a8c 0%, #b4569a 42%, #ff8a5c 78%, #ffc06a 100%); }
.w-dusk { inset: 0; opacity: 0; mix-blend-mode: soft-light; background: linear-gradient(rgba(255, 150, 80, 0.9), rgba(255, 110, 90, 0.7) 50%, rgba(80, 60, 150, 0.85)); }

.ship { position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; transform-origin: 0 0; will-change: transform;
  mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat; mask-size: 100% 100%; -webkit-mask-size: 100% 100%; }
.rig-g { position: absolute; left: 0; top: 0; width: 1536px; height: 1024px; }
.rig-p { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; }

/* fx: cannonball, muzzle flash, splash, coins, banners */
.fx { position: absolute; left: 0; top: 0; will-change: transform, opacity; pointer-events: none; }
.fx img { display: block; width: 100%; height: auto; }
.fx-ball { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a8f99 0 12%, #2c2f36 40%, #0d0e11 75%); box-shadow: 0 0 0 3px #0d0e11; }
.fx-smoke { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(235,235,240,0.6) 55%, rgba(255,255,255,0) 72%); }
.fx-dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); box-shadow: 0 3px 0 rgba(42, 22, 11, 0.35); }
.fx-flash { width: 220px; height: 220px; margin: -110px 0 0 -110px; }
.fx-splash { width: 360px; height: 360px; margin: -315px 0 0 -180px; background: url(../img/sea/splash-ball.webp) 0 0 / 400% 200% no-repeat; }
.fx-coin { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
.fx-shield { width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 227, 255, 0) 52%, rgba(123, 227, 255, 0.35) 64%, rgba(255, 255, 255, 0.9) 70%, rgba(30, 155, 240, 0) 74%);
  box-shadow: 0 0 60px rgba(123, 227, 255, 0.55); }
.fx-banner { font: 400 clamp(34px, 4.6vw, 70px)/1 var(--display); color: var(--gold); white-space: nowrap; transform: translate(-50%, -50%);
  text-shadow: var(--outline-xl); letter-spacing: 0.02em; }
.fx-vs { width: clamp(150px, 16vw, 260px); margin-left: calc(clamp(150px, 16vw, 260px) / -2); }
.fx-timer { width: clamp(160px, 15vw, 240px); height: auto; margin-left: calc(clamp(160px, 15vw, 240px) / -2); display: grid; place-items: center; }
.fx-timer img { width: 100%; grid-area: 1 / 1; }
.fx-timer b { grid-area: 1 / 1; font: 400 clamp(26px, 2.6vw, 40px)/1 var(--display); color: #fff; text-shadow: var(--outline-s); padding-bottom: 4%; }

/* ---------- type ---------- */
:root {
  --outline-s: 0 0.06em 0 var(--ink), 0.05em 0 0 var(--ink), -0.05em 0 0 var(--ink), 0 -0.05em 0 var(--ink),
    0.04em 0.04em 0 var(--ink), -0.04em 0.04em 0 var(--ink), 0.04em -0.04em 0 var(--ink), -0.04em -0.04em 0 var(--ink);
  --outline-xl: 0 0.09em 0 var(--ink), 0.055em 0 0 var(--ink), -0.055em 0 0 var(--ink), 0 -0.055em 0 var(--ink),
    0.045em 0.045em 0 var(--ink), -0.045em 0.045em 0 var(--ink), 0.045em -0.045em 0 var(--ink), -0.045em -0.045em 0 var(--ink),
    0.03em 0.08em 0 var(--ink), -0.03em 0.08em 0 var(--ink), 0 0.14em 0.08em rgba(0, 0, 0, 0.25);
}
.display { font: 400 clamp(40px, 6.2vw, 92px)/0.98 var(--display); margin: 0; color: #fff; text-shadow: var(--outline-xl); letter-spacing: 0.01em; }
.display.small { font-size: clamp(30px, 3.6vw, 52px); }
.hot { color: var(--gold); }
.kicker { display: inline-block; margin: 0 0 18px; padding: 8px 18px 7px; font: 400 clamp(15px, 1.4vw, 19px)/1 var(--display);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream);
  background: linear-gradient(#83492a, var(--wood) 55%, var(--wood-in)); border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 210, 140, 0.35), 0 4px 0 var(--ink); transform: rotate(-2deg); text-shadow: 0 2px 0 var(--ink); }
.body { margin: 22px 0 0; max-width: 34ch; padding: 14px 18px 15px; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.4; font-weight: 800;
  color: var(--ink); background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink); }
.body b { color: #b5420f; }
.pill { display: inline-block; margin: 0; padding: 14px 26px 12px; font: 400 clamp(19px, 1.8vw, 26px)/1 var(--display); letter-spacing: 0.02em; color: var(--ink);
  border: 4px solid var(--ink); border-radius: 18px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 7px 0 var(--ink); }
.pill-gold { background: linear-gradient(#ffe26b, var(--gold) 45%, #f2a21a); }

/* ---------- top bar ---------- */
.bar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 var(--gutter); pointer-events: none; background: var(--navy); border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 0 rgba(42, 22, 11, 0.25); transition: transform 0.5s cubic-bezier(.2, .9, .2, 1.2), opacity 0.3s; transform: translateY(-120%); opacity: 0; }
.bar.is-shown { transform: none; opacity: 1; }
.bar-logo { pointer-events: auto; width: 104px; display: block; margin-top: 18px; }
.bar-logo img { display: block; width: 100%; }
.bar-cta { pointer-events: auto; display: flex; align-items: center; gap: 8px; }
.bar-cta img { display: block; height: 40px; width: auto; }   /* Apple's minimum on the web */
.bar-cta img.gp { height: calc(40px * 250 / 168); margin: calc(-40px * 41 / 168); }
.bar-cta .store-soon { font-size: 12px; padding: 5px 8px 4px; }

/* Apple's official badge, unmodified: at least 40 px tall, clear space of a tenth of its height all round */
.store { display: inline-grid; justify-items: center; gap: 8px; }
.store-badge { display: block; height: clamp(48px, 4.6vw, 62px); width: auto; margin: 6px; }
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
/* Google's official PNG carries its clear space (41px of 250 around a 564x168 badge): scale it so the visible badge matches Apple's height */
.store-badge-gp { height: calc(clamp(48px, 4.6vw, 62px) * 250 / 168); margin: calc(6px - clamp(48px, 4.6vw, 62px) * 41 / 168); }
.store-soon { font: 400 15px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); padding: 7px 12px 6px;
  background: linear-gradient(#ffe26b, var(--gold) 45%, #f2a21a); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }

/* ---------- story beats over the world ---------- */
main { position: relative; z-index: 10; }
.beat { position: relative; height: var(--len, 220vh); }
.beat-hero { --len: 170vh; }
.beat[data-beat="duel"] { --len: 230vh; }
.beat-fire { --len: 300vh; }
.beat[data-beat="waves"] { --len: 260vh; }
.beat-streak { --len: 380vh; }
.beat-finale { --len: 220vh; }
.copy { position: sticky; top: 13vh; width: min(46vw, 640px); margin-left: var(--gutter); will-change: transform, opacity; }

.copy-hero { top: 3vh; width: min(calc(100vw - var(--gutter) * 2), 640px); margin: 0 auto; display: grid; justify-items: center; text-align: center; }
.logo { margin: 0 0 4px; line-height: 0; }
.logo img { width: min(24vw, 330px); height: auto; }
.lede { margin: 0 0 16px; max-width: 34ch; font: 400 clamp(18px, 1.6vw, 24px)/1.15 var(--display); color: #fff; text-shadow: var(--outline-s); }
.lede strong { font-weight: 400; color: var(--gold); }
.scroll-hint { position: absolute; z-index: 2; left: 50%; top: calc(100vh - 64px); transform: translateX(-50%); margin: 0; display: flex; white-space: nowrap; align-items: center; gap: 12px; font: 400 18px/1 var(--display); letter-spacing: 0.04em; text-shadow: var(--outline-s); }
.scroll-hint i { width: 26px; height: 40px; border: 3px solid #fff; border-radius: 14px; position: relative; box-shadow: 0 0 0 3px var(--ink); }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 6px; height: 9px; margin-left: -3px; border-radius: 3px; background: #fff; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

.controls { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.controls li { display: grid; justify-items: center; gap: 8px; font: 400 16px/1 var(--display); letter-spacing: 0.03em; text-shadow: var(--outline-s); }
.ctl { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink), inset 0 4px 0 rgba(255, 255, 255, 0.35); }
.ctl img { width: 66%; }
.ctl-wheel { background: radial-gradient(circle, #3a3f4a, #1d2027); }
.ctl-fire { background: radial-gradient(circle at 40% 35%, #ffb04a, var(--orange) 55%, #c95a10); }
.ctl-shield { background: radial-gradient(circle at 40% 35%, #6cc7ff, var(--blue) 55%, #0f63b0); }

.streak-hud { position: fixed; z-index: 1; top: 11vh; right: var(--gutter); display: grid; justify-items: center; opacity: 0; pointer-events: none;
  transform-origin: 50% 0; will-change: opacity; }
.choice { opacity: 0; }
.streak-crown img { width: clamp(70px, 7vw, 110px); display: block; margin-bottom: -14px; position: relative; z-index: 1; filter: drop-shadow(0 4px 0 var(--ink)); }
.streak-plaque { display: grid; justify-items: center; padding: 14px 34px 10px; background: linear-gradient(#83492a, var(--wood) 55%, var(--wood-in));
  border: 4px solid var(--ink); border-radius: 22px; box-shadow: inset 0 3px 0 rgba(255, 210, 140, 0.35), 0 7px 0 var(--ink); }
.streak-plaque span { font: 400 18px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream); text-shadow: 0 2px 0 var(--ink); }
.streak-plaque b { font: 400 clamp(64px, 7vw, 104px)/0.95 var(--display); color: var(--gold); text-shadow: var(--outline-xl); font-weight: 400; }
.streak-row { display: flex; gap: 10px; margin-top: 12px; }
.streak-row > span { display: flex; align-items: center; gap: 6px; padding: 8px 14px 7px; font: 400 18px/1 var(--display); color: var(--ink);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.streak-row b { font-weight: 400; color: #b5420f; }
.streak-loot img { width: 24px; }
.choice { display: flex; gap: 14px; margin-top: 22px; }
.choice-card { display: grid; gap: 2px; padding: 12px 18px 11px; border: 4px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink); color: var(--ink); }
.choice-card b { font: 400 22px/1 var(--display); font-weight: 400; }
.choice-card span { font-size: 15px; }
.choice-home { background: linear-gradient(#ffe26b, var(--gold) 45%, #f2a21a); }
.choice-go { background: linear-gradient(#8ff07c, var(--green) 50%, #2f9e2a); }

.copy-finale { top: 16vh; text-align: center; margin: 0 auto; width: min(92vw, 1000px); display: grid; justify-items: center; gap: 26px; }
.copy-finale .display { font-size: clamp(48px, 8vw, 130px); }

/* ---------- panels: full-bleed chapters that slide over the world ---------- */
.panel { position: relative; z-index: 2; padding: 16vh var(--gutter) 14vh; clip-path: polygon(0 6vw, 37% 0, 37% 3vw, 100% 0, 100% 100%, 0 100%); margin-top: -6vw; }
.panel-head { max-width: 760px; }
.panel .body { max-width: 52ch; }

.panel-captains { background: var(--navy); }
.captains { margin-top: 8vh; display: grid; gap: 12vh; }
.cap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; min-height: 80vh; }
.cap::before { content: ""; position: absolute; inset: 6% -10vw; background: var(--cap-bg, #78bef0); clip-path: polygon(0 18%, 100% 0, 100% 82%, 0 100%); z-index: -1; }
.cap:nth-child(even) .cap-art { order: 2; }
.cap-art { position: relative; height: min(84vh, 820px); display: grid; place-items: end center; }
.cap-art .figure { height: 100%; width: auto; max-width: 100%; }
.figure { position: relative; }
.figure-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.cap-text { display: grid; gap: 18px; justify-items: start; padding: 0 2vw; }
.cap-name { font: 400 clamp(46px, 6.5vw, 104px)/0.92 var(--display); color: #fff; text-shadow: var(--outline-xl); margin: 0; }
.rarity { font: 400 16px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 14px 7px; border: 3px solid var(--ink); border-radius: 10px; box-shadow: 0 4px 0 var(--ink); color: #fff; text-shadow: 0 2px 0 var(--ink); }
.rarity-common { background: #7d8b93; }
.rarity-rare { background: #2f8de0; }
.rarity-epic { background: #9a4fe0; }
.rarity-legendary { background: linear-gradient(#ffd84a, #f29a1a); color: var(--ink); text-shadow: none; }
.bubble { position: relative; max-width: 30ch; margin: 0; padding: 18px 22px; font: 400 clamp(22px, 2.2vw, 32px)/1.12 var(--display); color: var(--ink);
  background: #fff; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 7px 0 var(--ink); }
.bubble::after { content: ""; position: absolute; left: 42px; bottom: -27px; width: 34px; height: 30px; background: #fff; border: 4px solid var(--ink); border-top: 0; border-left: 0;
  transform: skewX(-35deg); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.cap:nth-child(even) .bubble::after { left: auto; right: 42px; transform: skewX(35deg) scaleX(-1); }
.cap-bio { margin: 0; max-width: 40ch; font-size: clamp(16px, 1.2vw, 19px); font-weight: 800; color: var(--ink); }

.roster { margin-top: 16vh; }
.roster-grid { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
.roster-grid li { display: grid; justify-items: center; gap: 8px; font: 400 15px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; text-shadow: var(--outline-s); }
.roster-grid img { width: 100%; height: auto; max-width: 116px; aspect-ratio: 1; border-radius: 50%; border: 4px solid var(--ink); background: var(--bg, #78bef0); box-shadow: 0 5px 0 var(--ink); transition: transform 0.2s; }
.roster-grid li:hover img { transform: translateY(-6px) rotate(-3deg); }

.panel-shipyard { background: linear-gradient(#1b6fb8, #0e4f8f 60%, #0a3a66); overflow: hidden; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4vw; align-items: center; }
.yard-stage { display: grid; justify-items: center; gap: 10px; }
.mk { position: relative; width: 100%; max-width: 760px; aspect-ratio: 640 / 300; }
.mk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 0 rgba(4, 20, 40, 0.35)); }
.mk-label { margin: 0; font: 400 clamp(26px, 2.6vw, 38px)/1 var(--display); text-shadow: var(--outline-s); }
.mk-label span { color: var(--gold); }
.fleet { grid-column: 1 / -1; margin: 8vh calc(var(--gutter) * -1) 0; overflow: hidden; }
.fleet-track { list-style: none; margin: 0; padding: 0 var(--gutter); display: flex; gap: 22px; width: max-content; will-change: transform; }
.fleet-track li { width: clamp(260px, 30vw, 440px); display: grid; gap: 4px; justify-items: center; font: 400 20px/1 var(--display); text-shadow: var(--outline-s); }
.fleet-track img { width: 100%; height: auto; aspect-ratio: 640 / 300; filter: drop-shadow(0 10px 0 rgba(4, 20, 40, 0.3)); }
.fleet-track small { font: 800 13px/1 var(--text); color: var(--ice); text-shadow: none; letter-spacing: 0.04em; text-transform: uppercase; }

.panel-arsenal { background: linear-gradient(#3b2414, var(--wood-dark) 45%, #2a160b); }
.cannons { list-style: none; margin: 8vh 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.cannons li { position: relative; display: grid; justify-items: center; gap: 6px; padding: 16px 12px 14px; background: linear-gradient(#83492a, var(--wood) 55%, var(--wood-in));
  border: 4px solid var(--ink); border-radius: 18px; box-shadow: inset 0 3px 0 rgba(255, 210, 140, 0.3), 0 6px 0 var(--ink); }
.cannons img { width: 100%; aspect-ratio: 1575 / 999; object-fit: contain; }
.cannons b { font: 400 22px/1 var(--display); font-weight: 400; text-shadow: var(--outline-s); }
.cannons .rarity { font-size: 12px; padding: 6px 10px 5px; }
.rarity-uncommon { background: #3fae4a; }
.rarity-mythic { background: linear-gradient(#ff7ad9, #9a3cf0); }
.powerups { margin-top: 12vh; }
.pu-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.pu-list li { display: grid; grid-template-columns: 84px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 14px 18px;
  background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink); }
.pu-list img { grid-row: 1 / 3; width: 84px; }
.pu-list b { font: 400 24px/1 var(--display); font-weight: 400; align-self: end; }
.pu-list span { font-size: 16px; align-self: start; }

.panel-glory { background: linear-gradient(#5b2a86, #2f1f6b 50%, var(--navy)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: center; }
.board { background: var(--paper); color: var(--ink); border: 5px solid var(--ink); border-radius: 26px; box-shadow: 0 9px 0 var(--ink); padding: 18px 18px 10px; }
.board-head { display: flex; align-items: center; gap: 12px; font: 400 30px/1 var(--display); padding: 0 6px 12px; border-bottom: 3px dashed rgba(42, 22, 11, 0.3); }
.board-head img { width: 54px; }
.board-head b { font-weight: 400; }
.board-rows { list-style: none; margin: 0; padding: 0; }
.board-rows li { display: grid; grid-template-columns: 44px 52px 1fr auto; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 2px solid rgba(42, 22, 11, 0.12); font: 800 18px/1 var(--text); }
.board-rows li:last-child { border-bottom: 0; background: rgba(255, 198, 41, 0.35); border-radius: 12px; }
.board-rows .rank { font: 400 24px/1 var(--display); text-align: center; }
.board-rows img { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background: var(--bg, #78bef0); }
.board-rows .score { font: 400 26px/1 var(--display); color: #b5420f; }
.crew { grid-column: 1 / -1; margin-top: 8vh; }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; display: grid; justify-items: center; gap: 18px; padding: 10vh var(--gutter) 14vh; text-align: center;
  background: linear-gradient(#3b2414, #2a160b); clip-path: polygon(0 4vw, 63% 0, 63% 2vw, 100% 0, 100% 100%, 0 100%); margin-top: -4vw; }
.foot-logo { width: min(320px, 70vw); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; font: 400 20px/1 var(--display); letter-spacing: 0.03em; }
.foot-links a, .foot-link { text-decoration: none; color: var(--cream); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; }
.foot-links a:hover, .foot-link:hover { color: var(--gold); }
.foot-small { margin: 0; font-size: 14px; color: rgba(243, 221, 179, 0.7); }

/* ---------- floating sound button ---------- */
.sound { position: fixed; z-index: 40; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; }
.sound-btn { width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 5px 0 rgba(42, 22, 11, 0.45)); transition: transform 0.15s; }
.sound-btn img { width: 100%; display: block; }
.sound-btn:hover { transform: translateY(-2px) rotate(-4deg); }
.sound-btn:active { transform: translateY(2px) scale(0.96); }
.sound-btn:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; border-radius: 14px; }
.sound-btn.is-waiting { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-5px) rotate(-5deg); } }
.sound-hint { margin: 0; padding: 9px 13px 8px; font: 400 15px/1 var(--display); letter-spacing: 0.03em; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .copy { width: auto; margin: 0 var(--gutter); top: 9vh; }
  .copy-hero { top: 3vh; width: auto; }
  .lede { font-size: 18px; }
  .body { max-width: none; }
  .streak-hud { top: 40vh; right: auto; left: 50%; transform: translateX(-50%) scale(0.62); transform-origin: 50% 0; }
  .cannons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cannons b { font-size: 18px; }
  .beat-streak .copy .choice { display: none; }
  .cap { grid-template-columns: 1fr; min-height: auto; gap: 18px; }
  .cap:nth-child(even) .cap-art { order: 0; }
  .cap-art { height: 58vh; }
  .panel-shipyard, .panel-glory { grid-template-columns: 1fr; }
  .controls { gap: 12px; }
  .ctl { width: 64px; height: 64px; }
  .bar-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i::after, .sound-btn.is-waiting { animation: none; }
}

/* ---------- wide screens: the copy sits in a band across the sky, the ships own the sea ---------- */
@media (min-width: 821px) and (min-aspect-ratio: 21/20) {
  .beat .copy:not(.copy-hero):not(.copy-finale) { top: max(78px, 10vh); width: min(calc(100vw - var(--gutter) * 2), 1240px);
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 430px); column-gap: 44px; align-items: end; }
  .beat .copy:not(.copy-finale) .kicker { grid-column: 1 / -1; justify-self: start; }
  .beat .copy:not(.copy-finale) .display { grid-column: 1; grid-row: 2 / span 2; align-self: end; font-size: clamp(38px, 4.3vw, 66px); }
  .beat .copy:not(.copy-finale) .body { grid-column: 2; grid-row: 2; margin: 0; }
  .beat .copy .controls, .beat .copy .choice { grid-column: 2; grid-row: 3; margin-top: 16px; }
  .streak-hud { top: 39vh; right: auto; left: 50%; transform: translateX(-50%); }
}

/* the harbour conversation */
.fx-talk { width: max-content; max-width: min(340px, 84vw); padding: 14px 16px 12px; background: #fff; color: var(--ink); border: 4px solid var(--ink);
  border-radius: 20px; box-shadow: 0 6px 0 var(--ink); font: 800 clamp(15px, 1.2vw, 18px)/1.3 var(--text); transform-origin: 50% 100%; opacity: 0; }
.fx-talk::after { content: ""; position: absolute; left: calc(50% + var(--tail, 0px) - 12px); bottom: -15px; width: 22px; height: 22px; background: #fff;
  border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(45deg); border-bottom-right-radius: 4px; }
.talk-name { position: absolute; top: -17px; left: 14px; padding: 5px 10px 4px; font: 400 15px/1 var(--display); letter-spacing: 0.04em; color: #fff;
  background: var(--who, #78bef0); border: 3px solid var(--ink); border-radius: 10px; text-shadow: var(--outline-s); box-shadow: 0 3px 0 var(--ink); }
.talk-body { display: grid; }
.talk-body > span { grid-area: 1 / 1; }
.talk-ghost { visibility: hidden; }

/* no WebGL: a plain painted gradient stands in for the sea */
#world.no-webgl { background: linear-gradient(#3e9ee4 0 52%, #2f8bd0 52%, #3fb8e6 72%, #62e2d6); }
#world.no-webgl #sea-back, #world.no-webgl #sea-front { display: none; }

@media (max-width: 820px) {
  .copy-hero .logo img { width: 210px; }
}

/* phones held sideways: little height, so the copy shrinks to a headline in the corner */
@media (orientation: landscape) and (max-height: 520px) {
  .bar { height: 46px; }
  .bar-logo { width: 62px; margin-top: 4px; }
  .copy-hero { top: 10px; width: min(60vw, 420px); }
  .copy-hero .logo img { width: 150px; }
  .lede { font-size: 16px; margin-bottom: 10px; }
  .pill { font-size: 14px; padding: 8px 14px 7px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
  .scroll-hint { display: none; }
  .beat .copy:not(.copy-hero):not(.copy-finale) { top: 56px; width: min(46vw, 420px); display: block; }
  .beat .copy:not(.copy-finale) .display { font-size: 28px; }
  .beat .copy:not(.copy-finale) .kicker { font-size: 12px; margin-bottom: 8px; }
  .beat .copy .body, .beat .copy .controls, .beat .copy .choice { display: none; }
  .streak-hud { top: 50px; right: var(--gutter); left: auto; transform: scale(0.5); transform-origin: 100% 0; }
  .fx-talk { max-width: 260px; font-size: 13px; padding: 10px 12px 9px; }
}

/* ---------- loading screen: a tiny duel while the harbour loads ---------- */
html.is-loading body { overflow: hidden; }
.loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; color: #fff;
  background: radial-gradient(120% 85% at 50% 18%, #6cccf7 0%, #2f8bd0 48%, #1a5a9a 100%); }
.loader::after { content: ""; position: absolute; left: 0; right: 0; bottom: -39px; height: 40px; background-repeat: repeat-x; background-size: 180px 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 40'%3E%3Cpath d='M0 0 H180 V10 Q135 40 90 10 T0 10 Z' fill='%231a5a9a'/%3E%3C/svg%3E"); }
.ld-inner { position: relative; z-index: 1; width: min(92vw, 980px); display: grid; justify-items: center; gap: 20px; padding-bottom: 10vh; }
.ld-logo { width: min(62vw, 290px); animation: ld-bob 2.6s ease-in-out infinite; }
.ld-track { position: relative; width: 100%; height: clamp(118px, 21vw, 206px); }
.ld-water { position: absolute; left: 0; right: 0; bottom: 6%; height: 18px; border-radius: 12px; overflow: hidden;
  background: rgba(8, 36, 72, 0.5); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ld-wake { height: 100%; width: 0; background: linear-gradient(90deg, #3fb8e6, #62e2d6 70%, #e9fdff); border-radius: 0 10px 10px 0; }
.ld-ship, .ld-foe { position: absolute; bottom: 10%; width: clamp(96px, 20vw, 196px); height: auto; filter: drop-shadow(0 6px 0 rgba(4, 20, 40, 0.35)); }
.ld-ship { left: 0; translate: var(--x, 0px) 0; animation: ld-bob 1.7s ease-in-out infinite; transform-origin: 50% 90%; }
.ld-foe { right: 0; animation: ld-bob 1.9s ease-in-out -0.6s infinite; transform-origin: 50% 90%; }
.ld-ship.is-firing { animation: ld-recoil 0.35s ease-out, ld-bob 1.7s ease-in-out 0.35s infinite; }
.ld-foe.is-sunk { animation: ld-sink 1s cubic-bezier(.5, 0, .8, .6) forwards; }
.ld-ball { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, #9aa0aa 0 12%, #2c2f36 45%, #0d0e11 80%); box-shadow: 0 0 0 2px #0d0e11; }
.ld-ship.is-firing ~ .ld-ball { opacity: 1; }
.is-hit .ld-ball { opacity: 0 !important; transition: opacity 0.1s; }
.ld-boom { position: absolute; right: 5%; bottom: 26%; width: 130px; height: 130px; border-radius: 50%; opacity: 0; transform: scale(0.2);
  background: radial-gradient(circle, #fff7c2 0%, #ffc23f 35%, rgba(255, 120, 40, 0.6) 55%, rgba(255, 120, 40, 0) 72%); }
.is-hit .ld-boom { animation: ld-boom 0.6s ease-out forwards; }
.ld-status { margin: 0; display: flex; align-items: baseline; gap: 14px; min-height: 1.6em; font: 400 clamp(15px, 2vw, 20px)/1 var(--display); letter-spacing: 0.06em; text-shadow: var(--outline-s); }
.ld-pct { font-size: 1.6em; font-weight: 400; color: var(--gold); min-width: 3ch; text-align: right; }
.ld-actions { display: grid; justify-items: center; gap: 12px; opacity: 0; transform: translateY(18px) scale(0.85); pointer-events: none;
  transition: opacity 0.35s, transform 0.45s cubic-bezier(.2, 1.5, .35, 1); }
.is-ready .ld-actions { opacity: 1; transform: none; pointer-events: auto; }
.ld-go { cursor: pointer; font-size: clamp(22px, 3vw, 30px); padding: 16px 36px 14px; transition: transform 0.15s; }
.ld-go:hover { transform: translateY(-2px); }
.ld-go:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 3px 0 var(--ink); }
.ld-go:focus-visible, .ld-quiet:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
.ld-quiet { padding: 6px 10px; background: none; border: 0; cursor: pointer; color: #e6f6ff; font: 800 15px/1 var(--text); text-decoration: underline; text-underline-offset: 3px; }
.ld-waves { position: absolute; left: 0; bottom: 0; width: 200%; height: 22vh; animation: ld-drift 9s linear infinite; }
.ld-wave1 { fill: rgba(98, 226, 214, 0.25); }
.ld-wave2 { fill: rgba(26, 90, 154, 0.55); }
.loader.is-leaving { animation: ld-leave 0.9s cubic-bezier(.7, 0, .25, 1) forwards; pointer-events: none; }
@keyframes ld-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes ld-recoil { 0% { transform: translateX(0); } 30% { transform: translateX(-10px) rotate(-4deg); } 100% { transform: none; } }
@keyframes ld-sink { 0% { transform: none; opacity: 1; } 25% { transform: translateY(-8px) rotate(6deg); } 100% { transform: translateY(70%) rotate(-24deg); opacity: 0; } }
@keyframes ld-boom { 0% { opacity: 1; transform: scale(0.2); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes ld-drift { to { transform: translateX(-50%); } }
@keyframes ld-leave { to { transform: translateY(calc(-100% - 40px)); } }
@media (prefers-reduced-motion: reduce) {
  .ld-logo, .ld-ship, .ld-foe, .ld-waves { animation: none; }
  .loader.is-leaving { animation: none; opacity: 0; }
}

/* ---------- the harbour doors (the game's CashOutDoors): shut over the loader, open on the harbour ---------- */
.doors { position: fixed; inset: 0; z-index: 110; pointer-events: none; display: none; }
.doors.is-on { display: block; }
.door { position: absolute; top: -8px; bottom: -8px; width: calc(50% + 8px); overflow: hidden; background-repeat: no-repeat; background-size: cover;
  will-change: transform; box-shadow: 0 0 30px rgba(0, 0, 0, 0.35); }
.door-l { left: 0; background-image: url(../img/ui/door-left.webp); background-position: right center; }
.door-r { right: 0; background-image: url(../img/ui/door-right.webp); background-position: left center; }
.door-logo { position: absolute; top: 50%; width: min(64vw, 560px); max-width: none; }
.door-l .door-logo { right: 0; transform: translate(50%, calc(-50% - 16px)); }
.door-r .door-logo { left: 0; transform: translate(-50%, calc(-50% - 16px)); }
.door-dust { position: absolute; left: 50%; bottom: 6%; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  background: radial-gradient(circle, rgba(191, 158, 122, 0.85), rgba(191, 158, 122, 0) 70%); }

/* ---------- contact form: a parchment card in a wooden frame ---------- */
.contact { padding: 0; border: 0; background: none; max-width: min(560px, calc(100vw - 24px)); width: 100%; overflow: visible; color: var(--ink); }
.contact::backdrop { background: rgba(8, 20, 40, 0.62); backdrop-filter: blur(3px); }
.contact-card { position: relative; display: grid; gap: 16px; padding: 30px 26px 26px; background: var(--paper); border: 6px solid var(--wood);
  border-radius: 26px; box-shadow: 0 0 0 4px var(--ink), 0 10px 0 4px var(--ink), 0 24px 60px rgba(0, 0, 0, 0.45); }
.contact[open] .contact-card { animation: card-in 0.35s cubic-bezier(.2, 1.4, .35, 1); }
@keyframes card-in { from { transform: translateY(30px) scale(0.92); opacity: 0; } }
.contact-title { margin: 0; text-align: center; font: 400 clamp(26px, 4vw, 34px)/1.05 var(--display); color: #fff; text-shadow: var(--outline-s); }
.contact-close { position: absolute; top: -18px; right: -14px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  font: 400 30px/1 var(--display); color: #fff; background: radial-gradient(circle at 40% 35%, #ff7a5c, var(--red) 60%, #a8261a);
  border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.contact-fields { display: grid; gap: 12px; }
.contact-fields[hidden] { display: none; }
.field { display: grid; gap: 6px; font: 400 16px/1 var(--display); letter-spacing: 0.02em; }
.field i { font-style: normal; color: #8a6a4a; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; font: 700 16px/1.35 var(--text); color: var(--ink); background: #fffaf0;
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: inset 0 3px 0 rgba(42, 22, 11, 0.08); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.field.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-error { margin: 0; display: grid; gap: 4px; padding: 12px 14px; background: #ffe2dc; border: 3px solid var(--red); border-radius: 14px; font-size: 15px; }
.contact-error[hidden] { display: none; }
.contact-error span { font-size: 13px; color: #8a2a1e; }
.contact-send { justify-self: center; cursor: pointer; }
.contact-send[hidden] { display: none; }
.contact-send:disabled { opacity: 0.7; cursor: progress; }
.contact-done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 6px 0 4px; }
.contact-done[hidden] { display: none; }
.contact-done p { margin: 0; max-width: 34ch; }
.contact-done-title { font: 400 24px/1.1 var(--display); color: #b5420f; }

/* ---------- text pages: privacy, terms, support, delete-account ---------- */
body.doc { background: radial-gradient(120% 60% at 50% 0%, #1b3a6b 0%, var(--navy) 60%) fixed, var(--navy); }
.doc-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 var(--gutter);
  background: var(--navy); border-bottom: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(42, 22, 11, 0.25); }
.doc-logo { width: 104px; margin-top: 18px; }
.doc-logo img { display: block; width: 100%; }
.doc-home { font: 400 15px/1 var(--display); letter-spacing: 0.03em; color: var(--ink); text-decoration: none; padding: 10px 14px 9px;
  background: linear-gradient(#ffe26b, var(--gold) 45%, #f2a21a); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.doc-main { display: grid; justify-items: center; padding: 7vh var(--gutter) 12vh; }
.doc-card { width: 100%; max-width: 820px; padding: clamp(24px, 5vw, 56px); color: var(--ink); background: var(--paper); border: 6px solid var(--wood);
  border-radius: 26px; box-shadow: 0 0 0 4px var(--ink), 0 10px 0 4px var(--ink), 0 30px 60px rgba(0, 0, 0, 0.35); }
.doc-card .display { margin-top: 4px; }
.doc-updated { margin: 10px 0 26px; font-size: 14px; color: #8a6a4a; }
.doc-lede { font-size: clamp(18px, 1.6vw, 20px); }
.doc-card h2 { margin: 34px 0 10px; font: 400 clamp(22px, 2.2vw, 27px)/1.15 var(--display); color: #8f2f0b; }
.doc-card p, .doc-card li { font-size: 17px; line-height: 1.6; }
.doc-card p { margin: 0 0 12px; }
.doc-card ul, .doc-card ol { margin: 0 0 12px; padding-left: 1.2em; }
.doc-card li { margin-bottom: 8px; }
.doc-card li::marker { color: var(--amber); }
.doc-card b { color: var(--ink); }
.doc-card a { color: #b5420f; text-underline-offset: 3px; }
.doc-ask { display: inline-block; margin: 6px 0 0; padding: 10px 16px 9px; cursor: pointer; font: 400 17px/1 var(--display); letter-spacing: 0.02em; color: var(--ink);
  background: linear-gradient(#ffe26b, var(--gold) 45%, #f2a21a); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.doc-ask:hover { transform: translateY(-1px); }
a.doc-ask { color: var(--ink); text-decoration: none; }
.doc-ask:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.doc .foot { margin-top: 0; }

/* ---------- the game's own wood and gold (9-sliced, so bolts and corners never stretch) ---------- */
/* labels: two planks with gold bolts (Hud_WoodPlate) */
.kicker { background: none; border-style: solid; border-width: 0 24px; border-radius: 0; box-shadow: none; padding: 11px 6px 12px;
  border-image: url(../img/ui/wood-plate.webp) 0 70 fill / 0 24px stretch; filter: drop-shadow(0 4px 0 rgba(42, 22, 11, 0.35)); }
/* text cards: wood frame with gold bolts around parchment (the captains' details panel) */
.body, .board, .doc-card, .contact-card { background: none; box-shadow: none; border-radius: 0; border-style: solid;
  border-image: url(../img/ui/wood-panel.webp?v=2) 38 fill / 24px stretch; filter: drop-shadow(0 8px 0 rgba(42, 22, 11, 0.35)); }
.body { border-width: 24px; padding: 4px 6px 6px; }
.board { border-width: 28px; padding: 6px 8px 2px; }
.doc-card { border-width: 30px; padding: clamp(14px, 3vw, 40px); border-image-width: 30px; }
.contact-card { border-width: 30px; padding: 20px 14px 14px; border-image-width: 30px; }
/* cannon and power-up cards: the smaller framed parchment */
.cannons li, .pu-list li { background: none; box-shadow: none; border-radius: 0; border-style: solid; border-width: 22px;
  border-image: url(../img/ui/wood-card.webp) 44 fill / 22px stretch; filter: drop-shadow(0 6px 0 rgba(42, 22, 11, 0.35)); }
.cannons li { padding: 4px 4px 6px; }
.cannons b { color: #fff; }
.pu-list li { padding: 2px 6px; }
/* gold and green buttons: the BATTLE and Invite buttons */
.pill-gold, .store-soon, .doc-ask, .choice-home, .doc-home { background: none; box-shadow: none; border-radius: 0; border-style: solid;
  border-image: url(../img/ui/btn-gold.webp) 40 46 50 46 fill / 13px 15px 16px 15px stretch; filter: drop-shadow(0 4px 0 rgba(42, 22, 11, 0.3)); }
.pill-gold { border-width: 13px 15px 16px; padding: 4px 16px 2px; }
.store-soon { border-width: 9px 11px 11px; padding: 0 4px; border-image-width: 9px 11px 11px; }
.doc-ask, .doc-home { border-width: 10px 12px 12px; padding: 2px 8px 0; border-image-width: 10px 12px 12px; }
.choice-home, .choice-go { border-width: 12px 14px 15px; padding: 2px 8px 0; box-shadow: none; border-radius: 0; background: none; border-style: solid; }
.choice-home { border-image-width: 12px 14px 15px; }
.choice-go { color: #fff; text-shadow: var(--outline-s); border-image: url(../img/ui/btn-green.webp) 30 34 38 34 fill / 12px 14px 15px stretch; filter: drop-shadow(0 4px 0 rgba(42, 22, 11, 0.3)); }
.choice-go span { color: #eaffdf; }
/* the streak sign: the battle timer's plaque, with STREAK and the number side by side */
.streak-plaque { display: flex; align-items: center; gap: 12px; background: none; box-shadow: none; border-radius: 0; border-style: solid;
  border-width: 0 34px; padding: 10px 4px 14px; border-image: url(../img/ui/wood-timer.webp) 0 80 fill / 0 34px stretch; filter: drop-shadow(0 6px 0 rgba(42, 22, 11, 0.35)); }
.streak-plaque b { font-size: clamp(54px, 5.4vw, 80px); line-height: 0.9; }
.streak-crown img { margin-bottom: -10px; }
/* small parchment pills with a wood rim and bolts */
.streak-row > span, .sound-hint { background: none; box-shadow: none; border-radius: 0; border-style: solid; border-width: 0 22px; padding: 12px 2px 11px;
  border-image: url(../img/ui/wood-pill.webp) 0 70 fill / 0 22px stretch; filter: drop-shadow(0 3px 0 rgba(42, 22, 11, 0.3)); }

/* ---------- invite friends ---------- */
.panel-crew { background: radial-gradient(90% 60% at 80% 10%, #2f9e6a 0%, rgba(47, 158, 106, 0) 60%), linear-gradient(#1d6b4f, #134b3a 55%, #0d3329); }
.crew-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: center; }
.crew-copy .body { max-width: 44ch; }
.crew-ship { position: relative; aspect-ratio: 1.05; max-width: 560px; justify-self: center; width: 100%; }
.crew-rook { position: absolute; left: 6%; top: 0; width: 78%; filter: drop-shadow(0 18px 0 rgba(4, 30, 20, 0.35)); animation: ld-bob 3.2s ease-in-out infinite; }
.crew-coins { position: absolute; left: -2%; bottom: 2%; width: 30%; filter: drop-shadow(0 8px 0 rgba(4, 30, 20, 0.35)); }
.crew-gems { position: absolute; right: 0; bottom: 8%; width: 28%; filter: drop-shadow(0 8px 0 rgba(4, 30, 20, 0.35)); animation: ld-bob 2.4s ease-in-out -1s infinite; }
.crew-code { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%) rotate(-3deg); display: grid; justify-items: center; gap: 2px;
  padding: 16px 40px 14px; border-style: solid; border-width: 0 40px; border-image: url(../img/ui/wood-pill.webp) 0 120 fill / 0 40px stretch;
  filter: drop-shadow(0 6px 0 rgba(42, 22, 11, 0.4)); white-space: nowrap; }
.crew-code span { font: 800 13px/1 var(--text); letter-spacing: 0.12em; text-transform: uppercase; color: #8a6a4a; }
.crew-code b { font: 400 clamp(30px, 3.4vw, 46px)/1 var(--display); font-weight: 400; letter-spacing: 0.12em; color: var(--ink); }

.crew-steps { list-style: none; margin: 10vh 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.crew-step { position: relative; display: grid; align-content: start; gap: 8px; padding: 26px 18px 18px; color: var(--ink); border-style: solid; border-width: 24px;
  border-image: url(../img/ui/wood-panel.webp?v=2) 38 fill / 24px stretch; filter: drop-shadow(0 8px 0 rgba(42, 22, 11, 0.35)); min-height: 250px; }
.crew-step h3 { margin: 0; font: 400 clamp(24px, 2.2vw, 30px)/1.05 var(--display); color: #8f2f0b; }
.crew-step p { margin: 0; font-size: 17px; font-weight: 800; }
.step-n { position: absolute; top: -46px; left: -10px; width: 60px; height: 60px; display: grid; place-items: center; font: 400 32px/1 var(--display); color: #fff;
  text-shadow: var(--outline-s); background: radial-gradient(circle at 40% 35%, #8ff07c, var(--green) 55%, #2f9e2a); border: 4px solid var(--ink); border-radius: 50%; box-shadow: 0 4px 0 var(--ink); }
.step-art img { width: 46%; margin: 4px auto 0; display: block; }
.step-gift { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.step-gift img { width: 44px; height: auto; }
.step-gift b { font: 400 clamp(30px, 3vw, 40px)/1 var(--display); font-weight: 400; color: var(--ink); margin-right: 10px; }
.step-gift small { font-weight: 800; color: #8a6a4a; }

.road { margin-top: 12vh; }
.road-sub { margin: 10px 0 0; font-size: 18px; color: #d8f5e6; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.road-track { position: relative; margin-top: 40px; padding: 108px 2% 0; }
.road-line { position: absolute; left: 6%; right: 6%; top: 116px; height: 14px; border-radius: 10px; background: rgba(4, 30, 20, 0.55); border: 3px solid var(--ink); overflow: hidden; }
.road-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe26b, var(--gold) 60%, #f2a21a); }
.road-ship { position: absolute; top: 132px; left: 6%; width: clamp(80px, 9vw, 120px); transform: translate(-50%, -100%); filter: drop-shadow(0 6px 0 rgba(4, 30, 20, 0.35)); will-change: left; }
.road-stops { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stop { display: grid; justify-items: center; gap: 10px; }
.stop-reward { order: 2; display: grid; justify-items: center; gap: 2px; align-content: start; padding-top: 2px; transform: scale(0.82); opacity: 0.55;
  transition: transform 0.35s cubic-bezier(.2, 1.6, .35, 1), opacity 0.25s; }
.stop-reward img { width: 46px; height: auto; }
.stop-reward b { font: 400 26px/1 var(--display); font-weight: 400; color: #fff; text-shadow: var(--outline-s); }
.stop-reward small { display: flex; align-items: center; gap: 3px; font: 400 15px/1 var(--display); color: var(--gold); text-shadow: var(--outline-s); }
.stop-reward small img { width: 20px; }
.stop-pin { order: 0; width: 30px; height: 30px; border-radius: 50%; background: #2a5a48; border: 4px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: background 0.25s, transform 0.35s cubic-bezier(.2, 1.6, .35, 1); }
.stop-label { order: 1; font: 400 17px/1.1 var(--display); color: #fff; text-shadow: var(--outline-s); text-align: center; }
.stop.is-reached .stop-reward { transform: scale(1.08); opacity: 1; }
.stop.is-reached .stop-pin { background: radial-gradient(circle at 40% 35%, #ffe26b, var(--gold) 55%, #d68c14); transform: scale(1.2); }

.beat-card { margin-top: 12vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: center; }
.beat-scroll { position: relative; aspect-ratio: 900 / 313; background: url(../img/invite/challenge-scroll.webp) center / contain no-repeat; display: flex; align-items: center;
  justify-content: center; gap: 18px; transform: rotate(-3deg); filter: drop-shadow(0 10px 0 rgba(4, 30, 20, 0.35)); }
.beat-scroll span { font: 400 clamp(22px, 2.6vw, 34px)/1 var(--display); color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.beat-scroll b { font: 400 clamp(48px, 5.6vw, 76px)/1 var(--display); font-weight: 400; color: #b5420f; }
.beat-text .body { max-width: 40ch; }

@media (max-width: 820px) {
  .crew-head, .beat-card { grid-template-columns: 1fr; }
  .crew-ship { max-width: 380px; }
  .crew-steps { grid-template-columns: 1fr; gap: 56px; }
  .crew-step { min-height: 0; }
  .step-art img { width: 34%; }
  .road-line { left: 8%; right: 8%; }
  .road-stops { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 26px; }
  .road-line, .road-ship { display: none; }
  .road-track { padding-top: 0; }
}

/* step pictures: the friend sailing in with the gift, Rook celebrating his payout */
.step-scene { position: relative; display: block; height: clamp(140px, 13vw, 190px); margin-top: 8px; }
.step-scene img { position: absolute; height: auto; filter: drop-shadow(0 6px 0 rgba(42, 22, 11, 0.25)); }
.step-scene .sc-ship { left: 50%; bottom: 0; width: auto; height: 100%; transform: translateX(-50%); }
.step-scene-friend .sc-ship { animation: ld-bob 2.8s ease-in-out infinite; }
.step-scene .sc-coins { left: 4%; bottom: -4px; width: 30%; max-width: 110px; }
.step-scene-friend .sc-ticket { left: 8%; top: 4%; width: 18%; max-width: 64px; transform: rotate(-12deg); }
.step-scene-paid .sc-ship { height: 96%; }
.step-scene-paid .sc-coins { left: auto; right: 2%; }
.sc-level { position: absolute; left: 4%; top: 6%; padding: 6px 10px 5px; font: 400 18px/1 var(--display); color: #fff; text-shadow: var(--outline-s);
  background: radial-gradient(circle at 40% 35%, #8ff07c, var(--green) 55%, #2f9e2a); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 var(--ink); transform: rotate(-8deg); }
.step-art img { width: auto; height: clamp(140px, 13vw, 190px); margin: 8px auto 0; }
@media (max-width: 820px) { .step-scene { height: 150px; } .step-art img { height: 150px; } }

/* ---------- cookie question: a framed parchment card at the bottom, both answers the same size ---------- */
.consent { position: fixed; z-index: 50; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px)); display: grid; justify-items: center; gap: 10px; color: var(--ink);
  border-style: solid; border-width: 22px; padding: 2px 6px 4px; border-image: url(../img/ui/wood-card.webp) 44 fill / 22px stretch;
  filter: drop-shadow(0 6px 0 rgba(42, 22, 11, 0.35)); animation: card-in 0.35s cubic-bezier(.2, 1.4, .35, 1); }
.consent[hidden] { display: none; }
.consent-text { margin: 0; text-align: center; font: 700 15px/1.45 var(--text); }
.consent-text b { font: 400 19px/1 var(--display); letter-spacing: 0.02em; margin-right: 4px; }
.consent-text a { color: var(--ink); }
.consent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
.consent .pill { min-width: 140px; font-size: 19px; cursor: pointer; }
