/* Layout: full-bleed 3D bay; a quiet HUD pinned to the corners; the journal is a paper spread laid over the water. */

/* Fonts are served from this site (SIL Open Font License, see assets/fonts). Caveat and Nunito are variable fonts. */
@font-face {
  font-family: 'Caveat';
  src: url('assets/fonts/caveat-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('assets/fonts/kalam-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('assets/fonts/kalam-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --sea-night: #0f1b2b;
  --hud-ink: #fff9ef;
  --hud-veil: rgba(22, 30, 42, 0.34);
  --hud-line: rgba(255, 249, 239, 0.2);
  --lantern: #ffc977;
  --seaglass: #93dccd;
  --coral: #ff9a82;
  --paper: #f3e8cf;
  --paper-shade: #e6d4ae;
  --ink: #35291f;
  --ink-soft: #6e5c49;
  --ink-faint: rgba(53, 41, 31, 0.32);
  --stamp: #b5532f;
  --panel: rgba(14, 24, 34, 0.58);
  --sonar-fish: #ffc977;
  --sonar-weed: #7fc28a;
  --sonar-bottom: #ead3a2;
  --sonar-bait: #ff9a82;
  --water-top: #5fb6c0;
  --water-deep: #1b4f78;
  --sand: #a88a5c;
  --font-display: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;
  --font-hand: 'Kalam', 'Bradley Hand', 'Segoe Print', cursive;
  --font-ui: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--sea-night);
  color: var(--hud-ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
button { touch-action: manipulation; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  outline: none;
}
#scene.dragging { cursor: grabbing; }

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(24, 16, 34, 0.32) 100%);
}

#underwater-tint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 18%, rgba(150, 220, 210, 0.04), rgba(8, 40, 60, 0.36) 95%);
}

#rest-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(255, 220, 170, 0.12) 100%);
  opacity: 0;
  transition: opacity 0.8s ease;
  font-family: var(--font-display);
  font-size: 30px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
#rest-veil.show { opacity: 1; }

#loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--sea-night);
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--hud-ink);
}

#notice {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px max(24px, env(safe-area-inset-right, 0px)) 24px max(24px, env(safe-area-inset-left, 0px));
  background: var(--sea-night);
  text-align: center;
}
#notice p { margin: 0; max-width: 32ch; font-family: var(--font-hand); font-size: 20px; line-height: 1.45; }
#notice button, .nojs {
  font: 800 15px var(--font-ui);
  padding: 10px 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 249, 239, 0.94);
  color: #24324a;
  cursor: pointer;
}
.nojs { position: fixed; inset: auto 16px 16px; margin: 0; text-align: center; }

/* ---------- HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#hud.off { opacity: 0; }
#hud.off #journal-btn { pointer-events: none; }

.pill {
  background: var(--hud-veil);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--hud-line);
  border-radius: 999px;
  color: var(--hud-ink);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  font: 800 12px/1.5 var(--font-ui);
  text-align: center;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 6px;
  background: rgba(255, 249, 239, 0.92);
  color: #243041;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

#clock {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 10px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#clock .soft { font-weight: 500; opacity: 0.78; }
#clock .soft::before { content: '·'; margin-right: 9px; opacity: 0.6; }
#clock-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--lantern);
  box-shadow: 0 0 10px var(--lantern);
  transition: background 2s, box-shadow 2s;
}
#clock-dot.moon { background: #e2e8f6; box-shadow: 0 0 10px rgba(226, 232, 246, 0.7); }

#place {
  position: absolute;
  top: 11%;
  left: 0;
  right: 0;
  padding-inline: 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 1.6s ease, transform 1.6s ease;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}
#place.show { opacity: 1; transform: none; }
#place-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 7vw, 80px);
  line-height: 1;
  text-wrap: balance;
}
#place .rule { width: 110px; height: 1px; margin: 12px auto 8px; background: currentColor; opacity: 0.5; }
#place-sub { font-family: var(--font-hand); font-size: clamp(16px, 2.2vw, 21px); opacity: 0.92; }

#toast {
  position: absolute;
  top: calc(112px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  max-width: min(340px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--hud-veil);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--hud-line);
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  z-index: 4; /* above the fish finder, even a dragged one */
}
#toast.show { opacity: 1; transform: none; }

#hint {
  position: absolute;
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(8px);
  max-width: calc(100% - 32px);
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#hint.show { opacity: 1; transform: none; }

#prompt {
  position: absolute;
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  padding: 9px 18px;
  font: 600 15px var(--font-ui);
  pointer-events: auto;
  cursor: pointer;
  animation: rise 0.5s ease;
}

#meter {
  position: absolute;
  left: calc(50% + clamp(110px, 18vw, 220px));
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  width: 86px;
  height: 86px;
  transform: translateX(-50%);
}
#meter svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.m-track { fill: none; stroke: rgba(255, 249, 239, 0.18); stroke-width: 6; }
.m-track.thin { stroke-width: 4; }
.m-outer {
  fill: none;
  stroke: var(--hud-ink);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  filter: drop-shadow(0 0 4px rgba(255, 249, 239, 0.4));
}
.m-inner {
  fill: none;
  stroke: var(--seaglass);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251.33;
  stroke-dashoffset: 251.33;
  transition: stroke 0.25s ease;
}
/* Ease off: the flick before a run and the surge. */
#meter.alert .m-track { stroke: rgba(255, 196, 110, 0.55); animation: meterPulse 0.45s ease-in-out infinite alternate; }
#meter.alert #meter-label { color: #ffd59a; }
@keyframes meterPulse { from { stroke-width: 6; opacity: 0.6; } to { stroke-width: 10; opacity: 1; } }
/* Near the line's breaking strain: the tension ring flashes red, and the word with it. */
#meter.danger .m-inner { stroke: var(--coral) !important; animation: meterDanger 0.16s ease-in-out infinite alternate; }
#meter.danger #meter-label > span:first-child { color: #ffb3a1; }
@keyframes meterDanger { from { stroke-width: 4; opacity: 0.7; } to { stroke-width: 9; opacity: 1; } }
.reduce-motion #meter.danger .m-inner { animation: none; stroke-width: 7; }
/* Where the reel's drag starts to give line, on the tension ring. */
.m-drag { fill: var(--hud-ink); stroke: rgba(15, 27, 43, 0.75); stroke-width: 1.5; }
.m-drag.locked { fill: var(--coral); }
#meter-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

#bite-mark {
  position: absolute;
  left: -19px;
  top: -64px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--lantern);
  color: #3a2a14;
  font: 800 22px var(--font-ui);
  box-shadow: 0 0 0 5px rgba(255, 201, 119, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.12s ease;
}
#bite-mark.show { opacity: 1; animation: bob 0.5s ease-in-out infinite alternate; }
#bite-mark b { font: inherit; }
/* "Bite — strike!" or "Fish on!" under the mark: what to do, not just that something happened. */
#bite-text {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(22, 30, 42, 0.62);
  color: var(--hud-ink);
  font: 700 13px var(--font-ui);
}
#bite-text:empty { display: none; }
#bite-mark.fishon { background: #9fe3b4; box-shadow: 0 0 0 5px rgba(159, 227, 180, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25); }

#corner {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex;
  gap: 8px;
}
#corner button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 7px 12px;
  font: 700 14px var(--font-ui);
  pointer-events: auto;
  cursor: pointer;
}
#corner button:hover { background: rgba(22, 30, 42, 0.5); }
#finder-btn.on { background: rgba(255, 201, 119, 0.3); border-color: rgba(255, 201, 119, 0.6); }
#journal-btn.pulse { animation: glow 1.4s ease-in-out 4; }
#hud.off #corner button { pointer-events: none; }

#view-chip {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  max-width: min(540px, calc(100% - 32px));
  padding: 8px 16px;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#view-chip.show { opacity: 1; transform: none; }

.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--hud-line);
  border-radius: 14px;
  color: var(--hud-ink);
}

/* Bottom-left column: the fish finder with the bait panel above it. */
#left-stack {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 10px;
}
/* Narrower windows: the centred hint and action prompt reach this far, so sit above both. */
@media (max-width: 1199px) {
  body:not(.touch) #left-stack { bottom: calc(126px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1200px) {
  body:not(.touch) #hud:has(#left-stack > .panel:not([hidden])) #hint { max-width: calc(100% - 700px); }
}
body.touch #left-stack { display: contents; }
body.touch #bait, body.touch #sonar { position: absolute; }

/* Bait: depth gauge, numbers, and what the fish are doing */
#bait {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 6px 12px;
  width: 230px;
  padding: 10px 14px 10px 12px;
  animation: rise 0.4s ease;
}
.bait-gauge {
  grid-row: 1 / span 2;
  position: relative;
  width: 6px;
  height: 66px;
  justify-self: center;
  border-radius: 3px;
  background: linear-gradient(var(--water-top), var(--water-deep));
  border-bottom: 3px solid var(--sand);
}
#bait-mark {
  position: absolute;
  left: 50%;
  top: 0;
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5.5px;
  border-radius: 2px;
  background: var(--sonar-bait);
  transform: rotate(45deg);
  transition: top 0.3s ease;
}
#bait dl {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 2px 10px;
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#bait dt { opacity: 0.7; font-weight: 600; }
#bait dd { margin: 0; font-weight: 800; }
#bait-status { margin: 0; font-family: var(--font-hand); font-size: 15px; line-height: 1.3; }
#bait[data-status="bite"] #bait-status, #bait[data-status="hooked"] #bait-status { color: var(--lantern); font-weight: 700; }

/* Fish finder */
#sonar {
  width: 300px;
  max-height: calc(100vh - 12px);
  overflow-y: auto;
  padding: 8px 10px 10px;
  pointer-events: auto;
  animation: rise 0.4s ease;
}
#sonar header { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-bottom: 6px; font-size: 12px; cursor: grab; touch-action: none; }
#sonar .s-depth { order: 5; flex-basis: 100%; margin-left: 18px; }
#sonar .s-title { margin-right: auto; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sonar header button { flex: none; }
#sonar.dragging header { cursor: grabbing; }
#sonar.floating { position: fixed !important; bottom: auto !important; right: auto !important; z-index: 3; }
#sonar.size-0 { width: 230px; }
#sonar.size-2 { width: 420px; }
.s-grip { width: 10px; height: 14px; opacity: 0.55; background: radial-gradient(circle, currentColor 1.2px, transparent 1.6px) 0 0 / 5px 5px; }
#sonar-size {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--hud-line);
  border-radius: 50%;
  background: transparent;
  color: var(--hud-ink);
  font: 800 12px var(--font-ui);
  cursor: pointer;
}
.s-title { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.s-depth { margin-left: auto; opacity: 0.85; font-variant-numeric: tabular-nums; }
#sonar-depth { font-size: 15px; font-weight: 800; opacity: 1; }
#sonar-help {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--hud-line);
  border-radius: 50%;
  background: transparent;
  color: var(--hud-ink);
  font: 800 12px var(--font-ui);
  cursor: pointer;
}
#sonar-canvas { display: block; width: 100%; height: auto; border-radius: 8px; }
#sonar-legend ul { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 4px; padding: 0; list-style: none; font-size: 12px; }
#sonar-legend i { display: inline-block; width: 12px; height: 8px; margin-right: 5px; vertical-align: middle; border-radius: 6px; }
#sonar-legend .lg-fish { background: linear-gradient(90deg, #ffd682, #ff7040); }
#sonar-legend .lg-weed { background: var(--sonar-weed); }
#sonar-legend .lg-bottom { height: 3px; border-radius: 1px; background: var(--sonar-bottom); }
#sonar-legend .lg-bait { width: 8px; height: 8px; border-radius: 1px; background: #9fe3ff; transform: rotate(45deg); }
#sonar-legend p { margin: 0; font-size: 12px; line-height: 1.4; opacity: 0.85; }

button:focus-visible, #scene:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; }
/* Playing with a controller: wherever the focus is, you can see it (there's no mouse pointer to
   follow), and the on-screen touch controls step aside. */
body.pad :focus { outline: 3px solid var(--lantern); outline-offset: 3px; }
body.pad #touch, body.pad #cancel-btn { display: none !important; }
body:not(.pad) .pad-only { display: none !important; }
body.pad .keys-only { display: none !important; }

/* Rod and tackle in hand, under the clock. Click to open the backpack. */
#gear {
  position: absolute;
  top: calc(58px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 6px 14px 6px 12px;
  font: 700 13px var(--font-ui);
  pointer-events: auto;
  cursor: pointer;
}
#gear:hover { background: rgba(22, 30, 42, 0.5); }
/* The conditions panel: wind, current and sea where you are, under the rod. */
#conditions {
  position: absolute;
  top: calc(96px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  display: grid;
  gap: 2px;
  padding: 6px 12px;
  border-radius: 12px;
  font: 600 12px var(--font-ui);
  pointer-events: none;
}
#conditions .cd-row { display: grid; grid-template-columns: 56px auto; gap: 6px; white-space: nowrap; }
#conditions .cd-k { opacity: 0.7; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; line-height: 16px; }
#conditions .cd-arrow { display: inline-block; width: 1.1em; text-align: center; font-weight: 800; }
#gear .soft { font-weight: 500; opacity: 0.85; }
#gear .soft::before { content: '·'; margin-right: 8px; opacity: 0.6; }
#gear.flash { animation: glow 1.2s ease-in-out 2; }
#clock-food.hungry { color: var(--coral); opacity: 1; }
#clock-food.fed { color: var(--seaglass); opacity: 1; }

/* Where the boat (and camp) are while you're on foot. Pinned to the screen edge when out of view. */
.marker {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(22, 30, 42, 0.5);
  border: 1px solid rgba(255, 201, 119, 0.55);
  font: 700 12px var(--font-ui);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.marker.camp { border-color: rgba(147, 220, 205, 0.55); }
.marker .m-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--lantern);
  transition: transform 0.1s linear;
}
.marker.camp .m-arrow { border-bottom-color: var(--seaglass); }
.marker.trip { border-color: rgba(240, 180, 140, 0.6); }
.marker.trip .m-arrow { border-bottom-color: #f0b48c; }
/* The crossing's: where to steer for, across the open sea. */
.marker.cross { border-color: rgba(140, 200, 240, 0.7); }
.marker.cross .m-arrow { border-bottom-color: #8cc8f0; }
/* A dialog's list: what's ready (a tick) and what isn't (a warning). */
.cf-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; text-align: left; }
.cf-list li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.35; }
.cf-list li::before { position: absolute; left: 0; top: 0; width: 16px; text-align: center; font-weight: 700; }
.cf-list li.ok::before { content: '✓'; color: #5a9a6a; }
.cf-list li.warn::before { content: '!'; color: #d07040; }
.marker.near { opacity: 0.75; }
.marker.guide { border-color: rgba(255, 214, 140, 0.85); background: rgba(40, 32, 20, 0.6); }
.marker.guide .m-arrow { border-bottom-color: #ffd68c; }

/* The first-trip guide: a small card under the corner buttons, one step at a time. */
#guide {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: min(320px, calc(100% - 32px));
  padding: 10px 12px 12px 14px;
  pointer-events: auto;
  font: 14px/1.45 var(--font-ui);
}
#guide.fresh { animation: guide-step 1.2s ease; }
@keyframes guide-step { 0% { box-shadow: 0 0 0 0 rgba(255, 214, 140, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(255, 214, 140, 0); } }
.gd-head { display: flex; align-items: center; gap: 6px; }
.gd-step { flex: 1; font: 700 11.5px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.gd-icon {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hud-line);
  background: transparent; color: var(--hud-ink); font: 700 15px/1 var(--font-ui); cursor: pointer;
}
.gd-icon:hover { background: rgba(255, 255, 255, 0.12); }
#gd-title { margin: 6px 0 4px; font: 700 16px var(--font-ui); }
#gd-text { margin: 0; }
#gd-text kbd { font-size: 12px; }
.gd-dots { display: flex; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.gd-dots li { width: 18px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); }
.gd-dots li.done { background: var(--seaglass); }
.gd-dots li.now { background: #ffd68c; }
#hud.off #guide { display: none; }
/* While the guide card is up, the toasts that share its corner come in below it. */
body.guiding:not(.touch) #toast { top: calc(74px + var(--guide-h, 180px) + env(safe-area-inset-top, 0px)); }
body.touch #guide { top: calc(64px + env(safe-area-inset-top, 0px)); width: min(270px, 46vw); padding: 8px 10px 10px 12px; font-size: 13px; }
body.touch #gd-title { font-size: 14.5px; }
/* Phones upright: the card spans the top under the buttons, and the tips that live up there
   (the hint, the bait panel, the view tip) move down below it. */
@media (max-width: 600px) {
  body.touch #guide { top: calc(100px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; width: auto; }
  body.touch.guiding #hint { top: calc(108px + var(--guide-h, 160px) + env(safe-area-inset-top, 0px)); }
  body.touch.guiding #bait { top: calc(144px + var(--guide-h, 160px) + env(safe-area-inset-top, 0px)); }
  body.touch.guiding #view-chip { top: calc(244px + var(--guide-h, 160px) + env(safe-area-inset-top, 0px)); }
}
/* Phones sideways: a narrower card on the right, the hint keeping clear of it, and the card
   scrolling rather than reaching down to the thumbs. */
@media (max-height: 480px) {
  body.touch #guide { top: calc(58px + env(safe-area-inset-top, 0px)); width: 210px; font-size: 12px; max-height: calc(100vh - 220px); overflow-y: auto; }
  body.touch.guiding #hint { max-width: calc(100% - 480px); }
}
@media (max-width: 760px) {
  body:not(.touch) #guide { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  body.guiding:not(.touch) #toast { top: calc(112px + env(safe-area-inset-top, 0px)); }
}

#sleep-veil {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  background: #0b111b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  color: var(--hud-ink);
}
#sleep-veil.show { opacity: 1; pointer-events: auto; }

/* ---------- backpack and camp sheets ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 18, 28, 0.35);
  animation: fade 0.3s ease;
}
.sheet-inner {
  position: relative;
  width: min(900px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px 26px 22px;
  border-radius: 8px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 255, 255, 0.45), transparent 55%),
    var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 0 5px rgba(92, 64, 40, 0.8);
  user-select: text;
}
#camp .sheet-inner { width: min(620px, 100%); }
.sheet header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding-right: 36px; }
.sheet h2 { margin: 0; font: 700 40px/1 var(--font-display); }
.sheet header p { margin: 0; font: 15px var(--font-hand); color: var(--ink-soft); }
.sheet h3 { margin: 18px 0 8px; font: 700 26px/1 var(--font-display); }
.sheet h3 .count { font: 700 12px var(--font-ui); color: var(--ink-soft); margin-left: 6px; letter-spacing: 0.04em; }
.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font: 400 28px/1 var(--font-ui);
  cursor: pointer;
}
.sheet-close:hover { background: rgba(53, 41, 31, 0.08); }
.pk-setups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 6px; }
.pk-setup { display: flex; flex-direction: column; gap: 3px; }
.pk-setup .pk-btn { align-self: flex-start; }
.pk-setup .pk-btn.on { background: var(--ink, #35291f); color: var(--paper, #f6efe2); }
.pk-travel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 12px 0 2px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(53, 41, 31, 0.07);
}
.pk-travel-label { font: 700 20px/1 var(--font-display); margin-right: 4px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pk-card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px 12px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
}
.pk-card.active { border-color: var(--stamp); background: rgba(255, 236, 205, 0.6); }
.pk-card.boxed { border-style: dashed; background: rgba(255, 255, 255, 0.12); }
.pk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pk-top strong { font: 700 22px/1.05 var(--font-display); }
.pk-tag { font: 700 10px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); text-align: right; }
.pk-stats { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 2px 0; font: 600 12px var(--font-ui); }
.pk-stats dt { color: var(--ink-soft); }
.pk-stats dd { margin: 0; }
.pk-card p { margin: 0; font: 14px/1.35 var(--font-hand); }
.pk-good::before { content: '+ '; color: #4f7a3a; font-weight: 700; }
.pk-bad::before { content: '− '; color: var(--stamp); font-weight: 700; }
.pk-bad { color: var(--ink-soft); }
.pk-meta { font: 600 11px var(--font-ui) !important; color: var(--ink-soft); }
.pk-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pk-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 700 12px var(--font-ui);
  cursor: pointer;
}
.pk-btn:hover { background: #4a3a2c; }
.pk-btn.quiet { background: transparent; color: var(--ink); border-color: var(--ink-faint); }
.pk-btn.quiet:hover { background: rgba(53, 41, 31, 0.06); }
.pk-btn:disabled { opacity: 0.4; cursor: default; }
.pk-on { font: 700 12px var(--font-ui); color: var(--stamp); }
.pk-note { font: 600 12px var(--font-ui); color: var(--ink-soft); }
.pk-creel { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-fish { padding: 3px 10px; border-radius: 999px; background: rgba(53, 41, 31, 0.08); font: 700 12px var(--font-ui); }
.pk-help { margin: 16px 0 0; font: 600 12px var(--font-ui); color: var(--ink-soft); }
.sheet kbd { background: var(--ink); color: var(--paper); box-shadow: none; }

.cp-tabs { display: flex; gap: 6px; margin: 12px 0 4px; }
.cp-tabs button {
  padding: 6px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.cp-tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 7px 0; border-bottom: 1px dashed var(--ink-faint); }
.cp-row p { margin: 0; flex: 1 1 200px; font: 16px/1.35 var(--font-hand); }
.cp-row strong { font: 700 22px var(--font-display); min-width: 74px; }
.cp-soft { font: 600 12px var(--font-ui); color: var(--ink-soft); }
p.cp-soft { margin: 6px 0; }
.cp-lead { font: 17px var(--font-hand); margin: 10px 0; }
.cp-bar { position: relative; flex: 1 1 140px; max-width: 220px; height: 9px; border-radius: 5px; background: rgba(53, 41, 31, 0.12); overflow: hidden; }
.cp-bar i { position: absolute; inset: 0 auto 0 0; background: #6f9a4e; border-radius: 5px; }
.cp-bar.warm i { background: var(--stamp); }
.cp-fire { width: 14px; height: 14px; border-radius: 50%; background: #9a9086; }
.cp-fire.lit { background: #ff9b52; box-shadow: 0 0 10px #ff9b52; }
.cp-fire.embers { background: #b5532f; }
.cp-wake { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pk-btn.wake { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; font-size: 15px; text-align: left; }
.pk-btn.wake small { font: 600 12px var(--font-ui); opacity: 0.8; }

/* ---------- cards ---------- */

.card {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  transform: translate(-50%, -50%) rotate(-1.2deg);
  padding: 22px 26px 18px;
  border-radius: 4px;
  color: var(--ink);
  text-align: center;
  font-family: var(--font-hand);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(ellipse at 100% 100%, var(--paper-shade), transparent 70%),
    var(--paper);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.06);
  animation: cardIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  cursor: pointer;
}
.card canvas { display: block; width: 100%; height: auto; margin: 0 auto; }
#note-card canvas { width: 150px; }
.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}
#cc-size { font: 700 13px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.card p { font-size: 17px; line-height: 1.45; margin: 10px auto 0; max-width: 34ch; }
.card-act { margin-top: 14px; font: 600 13px var(--font-ui); color: var(--ink-soft); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.card-act button {
  padding: 6px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.card-act button:hover { background: rgba(255, 255, 255, 0.7); }
.card-act button[hidden] { display: none; }
#cc-rig { font: 600 12px var(--font-ui) !important; color: var(--ink-soft); margin-top: 6px !important; }
.card kbd { background: var(--ink); color: var(--paper); box-shadow: none; }
.stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--stamp);
  border: 2px solid currentColor;
  border-radius: 4px;
  padding: 0 10px;
  transform: rotate(-4deg);
  animation: stamp 0.5s 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* ---------- journal ---------- */

#journal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 18, 28, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.35s ease;
}
.book {
  position: relative;
  width: min(1060px, 100%);
  height: min(680px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 8px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(92, 64, 40, 0.85), 0 0 0 7px rgba(0, 0, 0, 0.2);
  animation: cardIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  user-select: text;
}
.page {
  min-width: 0;
  overflow-y: auto;
  padding: 26px 34px 30px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(70, 110, 150, 0.13) 31px 32px);
  background-position: 0 64px;
}
.page.left { box-shadow: inset -28px 0 32px -28px rgba(60, 40, 20, 0.4); }
.page.right { box-shadow: inset 28px 0 32px -28px rgba(60, 40, 20, 0.4); }
.page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  margin: 0 0 8px;
}
.page h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  margin: 18px 0 6px;
}
.j-entry {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink-faint);
}
.j-entry canvas { width: 150px; height: auto; }
.j-entry h3 { margin: 0; font-size: 32px; }
.j-note { font-family: var(--font-hand); font-size: 16px; line-height: 1.35; margin: 4px 0 6px; }
.j-meta { font: 600 12px/1.4 var(--font-ui); color: var(--ink-soft); margin: 2px 0 0; }
.j-entry.unknown h3, .j-entry.unknown .j-note { color: var(--ink-soft); }
.page h3.j-water { margin: 14px 0 0; font-size: 24px; color: var(--ink-soft); }
.page h3.j-water .count { font: 700 12px var(--font-ui); margin-left: 8px; letter-spacing: 0.04em; }
.j-seen { display: block; font: 13px/1.35 var(--font-ui); color: #2f6f74; }
.j-tackle { color: var(--stamp); }
#j-map { display: block; width: 100%; height: auto; margin: 4px 0 6px; }
#j-places { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#j-places li { display: grid; gap: 1px; font-family: var(--font-hand); font-size: 15px; line-height: 1.35; }
#j-places strong { font-family: var(--font-display); font-size: 24px; line-height: 1; }
#j-places li.faint { color: var(--ink-faint); }
.j-keepsake { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; font-family: var(--font-hand); font-size: 15px; }
.j-keepsake canvas { width: 64px; height: 64px; }
.j-keepsake strong { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1; }
.j-empty { font-family: var(--font-hand); font-size: 15px; margin: 0; color: var(--ink-soft); }
.j-someday { font-family: var(--font-hand); font-size: 14px; color: var(--ink-faint); margin: 10px 0 0; }
#j-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font: 400 28px/1 var(--font-ui);
  cursor: pointer;
}
#j-close:hover { background: rgba(53, 41, 31, 0.08); }
.j-settings { display: flex; flex-wrap: wrap; gap: 8px; }
.j-save-status { flex: 1 1 100%; margin: 0; font: 600 12px/1.4 var(--font-ui); color: var(--ink-soft); }
.j-settings button.danger { border-color: rgba(181, 83, 47, 0.55); color: var(--stamp); }
.j-cloud p { flex: 1 1 100%; margin: 0; font: 14px/1.4 var(--font-hand); }
.j-cloud { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--ink-faint); }
.j-cloud h4 { flex: 1 1 100%; margin: 0; font: 700 20px var(--font-display); }
.j-cloud-form { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.j-cloud .j-cloud-msg { font: 600 12px/1.4 var(--font-ui); color: var(--stamp); }
.j-cloud input { flex: 1 1 200px; padding: 6px 10px; border: 1.5px solid var(--ink-faint); border-radius: 999px; background: rgba(255, 255, 255, 0.5); font: 600 13px var(--font-ui); color: var(--ink); }

/* Journal tabs: a pair of bookmarks along the top edge. */
.j-tabs { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; }
.j-tabs button {
  padding: 5px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.j-tabs button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.book .page { padding-top: 46px; }
/* On a phone the tabs sit on one line, left of the close button (short names on the narrowest). */
@media (max-width: 760px) {
  .j-tabs { left: 14px; transform: none; gap: 4px; }
  .j-tabs button { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
}
@media (max-width: 440px) {
  .j-tab-more { display: none; }
  .j-tabs button::first-letter { text-transform: uppercase; }
}
/* Pages scrolled down fade out under the tabs instead of running into them. */
@media (min-width: 761px) {
  .book .page { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px); mask-image: linear-gradient(to bottom, transparent 0, #000 40px); }
}

/* The catch log */
.j-sum { font: 16px/1.4 var(--font-hand); margin: 0 0 8px; }
.j-best { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; margin: 6px 0 4px; border: 1.5px solid rgba(181, 83, 47, 0.4); border-radius: 8px; background: rgba(255, 236, 205, 0.45); }
.j-best canvas { width: 130px; height: auto; }
.j-best strong { display: block; font: 700 26px/1 var(--font-display); }
.j-best span { display: block; font: 14px/1.35 var(--font-hand); }
.j-sp-left { margin: 8px 0 0; font: 15px var(--font-hand); color: var(--ink-soft); }
.j-sp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 7px 0; border-bottom: 1px dashed var(--ink-faint); }
.j-sp strong { font: 700 22px/1.1 var(--font-display); }
.j-sp .j-n { font: 700 13px var(--font-ui); text-align: right; }
.j-sp .j-detail { grid-column: 1 / -1; font: 600 12px/1.4 var(--font-ui); color: var(--ink-soft); }
.j-filters { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 2px 0 8px; }
.j-filters label { display: flex; align-items: center; gap: 5px; font: 700 12px var(--font-ui); color: var(--ink-soft); }
.j-filters select { padding: 3px 6px; border: 1.5px solid var(--ink-faint); border-radius: 8px; background: rgba(255, 255, 255, 0.5); color: var(--ink); font: 600 13px var(--font-ui); }
#log-list { list-style: none; margin: 0; padding: 0; }
#log-list li { padding: 7px 0; border-bottom: 1px dashed var(--ink-faint); }
#log-list .l-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
#log-list strong { font: 700 21px/1.1 var(--font-display); }
#log-list .l-when { font: 700 11px var(--font-ui); color: var(--ink-soft); white-space: nowrap; }
#log-list .l-info { font: 14px/1.35 var(--font-hand); }
#log-list .l-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font: 700 10px/1.7 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase; background: rgba(53, 41, 31, 0.08); }
#log-list .l-tag.kept, #log-list .l-tag.cooked, #log-list .l-tag.eaten { background: rgba(181, 83, 47, 0.14); color: var(--stamp); }
#log-list .l-tag.sold { background: rgba(47, 111, 116, 0.14); color: #2f6f74; }
#log-list .l-empty { font: 15px var(--font-hand); color: var(--ink-soft); border: none; }
#log-more { margin-top: 10px; padding: 6px 14px; border: 1.5px solid var(--ink-faint); border-radius: 999px; background: rgba(255, 255, 255, 0.35); color: var(--ink); font: 700 13px var(--font-ui); cursor: pointer; }

/* A gentle "are you sure?" */
#confirm { z-index: 12; }
.confirm-inner { width: min(460px, 100%) !important; }
.confirm-inner p { font: 16px/1.45 var(--font-hand); margin: 10px 0 0; }
.confirm-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.pk-btn.danger { background: var(--stamp); border-color: var(--stamp); }
.j-settings label { display: flex; flex: 1 1 100%; align-items: center; gap: 10px; font: 700 13px var(--font-ui); color: var(--ink); }
.j-settings input[type="range"] { flex: 1; max-width: 220px; margin-left: auto; accent-color: var(--stamp); }
.j-settings button {
  padding: 7px 14px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.j-settings button:hover { background: rgba(255, 255, 255, 0.6); }

/* ---------- title ---------- */

#title {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  text-align: center;
  background: linear-gradient(to bottom, rgba(15, 27, 43, 0) 0%, rgba(15, 27, 43, 0.12) 45%, rgba(15, 27, 43, 0.55) 100%);
  transition: opacity 1.6s ease;
}
#title.gone { opacity: 0; pointer-events: none; }
#title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(76px, 14vw, 160px);
  line-height: 0.9;
  text-shadow: 0 4px 40px rgba(20, 20, 40, 0.3);
  animation: rise 1.6s ease both;
}
.t-sub {
  margin: 10px 0 0;
  font-family: var(--font-hand);
  font-size: clamp(17px, 2.4vw, 22px);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  animation: rise 1.6s 0.25s ease both;
}
#start-btn {
  margin-top: 26px;
  padding: 12px 38px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 249, 239, 0.94);
  color: #24324a;
  font: 800 16px var(--font-ui);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: rise 1.6s 0.45s ease both;
}
#start-btn:hover { background: #fff; }
.t-keys {
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px 14px;
  justify-content: center;
  align-items: center;
  margin: 30px auto 0;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--hud-veil);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  text-align: left;
  animation: rise 1.6s 0.6s ease both;
}
.t-keys dt { text-align: right; font-weight: 600; opacity: 0.9; }
.t-keys dd { margin: 0; opacity: 0.85; }
.t-pad { margin: 10px 0 0; font-size: 13px; opacity: 0.75; animation: rise 1.6s 0.65s ease both; }
.t-pad:empty { display: none; }
#meter-label .ml-sub { margin-top: 3px; font: 800 11px/1 var(--font-ui); opacity: 0.9; white-space: nowrap; }
/* Shorter screens: a more compact title so the settings line and offline status fit. */
@media (max-height: 780px) {
  #title h1 { font-size: clamp(60px, 12vh, 120px); }
  .t-keys { margin-top: 16px; padding: 10px 16px; gap: 4px 12px; font-size: 12.5px; }
  .t-note { margin-top: 10px; }
}
.t-offline { margin: 8px 0 0; font: 600 12px/1.4 var(--font-ui); color: rgba(255, 249, 239, 0.7); animation: rise 1.6s 0.9s ease both; }
.t-offline.ok::before { content: '✓ '; color: #9fd8a8; }
#clock-net { color: #ffd59a; opacity: 1; }
.t-note { margin-top: 14px; font-size: 13px; animation: rise 1.6s 0.7s ease both; color: rgba(255, 249, 239, 0.75); }
.t-quality {
  margin-left: 6px;
  padding: 3px 10px;
  border: 1px solid var(--hud-line);
  border-radius: 999px;
  background: var(--hud-veil);
  color: var(--hud-ink);
  font: 700 12px var(--font-ui);
  cursor: pointer;
}

/* ---------- touch controls ---------- */

#touch { display: none; }
body.touch.started #touch { display: block; }
body.touch .desk-only { display: none !important; }
body:not(.touch) .touch-only { display: none !important; }

#stick-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 60%;
  pointer-events: auto;
  touch-action: none;
}
#stick-base {
  position: absolute;
  left: calc(86px + env(safe-area-inset-left, 0px));
  top: calc(100% - 104px - env(safe-area-inset-bottom, 0px));
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 249, 239, 0.4);
  background: rgba(22, 30, 42, 0.2);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
#stick-zone.active #stick-base { opacity: 1; transition: none; }
#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 249, 239, 0.88);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

#act-btn {
  position: absolute;
  right: calc(32px + env(safe-area-inset-right, 0px));
  bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(255, 249, 239, 0.55);
  background: rgba(22, 30, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--hud-ink);
  font: 700 25px/1 var(--font-display);
  pointer-events: auto;
  touch-action: none;
  transition: transform 0.12s ease, background 0.2s ease;
}
#act-btn.down { transform: scale(0.93); background: rgba(255, 249, 239, 0.25); }
#act-btn.quiet { opacity: 0.55; }
#act-btn.urgent { background: var(--lantern); color: #3a2a14; border-color: var(--lantern); animation: bob 0.45s ease-in-out infinite alternate; }

#rest-btn {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  pointer-events: auto;
  touch-action: none;
}
#rest-btn.down { background: rgba(255, 201, 119, 0.45); }

/* Touch layout: buttons up top, thumbs at the bottom, hints under the clock. */
body.touch #corner { right: calc(64px + env(safe-area-inset-right, 0px)); }
body.touch #corner button { padding: 9px 12px; }
body.touch #bait {
  top: calc(136px + env(safe-area-inset-top, 0px));
  bottom: auto;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: min(260px, calc(100% - 32px));
}
body.touch { --finder-w: min(250px, 54vw); }
body.touch:has(#sonar.size-2) { --finder-w: min(380px, 92vw); }
body.touch #sonar {
  left: auto;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  width: var(--finder-w);
}
body.touch #view-chip { top: calc(236px + env(safe-area-inset-top, 0px)); bottom: auto; }
#cancel-btn {
  position: absolute;
  right: calc(136px + env(safe-area-inset-right, 0px));
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 249, 239, 0.5);
  background: rgba(22, 30, 42, 0.5);
  color: var(--hud-ink);
  font: 700 18px var(--font-ui);
  pointer-events: auto;
}
body.touch #hint {
  top: calc(100px + env(safe-area-inset-top, 0px));
  bottom: auto;
  transform: translateY(-8px);
  white-space: normal;
}
body.touch #hint.show { transform: none; }
body.touch #toast {
  top: auto;
  bottom: calc(200px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  transform: translateY(6px);
  text-align: center;
}
body.touch #toast.show { transform: none; }
body.touch #prompt { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); padding: 12px 20px; }
/* With the fish finder open in its corner, the prompt keeps to the space beside it.
   (Phones held sideways put the finder under the clock instead.) */
@media (min-height: 481px) {
  body.touch:has(#sonar:not([hidden], .floating)) #prompt {
    right: calc(var(--finder-w) + 16px + env(safe-area-inset-right, 0px));
    max-width: calc(100% - var(--finder-w) - 48px - env(safe-area-inset-right, 0px));
  }
}
body.touch #place { top: 20%; }
body.touch #meter {
  left: auto;
  right: calc(1px + env(safe-area-inset-right, 0px));
  bottom: calc(5px + env(safe-area-inset-bottom, 0px));
  width: 150px;
  height: 150px;
  transform: none;
}
body.touch #meter-label { display: none; }
body.touch #rest-veil { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, -46%) rotate(-3deg) scale(0.96); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } to { opacity: 1; transform: rotate(-4deg); } }
@keyframes bob { to { margin-top: -6px; } }
@keyframes glow {
  50% { background: rgba(255, 201, 119, 0.45); box-shadow: 0 0 22px rgba(255, 201, 119, 0.6); }
}

/* the journal book doesn't share the card's centring transform */
.book { animation-name: fade; }

@media (max-width: 560px) {
  #corner .label { display: none; }
}
#corner[data-fit='keys'] .label, #corner:is([data-fit='icons'], [data-fit='tight']) :is(.label, kbd) { display: none; }
#corner[data-fit='tight'] { gap: 4px; }
#corner[data-fit='tight'] > button.pill { padding-inline: 9px; }

/* Phones held sideways: little height, so the finder tucks under the clock and the view tip sits between the thumbs. */
@media (max-height: 480px) {
  body.touch #hint { top: calc(58px + env(safe-area-inset-top, 0px)); max-width: calc(100% - 360px); }
  body.touch #toast { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 360px); }
  body.touch #sonar {
    top: calc(98px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: calc(16px + env(safe-area-inset-left, 0px));
    right: auto;
    width: 186px;
    padding: 6px 8px 8px;
  }
  body.touch #sonar header { margin-bottom: 4px; }
  body.touch #view-chip {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 340px);
  }
}

@media (max-width: 900px) {
  #place { top: 19%; }
}

@media (max-width: 760px) {
  .book { grid-template-columns: 1fr; overflow-y: auto; }
  .page { overflow: visible; padding: 22px 20px; }
  .j-entry { grid-template-columns: 110px minmax(0, 1fr); }
  .j-entry canvas { width: 110px; }
  #clock .soft { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.j-best .j-label { display: block; font: 700 11px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--stamp); margin-bottom: 2px; }
#log-list .l-cond { color: var(--ink-soft); font-size: 13px; }

/* ---------------- Settings ---------------- */
#settings .sheet-inner { width: min(760px, 100%); }
#settings-body { display: grid; gap: 2px; margin-top: 10px; }
.st-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 8px 18px;
  padding: 10px 2px;
  border-bottom: 1px dashed rgba(53, 41, 31, 0.16);
}
.st-text { display: grid; gap: 2px; }
.st-label { font: 700 15px var(--font-ui); }
.st-desc { font: 13px/1.35 var(--font-ui); color: var(--ink-soft); }
.st-note { margin: 8px 2px; font: 14px/1.4 var(--font-hand); color: var(--ink-soft); }
.st-warn { padding: 8px 12px; border-left: 3px solid var(--stamp); background: rgba(181, 83, 47, 0.08); border-radius: 4px; color: var(--ink); }
.st-slider { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.st-slider input { flex: 1; accent-color: #5c4028; }
.st-slider output { width: 44px; text-align: right; font: 700 13px var(--font-ui); font-variant-numeric: tabular-nums; }
.st-stack { display: grid; gap: 6px; justify-items: end; }
.st-choice { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.st-choice button {
  padding: 6px 11px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.st-choice button:hover { background: rgba(53, 41, 31, 0.06); }
.st-choice button.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.st-weather { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.st-wcard {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.st-wcard strong { font: 700 18px/1 var(--font-display); }
.st-wcard small { font: 12.5px/1.35 var(--font-ui); color: var(--ink-soft); }
.st-wcard.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.st-wcard.on small { color: rgba(246, 239, 226, 0.8); }
.st-keyhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-keys { display: grid; gap: 2px; }
.st-keys h4 { margin: 10px 0 2px; font: 700 12px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.st-key { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; align-items: center; gap: 10px; padding: 4px 2px; font: 13.5px var(--font-ui); }
.st-keycaps { display: flex; gap: 4px; }
.st-key .pk-btn { padding: 4px 8px; font-size: 12px; }
.st-key.st-pad { grid-template-columns: minmax(0, 1fr) auto; }
.st-key .pk-btn.waiting { background: var(--lantern); border-color: var(--lantern); color: #3a2a14; }
.st-fixed { justify-self: center; font: 600 12px var(--font-ui); color: var(--ink-soft); }
@media (max-width: 620px) {
  .st-row { grid-template-columns: 1fr; }
  .st-choice { justify-content: flex-start; }
  .st-stack { justify-items: start; }
  .st-key { grid-template-columns: minmax(0, 1fr) auto; }
  .st-key .pk-btn, .st-fixed { grid-column: 2; }
}

/* Backpack: line and rig choices, and what won't work */
.pk-select {
  max-width: 100%;
  padding: 3px 6px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font: 600 12.5px var(--font-ui);
}
.pk-warn, .pk-block { margin: 6px 0 0; padding: 5px 8px; border-radius: 6px; font: 600 12.5px/1.35 var(--font-ui); }
.pk-warn { background: rgba(255, 196, 110, 0.25); color: #6a4a14; }
.pk-block { background: rgba(181, 83, 47, 0.14); color: var(--stamp); }
.pk-acts .pk-block { margin: 0; }
.pk-save { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pk-save input { flex: 1 1 160px; padding: 6px 8px; border: 1.5px solid var(--ink-faint); border-radius: 6px; background: rgba(255, 255, 255, 0.6); font: 600 13px var(--font-ui); color: var(--ink); }

/* ---------- the map ---------- */

#map .sheet-inner.map-inner { width: min(1100px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.map-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; margin-top: 10px; }
.map-frame { position: relative; min-height: 0; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(53, 41, 31, 0.35); background: #efe3c6; }
#map-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#map-canvas:active { cursor: grabbing; }
.map-zoom { position: absolute; left: 10px; top: 10px; display: grid; gap: 6px; }
.map-zoom button {
  width: 36px; height: 36px; border: 1.5px solid var(--ink); border-radius: 50%;
  background: rgba(243, 232, 207, 0.92); color: var(--ink); font: 700 20px/1 var(--font-ui); cursor: pointer;
}
.map-zoom button:hover { background: var(--paper-shade); }
.map-side { min-height: 0; overflow-y: auto; padding-right: 4px; }
.map-side h3:first-child { margin-top: 0; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.map-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 8px; padding: 6px 0; border-bottom: 1px dashed rgba(53, 41, 31, 0.16); }
.map-list li span { grid-column: 1; font: 13px/1.3 var(--font-ui); color: var(--ink-soft); }
.map-list li .pk-btn { grid-column: 2; grid-row: 1 / span 2; }
.map-list li.faint { display: block; font: 14px var(--font-hand); color: var(--ink-soft); border: none; }
.map-name { justify-self: start; padding: 0; border: none; background: none; color: var(--ink); font: 700 15px var(--font-ui); text-align: left; cursor: pointer; }
.map-name:hover { text-decoration: underline; }
.map-note { margin: 6px 0 0; font: 14px var(--font-hand); color: var(--ink-soft); }
.map-key { margin: 14px 0 0; font: 13px/2 var(--font-ui); color: var(--ink-soft); }
.map-key span { display: inline-block; vertical-align: middle; margin: 0 2px 0 8px; }
.map-key span:first-child { margin-left: 0; }
.mk-tent { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid #7f9a6a; }
.mk-dock { width: 14px; height: 5px; background: #a77746; outline: 1.5px solid var(--ink); }
.mk-x { font: 700 16px/1 var(--font-ui); color: var(--ink); }
.mk-fish { width: 10px; height: 6px; border-radius: 50%; background: #2f6f74; }
.mk-you { width: 10px; height: 10px; border-radius: 50%; background: #e8b440; outline: 2px solid var(--ink); }
@media (max-width: 760px) {
  #map .sheet-inner.map-inner { height: 100%; padding: 14px 14px 16px; }
  .map-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 1fr) auto; }
  .map-side { max-height: 34vh; }
  .sheet h2 { font-size: 32px; }
}

/* ---------- the backpack: opening your tackle ---------- */

#pack.gx {
  --gx-canvas: #545c3b;
  --gx-canvas-deep: #41472c;
  --gx-tray: #3a3f27;
  --gx-cream: #f4ead2;
  --gx-cream-2: #e9dcbc;
  --gx-cream-3: #dccba4;
  --gx-ink: #33281e;
  --gx-ink-soft: #66543f;
  --gx-on: #3f6f2f;
  --gx-other: #8a5a12;
  --gx-no: #a3401f;
  --gx-sel: #d9963a;
  padding: 12px;
}
#pack .gx-inner {
  width: min(1360px, 100%);
  height: min(880px, 100%);
  max-height: none;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
  color: var(--gx-cream);
  user-select: none;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.035) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 20% 0%, rgba(255, 240, 200, 0.12), transparent 60%),
    var(--gx-canvas);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 5px #3b3020, inset 0 0 0 1px rgba(255, 240, 200, 0.12);
}

/* The label at the top: what this is and where you are. */
#pack .gx-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; padding: 12px 14px 8px; }
.gx-label {
  flex: 1;
  min-width: 0;
  padding: 8px 16px 9px;
  border-radius: 5px;
  color: var(--gx-ink);
  background: linear-gradient(180deg, #f8f0dc, var(--gx-cream));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(110, 85, 50, 0.25);
}
#pack .gx-label h2 { margin: 0; font: 700 32px/1 var(--font-display); }
.gx-label p { margin: 2px 0 0; font: 13.5px/1.35 var(--font-ui); color: var(--gx-ink-soft); }
.gx-caps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gx-caps li {
  display: grid;
  justify-items: center;
  min-width: 58px;
  padding: 4px 8px 5px;
  border-radius: 6px;
  background: var(--gx-canvas-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.18);
}
.gx-caps span { font: 700 10.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #d9cfae; }
.gx-caps b { font: 800 17px/1.1 var(--font-ui); color: var(--gx-cream); font-variant-numeric: tabular-nums; }
.gx-caps li.full b { color: #ffd38a; }
.gx-close {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--gx-cream);
  color: var(--gx-ink);
  font: 400 28px/1 var(--font-ui);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.gx-close:hover { background: #fff7e4; }

/* Category tabs, like labels on the drawers of a tackle box. */
.gx-cats { display: flex; gap: 4px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.gx-cats::-webkit-scrollbar { display: none; }
.gx-cat {
  flex: none;
  padding: 8px 14px 9px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: rgba(0, 0, 0, 0.16);
  color: #eee3c6;
  font: 700 14px var(--font-ui);
  cursor: pointer;
}
.gx-cat:hover { background: rgba(0, 0, 0, 0.26); }
.gx-cat[aria-selected="true"] { background: var(--gx-tray); color: #fff6dc; box-shadow: inset 0 3px 0 var(--gx-sel); }
.gx-panes { display: none; }

.gx-body {
  display: grid;
  grid-template-columns: minmax(330px, 1.05fr) minmax(360px, 1.15fr) minmax(260px, 300px);
  gap: 12px;
  min-height: 0;
  padding: 0 12px 10px;
}
.gx-browser, .gx-inspect, .gx-setup { min-height: 0; border-radius: 0 8px 8px 8px; }

/* The browser: a tackle tray of compartments. */
.gx-browser {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--gx-tray);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.1), inset 0 8px 18px rgba(0, 0, 0, 0.25);
}
.gx-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.gx-search {
  flex: 1 1 120px;
  min-width: 100px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 240, 200, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--gx-cream);
  font: 600 13px var(--font-ui);
}
.gx-search::placeholder { color: #bfb393; }
.gx-seg { display: inline-flex; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.25); }
.gx-seg .gx-chip { border-radius: 0; box-shadow: none; }
.gx-chip {
  position: relative;
  padding: 5px 11px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, 0.25);
  color: #eee3c6;
  font: 700 12.5px var(--font-ui);
  cursor: pointer;
}
.gx-chip:hover { background: rgba(0, 0, 0, 0.3); }
.gx-chip.on { background: var(--gx-cream); color: var(--gx-ink); }
.gx-grid { overflow-y: auto; padding: 0 10px 14px; overscroll-behavior: contain; scrollbar-color: rgba(255, 240, 200, 0.3) transparent; }
#pack .gx-sec { margin: 12px 2px 7px; font: 800 11.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #e2d6b4; }
.gx-sec.box { color: #c9bd9a; }
.gx-note { margin: 2px 2px 8px; font: 13px/1.4 var(--font-ui); color: #d8ccaa; }
.gx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.gx-tiles.wide { grid-template-columns: 1fr; }
.gx-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 1px;
  padding: 6px 7px 7px;
  border: none;
  border-radius: 8px;
  text-align: left;
  color: var(--gx-ink);
  background: linear-gradient(180deg, #f6eed9, var(--gx-cream-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 0 rgba(0, 0, 0, 0.08), 0 2px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gx-tile:hover { transform: translateY(-1px); }
.gx-tile:focus-visible { outline: 3px solid #ffe2a8; outline-offset: 2px; }
.gx-tile.is-sel { box-shadow: 0 0 0 3px var(--gx-sel), 0 4px 10px rgba(0, 0, 0, 0.35); }
.gx-tile.is-box { background: linear-gradient(180deg, #ece2c8, #ddd0ae); }
.gx-pic {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 42%, #fffaf0, #efe3c6 62%, #e3d4b0);
  box-shadow: inset 0 0 0 1px rgba(110, 85, 50, 0.14);
  overflow: hidden;
}
.gx-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gx-pic img.loading { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent) -100% 0 / 60% 100% no-repeat; animation: gx-shimmer 1.2s infinite; }
@keyframes gx-shimmer { to { background-position: 200% 0; } }
.gx-name { margin-top: 4px; font: 800 13.5px/1.2 var(--font-ui); }
.gx-spec { font: 600 12px/1.3 var(--font-ui); color: var(--gx-ink-soft); }
.gx-state { margin-top: 3px; font: 800 11.5px/1.2 var(--font-ui); color: var(--gx-ink-soft); }
.gx-state i { font-style: normal; display: inline-block; width: 1.1em; text-align: center; }
.gx-state.on { color: var(--gx-on); }
.gx-state.other { color: var(--gx-other); }
.gx-state.no { color: var(--gx-no); }
.gx-state.box { color: #6f5f48; }
.gx-tile.is-on::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--gx-on);
}
/* Rods: the handle and reel close up beside a strip of the whole rod. */
.gx-tile.rod { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto auto auto auto; column-gap: 10px; }
.gx-tile.rod .gx-pic { grid-row: 1 / 4; aspect-ratio: auto; display: contents; }
.gx-tile.rod .gx-close-img {
  grid-row: 1 / 4;
  width: 112px;
  height: 84px;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 42%, #fffaf0, #efe3c6 62%, #e3d4b0);
}
.gx-tile.rod .gx-full-img {
  grid-column: 1 / 3;
  grid-row: 4;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 96;
  margin-top: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbf4e3, #ece0c2);
}
.gx-tile.rod .gx-name, .gx-tile.rod .gx-spec, .gx-tile.rod .gx-state { grid-column: 2; }
.gx-tile.rod .gx-name { font-size: 15px; }
.gx-pic .gx-half { width: 50%; height: 100%; display: inline-block; }

/* The selected piece: lit like a photograph, with what it is and what to do with it. */
.gx-inspect {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  color: var(--gx-ink);
  background: var(--gx-cream);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(110, 85, 50, 0.2);
}
.gx-stage {
  position: relative;
  height: clamp(190px, 36vh, 340px);
  background:
    linear-gradient(180deg, transparent 84%, rgba(120, 86, 52, 0.18) 84%, rgba(120, 86, 52, 0.28) 100%),
    radial-gradient(ellipse at 50% 40%, #fffcf3 0%, #f5ead1 45%, #e2d1aa 100%);
  border-bottom: 1px solid rgba(110, 85, 50, 0.25);
}
.gx-stage.long { height: clamp(150px, 26vh, 220px); }
.gx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.gx-stage.long .gx-canvas { cursor: default; }
.gx-canvas:active { cursor: grabbing; }
.gx-canvas:focus-visible { outline: 3px solid var(--gx-sel); outline-offset: -3px; }
.gx-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.gx-tools .gx-chip { background: rgba(244, 234, 210, 0.85); color: var(--gx-ink); box-shadow: inset 0 0 0 1px rgba(110, 85, 50, 0.35); }
.gx-tools .gx-chip.on { background: var(--gx-ink); color: var(--gx-cream); }
.gx-icon { width: 30px; padding: 5px 0; text-align: center; font-size: 15px; }
.gx-hint { position: absolute; left: 10px; bottom: 6px; font: 600 11.5px var(--font-ui); color: rgba(60, 45, 30, 0.6); pointer-events: none; }
.gx-info { overflow-y: auto; padding: 12px 18px 10px; user-select: text; overscroll-behavior: contain; }
.gx-kicker { margin: 0; font: 800 11px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gx-ink-soft); }
#pack .gx-title { margin: 2px 0 4px; font: 700 28px/1.05 var(--font-display); }
.gx-desc { margin: 0 0 8px; font: 14px/1.45 var(--font-ui); }
.gx-specs { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 10px; font: 13px/1.35 var(--font-ui); }
.gx-specs dt { color: var(--gx-ink-soft); font-weight: 700; }
.gx-specs dd { margin: 0; font-weight: 600; }
.gx-checks { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; font: 13px/1.4 var(--font-ui); }
.gx-checks li { display: grid; grid-template-columns: 20px 1fr; align-items: start; padding: 4px 8px 4px 6px; border-radius: 6px; background: rgba(53, 41, 31, 0.05); }
.gx-checks i { font-style: normal; font-weight: 900; text-align: center; }
.gx-checks .ok i { color: var(--gx-on); }
.gx-checks .warn { background: rgba(232, 168, 60, 0.18); }
.gx-checks .warn i { color: #9a5a0a; }
.gx-checks .no { background: rgba(163, 64, 31, 0.12); }
.gx-checks .no i { color: var(--gx-no); }
.gx-checks .info i { color: var(--gx-ink-soft); }
.gx-compare { width: 100%; margin: 0 0 6px; border-collapse: collapse; font: 13px/1.3 var(--font-ui); }
.gx-compare caption { text-align: left; font: 800 11px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gx-ink-soft); padding-bottom: 4px; }
.gx-compare th, .gx-compare td { padding: 4px 6px; border-top: 1px dashed rgba(53, 41, 31, 0.18); text-align: left; }
.gx-compare tr:first-of-type th { border-top: none; font-weight: 800; }
.gx-compare th { color: var(--gx-ink-soft); font-weight: 700; }
.gx-compare td.new { font-weight: 800; }
.gx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  background: var(--gx-cream-2);
  border-top: 1px solid rgba(110, 85, 50, 0.25);
}
.gx-actions .pk-btn { padding: 8px 16px; font-size: 14px; }
.gx-go { background: var(--gx-on); border-color: var(--gx-on); }
.gx-go:hover { background: #355f27; }
.gx-go:disabled { opacity: 1; background: transparent; color: var(--gx-ink-soft); border-color: rgba(53, 41, 31, 0.3); }
.gx-why { flex: 1 1 100%; margin: 0; font: 600 12.5px/1.35 var(--font-ui); color: var(--gx-ink-soft); }
.gx-save { display: flex; flex: 1 1 100%; gap: 6px; }
.gx-save input { flex: 1; min-width: 0; padding: 6px 10px; border: 1.5px solid rgba(53, 41, 31, 0.3); border-radius: 999px; background: #fffaf0; color: var(--gx-ink); font: 600 13px var(--font-ui); }
.gx-empty { padding: 20px; color: var(--gx-ink-soft); }

/* Your setup: the rod in hand and what's rigged on it, joined by the line. */
.gx-setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 10px 10px 12px;
  border-radius: 8px;
  color: var(--gx-ink);
  background: linear-gradient(180deg, #ece0c4, #e2d3b0);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(110, 85, 50, 0.2);
  overscroll-behavior: contain;
}
.gx-rodhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
#pack .gx-rodhead h3 { margin: 0; font: 700 22px/1 var(--font-display); }
.gx-rodhead .gx-chip { background: var(--gx-ink); color: var(--gx-cream); box-shadow: none; }
.gx-chain { position: relative; display: grid; gap: 6px; margin: 0; padding: 0 0 0 0; list-style: none; }
.gx-chain::before {
  content: '';
  position: absolute;
  left: 33px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: repeating-linear-gradient(180deg, rgba(53, 41, 31, 0.45) 0 6px, rgba(53, 41, 31, 0.2) 6px 9px);
}
.gx-link {
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 8px;
  text-align: left;
  color: var(--gx-ink);
  background: rgba(255, 250, 238, 0.85);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(110, 85, 50, 0.16);
  cursor: pointer;
  transition: box-shadow 0.12s ease, background 0.12s ease;
}
.gx-link:hover { background: #fffaf0; }
.gx-link:focus-visible { outline: 3px solid var(--gx-sel); outline-offset: 1px; }
.gx-link.viewing { box-shadow: 0 0 0 2px var(--gx-ink); }
.gx-link.changing { box-shadow: 0 0 0 2px var(--gx-sel); background: #fff3dc; }
.gx-link.flash { animation: gx-flash 1.2s ease; }
@keyframes gx-flash { 0% { background: #d8ecc8; } 100% { background: rgba(255, 250, 238, 0.85); } }
.gx-lpic { display: block; width: 66px; height: 50px; border-radius: 6px; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #fffaf0, #efe3c6 70%); }
.gx-lpic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gx-ltxt { display: grid; min-width: 0; }
.gx-ltxt small { font: 800 10.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gx-ink-soft); }
.gx-ltxt b { font: 800 13.5px/1.2 var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-ltxt > span { font: 600 12px/1.3 var(--font-ui); color: var(--gx-ink-soft); }
.gx-ltxt .gx-next { color: #8a5a12; font-weight: 800; }
.gx-next i { font-style: normal; }
.gx-chain.compact .gx-link { grid-template-columns: 54px minmax(0, 1fr); }
.gx-chain.compact .gx-lpic { width: 54px; height: 40px; }
.gx-chain.compact::before { left: 27px; }
.gx-sum { margin: 2px 2px 0; font: 600 12.5px/1.4 var(--font-ui); color: var(--gx-ink-soft); }
.gx-warn { margin: 0; padding: 5px 8px; border-radius: 6px; font: 600 12.5px/1.35 var(--font-ui); }
.gx-warn.warn { background: rgba(232, 168, 60, 0.22); color: #6a4a14; }
.gx-warn.block { background: rgba(163, 64, 31, 0.14); color: var(--gx-no); }
.gx-more { margin-top: 4px; border-radius: 8px; background: rgba(255, 250, 238, 0.55); box-shadow: inset 0 0 0 1px rgba(110, 85, 50, 0.16); }
.gx-more summary { padding: 7px 10px; font: 800 13px var(--font-ui); cursor: pointer; list-style-position: inside; }
.gx-more summary span { color: var(--gx-ink-soft); font-weight: 700; }
.gx-creel, .gx-travel { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.gx-fish { padding: 3px 10px; border-radius: 999px; background: rgba(53, 41, 31, 0.08); font: 700 12px var(--font-ui); }
.gx-travel .gx-note { flex: 1 1 100%; margin: 0; color: var(--gx-ink-soft); }
.gx-keys { margin: auto 2px 0; padding-top: 6px; font: 600 12px var(--font-ui); color: var(--gx-ink-soft); }
.gx-status { min-height: 0; margin: 0; padding: 0 16px 8px; font: 700 13px var(--font-ui); color: #f6ecd2; }
.gx-status:empty { padding-bottom: 4px; }

/* Tooltips that also show on keyboard focus. */
#pack [data-tip]:hover::after, #pack [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--gx-ink);
  color: var(--gx-cream);
  font: 700 11.5px var(--font-ui);
  white-space: nowrap;
  pointer-events: none;
}

/* Medium windows: the browser on the left, the selected piece above your setup on the right. */
@media (max-width: 1179px) {
  .gx-body { grid-template-columns: minmax(300px, 1fr) minmax(330px, 1.1fr); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); }
  .gx-browser { grid-row: 1 / 3; }
  .gx-inspect { grid-column: 2; grid-row: 1; }
  .gx-setup { grid-column: 2; grid-row: 2; }
  .gx-stage { height: clamp(150px, 26vh, 260px); }
  .gx-caps li { min-width: 50px; }
}
/* Narrow: one panel at a time, chosen with tabs. */
@media (max-width: 819px) {
  #pack.gx { padding: 0; }
  #pack .gx-inner { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
  #pack .gx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 10px 6px; gap: 8px; }
  .gx-label { padding: 6px 12px 7px; }
  #pack .gx-label h2 { font-size: 24px; }
  .gx-label p { display: none; }
  .gx-caps { grid-column: 1 / 3; grid-row: 2; }
  .gx-caps li { flex: 1; grid-auto-flow: column; gap: 6px; align-items: baseline; }
  .gx-caps li { min-width: 0; padding: 3px 6px; }
  .gx-caps span { font-size: 9.5px; }
  .gx-caps b { font-size: 14px; }
  .gx-cats { padding: 0 10px; }
  .gx-cat { padding: 7px 11px 8px; font-size: 13px; }
  .gx-panes { display: flex; gap: 6px; padding: 8px 10px 6px; }
  .gx-panes button { flex: 1; padding: 6px 8px; border: none; border-radius: 999px; background: rgba(0, 0, 0, 0.2); color: #eee3c6; font: 800 13px var(--font-ui); }
  .gx-panes button[aria-pressed="true"] { background: var(--gx-cream); color: var(--gx-ink); }
  .gx-body { display: block; padding: 0 10px 8px; }
  .gx-body > * { height: 100%; }
  .gx-body:not([data-pane="browse"]) .gx-browser,
  .gx-body:not([data-pane="inspect"]) .gx-inspect,
  .gx-body:not([data-pane="setup"]) .gx-setup { display: none; }
  .gx-stage { height: clamp(160px, 32vh, 260px); }
  .gx-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

.reduce-motion #pack *, .reduce-motion #pack *::before { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  #pack *, #pack *::before { transition: none !important; animation: none !important; }
}
.gx-pic.stack { display: grid; grid-template-rows: 1fr 1fr; align-items: center; padding: 2px 0; }
.gx-pic .gx-strip { width: 100%; height: 100%; object-fit: contain; }
.gx-kit { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin: 0 0 10px; }
.gx-kit-item { margin: 0; padding: 3px; border-radius: 6px; background: radial-gradient(ellipse at 50% 40%, #fffaf0, #eadcbc); text-align: center; }
.gx-kit-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }
.gx-kit-item figcaption { font: 700 11px/1.2 var(--font-ui); color: var(--gx-ink-soft); }

/* ---------- the field guide (in the journal) ---------- */

.gx-targets { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 0 10px; font: 700 12px var(--font-ui); color: var(--gx-ink-soft); }
.gx-targets .gx-target { background: rgba(53, 41, 31, 0.08); color: var(--gx-ink); box-shadow: inset 0 0 0 1px rgba(53, 41, 31, 0.2); }
.gx-targets .gx-target:hover { background: rgba(53, 41, 31, 0.16); }
#pack .gx-guidebtn { flex: none; padding: 8px 14px; background: var(--gx-cream); color: var(--gx-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }

.g-head h2 { margin-bottom: 2px; }
.g-sum { margin: 0 0 8px; font: 600 12.5px/1.4 var(--font-ui); color: var(--ink-soft); }
.g-tools { display: grid; gap: 6px; margin-bottom: 6px; }
.g-search { padding: 6px 12px; border: 1.5px solid var(--ink-faint); border-radius: 999px; background: rgba(255, 255, 255, 0.55); color: var(--ink); font: 600 13px var(--font-ui); }
.g-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.g-chip, .g-btn {
  padding: 4px 10px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font: 700 12px var(--font-ui);
  cursor: pointer;
}
.g-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.g-chip.planned { border-style: dashed; }
.g-btn { padding: 6px 14px; font-size: 13px; }
.g-btn.go { background: #3f6f2f; border-color: #3f6f2f; color: #fff8e6; }
.g-chip:focus-visible, .g-btn:focus-visible, .g-card:focus-visible, .g-canvas:focus-visible { outline: 3px solid #d9963a; outline-offset: 2px; }
.page h3.g-group { margin: 14px 0 6px; font-size: 22px; color: var(--ink-soft); }
.g-list { display: grid; gap: 6px; }
.g-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 5px 8px 5px 5px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.g-card:hover { background: rgba(255, 255, 255, 0.6); }
.g-card.on { border-color: var(--stamp); background: rgba(255, 236, 205, 0.6); }
.g-card.plan { opacity: 0.85; border-style: dashed; border-color: var(--ink-faint); }
.g-pic { display: block; width: 112px; height: 68px; border-radius: 7px; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #fffaf0, #eadfc4 75%); }
.g-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.g-pic img.loading { opacity: 0; }
.g-nomodel { display: grid; place-items: center; height: 100%; font: 700 11px var(--font-ui); color: var(--ink-faint); }
.g-ctxt { display: grid; gap: 1px; min-width: 0; }
.g-ctxt b { font: 700 20px/1.05 var(--font-display); }
.g-ctxt i { font: italic 12.5px var(--font-ui); color: var(--ink-soft); }
.g-status { font: 800 11px var(--font-ui); letter-spacing: 0.02em; color: var(--ink-soft); }
.g-status.catchable { color: #3f6f2f; }
.g-status.planned, .g-status.verify { color: #8a5a12; }
.g-back { display: none; }
.g-title h2 { margin: 0; }
.g-sci { margin: 0; font: 600 15px var(--font-ui); color: var(--ink-soft); }
.g-sci .g-auth { font-weight: 500; font-size: 13px; }
.g-badge { display: inline-block; margin: 6px 0 4px; padding: 2px 10px; border-radius: 999px; font: 800 11.5px var(--font-ui); background: rgba(63, 111, 47, 0.14); color: #2f5a22; }
.g-badge.planned, .g-badge.verify { background: rgba(138, 90, 18, 0.14); color: #6a4410; }
.g-badge.observation { background: rgba(47, 90, 106, 0.14); color: #2f5a6a; }
.g-badge.retired { background: rgba(58, 46, 38, 0.1); color: #5a4a3e; }
.g-warn { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: rgba(232, 168, 60, 0.18); font: 600 13px/1.4 var(--font-ui); color: #6a4a14; }
.g-names { display: grid; grid-template-columns: max-content 1fr; gap: 1px 12px; margin: 6px 0; font: 13px var(--font-ui); }
.g-names dt { font-weight: 800; color: var(--ink-soft); }
.g-names dd { margin: 0; font-weight: 600; }
.g-stage { position: relative; margin: 8px 0 4px; border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #fffcf3, #efe3c6 60%, #e0cfa8); box-shadow: inset 0 0 0 1px rgba(110, 85, 50, 0.2); }
.g-canvas { display: block; width: 100%; height: 220px; cursor: grab; touch-action: none; }
.g-canvas:active { cursor: grabbing; }
.g-stools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.g-ruler { display: grid; gap: 1px; padding: 6px 10px 8px; font: 600 12.5px/1.35 var(--font-ui); color: var(--ink-soft); background: rgba(255, 255, 255, 0.35); }
.page h4 { margin: 10px 0 4px; font: 800 12px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.g-text { margin: 0 0 6px; font: 16px/1.4 var(--font-hand); }
.g-feat { margin: 0 0 6px; padding-left: 18px; font: 13.5px/1.45 var(--font-ui); }
.g-facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 8px; font: 13.5px/1.4 var(--font-ui); }
.g-facts dt { font-weight: 800; color: var(--ink-soft); }
.g-facts dd { margin: 0; font-weight: 600; }
.g-map { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: start; margin: 4px 0 8px; }
.g-mini { width: 140px; height: 200px; border-radius: 6px; }
.g-mapside { display: grid; gap: 8px; justify-items: start; }
.g-note { margin: 0 0 6px; font: 600 12.5px/1.45 var(--font-ui); color: var(--ink-soft); }
.g-regions { width: 100%; border-collapse: collapse; margin: 0 0 6px; font: 13px var(--font-ui); }
.g-regions th, .g-regions td { padding: 3px 4px; border-bottom: 1px dashed var(--ink-faint); text-align: left; }
.g-regions th { font-weight: 700; }
.g-regions td { font-weight: 800; }
.g-regions .st-resident { color: #2f5a22; }
.g-regions .st-seasonal { color: #2f5a6a; }
.g-regions .st-occasional { color: #8a5a12; }
.g-regions .st-absent, .g-regions .st-unknown { color: var(--ink-faint); }
.g-rec { margin: 6px 0 8px; padding: 8px 10px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.4); box-shadow: inset 0 0 0 1px rgba(110, 85, 50, 0.2); }
.g-rec h4 { margin-top: 0; }
.g-chain { display: grid; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.g-chain li { display: grid; grid-template-columns: 60px 70px 1fr; align-items: center; gap: 8px; font: 13px var(--font-ui); }
.g-chain li:not(:has(img))::before { content: ''; width: 60px; }
.g-chain small { font: 800 10.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.g-chain b { font-weight: 700; }
.g-timg { width: 60px; height: 45px; object-fit: contain; border-radius: 5px; background: radial-gradient(ellipse at 50% 45%, #fffaf0, #eadfc4 75%); }
.g-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.g-ok { font: 800 13px var(--font-ui); color: #3f6f2f; }
.g-miss { flex: 1 1 100%; margin: 0; font: 600 13px/1.4 var(--font-ui); color: #6a4410; }
/* Planning a trip */
.g-planbar { margin: 2px 0 8px; }
.g-tripback { margin-bottom: 6px; }
.g-step { margin: 14px 0 6px; }
.g-tripnow { background: rgba(240, 180, 140, 0.18); box-shadow: inset 0 0 0 1px rgba(181, 83, 47, 0.3); }
.g-places { gap: 5px; }
.g-place {
  display: grid; gap: 1px; width: 100%; padding: 6px 9px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--ink-faint); border-radius: 9px; background: rgba(255, 255, 255, 0.45); color: var(--ink);
  font: 13px var(--font-ui);
}
.g-place b { font-weight: 800; }
.g-place span { color: var(--ink-soft); font-size: 12px; }
.g-place.on { border-color: #b5532f; background: rgba(240, 180, 140, 0.25); }
.g-place:focus-visible { outline: 3px solid #d9963a; outline-offset: 2px; }
.g-chain li .g-have { grid-column: 3; font: 700 11.5px var(--font-ui); color: #8a5a12; }
.g-chain li .g-have.ok { color: #3f6f2f; }
.g-chain li:has(.g-have) { grid-template-rows: auto auto; }
.g-sources { margin: 12px 0 0; font: 13px/1.45 var(--font-ui); }
.g-sources summary { cursor: pointer; font-weight: 800; }
.g-sources ul { margin: 6px 0; padding-left: 18px; }
.g-sources a { color: #2f5a6a; word-break: break-word; }
.g-flash { margin: 6px 0 0; font: 700 13px var(--font-ui); color: #3f6f2f; }
@media (max-width: 760px) {
  .book[data-view="guide"] .j-guide-view { grid-column: 1 / -1; }
  .book[data-view="guide"]:not([data-gpane="page"]) .j-guide-view.right { display: none; }
  .book[data-view="guide"][data-gpane="page"] .j-guide-view.left { display: none; }
  .book[data-view="guide"][data-gpane="page"] .g-back { display: inline-block; margin-bottom: 6px; }
}
/* (The little map keeps its places beside it until a phone's width.) */
@media (max-width: 480px) {
  .g-map { grid-template-columns: 1fr; }
}

.st-sub { margin: 18px 0 4px; font: 800 13px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.st-compass { flex-wrap: wrap; }
.st-compass button { min-width: 44px; }

/* ---------------- Life on the Coast: your camp ---------------- */

/* Pitching a camp: a small paper panel low on the screen, clear of the view. */
.place-panel {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 12px 16px 10px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 30;
}
.place-panel h2 { margin: 0 0 4px; font: 700 28px/1 var(--font-display); }
.pl-status { margin: 0; font: 16px/1.35 var(--font-hand); padding-left: 22px; position: relative; min-height: 2.6em; }
.pl-status::before { position: absolute; left: 0; top: 0; font: 800 16px var(--font-ui); }
.pl-status.ok::before { content: '✓'; color: #3f7f4a; }
.pl-status.warn::before { content: '!'; color: #b07a12; left: 5px; }
.pl-status.bad::before { content: '✕'; color: #b5532f; }
.pl-warn { margin: 2px 0 0; font: 700 12.5px var(--font-ui); color: #8a5a12; }
.pl-warn:empty { display: none; }
.pl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.pl-tools > button:not(.pk-btn) {
  width: 38px; height: 34px; border-radius: 8px; border: 1.5px solid var(--ink-faint);
  background: transparent; color: var(--ink); font: 800 18px var(--font-ui); cursor: pointer;
}
.pl-tools > button:not(.pk-btn):hover { background: rgba(53, 41, 31, 0.07); }
#pl-ok { margin-left: auto; }
/* While choosing a spot, the fish finder and the cast button step aside (the panel pitches). */
body.placing #sonar, body.placing #act-btn, body.placing #cancel-btn { visibility: hidden; }
.pl-keys { margin: 8px 0 0; font: 600 12px var(--font-ui); color: var(--ink-soft); }
@media (max-width: 520px) {
  .place-panel { padding: 10px 12px 8px; }
  .place-panel h2 { font-size: 24px; }
  #pl-ok { margin-left: 0; }
}

/* The camp sheet: your camp's own controls. */
.cp-stove { width: 14px; height: 14px; border-radius: 50%; background: #9a9086; }
.cp-stove.lit { background: #7fb4ff; box-shadow: 0 0 10px #7fb4ff; }
.cp-name input {
  flex: 1 1 200px; min-width: 0; padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--ink-faint);
  background: rgba(255, 255, 255, 0.5); color: var(--ink); font: 18px var(--font-hand);
}
.cp-choice { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; }
.cp-choice .chip { padding: 4px 11px; font-size: 12.5px; background: transparent; color: var(--ink); border-color: var(--ink-faint); }
.cp-choice .chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cp-acts { gap: 8px; }
.cp-pack { padding: 10px 12px; border-radius: 8px; background: rgba(181, 83, 47, 0.08); box-shadow: inset 0 0 0 1px rgba(181, 83, 47, 0.25); }
.cp-pack p { margin: 0 0 6px; font: 15px/1.35 var(--font-hand); }
.cp-check { display: flex; gap: 8px; align-items: center; padding: 3px 0; font: 600 13px var(--font-ui); }

/* The camping kit, and the clothes, water and food, in the backpack (one column of rows). */
.gx-kit { display: grid; gap: 6px; }
#pack-kit, #pack-wear { grid-template-columns: minmax(0, 1fr); }
#pack-wear .pk-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--gx-accent, #b5532f); }
.gx-kit-text { margin: 0; font: 600 12.5px/1.4 var(--font-ui); }
.gx-kit-note { margin: 0; font: 500 12px/1.4 var(--font-ui); color: var(--gx-ink-soft); }
#pack-kit .gx-note { margin: 0; color: var(--gx-ink-soft); }
.gx-kit-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-kit-acts:empty { display: none; }

/* A text box in a question (naming your camp). */
#confirm-input {
  width: 100%; margin: 4px 0 12px; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--ink-faint);
  background: rgba(255, 255, 255, 0.55); color: var(--ink); font: 20px var(--font-hand);
}

/* ---------------- Life on the Coast: photographs, the board, memories, marks ---------------- */

/* Photo mode: a quiet frame over the view (the picture itself never includes it). */
.photo-frame { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.photo-frame::before {
  content: ''; position: absolute; inset: 18px; border: 2px solid rgba(255, 249, 239, 0.75); border-radius: 6px;
  box-shadow: 0 0 0 100vmax rgba(10, 16, 24, 0.12);
}
.pf-thirds { position: absolute; inset: 18px; background:
  linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 249, 239, 0.28) calc(33.33% - 0.5px), rgba(255, 249, 239, 0.28) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 249, 239, 0.28) calc(66.66% - 0.5px), rgba(255, 249, 239, 0.28) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
  linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 249, 239, 0.28) calc(33.33% - 0.5px), rgba(255, 249, 239, 0.28) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 249, 239, 0.28) calc(66.66% - 0.5px), rgba(255, 249, 239, 0.28) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)); }
.pf-hint { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); margin: 0; padding: 5px 12px; border-radius: 999px; background: var(--hud-veil); color: var(--hud-ink); font: 600 13px var(--font-ui); white-space: nowrap; }
.pf-acts { position: absolute; bottom: 30px; left: 30px; right: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: none; }
.pf-acts .pk-btn { padding: 8px 16px; font-size: 14px; white-space: nowrap; pointer-events: auto; }
.pf-acts .pk-btn.quiet { background: rgba(243, 232, 207, 0.85); }
@media (max-width: 560px) { .pf-hint { white-space: normal; width: calc(100% - 60px); text-align: center; } }

.photo-card { z-index: 40; width: min(520px, calc(100vw - 32px)); }
.photo-card img { display: block; width: 100%; border: 8px solid #fbf8f0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.photo-card input, .mem-viewer input {
  width: 100%; margin: 12px 0 4px; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--ink-faint);
  background: rgba(255, 255, 255, 0.55); color: var(--ink); font: 18px var(--font-hand);
}
.photo-card p { font: 15px/1.35 var(--font-hand); margin: 6px 0 10px; }
#cc-photo { background: transparent; }

/* The notice board. */
#board .sheet-inner { width: min(820px, 100%); }
.board-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.board-cols p { margin: 0 0 6px; font: 15px/1.4 var(--font-hand); }
.board-fish { padding: 6px 0; border-bottom: 1px dashed var(--ink-faint); }
.board-fish b { font: 700 15px var(--font-ui); }
.board-fish .pk-btn { font-size: 12px; padding: 3px 10px; }
.board-notices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.board-note { padding: 10px 12px; background: #fbf5e3; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); transform: rotate(-0.6deg); display: grid; gap: 8px; }
.board-note:nth-child(2n) { transform: rotate(0.8deg); }
.board-note.done { opacity: 0.75; }
.board-note-title { border: none; background: none; padding: 0; text-align: left; font: 700 20px var(--font-display); color: var(--ink); cursor: pointer; }
.board-note-title:hover { text-decoration: underline; }
@media (max-width: 640px) { .board-cols { grid-template-columns: 1fr; } }

/* The harbour: the fish market and the inns. */
#harbour .sheet-inner { width: min(640px, 100%); }
.hb-purse { margin: 4px 0 0; font: 700 14px var(--font-ui); color: var(--ink-soft); }
.hb-say { margin: 10px 0 6px; font: italic 16px/1.4 var(--font-hand); color: var(--ink-soft); }
.hb-slate { margin: 8px 0; padding: 10px 14px; background: #2b2f2e; color: #efefe6; border: 6px solid #6a503b; border-radius: 4px; }
.hb-slate h3 { margin: 0 0 4px; color: #efefe6; }
.hb-slate p { margin: 2px 0; font: 600 16px/1.35 var(--font-hand); }
.hb-hint { flex-basis: 100%; color: #2f6f74; }
.hb-done { font: 700 13px var(--font-ui); color: #2f6f74; }
.hb-warn { font: 700 13px var(--font-ui); color: var(--stamp); min-width: 10px; }
.hb-story { margin: 6px 0 10px; padding: 8px 14px; border-left: 3px solid var(--ink-faint); font: 17px/1.45 var(--font-hand); }
.hb-rumour { margin: 0; padding: 6px 0; border-bottom: 1px dashed var(--ink-faint); font: 16px/1.4 var(--font-hand); }
#hb-tabs .hb-room { margin-left: auto; }
.hb-favour { margin: 8px 0 12px; padding: 4px 12px 8px; background: rgba(201, 166, 90, 0.14); border: 1px solid rgba(138, 106, 74, 0.35); border-radius: 8px; }
.hb-favour .hb-story { border-left: none; padding-left: 0; }

/* Memories. */
.page h2 .count { font: 700 12px var(--font-ui); color: var(--ink-soft); margin-left: 6px; letter-spacing: 0.04em; }
.mem-photo-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.mem-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 6px 0; }
.mem-photo { display: grid; gap: 4px; padding: 5px 5px 7px; border: none; background: #fbf8f0; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18); cursor: pointer; text-align: left; color: var(--ink); }
.mem-photo:nth-child(3n) { transform: rotate(-1deg); }
.mem-photo:nth-child(3n + 1) { transform: rotate(0.8deg); }
.mem-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #ddd2b8; }
.mem-photo span { font: 13px/1.2 var(--font-hand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-photo.away img { opacity: 0.3; }
/* Notes: the grounds, the signs, the naturalist's field notes. */
.map-had { display: block; font: 12px/1.35 var(--font-ui); color: #2f6f74; }
.n-place { margin: 6px 0 12px; }
.n-place strong { display: block; font: 700 19px var(--font-display); }
.n-place p { margin: 1px 0 0; font: 16px/1.4 var(--font-hand); }
.n-life { margin: 6px 0 10px; padding: 4px 0 4px 10px; border-left: 3px solid #6f9a63; }
.n-life.faint { border-left-color: var(--ink-faint); opacity: 0.55; }
.n-life b { font: 700 15px var(--font-ui); }
.n-life i { font: italic 13px var(--font-ui); color: var(--ink-soft); }
.n-life p { margin: 2px 0 0; font: 13px/1.4 var(--font-ui); }
/* The day book: a page for each day out, your record, the harbour's challenges. */
.j-day { margin: 6px 0 14px; padding: 6px 12px 8px; border-left: 3px solid var(--ink-faint); }
.j-day strong { display: block; font: 700 20px var(--font-display); }
.j-day p { margin: 2px 0 0; font: 17px/1.4 var(--font-hand); color: var(--ink); }
.j-day.today { border-left-color: #2f6f74; }
.rec-totals { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 6px 0 12px; font: 14px/1.35 var(--font-ui); }
.rec-totals dt { color: var(--ink-soft); }
.rec-totals dd { margin: 0; font-weight: 700; }
.rec-bests, .rec-notable { margin: 4px 0 12px; padding-left: 22px; font: 16px/1.45 var(--font-hand); }
.rec-bests small, .rec-notable small { font: 12px var(--font-ui); color: var(--ink-soft); }
.rec-challenges { list-style: none; margin: 4px 0 12px; padding: 0; }
.rec-challenges li { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: start; margin: 0 0 10px; }
.rec-badge { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 1.5px var(--ink-faint); opacity: 0.25; }
.rec-challenges li.done .rec-badge { opacity: 1; }
.rec-challenges b { font: 700 15px var(--font-ui); }
.rec-challenges span { font: 13px/1.35 var(--font-ui); color: var(--ink-soft); }
.rec-challenges li.done span::after { content: ' ✓'; color: #4f7a43; font-weight: 700; }
.mem-adv { margin: 6px 0 14px; padding: 8px 12px; border-left: 3px solid var(--ink-faint); }
.mem-adv.done { border-left-color: #6f9a63; }
.mem-adv h4 { margin: 0 0 4px; font: 700 22px var(--font-display); }
.mem-clue { margin: 0 0 6px; font: italic 14px/1.4 var(--font-hand); color: var(--ink-soft); }
.mem-steps { margin: 0 0 6px; padding: 0; list-style: none; font: 600 13px/1.5 var(--font-ui); }
.mem-steps li.on { color: #3f6f3a; }
.mem-steps li .pk-btn { margin-left: 6px; padding: 1px 8px; font-size: 11px; }
.mem-end { margin: 0; font: 14px/1.4 var(--font-hand); }
.mem-keep, .mem-mark, .mem-place { padding: 6px 0; border-bottom: 1px dashed rgba(53, 41, 31, 0.16); }
.mem-keep b, .mem-mark b, .mem-place b { font: 700 15px var(--font-ui); }
.mem-keep p, .mem-mark p { margin: 2px 0; font: 14px/1.35 var(--font-hand); }
.mem-link { color: #2f6f74; font: 600 12.5px/1.4 var(--font-ui) !important; margin: 2px 0 0; }
.mem-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.mem-acts .pk-btn { font-size: 12px; padding: 3px 10px; }
.j-faint { color: var(--ink-soft); font: 14px var(--font-hand); }
.mem-viewer { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(30, 24, 18, 0.55); padding: 16px; }
.mem-viewer-inner { position: relative; width: min(820px, 100%); max-height: 100%; overflow-y: auto; padding: 18px 20px 16px; background: var(--paper); border-radius: 8px; color: var(--ink); }
.mem-viewer-inner img { display: block; width: 100%; border: 8px solid #fbf8f0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.mem-viewer-inner p { font: 15px/1.4 var(--font-hand); }

/* Your marks on the map. */
.map-mark-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.map-mark-tools .pk-btn { font-size: 12px; padding: 4px 10px; }
.map-mark-tools .pk-btn.on { background: var(--stamp); border-color: var(--stamp); color: #fff; }
#map-canvas.marking { cursor: crosshair; }
.map-pin-edit { display: grid; gap: 6px; padding: 8px; margin-bottom: 8px; border-radius: 8px; background: rgba(53, 41, 31, 0.07); }
.map-pin-edit input[type=text], .map-pin-edit textarea { width: 100%; padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--ink-faint); background: rgba(255, 255, 255, 0.6); color: var(--ink); font: 15px var(--font-hand); }
.mp-fav { font: 600 12.5px var(--font-ui); display: flex; gap: 6px; align-items: center; }
.mp-acts { display: flex; gap: 6px; }
.mp-acts .pk-btn { font-size: 12px; padding: 3px 10px; }

/* ---------------- Home & the garage: the workbench and the smaller outing sheet ---------------- */
.bench-inner { width: min(1060px, 100%); display: flex; flex-direction: column; max-height: 100%; }
.wb-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.wb-step { border: 1.5px solid var(--ink-faint); border-radius: 999px; background: transparent; color: var(--ink); padding: 5px 13px; font: 700 13px var(--font-ui); cursor: pointer; }
.wb-step:hover { background: rgba(53, 41, 31, 0.06); }
.wb-step.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.wb-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; min-height: 0; }
.wb-main { min-width: 0; }
.wb-main h3 { margin-top: 16px; }
.wb-main h4, .wb-side h4 { margin: 12px 0 4px; font: 700 12px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--stamp); }
.wb-main p, .wb-side p { margin: 4px 0; font: 15px/1.4 var(--font-hand); }
.wb-side { align-self: start; position: sticky; top: 0; padding: 10px 14px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.4); border: 1px dashed var(--ink-faint); }
.wb-side h3 { margin-top: 0; }
.wb-lead { font-size: 17px !important; }
.wb-faint { color: var(--ink-soft); font-size: 14px !important; }
.wb-okline { color: #3f7f4a; font: 700 13px var(--font-ui) !important; }
.wb-warnline { color: #9a5b12; font: 700 13px var(--font-ui) !important; }
.wb-status { min-height: 1.2em; color: #3f6f4a; font: 700 13px var(--font-ui) !important; }
.wb-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--ink-faint); }
.wb-foot .pk-btn:only-child { margin-left: auto; }
.wb-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.wb-act, .wb-go-btn, .wb-dest, .wb-catch {
  display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--ink-faint); background: rgba(255, 255, 255, 0.45); color: var(--ink);
}
.wb-act b, .wb-go-btn b, .wb-catch b { font: 700 22px/1.1 var(--font-display); }
.wb-act span, .wb-go-btn span { font: 14px/1.35 var(--font-hand); color: var(--ink-soft); }
.wb-act.on, .wb-dest.on, .wb-catch.on { border-color: var(--ink); background: rgba(255, 255, 255, 0.75); box-shadow: inset 0 0 0 1.5px var(--ink); }
.wb-act:hover, .wb-go-btn:hover, .wb-dest:hover, .wb-catch:hover { background: rgba(255, 255, 255, 0.7); }
.wb-chips { margin: 4px 0 8px; }
.wb-select { margin: 4px 0; padding: 6px 10px; border-radius: 8px; border: 1.5px solid var(--ink-faint); background: rgba(255, 255, 255, 0.6); color: var(--ink); font: 15px var(--font-hand); max-width: 100%; }
.wb-dests { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wb-dest { padding: 8px; }
.wb-map { display: block; width: 100%; height: auto; border-radius: 4px; }
.wb-dest-t { display: grid; gap: 2px; padding: 4px 2px 0; }
.wb-dest-t b { font: 700 22px/1.1 var(--font-display); }
.wb-dest-t span { font: 13px var(--font-ui); color: var(--ink-soft); }
.wb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.wb-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 11px var(--font-ui); background: rgba(53, 41, 31, 0.08); color: var(--ink-soft); }
.wb-tag.new { background: rgba(181, 83, 47, 0.12); color: var(--stamp); }
.wb-tag.camp, .wb-tag.pitched { background: rgba(79, 107, 58, 0.15); color: #3f5a2e; }
.wb-tag.carried { background: rgba(63, 127, 74, 0.15); color: #2f6b3a; }
.wb-tag.loaded { background: rgba(63, 111, 168, 0.15); color: #2f5a86; }
.wb-about { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.wb-about h3 { margin-top: 0; }
.wb-fish { display: grid; gap: 4px; }
.wb-fishrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 0; border-bottom: 1px dashed var(--ink-faint); }
.wb-fishrow b { font: 700 15px var(--font-ui); min-width: 150px; }
.wb-fishrow .pk-btn, .wb-setup .pk-btn.small, .pk-btn.small { padding: 3px 10px; font-size: 12px; }
.wb-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.wb-cols.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.wb-col { padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.4); border: 1px solid var(--ink-faint); }
.wb-col h4 { margin-top: 2px; }
.wb-setup { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 7px 0; border-bottom: 1px dashed var(--ink-faint); }
.wb-setup > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.wb-setup b { font: 700 15px var(--font-ui); }
.wb-setup .wb-faint { font: 13px/1.35 var(--font-ui) !important; }
.wb-setup-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wb-kit { display: grid; gap: 6px; }
.wb-kitrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-bottom: 1px dashed var(--ink-faint); }
.wb-kitrow > div:first-child { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.wb-kitrow b { font: 700 15px var(--font-ui); }
.wb-kitrow .cp-choice { flex: 0 1 auto; }
.wb-check { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.wb-check li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; font: 15px/1.35 var(--font-hand); }
.wb-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 800 12px var(--font-ui); }
.wb-ok .wb-mark { background: rgba(63, 127, 74, 0.18); color: #2f6b3a; }
.wb-warn .wb-mark { background: rgba(176, 122, 18, 0.2); color: #8a5a12; }
.wb-info .wb-mark { background: rgba(53, 41, 31, 0.1); color: var(--ink-soft); }
.wb-go { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.wb-catch { width: 100%; }
.wb-catch b { font: 700 15px var(--font-ui); }
.out-inner { width: min(640px, 100%); }
.mem-photo.on { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 860px) {
  .wb-body { grid-template-columns: 1fr; }
  .wb-side { position: static; order: -1; }
  .wb-about { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wb-step { padding: 4px 9px; font-size: 12px; }
  .wb-fishrow b { min-width: 0; }
}

/* The throttle lever: bottom right at the helm of a motorboat (or the kayak's motor), above the
   cast button on a touch screen. Notches from full ahead (top) to astern (bottom), the handle on
   the chosen one, a fill for what the motor is giving, a big Stop under it. */
#lever {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 168px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 3;
  font: 600 13px var(--font-ui);
  animation: rise 0.3s ease;
}
#lever[hidden] { display: none; }
/* The sailing panel: in the lever's place. */
#sail {
  position: absolute;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  width: 168px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 3;
  font: 600 13px var(--font-ui);
  animation: rise 0.3s ease;
}
#sail[hidden] { display: none; }
#hud.off #sail { display: none; }
.sl-chart { width: 132px; height: 132px; align-self: center; }
.sl-sheet { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: 0.9; }
.sl-sheet[hidden] { display: none; }
.sl-end { opacity: 0.7; }
.sl-track { position: relative; flex: 1; height: 10px; border-radius: 5px; background: rgba(255, 249, 239, 0.14); border: 1px solid var(--hud-line); }
.sl-mark { position: absolute; top: -4px; width: 10px; height: 16px; margin-left: -5px; border-radius: 4px; background: var(--lantern); }
.sl-best { position: absolute; top: -2px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: rgba(147, 220, 205, 0.8); }
.sl-best[hidden] { display: none; }
.sl-speed { font-size: 12px; text-align: center; opacity: 0.85; }
.sl-btns { display: flex; gap: 6px; }
.sl-btns button { flex: 1; }
.sl-btns button[hidden] { display: none; }
#hud.off #lever { display: none; }
.lv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.lv-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.72; }
.lv-now { font-size: 13px; color: var(--lantern); text-align: right; }
.lv-body { display: flex; align-items: stretch; gap: 8px; }
.lv-body[hidden] { display: none; }
.lv-notches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; flex: 1; gap: 2px; }
.lv-notches li { display: flex; align-items: center; gap: 6px; min-height: 26px; border-radius: 8px; padding-right: 4px; transition: background 0.15s ease, opacity 0.2s ease; }
.lv-notch {
  width: 34px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--hud-line);
  background: rgba(255, 249, 239, 0.08);
  color: var(--hud-ink);
  font: 800 12px var(--font-ui);
  cursor: pointer;
  touch-action: none;
}
.lv-name { font-size: 11.5px; opacity: 0.82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-notches li.lv-n .lv-notch { border-color: rgba(255, 249, 239, 0.45); }
.lv-notches li.lv-r .lv-notch { color: var(--coral); }
.lv-notches li.lv-q .lv-notch { color: var(--seaglass); }
.lv-notches li.on { background: rgba(255, 201, 119, 0.16); }
.lv-notches li.on .lv-notch { background: var(--lantern); border-color: var(--lantern); color: #3a2a14; }
.lv-notches li.locked { opacity: 0.38; }
.lv-track {
  position: relative;
  width: 22px;
  margin: 12px 0;
  border-radius: 11px;
  background: rgba(255, 249, 239, 0.12);
  border: 1px solid var(--hud-line);
  cursor: ns-resize;
  touch-action: none;
}
.lv-fill { position: absolute; left: 3px; right: 3px; border-radius: 6px; background: rgba(147, 220, 205, 0.55); transition: top 0.1s linear, height 0.1s linear; }
.lv-fill.astern { background: rgba(255, 154, 130, 0.6); }
.lv-handle {
  position: absolute;
  left: 50%;
  width: 34px;
  height: 18px;
  margin: -9px 0 0 -17px;
  border-radius: 9px;
  background: var(--hud-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: top 0.12s ease;
}
#lever.lv-dragging .lv-handle { transition: none; background: var(--lantern); }
.lv-stop, .lv-motor, #sail .lv-motor {
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hud-line);
  background: rgba(255, 249, 239, 0.1);
  color: var(--hud-ink);
  font: 800 14px var(--font-ui);
  cursor: pointer;
  touch-action: none;
}
.lv-stop { background: rgba(255, 154, 130, 0.22); border-color: rgba(255, 154, 130, 0.55); }
.lv-stop:hover, .lv-motor:hover { filter: brightness(1.15); }
.lv-motor { font-size: 12.5px; }
.lv-motor[hidden], .lv-stop[hidden] { display: none; }
.lv-keys { font-size: 11px; line-height: 1.5; opacity: 0.8; text-align: center; }
.lv-keys:empty { display: none; }
.lv-keys kbd { font-size: 10.5px; }
#lever.lv-raised { width: 150px; }
/* With the lever out, the bottom-right of the screen is its: the hint and prompt keep clear. */
@media (max-width: 1199px) {
  body.helm:not(.touch) #hint, body.helm:not(.touch) #prompt { max-width: calc(100% - 420px); }
}
/* Touch: above the cast button on the right, a little more compact, and the fish finder steps
   aside for it. */
body.touch #lever {
  bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  width: 150px;
  padding: 6px 8px 8px;
}
body.touch .lv-notches li { min-height: 30px; }
body.touch .lv-notch { width: 40px; height: 28px; font-size: 13px; }
body.touch .lv-name { font-size: 11px; }
body.touch.helm #sonar { right: calc(176px + env(safe-area-inset-right, 0px)); }
/* A phone on its side: beside the cast button, the full height of the screen, names hidden. */
@media (max-height: 520px) {
  body.touch #lever {
    top: calc(56px + env(safe-area-inset-top, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    right: calc(132px + env(safe-area-inset-right, 0px));
    width: 92px;
    gap: 4px;
  }
  body.touch .lv-name { display: none; }
  body.touch .lv-notches li { min-height: 26px; }
  body.touch .lv-notch { width: 44px; height: 24px; }
  body.touch .lv-body { flex: 1; min-height: 0; }
  body.touch .lv-stop { min-height: 30px; }
  #lever .lv-head .lv-title { display: none; }
  body.touch.helm #cancel-btn { right: calc(236px + env(safe-area-inset-right, 0px)); }
}
@media (max-height: 640px) and (min-width: 700px) {
  body:not(.touch) .lv-notches li { min-height: 22px; }
  body:not(.touch) .lv-notch { height: 20px; }
}

/* The mooring prompt (anchor, tie up, cast off, let go a tow): just above the main prompt, on
   its own key, a rope-coloured edge so it reads as the boat's own. */
#prompt2 {
  position: absolute;
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  bottom: calc(124px + env(safe-area-inset-bottom, 0px));
  padding: 7px 16px;
  font: 600 14px var(--font-ui);
  border-color: rgba(216, 196, 154, 0.7);
  pointer-events: auto;
  cursor: pointer;
  animation: rise 0.5s ease;
}
#prompt2[hidden] { display: none; }
#hud.off #prompt2 { display: none; }
body.touch #prompt2 { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); padding: 11px 18px; }
@media (max-width: 1199px) {
  body.helm:not(.touch) #prompt2 { max-width: calc(100% - 420px); }
}
@media (max-height: 520px) {
  body.touch #prompt2 { bottom: auto; top: calc(150px + env(safe-area-inset-top, 0px)); }
}

/* ---------------- diving ---------------- */

#dive { width: 228px; padding: 10px 12px 9px; font: 13px/1.35 var(--font-ui); color: var(--hud-ink); }
#dive .dv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#dive .dv-top span { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; opacity: 0.8; }
#dive #dv-depth { font-size: 22px; font-variant-numeric: tabular-nums; }
#dive .dv-gauge { position: relative; height: 9px; margin: 6px 0 5px; border-radius: 5px; background: rgba(255, 249, 239, 0.16); overflow: hidden; }
#dive #dv-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--seaglass); border-radius: 5px; transition: background 0.3s; }
#dive.warn #dv-fill { background: var(--coral); }
#dive #dv-turn { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--lantern); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
#dive .dv-row { display: flex; justify-content: space-between; gap: 8px; }
#dive .soft { opacity: 0.78; }
#dive-aim { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; display: grid; justify-items: center; gap: 6px; }
#dive-aim .da-ring { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 249, 239, 0.55); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
#dive-aim .da-ring::after { content: ''; position: absolute; left: 50%; top: 13px; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%; background: rgba(255, 249, 239, 0.8); }
#dive-aim.on .da-ring { border-color: var(--seaglass); }
#dive-aim.far .da-ring { border-color: var(--lantern); }
#dive-aim.bad .da-ring { border-color: var(--coral); }
#da-text { margin-top: 30px; padding: 3px 9px; border-radius: 999px; background: var(--hud-veil); color: var(--hud-ink); font: 600 12px var(--font-ui); white-space: nowrap; }
#da-text:empty { display: none; }
/* The edges of sight darkening as the breath runs out; black for a blackout. */
#dive-veil { position: fixed; inset: 0; pointer-events: none; --low: 0; --black: 0;
  background: radial-gradient(ellipse at center, transparent calc(70% - var(--low) * 45%), rgba(4, 10, 18, calc(var(--low) * 0.85)) 100%), rgba(2, 4, 8, var(--black)); }
.dive-btn { display: none; }
body.touch #dive { position: absolute; top: calc(172px + env(safe-area-inset-top, 0px)); left: 0; right: 0; margin-inline: auto; width: min(240px, calc(100% - 32px)); }
body.touch.diving .dive-btn {
  display: grid; place-items: center; position: absolute; right: calc(50px + env(safe-area-inset-right, 0px)); width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid rgba(255, 249, 239, 0.5); background: rgba(14, 24, 34, 0.42); color: var(--hud-ink); font-size: 18px; touch-action: none;
}
body.touch.diving #dive-up { bottom: calc(214px + env(safe-area-inset-bottom, 0px)); }
body.touch.diving #dive-down { bottom: calc(152px + env(safe-area-inset-bottom, 0px)); }
body.touch.diving #prompt { bottom: calc(286px + env(safe-area-inset-bottom, 0px)); }
body.touch.diving .dive-btn.down { background: rgba(255, 249, 239, 0.25); }
body.touch.diving #rest-btn { display: none; }
/* Sitting a while: the helm's panels and hints out of the way of the view. */
body.sitting #lever, body.sitting #hint { display: none !important; }
@media (prefers-reduced-motion: reduce) { #dive #dv-fill { transition: none; } }
