/* Blackwater Tides — inked storybook pirate theme.
   Palette and line weight follow the game's own icon: dark ink outlines (#1b120c), brass rims,
   teal sea, parchment and a moonlit night sky. */

:root {
  --ink: #1b120c;
  --ink-soft: #3a2a1d;
  --night: #08131d;
  --deep: #0d2230;
  --deep-2: #12303f;
  --sea: #1f5f6b;
  --sea-2: #2f8f8a;
  --foam: #d9f2ec;
  --parchment: #f4e6c4;
  --parchment-2: #ecd7a8;
  --parchment-3: #dcbf86;
  --brass: #c9a05a;
  --brass-light: #ffe7a1;
  --brass-dark: #6e4f22;
  --blood: #a8322a;
  --blood-light: #d0473b;
  --blood-dark: #631712;
  --wood: #4a2f1b;
  --wood-2: #5d3c22;
  --wood-dark: #24160c;
  --good: #3f8f4f;
  --good-dark: #2f7a3f;   /* behind small white tag text (4.5:1+) */
  --good-light: #7fd08b;
  --moon: #fff3c4;
  --text: #f3ead6;
  --text-dim: #b8c6c4;
  --font-display: "Pirata One", "Luminari", "Papyrus", fantasy;
  --font-body: "Alegreya", Georgia, "Times New Roman", serif;
  --font-ui: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --radius-rough: 14px 18px 12px 20px / 18px 12px 20px 14px;
  --shadow-deep: 0 18px 40px rgba(0, 0, 0, .45), 0 4px 10px rgba(0, 0, 0, .35);
  --max: 1180px;
  /* Sky stops, retinted by time of day (see [data-tod] below). */
  --sky-1: #050c16;
  --sky-2: #0e2436;
  --sky-3: #24475c;
  --sea-far: #12303f;
  --star-opacity: 1;
  --cloud: rgba(150, 180, 200, .16);
  --wave-1: #16404d;
  --wave-2: #1a5561;
  --wave-3: #0f3540;
}

[data-tod="dawn"] { --sky-1: #2d2546; --sky-2: #a2587a; --sky-3: #f2a56f; --sea-far: #3a4d63; --star-opacity: .25; --cloud: rgba(255, 196, 170, .4); --wave-1: #2f5868; --wave-2: #2b6c76; --wave-3: #17444f; }
[data-tod="day"]  { --sky-1: #2f78b0; --sky-2: #69b3d6; --sky-3: #cfeef2; --sea-far: #2f8f9a; --star-opacity: 0; --cloud: rgba(255, 255, 255, .88); --wave-1: #2f8f8a; --wave-2: #23767c; --wave-3: #155a63; }
[data-tod="dusk"] { --sky-1: #1b1f45; --sky-2: #7d3b5c; --sky-3: #f08a4b; --sea-far: #2b3b55; --star-opacity: .45; --cloud: rgba(240, 150, 120, .35); --wave-1: #244a5e; --wave-2: #215a68; --wave-3: #133846; }

*, *::before, *::after { box-sizing: border-box; }

/* scroll-padding keeps anchors and focused fields clear of the sticky top bar. */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 400 1.075rem/1.6 var(--font-body);
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(47, 143, 138, .18), transparent 60%),
    repeating-linear-gradient(0deg, rgba(201, 160, 90, .045) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(201, 160, 90, .045) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, var(--deep) 0%, var(--night) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img, svg { max-width: 100%; }

a { color: var(--brass-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff6d6; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.1; letter-spacing: .5px; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 3px; border-radius: 6px; }
/* Pale brass vanishes on parchment, so anything focused on paper gets a ring of red ink. */
.parchment :focus-visible { outline-color: var(--blood); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--brass-light); color: var(--ink); font: 700 1rem var(--font-ui); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: linear-gradient(180deg, #ffeeb8 0%, var(--brass) 48%, #a77a3a 52%, var(--brass-dark) 100%);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .72em 1.4em;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 800 1rem/1.1 var(--font-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 5px 0 var(--ink), 0 9px 18px rgba(0, 0, 0, .4);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s ease;
  position: relative;
  white-space: nowrap;
}
.btn:hover { color: var(--btn-fg); filter: brightness(1.08) saturate(1.05); transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 7px 0 var(--ink), 0 14px 24px rgba(0, 0, 0, .45); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 1px 0 var(--ink), 0 4px 10px rgba(0, 0, 0, .4); }
.btn[disabled], .btn.is-busy { cursor: progress; filter: grayscale(.4) brightness(.85); transform: none; }
.btn-blood { --btn-bg: linear-gradient(180deg, #ef7a5f 0%, var(--blood-light) 40%, var(--blood) 55%, var(--blood-dark) 100%); --btn-fg: #fff3e2; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
/* Deep enough behind the lettering for 4.5:1 (the old mid-teal sat near 3.5:1 under the cap height). */
.btn-sea { --btn-bg: linear-gradient(180deg, #7fd3c7 0%, #26807a 38%, var(--sea) 56%, #123c45 100%); --btn-fg: #f4fffb; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.btn-ghost { --btn-bg: rgba(8, 19, 29, .55); --btn-fg: var(--brass-light); border-color: var(--brass); box-shadow: 0 3px 0 rgba(0, 0, 0, .55); }
.btn-ghost:hover { --btn-fg: #fff6d6; background: rgba(201, 160, 90, .16); box-shadow: 0 5px 0 rgba(0, 0, 0, .55); }
/* On parchment a ghost button is inked, not brass on smoke (which turned muddy there). */
.parchment .btn-ghost { --btn-bg: rgba(255, 252, 240, .55); --btn-fg: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.parchment .btn-ghost:hover { --btn-fg: var(--blood-dark); background: #fffdf5; box-shadow: 0 5px 0 var(--ink); }
.btn-sm { padding: .5em 1em; font-size: .85rem; border-width: 2.5px; }
.btn-xs { padding: .35em .8em; font-size: .75rem; border-width: 2px; box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.btn-lg { padding: .85em 1.8em; font-size: 1.15rem; }
.btn-block { width: 100%; }
.btn .spinner { width: 1.1em; height: 1.1em; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

.link-button { background: none; border: 0; padding: 0; color: var(--brass-light); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.parchment .link-button { color: var(--blood); }
.parchment .link-button:hover { color: var(--blood-dark); }
.link-button[disabled] { cursor: progress; opacity: .6; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 160px),
    linear-gradient(180deg, var(--wood-2), var(--wood) 55%, var(--wood-dark));
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 3px 0 var(--brass-dark), 0 8px 24px rgba(0, 0, 0, .5);
}
.topbar-inner { width: min(100% - 32px, 1320px); margin-inline: auto; display: flex; align-items: center; gap: 22px; min-height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brass-light); flex-shrink: 0; }
.brand-crest { width: 44px; height: 44px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .5)); transition: transform .4s ease; }
.brand:hover .brand-crest { transform: rotate(-12deg) scale(1.06); }
.brand-name { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(255, 231, 161, .25); color: var(--brass-light); }

.site-nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: 8px 14px; border-radius: 10px;
  color: var(--parchment); text-decoration: none;
  font: 700 .98rem var(--font-ui); letter-spacing: .03em;
  transition: background .15s, color .15s;
}
.site-nav ul a:hover { background: rgba(255, 231, 161, .1); color: var(--brass-light); }
.site-nav ul a[aria-current="page"] { color: var(--brass-light); background: rgba(0, 0, 0, .28); box-shadow: inset 0 -3px 0 var(--brass); }
.nav-account { display: flex; align-items: center; gap: 14px; }
.nav-signin { color: var(--parchment); font: 700 .98rem var(--font-ui); text-decoration: none; }
.nav-signin:hover { color: var(--brass-light); text-decoration: underline; }
.nav-toggle { display: none; margin-left: auto; background: rgba(0, 0, 0, .25); border: 2px solid var(--brass); border-radius: 10px; width: 46px; height: 42px; padding: 6px; cursor: pointer; }
.nav-toggle svg { width: 100%; height: 100%; stroke: var(--brass-light); stroke-width: 3; stroke-linecap: round; fill: none; }
.nav-toggle .bar { transform-origin: 16px 16px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .bar-1 { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar-3 { transform: translateY(-7px) rotate(-45deg); }

.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid var(--brass); background: rgba(0, 0, 0, .3); color: var(--parchment); font: 700 .95rem var(--font-ui); cursor: pointer; }
.user-chip:hover { background: rgba(255, 231, 161, .1); }
.user-chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .chev { width: 14px; height: 14px; stroke: var(--brass-light); stroke-width: 2.5; fill: none; transition: transform .2s; }
.user-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.flag-badge { display: block; flex-shrink: 0; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 8px;
  background: var(--parchment); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-deep);
  animation: drop-in .18s ease-out;
}
.user-dropdown-head { margin: 4px 10px 8px; font: 500 .85rem var(--font-ui); color: var(--ink-soft); }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 700 .98rem var(--font-ui); text-decoration: none; cursor: pointer; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--parchment-2); color: var(--blood-dark); }

.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 10px 16px; background: linear-gradient(90deg, #4b2d10, #6e4a1c, #4b2d10); border-bottom: 3px solid var(--ink); color: var(--parchment); font: 500 .95rem var(--font-ui); text-align: center; }

/* ---------- Hero seascape ---------- */

.hero { position: relative; min-height: min(100vh, 980px); min-height: max(640px, min(100svh, 980px)); overflow: hidden; display: flex; align-items: center; border-bottom: 5px solid var(--ink); isolation: isolate; }
/* A soft dusk over the copy side of the sky, so the tagline still reads under a bright day sky. */
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(5, 12, 22, .5) 0%, rgba(5, 12, 22, .22) 36%, transparent 58%); }
.hero-short { min-height: 340px; align-items: flex-end; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.scene .sky-1 { stop-color: var(--sky-1); }
.scene .sky-2 { stop-color: var(--sky-2); }
.scene .sky-3 { stop-color: var(--sky-3); }
.scene .sea-far-stop { stop-color: var(--sea-far); }
.scene .stars { opacity: var(--star-opacity); transition: opacity 2s; }
.scene .star { animation: twinkle 3.4s ease-in-out infinite; }
.scene .sun { display: none; }
[data-tod="day"] .scene .sun, [data-tod="dawn"] .scene .sun { display: inline; }
[data-tod="day"] .scene .moon, [data-tod="dawn"] .scene .moon { display: none; }
[data-tod="day"] .scene .lamp-glow, [data-tod="day"] .scene .window-glow { opacity: .35; }
.scene .cloud { animation: cloud-drift linear infinite; }
.scene .cloud-a { animation-duration: 160s; }
.scene .cloud-b { animation-duration: 210s; animation-delay: -80s; }
.scene .cloud-c { animation-duration: 260s; animation-delay: -150s; }
.scene .wave { animation: wave-drift linear infinite; }
.scene .wave-back { animation-duration: 46s; }
.scene .wave-mid { animation-duration: 30s; }
.scene .wave-front { animation-duration: 19s; }
.scene .ship-pos { transform: translate(800px, 196px); }
.scene .ship { transform-box: fill-box; transform-origin: 50% 88%; animation: bob 7s ease-in-out infinite; }
.scene .flag-cloth { transform-box: fill-box; transform-origin: 0% 50%; animation: flutter 1.6s ease-in-out infinite; }
.scene .pennant { transform-box: fill-box; transform-origin: 0% 50%; animation: flutter 1.1s ease-in-out infinite; }
.scene .lamp-glow { animation: flicker 2.6s ease-in-out infinite; }
.scene .window-glow { animation: flicker 4s ease-in-out infinite; }
.scene .gull { transform-box: fill-box; transform-origin: 50% 50%; animation: flap .7s ease-in-out infinite alternate; }
.scene .gull-2 { animation-delay: -.3s; }
.scene .gull-3 { animation-delay: -.5s; }
.scene .gulls { animation: gulls-fly 48s linear infinite; }
.scene .beam { transform-origin: 704px 448px; visibility: hidden; }
body[data-server="online"] .scene .beam { visibility: visible; animation: sweep 7s ease-in-out infinite; }
.scene .cloud { fill: var(--cloud); }
.scene .wave-back .wave-fill { fill: var(--wave-1); }
.scene .wave-mid .wave-fill { fill: var(--wave-2); }
.scene .wave-front .wave-fill { fill: var(--wave-3); }
body[data-server="online"] .scene .lamp-room { fill: #ffe39a; }
.scene .ripple { animation: ripple 3s ease-in-out infinite; }

.hero-copy { position: relative; width: min(100% - 32px, 1320px); margin-inline: auto; padding: 60px 0 120px; }
.hero-copy-inner { max-width: 600px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 6px 14px; border: 2px solid var(--brass); border-radius: 999px; background: rgba(8, 19, 29, .6); color: var(--brass-light); font: 700 .85rem var(--font-ui); letter-spacing: .12em; text-transform: uppercase; }
.hero-title {
  font-size: clamp(3.4rem, 8.5vw, 7.4rem);
  line-height: .9;
  margin: 0 0 18px;
  color: var(--brass-light);
  background: linear-gradient(180deg, #fff8dd 0%, #ffe7a1 35%, #e2b465 60%, #9c6b2c 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 var(--ink)) drop-shadow(0 0 30px rgba(255, 220, 140, .25));
}
/* "Tides" gets its own pass of the gold, or it inherits only the dark bottom of the title's gradient. */
.hero-title span { display: block; font-size: .5em; letter-spacing: .02em; background: inherit; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-tagline { font-size: clamp(1.1rem, 1.8vw, 1.4rem); max-width: 34ch; color: var(--parchment); text-shadow: 0 2px 0 rgba(8, 19, 29, .9), 0 0 10px rgba(8, 19, 29, .9), 0 0 22px rgba(8, 19, 29, .7); margin-bottom: 28px; }
.hero .btn-ghost { --btn-bg: rgba(8, 19, 29, .78); }
.hero .btn-ghost:hover { background: rgba(8, 19, 29, .9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.hero-status { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; background: rgba(8, 19, 29, .66); border: 2px solid rgba(201, 160, 90, .5); font: 600 .95rem var(--font-ui); color: var(--parchment); }
.hero-short .hero-copy { padding: 110px 0 40px; }
.hero-short .hero-title { font-size: clamp(2.6rem, 6vw, 4.6rem); }

/* The lantern: lit and swinging when the crew server is up. */
.lantern { position: relative; display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8a8a8a, #3a3a3a); border: 2px solid var(--ink); flex-shrink: 0; }
body[data-server="online"] .lantern { background: radial-gradient(circle at 40% 35%, #f6ffb3, #7fd08b 55%, #2f7a3f); box-shadow: 0 0 10px 2px rgba(127, 208, 139, .65); animation: lantern-pulse 2.4s ease-in-out infinite; }

/* Treasure-chest download button */
.btn-chest { padding-left: 1em; }
.chest { width: 1.9em; height: 1.9em; overflow: visible; }
.chest .lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.chest .gleam { opacity: 0; transition: opacity .2s; }
.btn-chest:hover .chest .lid, .btn-chest:focus-visible .chest .lid { transform: rotate(-24deg) translateY(-2px); }
.btn-chest:hover .chest .gleam, .btn-chest:focus-visible .chest .gleam { opacity: 1; animation: gleam 1s ease-in-out infinite alternate; }

/* ---------- Sections ---------- */

.section { padding: 90px 0; position: relative; }
.section-tight { padding: 56px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.section-head h2 { color: var(--brass-light); text-shadow: 0 3px 0 var(--ink); }
.section-head p { color: var(--text-dim); font-size: 1.15rem; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--sea-2); font: 800 .8rem var(--font-ui); letter-spacing: .22em; text-transform: uppercase; }
.rope-divider { height: 22px; margin: 0; border: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='22'%3E%3Cpath d='M0 11c10-9 20-9 20 0s10 9 20 0' fill='none' stroke='%231b120c' stroke-width='9'/%3E%3Cpath d='M0 11c10-9 20-9 20 0s10 9 20 0' fill='none' stroke='%23b98b54' stroke-width='5'/%3E%3Cpath d='M4 8c5-3 9-3 12 0' fill='none' stroke='%23e9c891' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x center; }

.grid { display: grid; gap: 26px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Parchment card with an inked edge */
.parchment {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255, 255, 255, .45), transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(150, 95, 35, .22), transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(150, 95, 35, .18), transparent 35%),
    linear-gradient(160deg, var(--parchment) 0%, var(--parchment-2) 70%, var(--parchment-3) 100%);
  border: 3px solid var(--ink);
  border-radius: var(--radius-rough);
  box-shadow: inset 0 0 0 6px rgba(255, 248, 225, .35), inset 0 0 40px rgba(120, 72, 25, .25), var(--shadow-deep);
}
.parchment a:not(.btn) { color: var(--blood); }
.parchment a:not(.btn):hover { color: var(--blood-dark); }
.parchment h2, .parchment h3 { color: var(--ink); }

.feature-card { padding: 28px 24px 24px; text-align: center; transition: transform .25s ease; }
.feature-card:hover { transform: translateY(-6px) rotate(-.6deg); }
.feature-card:nth-child(even):hover { transform: translateY(-6px) rotate(.6deg); }
.feature-icon { width: 96px; height: 96px; margin: -62px auto 10px; display: block; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .35)); }
.feature-card h3 { margin-bottom: .3em; }
.feature-card p { font-size: 1rem; margin: 0; }
.feature-card .tag { display: inline-block; margin-top: 14px; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--brass-light); font: 700 .72rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }
.weapons { margin-top: 40px; }

/* Shipyard: hulls on a slipway */
.shipyard { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 20px; overflow-x: auto; padding: 10px 4px 26px; scroll-snap-type: x mandatory; scrollbar-color: var(--brass) transparent; }
/* position: relative keeps the cards' sr-only text inside the scroller (else it widens the page). */
.hull-card { position: relative; scroll-snap-align: start; padding: 14px 16px 18px; background: linear-gradient(180deg, rgba(18, 48, 63, .9), rgba(8, 19, 29, .95)); border: 3px solid var(--ink); border-radius: 16px; box-shadow: inset 0 0 0 2px rgba(201, 160, 90, .45), var(--shadow-deep); }
/* Each hull sits in its own little patch of moonlit sky, cropped to the card's inner edge. */
.mini-ship { display: block; width: 100%; height: auto; aspect-ratio: 240 / 138; margin-bottom: 10px; border: 2px solid rgba(201, 160, 90, .35); border-radius: 10px; background: radial-gradient(ellipse at 60% 30%, rgba(255, 243, 196, .16), transparent 55%), linear-gradient(180deg, #0e2436, #1d4256 80%); }
.mini-hull { transform-box: fill-box; transform-origin: 50% 100%; }
.hull-card:hover .mini-hull, .shipyard:focus-within .mini-hull { animation: mini-bob 2.6s ease-in-out infinite; }
.hull-card h3 { margin: 0; color: var(--brass-light); font-size: 1.6rem; }
.hull-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font: 700 .74rem var(--font-ui); letter-spacing: .08em; text-transform: uppercase; border: 2px solid var(--ink); }
.chip-tier { background: var(--brass); color: var(--ink); }
.chip-role { background: var(--sea); color: #effffb; }
.hull-card p { margin: 0; color: var(--text-dim); font-size: .98rem; }
.hull-card .unlock { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--parchment); font: 600 .85rem var(--font-ui); }
.key-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: var(--brass); stroke-width: 2.4; stroke-linecap: round; }

/* Wanted-poster world events */
.poster { padding: 22px 22px 20px; text-align: center; transform: rotate(-1.2deg); }
.poster:nth-child(3n+2) { transform: rotate(1deg); }
.poster:nth-child(3n) { transform: rotate(-.4deg); }
.poster::before { content: ""; position: absolute; top: -10px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e9e9e9, #6b6b6b 60%, #333); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.poster h3 { font-size: 1.9rem; margin-bottom: .1em; }
.poster .where { display: block; margin-bottom: 8px; font: 800 .75rem var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--blood); }
.poster p { font-size: 1rem; margin: 0; }

/* Crew band */
.crew-band { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.crew-band .parchment { padding: 30px; }
.big-stat { font-family: var(--font-display); font-size: 4.2rem; line-height: 1; color: var(--blood); }
.server-board { padding: 28px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, var(--wood-2), var(--wood-dark)); box-shadow: inset 0 0 0 3px rgba(201, 160, 90, .4), var(--shadow-deep); }
.server-board h3 { color: var(--brass-light); }
.server-board dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-family: var(--font-ui); }
.server-board dt { color: var(--text-dim); }
.server-board dd { margin: 0; color: var(--parchment); font-weight: 700; }
.crew-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.crew-names span { padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(201, 160, 90, .5); font: 600 .8rem var(--font-ui); color: var(--parchment); }
.crew-names .crew-empty { padding: 0; border: 0; background: none; font: italic 400 .95rem var(--font-body); color: var(--text-dim); }

/* News cards: a lone dispatch sits in the middle instead of hugging the left edge. */
.news-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 370px)); justify-content: center; }
.news-card { display: flex; flex-direction: column; padding: 24px; text-decoration: none; transition: transform .2s; }
.news-card:hover { transform: translateY(-4px); }
.news-card time, .post time { font: 800 .75rem var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--blood); }
.news-card h3 { margin: .3em 0; }
.news-card p { margin: 0; color: var(--ink-soft); }
.news-card .more { margin-top: auto; padding-top: 14px; font: 800 .85rem var(--font-ui); color: var(--blood); }

.cta-band { text-align: center; padding: 70px 24px; background: radial-gradient(ellipse at center, rgba(47, 143, 138, .28), transparent 70%); }
.cta-band h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--brass-light); text-shadow: 0 3px 0 var(--ink); }

/* ---------- Page shells ---------- */

.page { padding: 56px 0 90px; }
.page-narrow { width: min(100% - 32px, 820px); margin-inline: auto; }
.page-title { text-align: center; margin-bottom: 36px; }
.page-title h1 { color: var(--brass-light); text-shadow: 0 4px 0 var(--ink); margin-bottom: .15em; }
.page-title p { color: var(--text-dim); font-size: 1.15rem; margin: 0; }
.prose { padding: 40px clamp(22px, 5vw, 56px); }
.prose h2 { font-size: 2rem; margin-top: 1.2em; }
.prose h3 { font-size: 1.5rem; margin-top: 1em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose code { padding: 1px 6px; border-radius: 5px; background: rgba(27, 18, 12, .1); font-size: .92em; }
.prose > :first-child { margin-top: 0; }

/* ---------- Forms (auth scrolls) ---------- */

.auth-stage { position: relative; min-height: calc(100vh - 74px); display: grid; place-items: center; padding: 56px 16px 90px; overflow: hidden; isolation: isolate; }
.auth-stage .scene { opacity: .9; }
.auth-stage::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(8, 19, 29, .1), rgba(8, 19, 29, .65)); }
.scroll { position: relative; width: min(100%, 480px); padding: 46px clamp(22px, 5vw, 44px) 36px; margin: 22px 0; }
.scroll-wide { width: min(100%, 560px); }
.scroll::before, .scroll::after {
  content: ""; position: absolute; left: -16px; right: -16px; height: 30px; border: 3px solid var(--ink); border-radius: 15px;
  background: linear-gradient(180deg, #b48b4f 0%, #f1dcab 35%, #dcbf86 60%, #8d6631 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .35);
}
.scroll::before { top: -18px; }
.scroll::after { bottom: -18px; }
.scroll h1 { text-align: center; font-size: clamp(2.3rem, 6vw, 3rem); color: var(--ink); margin-bottom: .1em; }
.scroll .lede { text-align: center; color: var(--ink-soft); margin-bottom: 26px; font-style: italic; }
.scroll .emblem-top { display: block; width: 74px; height: 74px; margin: -6px auto 6px; color: var(--ink); }

.field { margin-bottom: 18px; }
.field label, .field .label { display: block; margin-bottom: 6px; font: 800 .82rem var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.field .hint { display: block; margin-top: 6px; font: 500 .85rem var(--font-ui); color: #6b5034; }
.input-wrap { position: relative; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"], .field select {
  width: 100%; padding: 12px 14px; font: 500 1.05rem var(--font-ui); color: var(--ink);
  background: rgba(255, 252, 240, .75);
  border: 2.5px solid var(--ink); border-radius: 10px;
  box-shadow: inset 0 3px 6px rgba(120, 72, 25, .18);
  transition: box-shadow .15s, background .15s;
}
.input:focus, .field input:focus { outline: none; background: #fffdf5; box-shadow: inset 0 3px 6px rgba(120, 72, 25, .12), 0 0 0 2px #fffdf5, 0 0 0 5px var(--sea); }
.field.has-error input { border-color: var(--blood); box-shadow: 0 0 0 3px rgba(168, 50, 42, .3); }
.field.has-error input:focus { box-shadow: inset 0 3px 6px rgba(120, 72, 25, .12), 0 0 0 2px #fffdf5, 0 0 0 5px var(--blood); }
.field-error { display: none; margin-top: 7px; padding-left: 26px; position: relative; font: 700 .9rem var(--font-ui); color: var(--blood); }
.field-error::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50% 45% 55% 50%; background: var(--blood); box-shadow: 4px 6px 0 -5px var(--blood), -3px 9px 0 -6px var(--blood); }
.field.has-error .field-error { display: block; }
.input-wrap input { padding-right: 52px; }
.peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--ink-soft); }
.peek:hover { background: rgba(27, 18, 12, .08); color: var(--ink); }
.peek svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.peek[aria-pressed="true"] .lens { fill: currentColor; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font: 500 .98rem var(--font-ui); color: var(--ink); cursor: pointer; }
.check input { appearance: none; flex-shrink: 0; width: 24px; height: 24px; margin: 0; border: 2.5px solid var(--ink); border-radius: 6px; background: rgba(255, 252, 240, .8); display: grid; place-items: center; cursor: pointer; }
.check input::after { content: ""; width: 12px; height: 7px; border: 3.5px solid var(--blood); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check.has-error input { border-color: var(--blood); }
.check + .field-error { margin: -6px 0 12px 36px; }

.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 20px; flex-wrap: wrap; font: 500 .95rem var(--font-ui); }
.form-row .check { margin: 0; }
.form-foot { text-align: center; margin: 22px 0 0; font: 500 1rem var(--font-ui); color: var(--ink-soft); }

.notice { display: none; margin-bottom: 18px; padding: 12px 14px 12px 46px; position: relative; border: 2.5px solid var(--ink); border-radius: 12px; font: 600 .97rem/1.45 var(--font-ui); }
.notice.is-shown { display: block; animation: drop-in .25s ease-out; }
.notice::before { position: absolute; left: 13px; top: 9px; font-size: 1.25rem; }
.notice-bad { background: #f6d2c8; color: var(--blood-dark); }
.notice-bad::before { content: "☠"; }
.notice-good { background: #d3eed6; color: #1e5129; }
.notice-good::before { content: "⚓"; }
.notice-info { background: #f8eccb; color: var(--ink); }
.notice-info::before { content: "✉"; }

/* Password strength: what ship would this password be? */
.strength { margin-top: 10px; }
.strength-track { position: relative; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(27, 18, 12, .12); overflow: hidden; }
.strength-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background-color: var(--blood); background-image: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 60%); transition: width .3s ease, background-color .3s ease; }
.strength-label { display: flex; justify-content: space-between; margin-top: 5px; font: 700 .82rem var(--font-ui); color: var(--ink-soft); }
.strength-label strong { color: var(--ink); }

.wax-seal-btn { margin-top: 6px; }

/* ---------- Account: Captain's Quarters ---------- */

.quarters { display: grid; grid-template-columns: 280px 1fr; gap: 30px; align-items: start; }
.quarters-side { position: sticky; top: 96px; padding: 24px 20px; text-align: center; }
.quarters-side .flag-big { width: 220px; height: auto; margin: -8px auto 4px; display: block; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)); }
.quarters-side h1 { font-size: 2.1rem; margin: 0; word-break: break-word; }
.quarters-side .handle { margin: 0 0 10px; font: 600 .95rem var(--font-ui); color: var(--ink-soft); }
.quarters-side .since { font: 500 .88rem var(--font-ui); color: #6b5034; margin-bottom: 16px; }
.badge-verified { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 800 .74rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; border: 2px solid var(--ink); }
.badge-verified.ok { background: #cfe9d3; color: #1e5129; }
.badge-verified.no { background: #f6d2c8; color: var(--blood-dark); }
.tabs { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; text-align: left; }
.tab {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 16px;
  border: 2.5px solid var(--ink); border-radius: 10px 4px 4px 10px;
  background: var(--parchment-2); color: var(--ink); font: 800 .95rem var(--font-ui); cursor: pointer; text-align: left;
  transition: transform .15s, background .15s;
}
.tab:hover { transform: translateX(4px); background: var(--parchment); }
.tab[aria-selected="true"] { background: var(--blood); color: #fff3e2; transform: translateX(8px); box-shadow: 0 4px 0 var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; right: -16px; top: -2.5px; bottom: -2.5px; width: 16px; background: var(--blood); clip-path: polygon(0 0, 100% 0, 30% 50%, 100% 100%, 0 100%); }
.tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tab-danger { background: #f0c9bf; }
.tabs + p { margin: 16px 0 0; }
.quarters-main { display: grid; gap: 26px; }
.panel { padding: 30px clamp(20px, 4vw, 38px); }
.panel[hidden] { display: none; }
.panel > h2 { font-size: 2.2rem; margin-bottom: .1em; }
.panel > .lede { color: var(--ink-soft); margin-bottom: 22px; }
.panel h3 { font-size: 1.55rem; margin: 28px 0 .3em; padding-top: 22px; border-top: 2px dashed rgba(27, 18, 12, .25); }
.panel .lede + h3 { border-top: 0; padding-top: 0; margin-top: 4px; }
.panel .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.panel form { max-width: 560px; }
.panel > p.hint { margin-top: 16px; font: 500 .95rem var(--font-ui); color: var(--ink-soft); }
.welcome-card { padding: 20px 26px; background: linear-gradient(135deg, #f8eccb, #e7d09c); }
.welcome-card h2 { font-size: 2rem; margin-bottom: .2em; }

.emblem-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.emblem-option { position: relative; padding: 8px; border: 2.5px solid var(--ink); border-radius: 12px; background: rgba(255, 252, 240, .6); cursor: pointer; display: grid; justify-items: center; gap: 2px; font: 700 .72rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.emblem-option svg { width: 52px; height: 52px; }
.emblem-option:hover { background: #fffdf5; }
.emblem-option[aria-checked="true"] { background: var(--ink); color: var(--brass-light); box-shadow: 0 0 0 3px var(--brass); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink); cursor: pointer; padding: 0; position: relative; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--parchment), 0 0 0 6px var(--blood); }
.swatch-custom { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 3px dashed var(--ink); overflow: hidden; cursor: pointer; background: conic-gradient(#e33, #ee3, #3e3, #3ee, #33e, #e3e, #e33); }
.swatch-custom input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; }
/* A colour picked from the wheel: the swatch takes that colour (set from JS) and the selected ring. */
.swatch-custom.is-picked { overflow: visible; border-style: solid; box-shadow: 0 0 0 3px var(--parchment), 0 0 0 6px var(--blood); }
.swatch-custom.is-picked input { inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.swatch-custom:has(input:focus-visible) { outline: 3px solid var(--blood); outline-offset: 5px; }

.session-list, .activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.session-list + p { margin-top: 18px; }
.session-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 2px solid rgba(27, 18, 12, .55); border-radius: 12px; background: rgba(255, 252, 240, .55); }
.session-item .btn { margin-left: auto; }
.session-item.is-current { border-color: var(--good); background: rgba(207, 233, 211, .7); }
.session-icon { width: 38px; height: 38px; flex-shrink: 0; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.session-body { flex: 1 1 170px; min-width: 0; font-family: var(--font-ui); }
.session-body strong { display: block; }
.session-body span { display: block; font-size: .88rem; color: #6b5034; }
.session-body .here-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--good-dark); color: #fff; font: 800 .68rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; vertical-align: 2px; }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px dashed rgba(27, 18, 12, .3); font: 500 .95rem var(--font-ui); }
.activity-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sea); border: 2px solid var(--ink); }
.activity-item.bad .dot { background: var(--blood); }
.activity-item time { color: #6b5034; font-size: .85rem; white-space: nowrap; }
.activity-item small { display: block; color: #6b5034; }
.empty { font-style: italic; color: #6b5034; }

.danger-zone { border: 3px dashed var(--blood); border-radius: 14px; padding: 20px; background: rgba(168, 50, 42, .07); }
.plank { display: block; width: 100%; max-width: 420px; height: 90px; margin: 0 auto 8px; }
.plank .walker { animation: walk-plank 5s ease-in-out infinite; transform-box: fill-box; }

dialog.modal { width: min(100% - 32px, 480px); padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog.modal::backdrop { background: rgba(4, 10, 16, .72); backdrop-filter: blur(3px); }
.modal-card { padding: 30px; text-align: center; }
.modal-card h2 { font-size: 2.1rem; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Download page ---------- */

.dl-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: stretch; }
.dl-card { padding: 34px clamp(22px, 4vw, 40px); }
.dl-card h2 { font-size: 2.4rem; margin-bottom: .15em; }
.dl-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 24px; font: 700 .95rem var(--font-ui); color: var(--ink-soft); }
.dl-meta span { display: inline-flex; gap: 6px; align-items: center; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.dl-alt { margin-top: 18px; font: 500 .95rem var(--font-ui); color: var(--ink-soft); }
.dl-platforms { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.platform-pill { padding: 6px 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(255, 252, 240, .6); font: 800 .85rem var(--font-ui); cursor: pointer; color: var(--ink); }
.platform-pill[aria-pressed="true"] { background: var(--ink); color: var(--brass-light); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 64px; border-radius: 14px; background: rgba(8, 19, 29, .55); border: 2px solid rgba(201, 160, 90, .45); font-family: var(--font-ui); }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--brass); color: var(--ink); border: 3px solid var(--ink); font: 400 1.4rem var(--font-display); }
.steps strong { display: block; color: var(--brass-light); }
.steps span { color: var(--text-dim); font-size: .96rem; }
.reqs { width: 100%; border-collapse: collapse; font-family: var(--font-ui); }
.reqs th, .reqs td { padding: 10px 12px; border-bottom: 1px dashed rgba(27, 18, 12, .35); text-align: left; vertical-align: top; }
.reqs th { width: 34%; color: var(--ink-soft); font-weight: 800; }

/* Patch notes as a ship's log */
.log-entry { padding: 26px 30px; margin-bottom: 22px; }
.log-entry header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 10px; }
.log-entry h2 { font-size: 2rem; margin: 0; }
.log-entry time, .log-entry .build { font: 800 .78rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--blood); }
.log-entry ul { margin: 0; padding-left: 1.3em; }
.log-entry .latest { padding: 2px 10px; border-radius: 999px; background: var(--good-dark); color: #fff; font: 800 .7rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }

/* FAQ */
.faq details { margin-bottom: 12px; border: 2.5px solid var(--ink); border-radius: 12px; background: rgba(255, 252, 240, .55); }
.faq summary { padding: 14px 18px; cursor: pointer; font: 800 1.05rem var(--font-ui); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.6rem/1 var(--font-display); color: var(--blood); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 14px; }

/* 404 / bottle */
.lost { text-align: center; }
.lost svg { width: min(360px, 80vw); height: auto; margin-bottom: 10px; }
.lost h1 { color: var(--brass-light); text-shadow: 0 4px 0 var(--ink); }
.lost .bottle { transform-box: fill-box; transform-origin: 50% 50%; animation: bottle-bob 4s ease-in-out infinite; }
.lost-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 26px; font: 700 1rem var(--font-ui); }

/* ---------- Footer ---------- */

.site-footer { position: relative; margin-top: 0; background: linear-gradient(180deg, var(--wood-dark), #140c06); border-top: 4px solid var(--ink); color: var(--text-dim); }
.footer-rope { position: absolute; left: 0; right: 0; top: -15px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='22'%3E%3Cpath d='M0 11c10-9 20-9 20 0s10 9 20 0' fill='none' stroke='%231b120c' stroke-width='9'/%3E%3Cpath d='M0 11c10-9 20-9 20 0s10 9 20 0' fill='none' stroke='%23b98b54' stroke-width='5'/%3E%3Cpath d='M4 8c5-3 9-3 12 0' fill='none' stroke='%23e9c891' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x center; }
.footer-inner { width: min(100% - 32px, 1320px); margin-inline: auto; display: grid; grid-template-columns: 1.3fr 1.6fr .9fr; gap: 40px; padding: 54px 0 30px; }
.footer-brand p { font-size: .98rem; max-width: 38ch; }
.footer-brand .brand-name { font-size: 1.6rem; }
.lantern-status { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 9px; border-radius: 999px; background: rgba(0, 0, 0, .35); border: 1.5px solid rgba(201, 160, 90, .35); font: 600 .9rem var(--font-ui); color: var(--parchment); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-links h2, .ships-clock h2 { font: 800 .8rem var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.footer-links a { display: block; padding: 4px 0; color: var(--parchment); text-decoration: none; font: 500 1rem var(--font-ui); }
.footer-links a:hover { color: var(--brass-light); text-decoration: underline; }
.ships-clock { padding: 16px 18px; border: 2px solid rgba(201, 160, 90, .45); border-radius: 16px; background: rgba(0, 0, 0, .3); font-family: var(--font-ui); }
.ships-clock p { margin: 0; }
.clock-time { font: 400 2.4rem/1 var(--font-display); color: var(--brass-light); }

/* "Calm the seas": freezes the ambient scenery (waves, clouds, gulls, lanterns, the flag) for anyone
   who'd rather it held still. Toasts, spinners and hover effects keep working. */
.calm-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 5px 12px 5px 9px; border: 1.5px solid rgba(201, 160, 90, .5); border-radius: 999px; background: rgba(0, 0, 0, .3); color: var(--parchment); font: 700 .82rem var(--font-ui); cursor: pointer; }
.calm-toggle:hover { color: var(--brass-light); border-color: var(--brass); }
.calm-toggle svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.calm-toggle[aria-pressed="true"] { background: var(--brass); border-color: var(--ink); color: var(--ink); }
.calm-toggle .icon-play, .calm-toggle[aria-pressed="true"] .icon-pause { display: none; }
.calm-toggle[aria-pressed="true"] .icon-play { display: inline; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-foot .hero-status { margin: 0; }
.hero-calm { margin: 0; padding: 9px; border-width: 2px; background: rgba(8, 19, 29, .66); }
.hero-calm svg { width: 18px; height: 18px; }
[data-calm] .scene, [data-calm] .scene *, [data-calm] .lantern, [data-calm] .lost .bottle, [data-calm] .plank .walker { animation-play-state: paused !important; }
[data-calm] .hull-card:hover .mini-hull, [data-calm] .shipyard:focus-within .mini-hull { animation: none; }
.clock-date { color: var(--parchment); font-weight: 600; margin-top: 4px !important; }
.clock-bells, .clock-moon { font-size: .9rem; }
.footer-fine { width: min(100% - 32px, 1320px); margin: 0 auto; padding: 16px 0 26px; border-top: 1px solid rgba(201, 160, 90, .2); font: 500 .85rem var(--font-ui); color: #8d8371; text-align: center; }

/* ---------- Toasts: messages in a bottle ---------- */

/* Above the kraken, so its parting message isn't hidden behind a tentacle. */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 400; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; color: var(--ink); animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1); font: 600 .97rem/1.4 var(--font-ui); cursor: pointer; }
.toast.bad { background: #f6d2c8; }
.toast .bottle-icon { width: 30px; height: 30px; flex-shrink: 0; }
.toast.leaving { animation: toast-out .3s ease-in forwards; }

/* ---------- Kraken (you know the code) ---------- */

.kraken { position: fixed; left: 0; right: 0; bottom: -10px; height: 70vh; pointer-events: none; z-index: 300; }
.kraken g { transform: translateY(100%); animation: tentacle-rise 3.6s cubic-bezier(.3, 1.2, .5, 1) forwards; transform-box: fill-box; transform-origin: 50% 100%; }
.kraken g:nth-child(2) { animation-delay: .2s; }
.kraken g:nth-child(3) { animation-delay: .35s; }
.kraken g:nth-child(4) { animation-delay: .1s; }

/* ---------- Animations ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes wave-drift { from { transform: translateX(0); } to { transform: translateX(-1600px); } }
@keyframes cloud-drift { from { transform: translateX(-500px); } to { transform: translateX(2100px); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(12px) rotate(1.4deg); } }
@keyframes flutter { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(5deg) scaleX(.93); } }
@keyframes flicker { 0%, 100% { opacity: .9; } 30% { opacity: .65; } 55% { opacity: 1; } 75% { opacity: .75; } }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.55); } }
@keyframes gulls-fly { from { transform: translate(-300px, 40px); } 50% { transform: translate(900px, -20px); } to { transform: translate(2000px, 30px); } }
@keyframes sweep { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.06); opacity: .15; } }
@keyframes ripple { 0%, 100% { opacity: .2; transform: translateX(0); } 50% { opacity: .6; transform: translateX(14px); } }
@keyframes lantern-pulse { 0%, 100% { box-shadow: 0 0 8px 1px rgba(127, 208, 139, .55); } 50% { box-shadow: 0 0 14px 4px rgba(127, 208, 139, .85); } }
@keyframes gleam { from { opacity: .6; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(30px) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) rotate(6deg); } }
@keyframes bottle-bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(10px) rotate(8deg); } }
@keyframes mini-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(3px) rotate(1.5deg); } }
@keyframes walk-plank { 0%, 15% { transform: translateX(0); } 60% { transform: translateX(210px); } 70% { transform: translate(230px, 10px) rotate(25deg); } 85%, 100% { transform: translate(240px, 120px) rotate(80deg); opacity: 0; } }
@keyframes tentacle-rise { 0% { transform: translateY(100%) scaleY(.6); } 55% { transform: translateY(0) scaleY(1.05); } 70% { transform: rotate(-4deg); } 85% { transform: rotate(3deg); } 100% { transform: translateY(105%); } }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); row-gap: 70px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .ships-clock { grid-column: 1 / -1; }
  .crew-band, .dl-hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; padding: 14px 16px 20px; background: linear-gradient(180deg, var(--wood), var(--wood-dark)); border-bottom: 4px solid var(--ink); box-shadow: 0 16px 30px rgba(0, 0, 0, .5); }
  .site-nav.is-open { display: flex; animation: drop-in .2s ease-out; }
  .site-nav ul { flex-direction: column; }
  .site-nav ul a { padding: 12px 14px; font-size: 1.1rem; }
  .nav-account { justify-content: space-between; padding-top: 12px; border-top: 1px solid rgba(201, 160, 90, .3); }
  .user-dropdown { left: 0; right: auto; }
  .quarters { grid-template-columns: 1fr; }
  .quarters-side { position: static; }
  .tabs { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .tab { border-radius: 10px; }
  .tab[aria-selected="true"] { transform: translateY(-3px); }
  .tab[aria-selected="true"]::after { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .scene .ship-pos { transform: translate(560px, 330px) scale(.74); }
  .scene .lighthouse { display: none; }
  .hero-copy { padding: 40px 0 46vh; }
  .hero { align-items: flex-start; }
  .panel .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .brand-name { font-size: 1.4rem; }
  .brand-crest { width: 38px; height: 38px; }
  .grid-4 { grid-template-columns: 1fr; }
  .footer-inner, .footer-links { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .emblem-picker { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .emblem-option svg { width: 40px; height: 40px; }
  .scene .ship-pos { transform: translate(560px, 400px) scale(.62); }
  .hero-actions .btn { width: 100%; }
  /* On a phone the copy runs the full width, so the dusk falls from the top instead. */
  .hero::after { background: linear-gradient(180deg, rgba(5, 12, 22, .5) 0%, rgba(5, 12, 22, .2) 45%, transparent 62%); }
  .scroll::before, .scroll::after { left: -8px; right: -8px; }
  .quarters-side .flag-big { width: 170px; }
  .modal-card { padding: 26px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
