/* Layout: a one-screen chart room. The sea chart fills the stage; a deck
   panel holds the port you are looking at. Day theme is a sunlit chart,
   night theme is the same sea after dark with the harbor lamps burning. */
:root {
  /* sea and land */
  --sea: #6db1bb;
  --sea-line: #5ea4af;
  --sea-ink: #2d6a76;
  --shallows: #b4dcdb;
  --land: #efe2bf;
  --shore: #9c8656;
  --land-ink: #8b7645;
  /* the deck (panels and text) */
  --panel: #fbf9f3;
  --panel-2: #f0ebdc;
  --line: #ddd5bf;
  --line-strong: #b9ae90;
  --ink: #12313a;
  --ink-soft: #4b676e;
  --ink-ghost: #9aa9a8;
  /* Tyrian purple, the dye Lydia sold at Philippi */
  --accent: #74204f;
  --accent-ink: #fdf6fa;
  --accent-wash: #f1dde8;
  --route: #74204f;
  /* lamp oil */
  --lamp: #f0ac1c;
  --lamp-edge: #8a5a06;
  --lamp-low: #c9b98d;
  --miss: #b24a22;
  --label: #12313a;
  --label-halo: #fbf6e6;
  --ship-hull: #5a3a22;
  --ship-sail: #fffdf6;

  --f-display: "Marcellus", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --f-verse: "Alegreya", "Iowan Old Style", Palatino, Georgia, serif;
  --f-ui: "Alegreya Sans", "Gill Sans", "Trebuchet MS", system-ui, sans-serif;

  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #0c2836; --sea-line: #143646; --sea-ink: #5f8c98; --shallows: #1c4753;
    --land: #2a4642; --shore: #55796f; --land-ink: #7fa096;
    --panel: #0e222d; --panel-2: #16303c; --line: #223f4b; --line-strong: #3d6170;
    --ink: #efe8d6; --ink-soft: #a3b8ba; --ink-ghost: #5d7a82;
    --accent: #e3a3cb; --accent-ink: #2b0f20; --accent-wash: #3a2438; --route: #e3a3cb;
    --lamp: #f7bf3e; --lamp-edge: #fbe3a1; --lamp-low: #6f6a55; --miss: #ec9668;
    --label: #efe8d6; --label-halo: #0c2836;
    --ship-hull: #c79a6b; --ship-sail: #f4ecd8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #0c2836; --sea-line: #143646; --sea-ink: #5f8c98; --shallows: #1c4753;
  --land: #2a4642; --shore: #55796f; --land-ink: #7fa096;
  --panel: #0e222d; --panel-2: #16303c; --line: #223f4b; --line-strong: #3d6170;
  --ink: #efe8d6; --ink-soft: #a3b8ba; --ink-ghost: #5d7a82;
  --accent: #e3a3cb; --accent-ink: #2b0f20; --accent-wash: #3a2438; --route: #e3a3cb;
  --lamp: #f7bf3e; --lamp-edge: #fbe3a1; --lamp-low: #6f6a55; --miss: #ec9668;
  --label: #efe8d6; --label-halo: #0c2836;
  --ship-hull: #c79a6b; --ship-sail: #f4ecd8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  height: 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body {
  height: 100%;
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font: 16px/1.45 var(--f-ui);
  font-variant-numeric: lining-nums;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p, ul, ol, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }

/* ---------- frame ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(170px, 1fr) auto;
  grid-template-areas: "top" "tabs" "map" "deck";
}
.app[data-screen="sail"] {
  grid-template-rows: auto minmax(110px, 26%) minmax(0, 1fr);
  grid-template-areas: "top" "map" "sail";
}
.top { grid-area: top; }
.tabs { grid-area: tabs; }
.mapwrap { grid-area: map; }
.deck { grid-area: deck; }
.sail { grid-area: sail; }
.app[data-screen="home"] .sail,
.app[data-screen="home"] .top-sail,
.app[data-screen="sail"] .deck,
.app[data-screen="sail"] .tabs,
.app[data-screen="sail"] .top-home { display: none; }

.top {
  padding: 10px var(--gutter-r) 10px var(--gutter-l);
  border-bottom: 1px solid var(--line);
}
.top-home {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 16px;
}
.wordmark {
  font: 400 20px/1.2 var(--f-display);
  letter-spacing: 0.02em;
}
.views { display: flex; gap: 2px; }
.views button {
  border: 0;
  border-radius: 4px;
  background: none;
  padding: 6px 11px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
}
.views button:hover { background: var(--panel-2); }
.views button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.views button { display: inline-flex; align-items: center; gap: 6px; }
.views svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.views svg .fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top-sail { display: flex; align-items: center; gap: 10px; }
.iconbtn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border: 0;
  border-radius: 4px;
  background: none;
}
.iconbtn:hover { background: var(--panel-2); }
.sail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sail-title strong { font: 400 19px/1.2 var(--f-display); }
.sail-title span { font-size: 14px; color: var(--ink-soft); }
.pips { display: flex; gap: 4px; flex: 0 1 auto; max-width: 40vw; }
.pips li {
  flex: 0 1 26px;
  width: 26px;
  min-width: 3px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
}
.pips li[data-s="now"] { background: var(--accent); }
.pips li[data-s="done"] { background: var(--lamp); }

/* ---------- voyage tabs ---------- */
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(60px, 1fr);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  padding: 0 calc(var(--gutter-r) - 8px) 0 calc(var(--gutter-l) - 8px);
}
.tab {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 6px;
  padding: 8px 8px 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  text-align: left;
  color: var(--ink-soft);
}
.tab-num { font: 400 18px/1 var(--f-display); color: var(--ink); }
.tab-count { font-size: 12.5px; font-variant-numeric: lining-nums tabular-nums; justify-self: end; }
.tab-name { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.2; }
.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.tab[aria-selected="true"] .tab-num { color: var(--accent); }
.tab:hover { background: var(--panel-2); }

/* ---------- chart ---------- */
.mapwrap { position: relative; min-height: 0; overflow: hidden; background: var(--sea); }
.charthost { position: absolute; inset: 0; }
svg.chart { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.chart .sea { fill: var(--sea); }
.chart .grat line { stroke: var(--sea-line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.chart .shallows { fill: none; stroke: var(--shallows); stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .shallows.s2 { stroke-width: 20px; opacity: 0.3; }
.chart .shallows.s1 { stroke-width: 8px; opacity: 0.55; }
.chart .lake { fill: var(--sea); stroke: var(--shore); stroke-width: 1px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .river { fill: none; stroke: var(--sea); stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .land { fill: var(--land); stroke: var(--shore); stroke-width: 1px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .region {
  font: 400 11px var(--f-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: var(--land-ink);
  pointer-events: none;
}
.chart .region.small { font-size: 9.5px; letter-spacing: 0.22em; }
.chart[data-far] .region.small { display: none; }
.chart .region.water { font: italic 400 13px var(--f-verse); letter-spacing: 0.24em; text-transform: none; fill: var(--sea-ink); }

.chart .route {
  fill: none;
  stroke: var(--route);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.38;
}
.chart .route.sea { stroke-dasharray: 7 6; }
.chart .route.road { stroke-dasharray: 0.1 5.5; stroke-width: 2.5px; }
.chart .route[data-done] { opacity: 1; }
.chart .route[data-dim] { opacity: 0.14; }

.chart .port { cursor: pointer; outline: none; }
.chart .port .hit { fill: transparent; }
.chart .port .glow { fill: url(#lampglow); opacity: 0; pointer-events: none; }
.chart .port .ring { fill: none; stroke: var(--label); stroke-width: 1.5; opacity: 0; }
.chart .port .lamp { fill: var(--panel); stroke: var(--label); stroke-width: 1.5; }
.chart .plabel {
  font: 400 13px var(--f-display);
  fill: var(--label);
  stroke: var(--label-halo);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.chart .port[data-state="ahead"] .lamp { fill: var(--lamp-low); stroke-opacity: 0.55; }
.chart .port[data-state="ahead"] .plabel { fill-opacity: 0.72; }
.chart .port[data-state="next"] .lamp { stroke: var(--accent); stroke-width: 2.5; }
.chart .port[data-state="done"] .lamp { fill: var(--lamp); stroke: var(--lamp-edge); }
.chart .port[data-state="done"] .glow { opacity: 0.95; }
.chart .port[data-sel] .ring,
.chart .port:focus-visible .ring { opacity: 1; }
.chart .port[data-next] .ring { opacity: 1; stroke: var(--accent); animation: beckon 2.2s ease-out infinite; transform-origin: center; transform-box: fill-box; }
.chart .port[data-dim] { opacity: 0.35; }
.chart .origin .dot { fill: var(--label); }
.chart #lampglow .g0 { stop-color: var(--lamp); stop-opacity: 0.85; }
.chart #lampglow .g1 { stop-color: var(--lamp); stop-opacity: 0; }

.chart .vessel { pointer-events: none; }
.chart .bob { animation: bob 3.2s ease-in-out infinite; }
.chart .hull { fill: var(--ship-hull); stroke: var(--label-halo); stroke-width: 1; stroke-linejoin: round; }
.chart .sailcloth { fill: var(--ship-sail); stroke: var(--ship-hull); stroke-width: 1.2; stroke-linejoin: round; }
.chart .spar { stroke: var(--ship-hull); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.chart .pennant { fill: var(--accent); }
.chart .walker { stroke: var(--ship-hull); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.chart .walker-halo { stroke: var(--label-halo); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.chart .walker-head { fill: var(--ship-hull); stroke: var(--label-halo); stroke-width: 1; }
.chart .vessel[data-mode="sea"] .onfoot,
.chart .vessel[data-mode="road"] .afloat { display: none; }

.rose {
  position: absolute;
  left: max(10px, env(safe-area-inset-left, 0px));
  bottom: 10px;
  width: 54px;
  height: 54px;
  color: var(--sea-ink);
  opacity: 0.7;
  pointer-events: none;
}
.app[data-screen="sail"] .rose { display: none; }

@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-2px) rotate(2deg); } }
@keyframes gutter { 0%, 100% { opacity: 0.45; } 40% { opacity: 0.15; } 60% { opacity: 0.5; } 75% { opacity: 0.2; } }
@keyframes beckon { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 80% { transform: translateX(-2px); } }
@keyframes rise { from { opacity: 0.2; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- deck (home) ---------- */
.deck {
  position: relative;
  max-height: 50vh;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding: 14px var(--gutter-r) 16px var(--gutter-l);
}
.deck-inner { display: flex; flex-direction: column; gap: 14px; max-width: 34rem; margin: 0 auto; }
.watch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-left: 3px solid var(--lamp);
}
.watch p { min-width: 0; font-size: 15px; }
.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.portcard { display: flex; flex-direction: column; gap: 8px; }
.portcard h2 { font: 400 28px/1.1 var(--f-display); text-wrap: balance; }
.story { color: var(--ink-soft); max-width: 62ch; }
.cargo { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.portcard .cargo { padding: 10px 12px; border: 0; background: var(--panel-2); }
.cargo-ref { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 400 19px/1.25 var(--f-display); }
.cargo-ref small { font: 400 13.5px var(--f-ui); color: var(--ink-soft); }
.cargo-tie { font: italic 400 16.5px/1.4 var(--f-verse); color: var(--ink-soft); }
.cargo-text { font: 400 18px/1.5 var(--f-verse); padding-top: 4px; }
.status { font-size: 14.5px; color: var(--ink-soft); }
.status b { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.btn {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  font-weight: 500;
  font-size: 16px;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.01em; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.quiet { min-height: 36px; padding: 5px 12px; font-size: 14.5px; color: var(--ink-soft); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.small { min-height: 36px; padding: 5px 14px; font-size: 15px; flex: none; }

.actions:empty { display: none; }
.steps { display: flex; justify-content: space-between; gap: 10px; }
.own { font-size: 14.5px; color: var(--ink-soft); }
.own summary { cursor: pointer; padding: 4px 0; }
.own-body { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.own textarea {
  width: 100%;
  min-height: 92px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 400 17px/1.45 var(--f-verse);
  resize: vertical;
}
.deckfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 5px 12px; font-size: 14px; color: var(--ink-soft); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

/* who is sailing, and the three deck views */
.whoami { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: 14.5px; color: var(--ink-soft); }
.whoami button {
  border: 0;
  padding: 0;
  background: none;
  font: 400 19px/1.2 var(--f-display);
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.whoami b { color: var(--ink); }
.viewhead { display: flex; flex-direction: column; gap: 4px; }
.viewhead h2 { font: 400 28px/1.1 var(--f-display); }
.viewhead p { color: var(--ink-soft); max-width: 62ch; }

.level { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.level-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.level-head > div { min-width: 0; }
.level h3 { font: 400 21px/1.2 var(--f-display); }
.level-blurb { font-size: 14.5px; color: var(--ink-soft); }
.here { padding-top: 3px; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: var(--accent); }
.lamps > li + li { border-top: 1px solid var(--line); }
.lamps > li > details > summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}
.lamps > li > details > summary::-webkit-details-marker { display: none; }
.v-ref { font-weight: 500; }
.v-note { font-size: 13.5px; color: var(--ink-soft); }
.lampdot { width: 12px; height: 12px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.lampdot[data-lamp="lit"] { background: var(--lamp); border-color: var(--lamp-edge); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 28%, transparent); }
.lampdot[data-lamp="low"] { background: var(--lamp-low); border-color: var(--lamp-edge); }
.locked {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  color: var(--ink-ghost);
}
.locked .v-note { color: var(--ink-ghost); }
.letter p { max-width: 62ch; }
.portpage h3 { font: 400 21px/1.2 var(--f-display); }
.v-body { display: flex; flex-direction: column; gap: 8px; padding: 0 0 14px 24px; }

.board { display: flex; flex-direction: column; gap: 6px; }
.board-row {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  text-align: left;
}
.board-row:hover { background: var(--panel-2); }
.board-row[data-me] { border-color: var(--accent); background: var(--accent-wash); }
.b-place { font: 400 20px var(--f-display); color: var(--ink-soft); text-align: center; }
.b-name { display: flex; flex-direction: column; min-width: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.b-name small { font-size: 13.5px; font-weight: 400; color: var(--ink-soft); }
.b-score { font: 700 20px var(--f-ui); font-variant-numeric: lining-nums tabular-nums; }

.join, .settings { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.join h3, .settings h3 { font: 400 21px/1.2 var(--f-display); }
.join > label { font-size: 14.5px; color: var(--ink-soft); }
#join-name {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 400 18px var(--f-ui);
}
.kinds { display: flex; flex-direction: column; gap: 6px; }
.kind {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
}
.kind b { display: block; font-size: 16px; color: var(--ink); }
.kind input { margin: 4px 0 0; accent-color: var(--accent); }
.kind:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.join .btn { align-self: flex-start; }
.shared { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.shared h3 { font: 400 21px/1.2 var(--f-display); }
.shared .board-row { cursor: default; }
.shared .board-row:hover { background: var(--panel); }
.shared .board-row[data-me]:hover { background: var(--accent-wash); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.inline input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 400 16px var(--f-ui);
}
.code { font: 700 17px var(--f-ui); letter-spacing: 0.14em; color: var(--ink); }
.err { color: var(--miss); }
.setrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }

/* ---------- passage (practice) ---------- */
.sail {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px var(--gutter-r) 12px var(--gutter-l);
  border-top: 1px solid var(--line);
}
.stage-note { font-size: 15px; color: var(--ink-soft); }
.verse-ref { margin: 0 0 -6px; font: 500 15px var(--f-display); letter-spacing: 0.02em; color: var(--accent); }
.sail[data-step="pass"] .verse-ref { text-align: center; }
.stage-note b { color: var(--ink); font-weight: 700; }
.stage-note.fresh { animation: rise 0.5s ease-out; }
.verse {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.12em 0.2em;
  font: 400 clamp(20px, 5.3vw, 25px)/1.5 var(--f-verse);
}
.w {
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  border-radius: 3px 3px 0 0;
}
.w[data-s="todo"], .w[data-s="cur"] { color: var(--ink-ghost); }
.w[data-v="hidden"][data-s="todo"], .w[data-v="hidden"][data-s="cur"] {
  color: transparent;
  border-bottom-color: var(--line-strong);
  user-select: none;
  -webkit-user-select: none;
}
.w[data-s="cur"] { background: var(--accent-wash); border-bottom-color: var(--accent); }
.w[data-s="done"] { color: var(--ink); }
.w[data-s="past"] { color: var(--ink-soft); }
.w[data-s="gap"] { color: var(--miss); text-decoration: underline 2px; text-underline-offset: 5px; }
.w[data-s="extra"] { color: var(--ink-ghost); text-decoration: line-through; font-size: 0.85em; }
.piece {
  padding: 0 3px;
  border-bottom: 2px solid var(--line-strong);
  border-radius: 3px 3px 0 0;
  color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.piece[data-s="cur"] { background: var(--accent-wash); border-bottom-color: var(--accent); }
.piece[data-s="done"] { color: var(--ink); border-bottom-color: transparent; }
.piece[data-s="miss"] { color: var(--miss); border-bottom-color: transparent; }
.sail[data-step="scramble"] .tiles { display: flex; flex-wrap: wrap; }
.piece-tile { flex: 1 1 auto; min-height: 48px; font-size: 18px; }
.app[data-kind="little"] .piece-tile { min-height: 56px; font-size: 21px; }
.sail:is([data-step="scramble"], [data-step="recite"]) .keys { display: none; }
.sail[data-step="recite"] .tiles { display: none; }
.recite { display: flex; flex-direction: column; gap: 8px; }
#recite-text {
  width: 100%;
  min-height: 7.5em;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: 400 19px/1.5 var(--f-verse);
  resize: vertical;
}
.recite-live { min-height: 1.4em; font: italic 400 16px/1.4 var(--f-verse); color: var(--ink-soft); }
.recite-bar { display: flex; justify-content: space-between; gap: 10px; }
.mic .m-stop { display: none; }
:root[data-listening] .mic .m-go { display: none; }
:root[data-listening] .mic .m-stop { display: inline; }
:root[data-listening] .mic { border-color: var(--miss); color: var(--miss); }
:root:not([data-mic="host"]):not([data-mic="browser"]) .mic { display: none; }
.recite-go { align-self: flex-start; }
.credits p { font-size: 13.5px; line-height: 1.45; }
.w[data-s="later"] { display: none; }
.w[data-s="miss"] { color: var(--miss); }
.w.shake { animation: shake 0.25s; }
.sail-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#ready { display: none; margin-left: auto; }
.sail:is([data-step="listen"], [data-step="echo"], [data-step="pass"]) #ready { display: inline-block; }
.sail:is([data-step="listen"], [data-step="echo"], [data-step="pass"]) :is(#hint, #hops, #mode, .tiles, .keys) { display: none; }
.sail[data-step="pass"] #ready { min-height: 52px; padding-inline: 24px; font-size: 18px; }
.listen .l-stop { display: none; }
:root[data-speaking] .listen .l-go { display: none; }
:root[data-speaking] .listen .l-stop { display: inline; }
:root[data-speech="none"] .listen { display: none; }
.tiles { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sail[data-input="tiles"] .tiles { display: grid; }
.tile {
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--panel-2);
  font: 500 20px/1.2 var(--f-verse);
  overflow-wrap: anywhere;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { background: var(--accent-wash); }
.tile:disabled { opacity: 0.35; text-decoration: line-through; cursor: default; }
.app[data-kind="little"] .tiles { grid-template-columns: minmax(0, 1fr); }
.app[data-kind="little"] .tile { min-height: 60px; font-size: 24px; }
.app[data-kind="little"] .verse { font-size: clamp(23px, 6.2vw, 29px); }
@media (min-width: 520px) {
  .app[data-kind="little"] .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.keys { display: none; flex-direction: column; gap: 6px; }
.sail[data-keys="on"] .keys { display: flex; }
.krow { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  font: 500 18px var(--f-ui);
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.key:active { background: var(--accent-wash); }

.landfall {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px var(--gutter-r) 18px var(--gutter-l);
  background: var(--panel);
  animation: rise 0.45s ease-out;
}
.landfall > * { max-width: 34rem; }
.landfall h2 { font: 400 26px/1.15 var(--f-display); text-wrap: balance; }
.landfall blockquote { font: 400 19px/1.5 var(--f-verse); padding-left: 14px; border-left: 3px solid var(--lamp); }
.landfall cite { font: 400 14.5px var(--f-ui); color: var(--ink-soft); font-style: normal; }
.gain { color: var(--accent); }
.todays { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--lamp); }
.todays .eyebrow { flex-basis: 100%; }
.todays ul { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.todays li { display: flex; align-items: center; gap: 8px; }
.todays li[data-done] { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.tick { width: 14px; height: 14px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 50%; }
li[data-done] .tick { background: var(--lamp); border-color: var(--lamp-edge); }
.todays.kept { border-left-color: var(--accent); }
.oil-lamp { width: 92px; height: 60px; align-self: flex-start; overflow: visible; }
.oil-lamp .body { fill: var(--ship-hull); }
.oil-lamp .handle { fill: none; stroke: var(--ship-hull); stroke-width: 3; stroke-linecap: round; }
.oil-lamp .flame { fill: var(--lamp); transform-origin: 58px 31px; animation: kindle 0.9s ease-out both, flicker 2.6s 0.9s ease-in-out infinite; }
.oil-lamp .halo { fill: var(--lamp); opacity: 0.22; transform-origin: 58px 20px; animation: glow 1.4s ease-out both; }
.lamprow { display: flex; gap: 6px; padding-top: 6px; }
.lamprow .lampdot { animation: pop 0.45s ease-out both; }
@keyframes kindle { from { transform: scale(0.1); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } to { transform: scale(1); } }
@keyframes flicker { 0%, 100% { transform: scale(1) skewX(0); } 30% { transform: scale(0.96, 1.04) skewX(-3deg); } 60% { transform: scale(1.03, 0.97) skewX(2deg); } }
@keyframes glow { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 0.22; } }
@keyframes pop { from { transform: scale(0.2); opacity: 0.2; } 70% { transform: scale(1.3); } to { transform: scale(1); opacity: 1; } }
.fanfare { padding: 10px 12px; border-left: 3px solid var(--lamp); background: var(--panel-2); }
.portpage { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel-2); }
.portpage .listen { align-self: flex-start; }

/* On a phone the sections move to a tab bar along the bottom. */
@media (max-width: 899px) {
  .app[data-screen="home"] { padding-bottom: 58px; }
  .app[data-screen="home"] .views {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: var(--panel);
    border-top: 1px solid var(--line);
  }
  .app[data-screen="home"] .views button { flex-direction: column; gap: 2px; padding: 5px 4px; font-size: 12.5px; border-radius: 8px; }
  .app[data-screen="home"] .views button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); }
  .views svg { width: 22px; height: 22px; }
  .rose { display: none; }
}

/* On a phone, Verses and Crew take the whole screen. */
@media (max-width: 899px) {
  .app[data-screen="home"]:is([data-view="verses"], [data-view="crew"], [data-view="logbook"], [data-view="game"], [data-view="help"], [data-view="season"], [data-view="seasonNew"]) {
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top" "deck";
  }
  .app[data-screen="home"]:is([data-view="verses"], [data-view="crew"], [data-view="logbook"], [data-view="game"], [data-view="help"], [data-view="season"], [data-view="seasonNew"]) :is(.tabs, .mapwrap) { display: none; }
  .app[data-screen="home"]:is([data-view="verses"], [data-view="crew"], [data-view="logbook"], [data-view="game"], [data-view="help"], [data-view="season"], [data-view="seasonNew"]) .deck { max-height: none; border-top: 0; }
}

/* ---------- wide screens: chart left, deck right ---------- */
@media (min-width: 900px) {
  .app,
  .app[data-screen="sail"] {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .app { grid-template-areas: "top top" "map tabs" "map deck"; }
  .app[data-screen="sail"] { grid-template-areas: "top top" "map sail" "map sail"; }
  .top { padding-block: 14px; }
  .wordmark { font-size: 24px; }
  .deck { max-height: none; border-top: 0; border-left: 1px solid var(--line); padding-top: 20px; }
  .tabs { border-left: 1px solid var(--line); }
  .sail { border-top: 0; border-left: 1px solid var(--line); padding-top: 20px; gap: 14px; }
  .verse { font-size: 25px; }
  .rose { width: 72px; height: 72px; left: 18px; bottom: 18px; }
  .chart .plabel { font-size: 14px; }
}

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

/* ---------- treasure chest ---------- */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.chest, .badge-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
/* The chest itself is a grid of medals, three or more across. */
.chest { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; }
.chest .badge { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 4px; }
.chest .badge .b-text { align-items: center; font-size: 13px; }
.chest .badge small { font-size: 11.5px; line-height: 1.25; }
.chest .medal { width: 50px; height: 50px; }
.badge { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 4px; color: var(--ink-ghost); }
.badge .b-text { display: flex; flex-direction: column; min-width: 0; font-size: 14.5px; line-height: 1.3; }
.badge small { font-size: 13px; }
.medal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 50%;
}
.badge[data-earned] { color: var(--ink); }
.badge[data-earned] small { color: var(--ink-soft); }
.badge[data-earned] .medal {
  border: 2px solid var(--lamp-edge);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--lamp) 55%, var(--panel)), var(--lamp));
  color: var(--ship-hull);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--lamp) 22%, transparent);
}
.badges-new .badge-row { padding-top: 6px; }
.badges-new .medal { animation: pop 0.5s ease-out both; }

/* ---------- forecast and harbor games ---------- */
.forecast { font-size: 14.5px; color: var(--ink-soft); }
.forecast b { color: var(--ink); font-variant-numeric: lining-nums; }
.games { display: flex; flex-direction: column; gap: 8px; }
.game-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.game-btn {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  text-align: left;
}
.game-btn .ico { width: 28px; height: 28px; color: var(--accent); }
.game-btn span { display: flex; flex-direction: column; min-width: 0; }
.game-btn small { font-size: 13px; color: var(--ink-soft); }
.game-btn:hover:not(:disabled) { border-color: var(--accent); }
.game-btn:disabled { opacity: 0.55; cursor: default; }
.game { display: flex; flex-direction: column; gap: 12px; }
.game h2 { font: 400 28px/1.15 var(--f-display); }
.game-prompt { font: 400 21px/1.5 var(--f-verse); padding-left: 14px; border-left: 3px solid var(--accent); }
.game-opts { display: grid; gap: 8px; }
.game-opt { text-align: left; font-size: 18px; line-height: 1.35; padding: 10px 14px; }
.game-opt:disabled { cursor: default; opacity: 1; text-decoration: none; }
.game-opt[data-right] { border-color: var(--lamp-edge); background: color-mix(in srgb, var(--lamp) 30%, var(--panel)); }
.game-opt[data-wrong] { border-color: var(--miss); color: var(--miss); text-decoration: line-through; }
.app[data-kind="little"] .game-opt { font-size: 21px; min-height: 58px; }

/* ---------- shipyard ---------- */
.shipyard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.shipyard-head { display: flex; align-items: center; gap: 12px; }
.shipyard-head h3 { font: 400 19px/1.2 var(--f-display); }
.ship-preview { width: 76px; height: 72px; flex: none; }
.ship-preview .hull { fill: var(--ship-hull); stroke: var(--label-halo); stroke-width: 1; stroke-linejoin: round; }
.ship-preview .spar { stroke: var(--ship-hull); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.ship-preview .sailcloth { stroke: var(--ship-hull); stroke-width: 1.2; stroke-linejoin: round; }
.ship-preview .pennant { fill: var(--accent); }
.chart .sailcloth { stroke: var(--ship-hull); }
.swatches, .marks { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--c);
}
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 58px;
  padding: 6px 6px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
}
.mark small { font-size: 11.5px; color: var(--ink-soft); }
.mark .ico { fill: currentColor; stroke: none; }
.mark .plain { width: 22px; height: 22px; border: 1.5px solid var(--line-strong); border-radius: 3px; }
.mark[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.mark:disabled { opacity: 0.45; cursor: default; }

/* ---------- our verses, backup ---------- */
.addverse { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.addverse label { font-size: 14px; color: var(--ink-soft); }
.addverse input, .addverse textarea, #backup-out, #backup-in {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 400 16px/1.45 var(--f-ui);
}
.addverse textarea { font: 400 17px/1.45 var(--f-verse); resize: vertical; }
#backup-out, #backup-in { font: 400 12.5px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; resize: vertical; }
.addverse .btn { align-self: flex-start; }
.print-btn { align-self: flex-start; }

/* ---------- large text ---------- */
:root[data-size="large"] body { font-size: 18px; }
:root[data-size="large"] .verse { font-size: clamp(26px, 6.8vw, 32px); }
:root[data-size="large"] .tile { font-size: 23px; }
:root[data-size="large"] :is(.story, .status, .cargo-tie, .level-blurb, .v-note, .todays ul, .portpage p, .letter p) { font-size: 17.5px; }
:root[data-size="large"] :is(.cargo-text, .landfall blockquote, .game-prompt) { font-size: 23px; }

/* ---------- printable memory cards ---------- */
#print-cards { display: none; }
@media print {
  :root.printing .app { display: none !important; }
  :root.printing #print-cards { display: block; color: #000; background: #fff; font-family: var(--f-verse); }
  :root.printing body { background: #fff; }
  #print-cards h1 { font: 400 20pt var(--f-display); margin: 0 0 10pt; }
  #print-cards .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  #print-cards .card {
    break-inside: avoid;
    min-height: 2.6in;
    padding: 14pt;
    border: 1px dashed #999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  #print-cards .c-text { font-size: 14pt; line-height: 1.45; margin: 0; }
  #print-cards .c-ref { font: 600 11pt var(--f-ui); margin: 10pt 0 0; }
}

/* ---------- seasonal invitation ---------- */
.season { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.season p { min-width: 0; flex: 1 1 14rem; font-size: 15px; }
.tabs::-webkit-scrollbar { display: none; }
.w.echo-on { background: var(--accent-wash); border-bottom-color: var(--accent); }
.w.echo-later { color: var(--ink-ghost); }
.sail[data-step="echo"] #ready { min-height: 52px; padding-inline: 24px; font-size: 18px; }
.b-low { color: var(--miss); font-weight: 500; }
.about { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); padding-left: 10px; border-left: 2px solid var(--line-strong); max-width: 62ch; }

/* ---------- sailing together ---------- */
.together { display: grid; gap: 8px; padding: 12px; background: var(--panel-2); border-left: 3px solid var(--accent); }
.together-head { display: flex; align-items: center; gap: 12px; }
.together-head h3 { margin: 0; }
.together-head .status { margin: 2px 0 0; }
.family-ship { width: 112px; height: 86px; flex: none; overflow: visible; }
.family-ship .fs-part { opacity: 0.14; }
.family-ship .fs-part[data-built] { opacity: 1; animation: fs-in 0.6s ease-out; }
.family-ship .hull { fill: var(--ship-hull); stroke: var(--label-halo); stroke-width: 1; stroke-linejoin: round; }
.family-ship .keel { stroke: var(--ship-hull); stroke-width: 4; stroke-linecap: round; }
.family-ship .spar { stroke: var(--ship-hull); stroke-width: 2; stroke-linecap: round; fill: none; }
.family-ship .sailcloth { fill: var(--ship-sail); stroke: var(--ship-hull); stroke-width: 1.2; stroke-linejoin: round; }
.family-ship .pennant { fill: var(--accent); }
.family-ship .glow { fill: var(--lamp); }
.family-ship .dove { fill: var(--ship-sail); stroke: var(--ship-hull); stroke-width: 1.5; }
.family-ship .fs-water { fill: none; stroke: var(--sea-ink); stroke-width: 1.4; stroke-linecap: round; }
@keyframes fs-in { from { opacity: 0.14; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .family-ship .fs-part[data-built] { animation: none; } }
.together .aboard { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.together .aboard li { display: flex; align-items: center; gap: 6px; }
.together .aboard li[data-done] { color: var(--ink-soft); }
.together .actions { align-items: center; }
.together .actions .status { margin: 0; font-size: 14px; }
.together-news { display: grid; justify-items: start; gap: 4px; }
.together-news .family-ship { width: 140px; height: 108px; }
.relay-setup { display: grid; gap: 10px; }
.relay-who { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: grid; text-align: left; gap: 1px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip small { font-weight: 400; font-size: 12.5px; color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.8; }
.relay-verse blockquote { margin: 6px 0; }
.relay-score { display: grid; gap: 4px; margin: 10px 0; }
.relay-score li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.together-hint { margin-top: 0; }
.sail[data-step="pass"] .stage-note { font-size: 17px; text-align: center; padding: 18px 0 6px; }
.sail[data-step="pass"] .stage-note b { display: block; font-family: var(--f-display, inherit); font-size: 28px; font-weight: 500; line-height: 1.2; margin-bottom: 6px; }
.sail[data-step="pass"] #ready { margin-inline: auto; }

/* Removing a sailor takes a second, plainly worded tap. */
.own-body .warn { color: var(--miss); margin: 0; }
.btn.danger { background: var(--miss); border-color: var(--miss); color: var(--panel); }
.relay-score li small { grid-column: 1 / -1; color: var(--ink-soft); }

/* What this is and how to play: the welcome on a first visit and the Help screen. */
.welcome h2 { font-size: 30px; }
.how { list-style: none; display: grid; gap: 14px; margin: 4px 0 6px; }
.how li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.how b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 19px; margin-bottom: 2px; }
.how li > span:last-child { color: var(--ink-soft); }
.how b { color: var(--ink); }
.how-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); }
.how-more { display: grid; gap: 6px; }
.how-more h3 { font: 400 19px/1.2 var(--f-display); margin-top: 10px; }
.how-more p { color: var(--ink-soft); }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Switching sailors from the chart, and the crew guide. */
.switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.switcher > span { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.switcher .chip { padding: 4px 12px; border-radius: 999px; font-size: 14.5px; }
.guide { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel-2, var(--panel)); }
.guide summary { cursor: pointer; font: 400 19px/1.3 var(--f-display); }
.guide[open] summary { margin-bottom: 10px; }
.guide .how { margin-bottom: 8px; }
.how-h { font: 400 22px/1.2 var(--f-display); margin-top: 6px; }

/* ---------- the shipyard ---------- */
.gilt { fill: none; stroke: #e0a526; stroke-width: 1.4; stroke-linecap: round; }
.oar { stroke-width: 1.1; }
.lantern-glow { stroke: var(--lamp-edge); stroke-width: 0.6; filter: drop-shadow(0 0 1.5px #f7bf3e); }
.figure { fill: #e0a526; stroke: var(--ship-hull); stroke-width: 1.2; }
.pet { fill: #3b2a20; stroke: #3b2a20; stroke-width: 0.6; stroke-linejoin: round; }
.lamb circle { fill: #fffdf6; stroke: #8a7a66; stroke-width: 0.5; }
.ship-preview .nest, .chart .nest { stroke-width: 0.8; }
.ship-preview.big { width: 112px; height: 106px; }
.yard { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.yard-head { display: flex; align-items: center; gap: 12px; }
.yard-head h3 { font: 400 21px/1.2 var(--f-display); }
.yard-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.yard-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.yard-item span { display: grid; gap: 1px; }
.yard-item b { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.yard-item small { font-size: 12.5px; color: var(--ink-soft); }
.yard-item .ico { width: 24px; height: 24px; flex: none; fill: currentColor; stroke: none; color: #b9861a; }
.yard-item[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-wash); }
.yard-item:disabled { opacity: 0.55; cursor: default; }
.yard-chip { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--c); border: 1px solid var(--line-strong); }

/* ---------- captain's orders and events at sea ---------- */
.orders { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--sea-ink); }
.orders ul { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.orders li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.orders li[data-done] { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.orders li .btn { padding: 2px 10px; }
.orders.kept { border-left-color: var(--accent); }
.event { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.event[data-ev="storm"] { border-color: var(--miss); }
.event[data-ev="wind"], .event[data-ev="calm"] { border-color: var(--sea-ink); }
.event blockquote { margin: 8px 0 2px; font-family: var(--f-verse); font-size: 17px; }
.event cite { font-size: 13.5px; color: var(--ink-soft); font-style: normal; }

/* ---------- deeper waters, gold lamps, name the reference ---------- */
.deep { padding: 10px 12px; border-left: 3px solid var(--sea-ink); background: var(--panel-2); }
.portpage.deep { border-left: 3px solid var(--sea-ink); }
.lampdot[data-lamp="gold"] { background: radial-gradient(circle at 35% 35%, #fff3c0, #e0a526 60%, #a86f0c); border-color: #8a5a06; box-shadow: 0 0 0 4px color-mix(in srgb, #e0a526 35%, transparent), 0 0 10px #f7bf3e; }
.ref-tile { font-family: var(--f-display); }
.tile[data-right] { background: color-mix(in srgb, var(--lamp) 35%, var(--panel)); border-color: var(--lamp-edge); }
.tile[data-wrong] { border-color: var(--miss); color: var(--miss); }
.app[data-hideref="true"] :is(#sail-ref, #verse-ref) { visibility: hidden; }
.sail[data-step="ref"] .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sail[data-step="ref"] :is(.keys, #hops, #mode) { display: none; }

/* ---------- seasons ---------- */
.season-banner { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid #b9861a; background: var(--panel-2); }
.season-banner .actions { margin-top: 2px; }
.tab.season-tab .tab-num { color: #b9861a; }
.season-me, .season-journey { display: flex; flex-direction: column; gap: 6px; }
.lamps.compact li .locked { padding: 4px 0; }
.stops { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: 15px; }
.stops li { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.stops li[data-done] { color: var(--ink); }
.season-board h3 { font: 400 19px/1.2 var(--f-display); margin-bottom: 6px; }
.board-row .x { margin-left: 4px; padding: 0 8px; font-size: 18px; line-height: 1; }
.season-form { display: flex; flex-direction: column; gap: 8px; }
.season-form select, .season-form input[type="number"] { font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); }
.season-form fieldset { border: 0; padding: 0; margin: 4px 0 0; }
.season-form legend { font-weight: 600; margin-bottom: 6px; }
.weeks-row { display: flex; align-items: center; gap: 12px; }
.weeks-row input { width: 6em; }
.season-end { display: flex; flex-direction: column; gap: 10px; }
.podium ol { list-style: none; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.podium li { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); min-width: 90px; }
.podium li[data-place="1"] { border-color: #e0a526; box-shadow: 0 0 0 2px color-mix(in srgb, #e0a526 40%, transparent); padding-block: 14px; }
.podium li small { color: var(--ink-soft); }
.season-stop { border-left: 3px solid #b9861a; }
@media print {
  #print-cards .cert { break-after: page; text-align: center; padding: 1.2in 0.8in; border: 6px double #b9861a; margin: 0.3in; }
  #print-cards .cert h1 { font-size: 26pt; margin: 8pt 0 18pt; }
  #print-cards .cert h2 { font: 400 30pt var(--f-display); margin: 10pt 0; }
  #print-cards .cert p { font-size: 14pt; }
  #print-cards .cert .c-small { font: 600 11pt var(--f-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #555; }
}
.season-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; max-height: 22rem; overflow-y: auto; }
.season-pick summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; padding: 4px 0 8px; }
.pick-list label { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.pick-list input { accent-color: var(--accent); }
