/* BoatBattle: Pirate Ship Battle — site styles. Plain CSS, no build step.
   Bands of flat colour (lagoon, foam, sunset gold, deep navy) joined by wave edges.
   One display face (Lilita One) with the game's thick ink outline; rounded system text for reading. */

@font-face {
  font-family: "Lilita One";
  src: url("fonts/lilita-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* colour */
  --ink: #13213a;        /* outlines, body text on light bands */
  --lagoon: #22c7de;
  --lagoon-deep: #0d93b4;
  --foam: #f2fcff;
  --gold: #ffc531;
  --gold-deep: #e39a12;
  --navy: #10305a;
  --navy-deep: #0a1f3d;
  --coral: #ff5a4e;
  --white: #ffffff;

  /* type */
  --display: "Lilita One", "Arial Rounded MT Bold", "Arial Black", sans-serif;
  --text: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 104px;
  --r-sm: 12px; --r-md: 20px; --r-lg: 32px;
  --edge: 6px;            /* depth of every "3D" bottom edge */
  --stroke: 4px;          /* outline on chunky things */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--navy-deep); color: var(--ink);
  font: 500 18px/1.6 var(--text);
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; border-radius: 8px; }
.wrap { width: min(1180px, 100% - 2 * var(--s2)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: var(--s1); z-index: 20;
  background: var(--gold); color: var(--ink); padding: var(--s1) var(--s2); border-radius: var(--r-sm);
  font-family: var(--display); text-decoration: none;
}
.skip:focus { left: var(--s1); }

/* ---------- The game's lettering: white fill, thick ink outline, solid drop below ---------- */
.ink-text {
  color: var(--white);
  -webkit-text-stroke: 0.16em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.1em 0 var(--ink);
}

/* ---------- Top bar ---------- */
.topbar { position: absolute; inset: 0 0 auto; z-index: 10; padding: var(--s2) 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.mark { font-family: var(--display); font-size: 26px; line-height: 1; text-decoration: none; }
.nav { display: flex; gap: var(--s1); }
.nav a {
  font-family: var(--display); font-size: 17px; line-height: 1; color: var(--ink); text-decoration: none;
  background: var(--white); border: 3px solid var(--ink); border-radius: 999px;
  padding: 9px 16px 8px; box-shadow: 0 4px 0 var(--ink);
}
.nav a:hover { background: var(--gold); }
.nav a:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.nav a[aria-current="page"] { background: var(--gold); }

/* ---------- Buttons: flat face, ink outline, solid edge underneath, sinks when pressed ---------- */
.btn {
  --face: var(--gold); --rim: var(--gold-deep); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--display); font-size: 24px; line-height: 1; color: var(--fg); text-decoration: none;
  background: var(--face);
  border: var(--stroke) solid var(--ink); border-radius: var(--r-md);
  padding: 18px 28px 16px; min-height: 64px;
  box-shadow: inset 0 -5px 0 var(--rim), 0 var(--edge) 0 var(--ink);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --face: #ffd257; }
.btn:active { transform: translateY(var(--edge)); box-shadow: inset 0 -3px 0 var(--rim), 0 0 0 var(--ink); }
.btn-navy { --face: var(--navy); --rim: var(--navy-deep); --fg: var(--white); }
.btn-navy:hover { --face: #17407a; }

.store { text-align: left; padding: 12px 28px 12px 14px; }
.store-badge {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--ink); color: var(--gold);
}
.store-label small { display: block; font-family: var(--text); font-weight: 800; font-size: 14px; letter-spacing: 0.01em; margin-bottom: 3px; }
.store-label span { display: block; font-size: 27px; }

/* ---------- Wave edges between bands ---------- */
.band { position: relative; background: var(--band); }
.band > .wave {
  position: absolute; left: 0; width: 100%; height: 56px; top: -55px;
  fill: var(--band); pointer-events: none;
}
.band-lagoon { --band: var(--lagoon); }
.band-foam   { --band: var(--foam); }
.band-gold   { --band: var(--gold); }
.band-navy   { --band: var(--navy); color: var(--white); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 108px 0 0; text-align: center;
  background: #7fd0e6 url("img/sea-painting-960.webp") center 30% / cover no-repeat;
}
@media (min-width: 961px) { .hero { background-image: url("img/sea-painting-1920.webp"); } }
.hero::before { /* sky stays bright; a soft vignette only behind the lettering */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 46% at 50% 26%, rgba(10, 31, 61, 0.42), rgba(10, 31, 61, 0) 72%);
}
.logo { margin: 0; display: inline-block; transform: rotate(-4deg); }
.logo-word {
  display: block; font-family: var(--display); font-weight: 400;
  font-size: clamp(68px, 18vw, 168px); line-height: 0.9; letter-spacing: 0.01em;
  -webkit-text-stroke-width: 0.13em;
  text-shadow: 0 0.06em 0 var(--ink), 0 0.12em 0 var(--ink), 0 0.2em 0.18em rgba(10, 31, 61, 0.45);
}
.ribbon {
  display: grid; place-items: center;
  width: clamp(270px, 62vw, 520px); aspect-ratio: 600 / 130; margin: -0.1em auto 0;
  background: url("img/ribbon.svg") center / contain no-repeat;
  font-family: var(--display); font-size: clamp(21px, 4.9vw, 38px); line-height: 1; color: var(--ink);
  padding-bottom: 5%;
  transform: rotate(2deg);
}
.hero-line {
  margin: var(--s3) auto 0; word-spacing: 0.05em;
  font-family: var(--display); font-weight: 400; font-size: clamp(28px, 6.4vw, 44px); line-height: 1.08;
}
.hero .btn { margin-top: var(--s4); }

.fleet-stage {
  position: relative; height: clamp(250px, 50vw, 560px); margin-top: var(--s3);
  width: min(1320px, 100%); margin-inline: auto;
}
.fleet-stage img { position: absolute; filter: drop-shadow(0 22px 14px rgba(6, 40, 70, 0.4)); }
.fleet-stage .lead  { width: min(62%, 760px); left: 50%; bottom: -3%; transform: translateX(-50%); z-index: 2; }
.fleet-stage .left  { width: 26%; left: 1%; bottom: 10%; z-index: 1; }
.fleet-stage .right { width: 27%; right: 0; bottom: 6%; z-index: 1; }
@media (max-width: 640px) {
  .fleet-stage { height: 82vw; margin-top: var(--s2); }
  .fleet-stage .lead { width: 96%; bottom: -1%; }
  .fleet-stage .left { width: 40%; left: -14%; bottom: 52%; }
  .fleet-stage .right { width: 42%; right: -16%; bottom: 50%; }
}
@keyframes sail { 0%, 100% { translate: 0 0; rotate: -0.8deg; } 50% { translate: 0 -10px; rotate: 0.6deg; } }
.fleet-stage .lead { animation: sail 6s ease-in-out infinite; }

/* ---------- Story bands: big illustration beside a short block of text ---------- */
.story { padding: var(--s6) 0; }
.story .wrap {
  display: grid; grid-template-columns: 1fr; gap: var(--s4); align-items: center; text-align: center;
}
.story-art { position: relative; }
.story h2 {
  margin: 0; -webkit-text-stroke-width: 0.11em; word-spacing: 0.06em; letter-spacing: 0.01em; font-family: var(--display); font-weight: 400;
  font-size: clamp(38px, 8.4vw, 64px); line-height: 1.02; text-wrap: balance;
}
.story p { margin: var(--s3) auto 0; max-width: 34ch; font-size: clamp(18px, 2.2vw, 21px); font-weight: 600; }
@media (min-width: 900px) {
  .story .wrap { grid-template-columns: 1.1fr 1fr; gap: var(--s5); text-align: left; }
  .story p { margin-left: 0; }
  .story.flip .story-art { order: 2; }
}

/* lagoon band: the controls */
.sticks { display: flex; gap: var(--s3); margin-top: var(--s4); justify-content: center; }
@media (min-width: 900px) { .sticks { justify-content: flex-start; } }
.stick { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; line-height: 1; }
.stick-pad {
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); border: var(--stroke) solid var(--ink);
  display: grid; place-items: center; box-shadow: 0 var(--edge) 0 var(--ink);
}
.stick-pad::after {
  content: ""; width: 42px; height: 42px; border-radius: 50%;
  background: var(--knob, var(--white)); border: var(--stroke) solid var(--ink);
  transform: translate(var(--dx, 12px), var(--dy, -10px));
}
.stick.fire .stick-pad { --knob: var(--coral); --dx: 14px; --dy: -14px; }
.lagoon-art img { width: 112%; max-width: none; margin-left: -6%; filter: drop-shadow(0 26px 16px rgba(5, 70, 100, 0.4)); }

/* foam band: the fleet */
.fleet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s2); }
.fleet-grid figure { margin: 0; text-align: center; }
.fleet-grid img { width: 100%; aspect-ratio: 1.25; object-fit: contain; filter: drop-shadow(0 16px 10px rgba(16, 48, 90, 0.25)); }
.tag {
  display: inline-block; margin-top: 6px;
  font-family: var(--display); font-size: clamp(17px, 4vw, 22px); line-height: 1; color: var(--ink);
  background: var(--white); border: 3px solid var(--ink); border-radius: 999px;
  padding: 7px 14px 6px; box-shadow: 0 4px 0 var(--ink);
}
.power { display: inline-flex; gap: 6px; margin-top: var(--s4); align-items: center; font-family: var(--display); font-size: 20px; }
.power i { width: 26px; height: 26px; border-radius: 7px; background: var(--gold); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.power i.off { background: #cfe4ec; }
.power span { margin-left: 8px; }

/* gold band: the chest */
.chest-art { display: grid; place-items: center; }
.chest-art .burst { position: absolute; width: 130%; max-width: none; opacity: 0.9; mix-blend-mode: screen; animation: spin 40s linear infinite; }
.chest-art .chest { position: relative; width: min(88%, 520px); filter: drop-shadow(0 26px 14px rgba(120, 60, 0, 0.45)); }
.chest-art .loot { position: absolute; width: 23%; filter: drop-shadow(0 10px 6px rgba(120, 60, 0, 0.35)); }
.chest-art .loot.a { left: 0; bottom: 4%; }
.chest-art .loot.b { right: 0; top: 4%; }
@keyframes spin { to { rotate: 360deg; } }

/* navy band: the skins */
.skins { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0; }
.skins figure { margin: 0; position: relative; text-align: center; }
.skins figure::before { /* the plinth shadow each ship stands on */
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 30px; height: 16%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), transparent); z-index: 0;
}
.skins img { position: relative; width: 100%; }
.skins figure:nth-child(2) img { transform: scale(1.18); transform-origin: 50% 90%; }
.skins figcaption { position: relative; margin-top: var(--s2); font-family: var(--display); font-size: clamp(16px, 3.6vw, 22px); line-height: 1; }
.band-navy .story p { color: #d9e9ff; }

/* ---------- Closing call ---------- */
.closing {
  position: relative; isolation: isolate; text-align: center; padding: 136px 0 var(--s6);
  background: #45c3dc url("img/sea-clean-1600.webp") center 62% / cover no-repeat;
}
.closing::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 55% at 50% 50%, rgba(10, 31, 61, 0.38), rgba(10, 31, 61, 0) 75%);
}
.closing > .wave { position: absolute; top: -1px; left: 0; width: 100%; height: 56px; fill: var(--navy); transform: scaleY(-1); }
.closing h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(40px, 9vw, 76px); line-height: 1; text-wrap: balance; }
.closing p { margin: var(--s2) 0 var(--s4); font-family: var(--display); font-size: clamp(20px, 3vw, 26px); }

/* ---------- Footer ---------- */
.footer { position: relative; background: var(--navy-deep); color: #c6d7ee; padding: var(--s5) 0 var(--s4); font-size: 16px; }
.footer > .wave { position: absolute; left: 0; width: 100%; height: 40px; top: -39px; fill: var(--navy-deep); }
.footer .wrap { display: grid; gap: var(--s3); justify-items: center; text-align: center; }
.footer .mark { font-size: 34px; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4); }
.footer nav a { font-family: var(--display); font-size: 20px; color: var(--white); text-decoration: none; }
.footer nav a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.footer p { margin: 0; }

/* ---------- Document pages ---------- */
.page-head {
  position: relative; text-align: center; padding: 120px 0 var(--s5);
  background: var(--lagoon);
}
.page-head h1 { margin: 0; display: inline-block; transform: rotate(-3deg); font-family: var(--display); font-weight: 400; font-size: clamp(48px, 12vw, 92px); line-height: 1; }
.page-head p { margin: var(--s3) auto 0; max-width: 30ch; font-family: var(--display); font-size: clamp(20px, 3vw, 24px); line-height: 1.25; }
.page-body { padding: var(--s5) 0 var(--s6); }
.prose { width: min(720px, 100% - 2 * var(--s2)); margin-inline: auto; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 5vw, 36px); line-height: 1.1; margin: var(--s5) 0 var(--s2); }
.prose p, .prose li { font-size: 18px; }
.prose ul { padding-left: 1.25em; }
.prose li { margin: 10px 0; }
.prose li::marker { color: var(--lagoon-deep); }
.prose a { color: #0a6f93; font-weight: 700; overflow-wrap: anywhere; }
.prose strong { font-weight: 800; }
.updated {
  display: inline-block; margin: 0 0 var(--s3); font-family: var(--display); font-size: 18px;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px 5px; box-shadow: 0 4px 0 var(--ink);
}

.help {
  display: grid; gap: var(--s2); justify-items: start;
  background: var(--gold); border: var(--stroke) solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 0 var(--edge) 0 var(--ink); padding: var(--s4) var(--s3) var(--s4);
  position: relative; overflow: hidden;
}
.help h2 { margin: 0; }
.help p { margin: 0; max-width: 30ch; font-weight: 600; }
.help .btn { font-size: clamp(18px, 4.6vw, 24px); overflow-wrap: anywhere; }
.help img { position: absolute; right: -24px; bottom: -18px; width: 170px; opacity: 0.95; }
@media (max-width: 560px) { .help img { width: 110px; right: -18px; top: -10px; bottom: auto; } }

.faq details {
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--r-md);
  box-shadow: 0 5px 0 var(--ink); margin: 0 0 var(--s2);
}
.faq summary {
  cursor: pointer; list-style: none; position: relative;
  padding: 18px 64px 17px 22px; font-family: var(--display); font-size: 21px; line-height: 1.2;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--lagoon); border: 3px solid var(--ink); font-size: 24px; line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; background: var(--gold); }
.faq .answer { padding: 0 22px 18px; }
.faq .answer p { margin: 0 0 12px; font-size: 17px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* On the pale foam band the headline is solid ink instead of outlined white */
.band-foam .story-copy h2 { color: var(--ink); -webkit-text-stroke: 0; text-shadow: 0 4px 0 rgba(34, 199, 222, 0.55); }

/* Buttons inside prose keep their own colours */
.prose a.btn { color: var(--fg); text-decoration: none; }
/* Short pages: the foam band grows so the footer sits at the bottom */
main { display: flex; flex-direction: column; }
main > .page-body { flex: 1 0 auto; }
@media (min-width: 561px) {
  .help { padding-right: 240px; }
  .help img { right: 32px; top: 50%; bottom: auto; translate: 0 -50%; width: 190px; }
}
.closing h2 { -webkit-text-stroke-width: 0.11em; word-spacing: 0.06em; }
.closing p { -webkit-text-stroke-width: 0.12em; word-spacing: 0.05em; }
.band-navy .skins { transform: scale(1.08); transform-origin: 50% 80%; }
