/* SeaTrader player screen — "the deck".
   Lacquer, brass and oxblood silk over a slowly changing harbor. The window never scrolls:
   everything sits in a fixed frame and only the working pane, the log and long lists scroll inside.

   Landscape (iPad first):  top bar across; tab rail | working pane | stage, log and helm.
   Portrait:                top bar; stage band (stage + log + helm); working pane; tab bar at the bottom.
   Colours come from Admin > Look & Style > Player screen (the --deck-* values in /theme.css). */

:root {
  --deck-night: #15100c; --deck-lacquer: #2a1b14; --deck-oxblood: #7b2428; --deck-brass: #c9a34e;
  --deck-jade: #2f6b5a; --deck-ivory: #f1e3c5; --deck-storm: #385467; --deck-leather: #6b452d;
  --amb-seconds: 40; --amb-dim: .55;
}

/* ------------------------------------------------------------ the palette, applied -- */
body.player {
  --glass: color-mix(in srgb, var(--deck-night) 80%, transparent);  /* more opaque: panels no longer blur the moving background */
  --glass-2: color-mix(in srgb, var(--deck-night) 34%, transparent);
  --edge: color-mix(in srgb, var(--deck-brass) 32%, transparent);
  --edge-hi: color-mix(in srgb, var(--deck-brass) 70%, transparent);
  --brass-hi: color-mix(in srgb, var(--deck-brass) 70%, #fff3cf);
  --jade-hi: color-mix(in srgb, var(--deck-jade) 45%, #d9fff0);
  --blood-hi: color-mix(in srgb, var(--deck-oxblood) 40%, #ffd2c8);
  /* The parchment names used by the shared components, remapped to the deck's palette. */
  --paper: var(--deck-night);
  --card: var(--glass-2);
  --ink: var(--deck-ivory);
  --muted: color-mix(in srgb, var(--deck-ivory) 62%, var(--deck-leather));
  --rule: color-mix(in srgb, var(--deck-brass) 22%, transparent);
  --gold: var(--deck-brass);
  --highlight: var(--brass-hi);
  --vermilion: var(--blood-hi);
  --jade: var(--jade-hi);
  --teak: var(--deck-lacquer);
  --teak-2: var(--deck-leather);
  --on-dark: var(--deck-ivory);
  --btn: var(--deck-lacquer);
  --btn-border: color-mix(in srgb, var(--deck-brass) 40%, transparent);
  --input: color-mix(in srgb, var(--deck-night) 78%, #000);
  background: var(--deck-night) !important;
  color: var(--deck-ivory);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
html:has(body.player) { height: 100%; overflow: hidden; background: var(--deck-night); }
body.player #app { position: relative; z-index: 1; height: 100vh; height: 100dvh; }
body.player ::selection { background: color-mix(in srgb, var(--deck-brass) 45%, transparent); }

/* ---------------------------------------------------------------- living background -- */
#ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(ellipse at 70% 30%, color-mix(in srgb, var(--deck-storm) 35%, transparent), transparent 60%),
  radial-gradient(ellipse at 20% 80%, color-mix(in srgb, var(--deck-oxblood) 30%, transparent), transparent 55%),
  var(--deck-night); }
#ambient .amb { position: absolute; inset: 0; opacity: 0; transition: opacity 3.6s ease-in-out; }
#ambient .amb.on { opacity: 1; }
#ambient .amb > img, #ambient .amb > video { width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(1.08) contrast(1.04); }
/* Still pictures only: the slow zoom/drift (ambDrift) was redrawn every frame under the blurred panels. */
#ambient .amb.on > * { transform: scale(1.04); }
#ambient .amb.d0 > * { transform-origin: 30% 40%; }
#ambient .amb.d1 > * { transform-origin: 75% 35%; }
#ambient .amb.d2 > * { transform-origin: 50% 70%; }
#ambient .amb.d3 > * { transform-origin: 20% 65%; }
@keyframes ambDrift { from { transform: scale(1.14) translate3d(0, 0, 0); } to { transform: scale(1.02) translate3d(0, -1%, 0); } }
#ambient::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 120% 95% at 50% 45%, transparent 35%, rgba(6, 4, 3, .82) 100%),
  linear-gradient(180deg, rgba(10, 7, 5, calc(var(--amb-dim) * .75)), rgba(10, 7, 5, var(--amb-dim)) 55%, rgba(10, 7, 5, calc(var(--amb-dim) + .15))); }
body.board #ambient { display: none; }

/* ------------------------------------------------------------------------ the frame -- */
.deck {
  height: 100%;
  display: grid;
  gap: clamp(.45rem, .9vw, .85rem);
  padding: max(.55rem, env(safe-area-inset-top)) max(.65rem, env(safe-area-inset-right))
           max(.55rem, env(safe-area-inset-bottom)) max(.65rem, env(safe-area-inset-left));
  grid-template-columns: 6.6rem minmax(0, 1fr) clamp(15.5rem, 28vw, 25rem);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "nav main side";
}
.dk-top { grid-area: top; } .dk-nav { grid-area: nav; } .dk-main, .dk-over { grid-area: main; } .dk-side { grid-area: side; }

.dk-top, .dk-nav, .dk-main, .dk-feed, .dk-helm, .dk-stage {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 236, 190, .07), inset 0 0 0 1px rgba(0, 0, 0, .25);
  
  min-width: 0; min-height: 0;
}

/* ------------------------------------------------------------------------- top bar -- */
.dk-top { display: flex; align-items: center; gap: clamp(.6rem, 1.6vw, 1.4rem); padding: .55rem .75rem .55rem .9rem; position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-lacquer) 82%, transparent), var(--glass)); }
.dk-top::after { content: ""; position: absolute; left: 1.2rem; right: 1.2rem; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--deck-brass), transparent); opacity: .8; }
.dk-house { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1 1 auto; }
.dk-house .chip { width: 1.15rem; height: 2.3rem; margin: 0; border-radius: 2px 2px 50% 50% / 2px 2px 22% 22%;
  box-shadow: 0 0 0 1px var(--edge-hi), 0 4px 10px rgba(0, 0, 0, .5); }
.dk-house > div { min-width: 0; }
.dk-house b { font: 400 clamp(1.15rem, 1.9vw, 1.55rem)/1.1 var(--serif); color: var(--deck-ivory); letter-spacing: .01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.dk-house .rankname { margin-left: .55rem; color: var(--brass-hi); font-size: .92rem; }
.dk-house small { display: block; font: italic .86rem/1.3 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-house { flex: 0 1 auto; }
.dk-port { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; line-height: 1; }
.dk-port span { font: .68rem/1.1 var(--special); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--deck-brass) 85%, var(--deck-ivory)); }
.dk-port b { max-width: 100%; font: 400 clamp(1.3rem, 2.3vw, 1.95rem)/1.15 var(--serif); color: var(--brass-hi); letter-spacing: .04em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-port small { font: italic .78rem/1.2 var(--sans); color: var(--muted); white-space: nowrap; }
.dk-stats { display: grid; grid-template-columns: repeat(7, minmax(0, auto)); gap: .4rem; flex: none; }
.plq { position: relative; min-width: 5.4rem; padding: .32rem .7rem .36rem; border-radius: calc(var(--radius) * .8); text-align: right;
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-lacquer) 90%, #fff 3%), color-mix(in srgb, var(--deck-night) 85%, transparent));
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08); }
.plq span { display: block; font: .66rem/1.1 var(--special); letter-spacing: .1em; color: color-mix(in srgb, var(--deck-brass) 85%, var(--deck-ivory)); }
.plq b { display: block; font: 700 1.04rem/1.25 var(--sans); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); white-space: nowrap; }
.plq.silver b { color: var(--brass-hi); }
.plq.worth { border-color: var(--edge-hi); }
.plq.bad b { color: var(--blood-hi); }
/* Port standing: a heat icon instead of a figure (player.js standingPlaque) */
.plq.standing { min-width: 4.6rem; border-color: color-mix(in srgb, var(--heat) 45%, var(--edge));
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08), 0 0 14px -8px var(--heat); }
.plq.standing b { display: flex; justify-content: flex-end; align-items: center; height: 1.3em; }
.plq-heat { width: 3.4rem; height: 1.2rem; overflow: visible; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--heat) 55%, transparent)); }
.plq-heat rect.off { fill: rgba(255, 236, 190, .07); stroke: rgba(255, 236, 190, .16); stroke-width: .6; }
.plq.standing.tier-0 { animation: plqWarn 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .plq.standing.tier-0 { animation: none; } }
.plq.bad { border-color: color-mix(in srgb, var(--deck-oxblood) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 38%, var(--deck-night)), color-mix(in srgb, var(--deck-night) 85%, transparent)); }

/* ------------------------------------------------------------------------ tab rail -- */
.dk-nav { display: flex; flex-direction: column; gap: .35rem; padding: .45rem .4rem; }
.dk-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-height: 4.4rem; padding: .45rem .2rem; background: transparent; border: 1px solid transparent; color: var(--muted);
  border-radius: calc(var(--radius) * 1); font: .7rem/1.1 var(--special); letter-spacing: .06em; transition: color .2s, background .2s, border-color .2s; }
.dk-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-nav svg { width: 2.1rem; height: 2.1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dk-nav button:hover:not(:disabled) { background: color-mix(in srgb, var(--deck-brass) 9%, transparent); color: var(--deck-ivory); border-color: var(--edge); }
.dk-nav button.on { color: var(--brass-hi); border-color: var(--edge-hi);
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--deck-brass) 26%, transparent), color-mix(in srgb, var(--deck-oxblood) 22%, transparent) 75%);
  box-shadow: 0 0 22px -6px color-mix(in srgb, var(--deck-brass) 60%, transparent), inset 0 1px 0 rgba(255, 236, 190, .14); }
.dk-nav button.on::before { content: ""; position: absolute; left: -.45rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px;
  background: var(--deck-brass); box-shadow: 0 0 10px var(--deck-brass); }
.dk-nav button.on svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--deck-brass) 70%, transparent)); }
.dk-nav { position: relative; z-index: 8; }
.dk-gap { flex: 1 1 auto; min-height: .3rem; min-width: .3rem; font-style: normal; }

/* the captain: the player's own picture at the foot of the rail, with a small menu beside it */
.dk-me { position: relative; display: flex; flex-direction: column; }
.dk-nav .dk-face { gap: .35rem; }
.dk-face img, .dk-face em { width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none; object-fit: cover; object-position: 50% 20%;
  border: 2px solid var(--house, var(--deck-brass)); box-shadow: 0 0 0 1px var(--edge-hi), 0 4px 12px rgba(0, 0, 0, .6); }
.dk-face em { display: grid; place-items: center; font: 400 1.05rem/1 var(--serif); font-style: normal; color: #fff6e3;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--house, var(--deck-brass)) 80%, #fff 18%), var(--house, var(--deck-brass)) 60%, color-mix(in srgb, var(--house, var(--deck-brass)) 60%, #000));
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.dk-me.open .dk-face { color: var(--brass-hi); border-color: var(--edge-hi); background: color-mix(in srgb, var(--deck-brass) 12%, transparent); }
.dk-me.open .dk-face img, .dk-me.open .dk-face em { box-shadow: 0 0 0 1px var(--brass-hi), 0 0 16px -2px var(--deck-brass); }
.dk-fly { position: absolute; left: calc(100% + .85rem); bottom: 0; z-index: 9; display: flex; flex-direction: column; gap: .3rem; padding: .4rem;
  background: color-mix(in srgb, var(--deck-night) 90%, transparent); border: 1px solid var(--edge-hi); border-radius: calc(var(--radius) * 1.2);
  box-shadow: 0 18px 40px -12px #000, inset 0 1px 0 rgba(255, 236, 190, .1);
  animation: flyIn .18s ease-out both; }
.dk-fly::before { content: ""; position: absolute; left: -6px; bottom: 1.6rem; width: 10px; height: 10px; transform: rotate(45deg);
  background: inherit; border-left: 1px solid var(--edge-hi); border-bottom: 1px solid var(--edge-hi); }
.dk-nav .dk-fly button { width: 4.4rem; min-height: 4rem; }
.dk-nav .dk-fly button.on { color: var(--jade-hi); border-color: color-mix(in srgb, var(--jade-hi) 50%, transparent);
  background: color-mix(in srgb, var(--deck-jade) 26%, transparent); box-shadow: none; }
.dk-nav .dk-fly button.on::before { display: none; }
.dk-nav .dk-fly button:disabled { opacity: .45; }
@keyframes flyIn { from { opacity: 0; transform: translateX(-6px); } }

/* -------------------------------------------------------------------- working pane -- */
.deck main.dk-main { max-width: none; margin: 0; padding: 0; position: relative; overflow: hidden; container: pane / inline-size; }
.dk-main::before, .dk-main::after { content: ""; position: absolute; z-index: 2; width: 1.1rem; height: 1.1rem; pointer-events: none; border: 2px solid var(--deck-brass); opacity: .75; }
.dk-main::before { top: .4rem; left: .4rem; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.dk-main::after { bottom: .4rem; right: .4rem; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }
.dk-pane { height: 100%; overflow-y: auto; overflow-x: hidden; padding: clamp(.6rem, 1.4vw, 1.1rem); -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--deck-brass) 55%, transparent) transparent; }
.dk-pane::-webkit-scrollbar, .dk-list::-webkit-scrollbar { width: 6px; }
.dk-pane::-webkit-scrollbar-thumb, .dk-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--deck-brass) 50%, transparent); border-radius: 6px; }
.deck .card { background: var(--glass-2); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .05);
  padding: clamp(.75rem, 1.4vw, 1.1rem); margin-bottom: .8rem; }
.deck .card:last-child { margin-bottom: 0; }
.deck .card h2 { font: 400 clamp(1.15rem, 1.8vw, 1.45rem)/1.2 var(--serif); color: var(--brass-hi); margin-bottom: .45rem;
  padding-bottom: .35rem; border-bottom: 1px solid; border-image: linear-gradient(90deg, var(--edge-hi), transparent 70%) 1; }
.deck.locked .dk-pane > .card { opacity: .62; filter: saturate(.6); }
/* the stage already shows the port, so the pane does not repeat its picture */
.deck .dk-pane > .card > .portart:first-child { display: none; }

/* tables, notes and small things on dark */
body.player .grid th { color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); font-family: var(--special); font-weight: 400; letter-spacing: .08em;
  border-bottom: 1px solid var(--edge-hi); }
body.player .grid td { border-bottom: 1px solid var(--rule); }
body.player .grid tbody tr:hover td { background: color-mix(in srgb, var(--deck-brass) 6%, transparent); }
body.player .grid tr.me td { background: color-mix(in srgb, var(--deck-brass) 13%, transparent); }
body.player .grid td b { font-weight: 700; }
body.player .note { background: color-mix(in srgb, var(--deck-brass) 12%, transparent); border-left-color: var(--deck-brass); }
body.player .note.bad { background: color-mix(in srgb, var(--deck-oxblood) 28%, transparent); border-left-color: var(--blood-hi); }
body.player .tag { color: var(--brass-hi); }
body.player .tag.bad { color: var(--blood-hi); }
body.player .gicon { border-radius: 50%; box-shadow: 0 0 0 1px var(--edge-hi), 0 3px 8px rgba(0, 0, 0, .5); width: 2.2rem; height: 2.2rem; }
body.player .ship { background: var(--glass-2); border-color: var(--rule); }
body.player .hull { background: color-mix(in srgb, var(--deck-night) 80%, #000); box-shadow: inset 0 0 0 1px var(--rule); }
body.player .hull i { background: linear-gradient(90deg, var(--deck-jade), var(--jade-hi)); }
body.player .hull i.low { background: linear-gradient(90deg, var(--deck-oxblood), var(--blood-hi)); }
body.player .est { color: var(--jade-hi); }
body.player .muted { color: var(--muted); }
body.player .rankname { color: var(--brass-hi); }
body.player .chart { border-color: var(--edge-hi); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .8); }

/* -------------------------------------------------------------------------- buttons -- */
body.player button { color: var(--deck-ivory); border: 1px solid var(--btn-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-lacquer) 88%, #fff 5%), var(--deck-lacquer));
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .08), 0 2px 6px -2px rgba(0, 0, 0, .6); transition: background .18s, border-color .18s, box-shadow .18s; }
body.player button:hover:not(:disabled) { border-color: var(--edge-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-leather) 80%, #fff 6%), var(--deck-lacquer)); }
body.player button:active:not(:disabled) { transform: translateY(1px); }
body.player button.primary { color: #fff6e3; border-color: color-mix(in srgb, var(--deck-brass) 75%, transparent); text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 78%, #ff9b84 10%), var(--deck-oxblood) 55%, color-mix(in srgb, var(--deck-oxblood) 70%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, .22), 0 6px 18px -8px color-mix(in srgb, var(--deck-oxblood) 90%, transparent); }
body.player button.primary:hover:not(:disabled) { border-color: var(--brass-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 70%, #ffb19c 18%), var(--deck-oxblood) 60%, color-mix(in srgb, var(--deck-oxblood) 75%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, .25), 0 0 20px -4px color-mix(in srgb, var(--deck-oxblood) 90%, transparent); }
body.player button.on { color: var(--deck-night); border-color: var(--brass-hi); text-shadow: none;
  background: linear-gradient(180deg, var(--brass-hi), var(--deck-brass) 60%, color-mix(in srgb, var(--deck-brass) 75%, #000)); }
body.player button.on:hover:not(:disabled) { background: linear-gradient(180deg, #fff1c9, var(--deck-brass)); }
body.player button.ghost { background: transparent; box-shadow: none; }
body.player button.link { background: none; border: 0; box-shadow: none; color: var(--brass-hi); }
body.player button:focus-visible, body.player input:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
body.player button.dest { background: var(--glass-2); }
body.player button.dest.on, body.player button.dest.on:hover:not(:disabled) { background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 55%, var(--deck-lacquer)), var(--deck-lacquer)); color: var(--deck-ivory); border-color: var(--brass-hi); }
body.player button.dest.on .muted { color: color-mix(in srgb, var(--deck-ivory) 80%, transparent); }
body.player input { color: var(--deck-ivory); background: var(--input); border-color: var(--btn-border); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45); }
body.player input::placeholder { color: color-mix(in srgb, var(--deck-ivory) 35%, transparent); }

/* ----------------------------------------------------------- set sail routes -- */
.sail-guide { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: .85rem 0 .65rem; }
.sail-guide.sail-guide-top { margin-top: 0; }
.sail-map { margin-top: .9rem; padding: .45rem; border: 1px solid var(--edge); border-radius: calc(var(--radius) * 1.35);
  background: color-mix(in srgb, var(--deck-night) 72%, transparent); box-shadow: inset 0 0 30px rgba(0, 0, 0, .32); }
.sail-map .chart { border-radius: var(--radius); }
body.player .sail-map .chart .port .label-bg { fill: color-mix(in srgb, var(--deck-night) 88%, transparent); stroke: color-mix(in srgb, var(--deck-brass) 55%, transparent); }
body.player .sail-map .chart .port .port-name { fill: #fff5df; }
body.player .sail-map .chart .port .port-status { fill: color-mix(in srgb, var(--deck-ivory) 68%, var(--deck-brass)); }
body.player .sail-map .chart .port.here .label-bg { fill: color-mix(in srgb, var(--deck-brass) 28%, var(--deck-night)); stroke: var(--brass-hi); }
body.player .sail-map .chart .port.dest .label-bg { fill: color-mix(in srgb, var(--deck-oxblood) 34%, var(--deck-night)); stroke: var(--blood-hi); }
body.player .sail-map .chart .port.dest .port-status { fill: #ffc1b3; }
body.player .sail-map .chart .port .ring { fill: var(--deck-night); }
body.player .sail-map .chart .port.here .ring { fill: var(--deck-brass); }
body.player .sail-map .chart .port.dest .ring { fill: var(--deck-oxblood); }
body.player .sail-map .chart .port .label-leader { stroke: color-mix(in srgb, var(--deck-ivory) 45%, var(--deck-night)); }
body.player .sail-map .chart .region { --wx: var(--jade-hi); --halo: color-mix(in srgb, var(--deck-night) 88%, transparent); }
body.player .sail-map .chart .region.wxt2 { --wx: #f1c465; }
body.player .sail-map .chart .region.wxt3 { --wx: #ff9b88; }
body.player .sail-map .chart .rname { fill: color-mix(in srgb, var(--deck-ivory) 78%, var(--deck-jade)); }
.sail-guide > span:first-child b { display: block; font: 400 1.08rem/1.15 var(--serif); color: var(--brass-hi); }
.heat-key { display: flex; align-items: center; gap: .35rem; flex: none; color: var(--muted); }
.heat-key small { font: 700 .62rem/1 var(--special); letter-spacing: .06em; text-transform: uppercase; }
.heat-key i { width: 5.5rem; height: .38rem; border-radius: 1rem; background: linear-gradient(90deg, hsl(118 55% 42%), hsl(55 78% 52%), hsl(4 72% 52%));
  box-shadow: 0 0 0 1px rgba(255, 244, 215, .15), 0 1px 5px #000; }
.deck .dests { grid-template-columns: repeat(auto-fill, minmax(min(14.5rem, 100%), 1fr)); gap: .75rem; margin-top: 0; }
/* Flex column from the top: a card stretched to its row's height keeps its art and stats at the top
   (a block button centres its content, which threw cards with service pills out of line). */
body.player button.dest.sail-card { --risk-color: hsl(var(--risk-hue) 62% 46%); position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; min-height: 0; padding: 0; overflow: hidden;
  text-align: left; border: 1px solid color-mix(in srgb, var(--risk-color) 62%, var(--edge-hi)); border-radius: calc(var(--radius) * 1.25);
  background: color-mix(in srgb, var(--deck-night) 72%, var(--risk-color) 6%); box-shadow: 0 12px 28px -18px #000, inset 0 0 0 1px rgba(255, 244, 215, .04); }
body.player button.dest.sail-card:hover:not(:disabled) { border-color: color-mix(in srgb, var(--risk-color) 75%, #fff); background: color-mix(in srgb, var(--deck-lacquer) 88%, var(--risk-color) 12%);
  box-shadow: 0 14px 32px -18px #000, 0 0 16px -9px var(--risk-color); }
body.player button.dest.sail-card.on, body.player button.dest.sail-card.on:hover:not(:disabled) { color: var(--deck-ivory); border-color: var(--brass-hi);
  background: color-mix(in srgb, var(--deck-lacquer) 80%, var(--deck-brass) 20%); transform: translateY(-3px);
  box-shadow: 0 0 0 3px var(--brass-hi), 0 0 22px 4px color-mix(in srgb, var(--deck-brass) 70%, transparent), 0 16px 34px -14px #000;
  animation: sail-pick-glow 2.2s ease-in-out infinite; }
/* Selected destination: brass ring + breathing glow, "Selected" chip, other cards step back */
@keyframes sail-pick-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--brass-hi), 0 0 18px 2px color-mix(in srgb, var(--deck-brass) 55%, transparent), 0 16px 34px -14px #000; }
  50%      { box-shadow: 0 0 0 3px var(--brass-hi), 0 0 30px 7px color-mix(in srgb, var(--deck-brass) 85%, transparent), 0 16px 34px -14px #000; }
}
body.player button.dest.sail-card { transition: transform .18s ease, opacity .18s ease, filter .18s ease, border-color .18s ease, background .18s ease; }
body.player button.dest.sail-card.on::after { content: "\2713  Selected"; position: absolute; z-index: 4; top: .55rem; left: 50%; transform: translateX(-50%); padding: .24rem .55rem; white-space: nowrap;
  color: var(--deck-night); background: var(--brass-hi); border-radius: 999px; font: 800 .62rem/1 var(--special); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 2px 10px -2px #000, 0 0 12px -2px var(--deck-brass); pointer-events: none; }
body.player button.dest.sail-card.on .dest-img { filter: saturate(1.15) brightness(1.08); }
body.player .dests:has(.sail-card.on) .sail-card:not(.on) { opacity: .62; filter: saturate(.7); }
body.player .dests:has(.sail-card.on) .sail-card:not(.on):hover:not(:disabled) { opacity: .9; filter: none; }
@media (prefers-reduced-motion: reduce) { body.player button.dest.sail-card.on { animation: none; transform: none; } }
.dest-art { position: relative; display: block; flex: none; height: clamp(6.4rem, 12vw, 8.2rem); overflow: hidden; background: var(--deck-lacquer); }
.dest-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 4, 3, .08) 12%, rgba(5, 4, 3, .2) 45%, rgba(5, 4, 3, .92) 100%); }
.dest-art::before { content: ""; position: absolute; z-index: 2; inset: auto 0 0; height: 3px; background: var(--risk-color); box-shadow: 0 0 12px var(--risk-color); }
.dest-img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 50%; transition: transform .35s ease, filter .35s ease; }
.sail-card:hover .dest-img { transform: scale(1.045); filter: saturate(1.08) contrast(1.04); }
.dest-title { position: absolute; z-index: 3; left: .75rem; right: .75rem; bottom: .55rem; display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.dest-title b { flex: 1 1 auto; min-width: 0; overflow: hidden; color: #fff; font: 800 clamp(1.45rem, 2.7vw, 1.85rem)/1.05 var(--serif); text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: .015em; text-shadow: 0 2px 10px #000, 0 1px 2px #000; }
.dest-pct { flex: none; margin-left: auto; color: #fff; font: 800 clamp(1.1rem, 2vw, 1.35rem)/1 var(--sans); font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px #000, 0 1px 2px #000; }
.dest-ban.tag.bad { position: absolute; z-index: 3; top: .55rem; left: .6rem; margin: 0; padding: .22rem .45rem; color: #fff; border: 1px solid color-mix(in srgb, var(--blood-hi) 85%, #fff);
  border-radius: .35rem; background: color-mix(in srgb, var(--deck-oxblood) 82%, transparent); box-shadow: 0 3px 10px rgba(0, 0, 0, .45); }
/* This player's home port: storm-blue card with an anchor ribbon, readable at a glance. */
body.player button.dest.sail-card.home { --home: #5fb0e8; border: 2px solid var(--home);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-storm) 70%, var(--deck-night)), color-mix(in srgb, var(--deck-storm) 40%, var(--deck-night)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--home) 40%, transparent), 0 0 18px -6px var(--home), 0 12px 28px -18px #000; }
body.player button.dest.sail-card.home:hover:not(:disabled) { border-color: color-mix(in srgb, var(--home) 70%, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-storm) 85%, var(--deck-night)), color-mix(in srgb, var(--deck-storm) 55%, var(--deck-night))); }
body.player button.dest.sail-card.home .dest-stat small { color: color-mix(in srgb, var(--home) 55%, var(--deck-ivory)); }
.dest-home { position: absolute; z-index: 3; top: .55rem; right: .6rem; padding: .26rem .55rem; color: #fff; white-space: nowrap;
  background: linear-gradient(180deg, #3d8fd0, #23608f); border: 1px solid #a9dbff; border-radius: .35rem;
  font: 800 .66rem/1 var(--special); letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 3px 10px rgba(0, 0, 0, .5), 0 0 10px -2px #5fb0e8; }
/* Standing orders: no / low protection is a warning panel with one button to where tribute is paid. */
.or-protect { display: flex; align-items: center; gap: .7rem; margin: .65rem 0 .2rem; padding: .6rem .7rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--blood-hi) 70%, transparent); border-left: 4px solid var(--blood-hi);
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-oxblood) 45%, var(--deck-night)), color-mix(in srgb, var(--deck-oxblood) 15%, var(--deck-night))); }
.or-protect.low { border-color: color-mix(in srgb, #f1c465 60%, transparent); border-left-color: #f1c465;
  background: linear-gradient(90deg, color-mix(in srgb, #8a6a1e 45%, var(--deck-night)), color-mix(in srgb, #8a6a1e 12%, var(--deck-night))); }
.or-protect-icon { flex: none; font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 1px 3px #000); }
.or-protect-text { flex: 1 1 auto; min-width: 0; display: grid; gap: .12rem; }
.or-protect-text b { color: #ffc1b3; font: 800 .8rem/1.1 var(--special); letter-spacing: .08em; text-transform: uppercase; }
.or-protect.low .or-protect-text b { color: #f6d98a; }
.or-protect-text span { color: var(--deck-ivory); font: .82rem/1.3 var(--sans); }
body.player button.or-pay { flex: none; white-space: nowrap; }
@media (max-width: 760px) { .or-protect { flex-wrap: wrap; } body.player button.or-pay { width: 100%; } }
.dest-rank { position: absolute; z-index: 3; right: .58rem; top: .55rem; display: grid; min-width: 3.65rem; padding: .28rem .42rem .32rem; text-align: center;
  border: 1px solid color-mix(in srgb, var(--risk-color) 65%, #fff); border-radius: .4rem; color: #fff; background: color-mix(in srgb, var(--risk-color) 58%, rgba(8, 6, 4, .88));
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);  }
.dest-rank b { font: 800 1.05rem/1 var(--sans); }
.dest-rank small { margin-top: .14rem; font: 700 .52rem/1 var(--special); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.dest-data { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .55rem; padding: .62rem .7rem .62rem; }
/* Port services: small caps tags, left-aligned under the stats (lined up with the stat icons). */
.dest-facilities { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: -.2rem; padding: 0 .7rem .55rem; }
.dest-facilities > span { padding: .12rem .34rem; border: 1px solid color-mix(in srgb, var(--deck-brass) 40%, transparent);
  border-radius: .25rem; color: color-mix(in srgb, var(--deck-ivory) 80%, var(--deck-brass)); background: rgba(255, 236, 190, .04);
  font: 700 .55rem/1.1 var(--special); letter-spacing: .08em; text-transform: uppercase; }
/* Standing on a Sail card: the masthead's five heat bars, with the number after them. */
.dest-stat strong.dest-rep { display: flex; align-items: center; gap: .35rem; overflow: visible; }
.dest-heat { flex: none; width: 2.6rem; height: .95rem; overflow: visible; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--heat) 55%, transparent)); }
.dest-heat rect.off { fill: rgba(255, 236, 190, .07); stroke: rgba(255, 236, 190, .16); stroke-width: .6; }
.dest-rep em { font-style: normal; color: var(--heat, var(--deck-ivory)); font-variant-numeric: tabular-nums; }
/* Danger monitor: jade, amber, coral, red by the odds of a pirate fight. Best price: jade above usual. */
.dest-stat.dz0 { color: var(--jade-hi); }
.dest-stat.dz1 { color: #f1c465; }
.dest-stat.dz2 { color: #ff9b88; }
.dest-stat.dz3 { color: #ff5d4a; }
.dest-stat.dz2 strong, .dest-stat.dz3 strong { color: #ffc1b3; }
.dest-stat.best-up { color: var(--jade-hi); }
.dest-stat.best-up strong { color: color-mix(in srgb, var(--jade-hi) 55%, var(--deck-ivory)); }
.dest-stat { display: flex; align-items: center; min-width: 0; gap: .4rem; color: color-mix(in srgb, var(--deck-ivory) 76%, var(--deck-brass)); }
.dest-stat > span { display: block; min-width: 0; }
.dest-stat small, .dest-stat strong { display: block; overflow-wrap: anywhere; }
/* Best price gets the whole bottom row so the cargo, the expected gap and how old the news is all show in full. */
.dest-stat.dest-best { grid-column: 1 / -1; margin-top: .2rem; padding-top: .3rem; border-top: 1px solid rgba(255, 236, 190, .08); }
.dest-best .dest-age { display: block; margin-top: .05rem; color: var(--muted); font: italic 600 .62rem/1.15 var(--sans); }
.dest-stat.dest-run { grid-column: 1 / -1; }
.dest-run .dest-gain { margin-left: .2rem; color: var(--jade-hi); font-variant-numeric: tabular-nums; }
.dest-stat.best-flat strong { color: color-mix(in srgb, var(--deck-ivory) 70%, var(--muted)); }
.dest-stat small { color: var(--muted); font: 700 .55rem/1.1 var(--special); letter-spacing: .08em; text-transform: uppercase; }
.dest-stat strong { margin-top: .08rem; color: var(--deck-ivory); font: 700 .75rem/1.15 var(--sans); }
.dest-icon { flex: none; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dest-stat.wx0, .dest-stat.wx1 { color: var(--jade-hi); }
.dest-stat.wx2 { color: #f1c465; }
.dest-stat.wx3 { color: #ff9b88; }

@media (orientation: portrait) and (max-width: 600px), (orientation: landscape) and (max-height: 560px) {
  .sail-guide { align-items: start; }
  .heat-key { display: none; }
  .dest-art { height: 6.2rem; }
  .sail-map { padding: .25rem; }
}

/* ---------------------------------------------------------------- side: stage, log, helm -- */
/* the stage is always square (port, market keeper, ship master...), as large as the column allows */
.dk-side { display: flex; flex-direction: column; align-items: center; container-type: size; min-height: 0; }
.dk-dyn { display: none; }
/* The ship master gets the same square stage as the market keeper (sized exactly like the Market tab);
   the Captain's Commission sits under her at the same width, and the column scrolls if it runs long. */
.deck[data-tab="fleet"] .dk-side {
  gap: clamp(.45rem, .9vw, .85rem); justify-content: flex-start; overflow: auto; scrollbar-width: thin;
}
.deck[data-tab="fleet"] .dk-stage { width: min(100cqw, 100cqh - 10.5rem - clamp(.45rem, .9vw, .85rem)); }
.deck[data-tab="fleet"] .dk-dyn { display: block; flex: none; width: min(100cqw, 100cqh - 10.5rem); }
.fleet-commission {
  container-type: inline-size;
  --rank-tone: var(--deck-leather); --rank-deep: var(--deck-night); --rank-metal: var(--brass-hi);
  position: relative; isolation: isolate; overflow: hidden; padding: .8rem;
  background: linear-gradient(145deg, var(--rank-tone), var(--rank-deep) 85%);
  color: var(--deck-ivory); border: 1px solid var(--rank-metal); border-radius: var(--radius);
  box-shadow: inset 0 3px var(--rank-metal);
}
.fleet-captain-portrait {
  position: absolute; z-index: -1; inset: 0 0 0 auto; width: 57%; height: 100%; object-fit: cover;
  object-position: center 24%; opacity: .55; mask-image: linear-gradient(to right, transparent, #000 58%);
  pointer-events: none;
}
.fleet-commission :is(.fleet-commission-label, .fleet-rank-identity, dl, .fleet-rank-progress) {
  text-shadow: 0 1px 4px var(--deck-night), 0 0 6px var(--deck-night);
}
.fleet-commission-label {
  color: var(--rank-metal); font: .78rem/1.25 var(--special); letter-spacing: .09em; text-transform: uppercase;
}
.fleet-rank-identity { display: flex; gap: .55rem; align-items: center; margin-block: .45rem; }
.fleet-rank-identity > div { min-width: 0; }
.fleet-rank-identity h2 { margin: 0; font-size: 1.16rem; line-height: 1.15; overflow-wrap: anywhere; }
.fleet-rank-identity strong { color: var(--rank-metal); }
.fleet-rank-seal {
  width: 4.5rem; height: 4.5rem; object-fit: contain; flex: none;
  filter: drop-shadow(0 3px 5px var(--rank-deep));
}
.fleet-commission dl {
  display: grid; grid-template-columns: 1fr .55fr 1.15fr; gap: .35rem; margin: 0;
  padding-block: .45rem; border-block: 1px solid color-mix(in srgb, var(--rank-metal) 30%, transparent);
}
.fleet-commission dt, .fleet-rank-progress small { color: var(--deck-ivory); font-size: .84rem; }
.fleet-commission dd { margin: 0; font-weight: bold; overflow-wrap: anywhere; }
.fleet-rank-progress { margin-top: .45rem; color: var(--rank-metal); }
.fleet-rank-progress small { display: block; }
@container (max-width: 250px) {
  .fleet-rank-identity { flex-direction: column; align-items: flex-start; }
  .fleet-commission dl { grid-template-columns: 1fr 1fr; }
  .fleet-commission dl > div:last-child { grid-column: 1 / -1; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .deck[data-tab="fleet"] :is(.dk-stage, .dk-dyn) { width: 100%; }
}
.fleet-promotion {
  width: min(31rem, calc(100% - 1.2rem)); max-height: calc(100dvh - 1.2rem); padding: 0;
  color: var(--deck-ivory); background: var(--deck-lacquer); border: 1px solid var(--edge-hi);
  border-radius: var(--radius); overflow: auto;
  --edge-hi: color-mix(in srgb, var(--deck-brass) 70%, transparent);
  --brass-hi: color-mix(in srgb, var(--deck-brass) 70%, #fff3cf);
}
.fleet-promotion::backdrop { background: #100b09cf; }
.fleet-mayor-portrait { display: block; width: 100%; height: clamp(5rem, 28dvh, 12rem); object-fit: cover; object-position: center 34%; }
.fleet-promotion-letter { padding: 1rem; }
.fleet-promotion-letter h2 { margin: .2rem 0 .55rem; color: var(--brass-hi); }
.fleet-promotion-letter p { margin: .55rem 0 1rem; }
.fleet-promotion-error { color: var(--blood-hi); }
.fleet-promotion-error:not(:empty) { margin-top: .5rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="fleet"] { grid-template-rows: auto minmax(0, 1.5fr) minmax(0, 1fr) auto; }
  .deck[data-tab="fleet"] .dk-side { flex-direction: row; justify-content: center; align-items: stretch; }
  .deck[data-tab="fleet"] .dk-stage { width: auto; height: 100cqh; max-width: 55cqw; }
  .deck[data-tab="fleet"] .dk-dyn { width: auto; flex: 1 1 0; max-width: 22rem; overflow: auto; }
}
.dk-stage { flex: none; width: min(100cqw, 100cqh); aspect-ratio: 1 / 1; }

.dk-stage { position: relative; overflow: hidden; padding: 0; background: var(--deck-night); }
#stage { position: absolute; inset: 0; overflow: hidden; --who: var(--deck-brass); }
.stg-layer { position: absolute; inset: 0; transition: opacity 1s ease, transform 1.6s ease, filter 1s ease; }
.stg-talk { opacity: 0; transform: scale(1.04); }
#stage.talking .stg-talk { opacity: 1; transform: none; }
#stage.talking .stg-idle { opacity: .0; filter: blur(6px); transform: scale(1.06); }
.stg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; background: #000; }
.stg-idle .stg-img { object-position: 50% 50%; animation: stgDrift 26s ease-in-out infinite alternate; }
#stage.talking .stg-talk .stg-img { animation: stgPush 12s ease-out both; }
@keyframes stgDrift { from { transform: scale(1.12) translateX(-2%); } to { transform: scale(1.04) translateX(2%); } }
@keyframes stgPush { from { transform: scale(1.0); } to { transform: scale(1.07); } }
.stg-mono { position: absolute; inset: 0; display: grid; place-items: center; font: 400 clamp(3rem, 8vw, 6rem) var(--serif); font-style: normal;
  color: var(--deck-ivory); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--who) 70%, #000), var(--deck-night)); }
.stg-frame { position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--deck-brass) 40%, transparent), inset 0 0 60px rgba(0, 0, 0, .55);
  background: linear-gradient(180deg, rgba(10, 7, 5, .35), transparent 22%, transparent 48%, rgba(10, 7, 5, .92) 100%); }
#stage.talking .stg-frame { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--who) 80%, transparent), inset 0 0 70px rgba(0, 0, 0, .5),
  inset 0 -40px 60px -30px color-mix(in srgb, var(--who) 45%, transparent); }
.stg-plate { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: .7rem .9rem .8rem; }
.stg-plate b { display: block; font: 400 clamp(1.1rem, 1.9vw, 1.5rem)/1.15 var(--serif); color: var(--deck-ivory); text-shadow: 0 2px 10px #000; }
.stg-plate span { display: block; font: .78rem/1.3 var(--special); letter-spacing: .1em; color: var(--brass-hi); text-shadow: 0 1px 6px #000; }
#stage.talking .stg-plate span { color: color-mix(in srgb, var(--who) 55%, var(--deck-ivory)); }
.stg-sub { margin: .45rem 0 0; padding-left: .65rem; border-left: 3px solid var(--who); font: italic 1rem/1.35 var(--sans); color: var(--deck-ivory);
  text-shadow: 0 1px 8px #000; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#stage.talking .stg-plate { animation: plateIn .5s ease-out both; }
@keyframes plateIn { from { opacity: 0; transform: translateY(10px); } }
.stg-wave { position: absolute; z-index: 3; top: .7rem; right: .75rem; display: flex; align-items: flex-end; gap: 3px; height: 1.2rem; opacity: 0; transition: opacity .4s; }
#stage.talking .stg-wave { opacity: 1; }
.stg-wave s { display: block; width: 3px; height: 30%; border-radius: 2px; background: var(--who); box-shadow: 0 0 6px var(--who); animation: voiceBar .9s ease-in-out infinite; }
.stg-wave s:nth-child(2) { animation-delay: .12s; } .stg-wave s:nth-child(3) { animation-delay: .24s; }
.stg-wave s:nth-child(4) { animation-delay: .36s; } .stg-wave s:nth-child(5) { animation-delay: .48s; }
/* while the stage is on screen the small floating speaker badge is not needed */
body.ingame #speaking { display: none !important; }

.dk-feed { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.dk-feedtabs { display: flex; gap: .3rem; padding: .45rem .45rem 0; flex: none; }
.dk-feedtabs button { flex: 1; min-height: 34px; padding: .25rem .5rem; font: .82rem var(--special); letter-spacing: .08em; }
.dk-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0; padding: .55rem .85rem .7rem 1.05rem; list-style: none;
  font: .95rem/1.4 var(--sans); scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--deck-brass) 55%, transparent) transparent; overscroll-behavior: contain; }
.dk-list li { position: relative; padding: .35rem 0 .35rem .2rem; border-bottom: 1px dotted var(--rule); }
.dk-list li:last-child { border: 0; }
.dk-list li::before { content: ""; position: absolute; left: -.7rem; top: .85rem; width: 5px; height: 5px; transform: rotate(45deg); background: var(--deck-brass); opacity: .7; }
.dk-list li.muted::before { display: none; }

.dk-helm { flex: none; padding: .65rem .8rem .75rem; display: flex; flex-direction: column; gap: .3rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 22%, var(--glass)), var(--glass)); }
.dk-helm .eyebrow { color: var(--brass-hi); font-size: .72rem; }
.dk-helm b { font: 400 1.08rem/1.2 var(--serif); }
.dk-helm button { margin-top: .25rem; }
.dk-helm.ready { background: linear-gradient(180deg, color-mix(in srgb, var(--deck-jade) 40%, var(--glass)), var(--glass)); border-color: color-mix(in srgb, var(--jade-hi) 50%, transparent); }
.dk-helm.ready .eyebrow { color: var(--jade-hi); }

/* --------------------------------------------------------------- captain's log overlay -- */
.dk-over { position: relative; z-index: 6; min-height: 0; display: flex; }
.dk-over:empty { display: none; }
.deck .veil { position: absolute; inset: 0; z-index: auto; padding: clamp(.6rem, 2vw, 1.4rem); border-radius: calc(var(--radius) * 1.4);
  background: rgba(8, 5, 3, .6);  animation: veilIn .4s ease-out; }
.deck .modal { max-width: 40rem; max-height: 100%; overflow-y: auto; background: color-mix(in srgb, var(--deck-night) 88%, transparent);
  border: 1px solid var(--edge-hi); color: var(--deck-ivory); box-shadow: 0 30px 70px -20px #000, 0 0 40px -10px color-mix(in srgb, var(--deck-brass) 35%, transparent);
  scrollbar-width: thin; }
.deck .modal h2 { font: 400 1.6rem var(--title); color: var(--brass-hi); }
.deck .modal .eyebrow { color: var(--blood-hi); font-family: var(--title); }
.deck .captains-log {
  --cl-pad: clamp(1rem, 3vw, 2rem);
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  max-width: 44rem; padding: 0; overflow: hidden; background: var(--deck-night);
}
.cl-art {
  position: absolute; z-index: -1; inset: 0 0 0 46%; pointer-events: none;
  mask-image: linear-gradient(to right, transparent, #000 45%);
}
.cl-art-media { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 58% 38%; }
.cl-art::after {
  position: absolute; inset: 0; content: "";
  background: linear-gradient(to top, var(--deck-night), transparent 48%);
}
.cl-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cl-page { padding: var(--cl-pad) var(--cl-pad) 0; overflow-wrap: anywhere; }
.captains-log.has-art .cl-page { width: 65%; }
.cl-page header { margin-bottom: .8rem; padding-bottom: .7rem; border-bottom: 1px solid var(--edge-hi); }
.cl-page p { margin: 0; }
#cl-title { color: var(--brass-hi); font: 1.25rem var(--title); }
.deck .captains-log h2 { margin: .15rem 0; color: var(--deck-ivory); font: 400 clamp(1.9rem, 4vw, 2.75rem)/1.1 var(--title); }
.cl-entries { display: grid; gap: .45rem; }
.cl-entry {
  padding: .38rem .65rem; border-inline-start: 4px solid transparent; border-radius: 0 5px 5px 0;
  background: color-mix(in srgb, var(--deck-night) 88%, transparent);
  font: 1.1rem/1.3 var(--sans);
}
.cl-entry[aria-current], .cx-say[aria-current] {
  background: color-mix(in srgb, var(--brass-hi) 77%, #ffe6ad); color: #25170d;
  border-inline-start-color: #946127; padding-block: .6rem;
}
/* Speaker portrait fills the whole height of the Now Reading band, flush to its edges. */
.cl-entry[aria-current].has-face, .cx-say[aria-current].has-face {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: stretch; gap: .85rem;
  padding: 0 .75rem 0 0; overflow: hidden;
}
:is(.cl-entry, .cx-say)[aria-current].has-face > div { align-self: center; padding-block: .6rem; }
.cl-reader, .cl-portrait { display: none; }
:is(.cl-entry, .cx-say)[aria-current] :is(.cl-reader, .cl-portrait) { display: block; }
.cl-reader span {
  display: flex; align-items: center; gap: .35rem;
  font: 700 .68rem/1.4 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .07em;
}
.cl-reader svg { display: block; width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cl-portrait {
  position: relative; width: 100%; height: 100%; min-height: 8.5rem; overflow: hidden;
  box-shadow: inset -1px 0 0 #805524;
}
.cl-face {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%;
}
:is(.captains-log, .cx-desk) footer {
  display: flex; justify-content: flex-end; flex: none;
  padding: .9rem var(--cl-pad) var(--cl-pad);
}
:is(.captains-log, .cx-desk) footer button { min-height: 44px; }
.captains-log footer button span { margin-inline-start: .35rem; }
@media (max-width: 600px) {
  .captains-log.has-art .cl-page { width: auto; }
  .captains-log.has-art header { padding-inline-end: 30%; }
  .cl-art { inset: 0 0 auto 44%; height: 10rem; }
  .cl-art-media { object-position: 58% 26%; }
  .cl-art::after { background: linear-gradient(to top, var(--deck-night), transparent 76%); }
}
@media (orientation: portrait) {
  .dk-over:has(:is(.cl-veil, .cx-veil, .pg-veil, .mp-veil)) { grid-row: side-start / main-end; }
}
@keyframes veilIn { from { opacity: 0; } }
.deck .veil.no-fade { animation: none; }

/* ---------------------------------------------------------------- toast, voices, offline -- */
body.player #toast { background: linear-gradient(180deg, var(--deck-lacquer), var(--deck-night)); color: var(--deck-ivory);
  border: 1px solid var(--edge-hi); box-shadow: 0 14px 34px -10px #000; font-family: var(--sans); }
body.player #toast.bad { background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 85%, #fff 6%), var(--deck-oxblood)); border-color: var(--blood-hi); color: #fff; }
body.player #mute { background: var(--deck-lacquer); color: var(--deck-ivory); border-color: var(--edge-hi); }
/* on the game screen the voices switch lives in the captain's menu at the bottom of the rail */
body.ingame #mute { display: none !important; }
#offline { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 40; border-radius: 0 0 8px 8px; padding: .35rem 1.2rem;
  background: var(--deck-oxblood); color: #fff; font-weight: 600; box-shadow: 0 6px 18px #000; }
#offline[hidden] { display: none; }

/* --------------------------------------------------- join, lobby and end (no deck yet) -- */
.solo { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
body.player .masthead { background: none !important; border: 0; padding: clamp(2rem, 9vh, 5rem) 1rem 1.2rem; }
body.player .masthead h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); color: var(--deck-ivory); text-shadow: 0 4px 30px #000, 0 0 40px color-mix(in srgb, var(--deck-brass) 35%, transparent); }
body.player .masthead p { color: var(--brass-hi); font-size: clamp(1rem, 2vw, 1.3rem); }
body.player .masthead .logo { filter: drop-shadow(0 6px 24px #000); }
body.player .solo .card { background: var(--glass); border: 1px solid var(--edge); border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 22px 44px -26px #000; }
body.player .solo .card h2 { color: var(--brass-hi); font-weight: 400; }
body.player .roster li { border-bottom-color: var(--rule); }

/* ======================================================================= PORTRAIT == */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck { grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto clamp(9.5rem, 25vh, 18rem) minmax(0, 1fr) auto;
    grid-template-areas: "top" "side" "main" "nav"; }
  .dk-top { flex-wrap: wrap; row-gap: .45rem; }
  .dk-stats { flex: 1 1 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .plq { min-width: 0; text-align: left; }
  .plq.standing b { justify-content: flex-start; }
  .dk-side { justify-content: center; }
  .dk-nav { flex-direction: row; padding: .35rem; }
  .dk-nav button { flex: 1 1 0; min-height: 3.5rem; padding: .3rem .1rem; }
  .dk-nav svg { width: 1.45rem; height: 1.45rem; }
  .dk-nav button.on::before { left: 22%; right: 22%; top: auto; bottom: -.35rem; width: auto; height: 3px; }
  .dk-me { flex: 1 1 0; }
  .dk-me .dk-face { flex: 1 1 auto; }
  .dk-face img, .dk-face em { width: 2rem; height: 2rem; font-size: .85rem; }
  .dk-fly { left: auto; right: 0; bottom: calc(100% + .8rem); flex-direction: row; }
  .dk-fly::before { left: auto; right: 1.4rem; bottom: -6px; border-left: 0; border-right: 1px solid var(--edge-hi); }
  @keyframes flyIn { from { opacity: 0; transform: translateY(6px); } }
  .dk-main::before, .dk-main::after { width: .9rem; height: .9rem; }
}

/* phones held upright: smaller band, the log lives in the Ledger tab */
@media (orientation: portrait) and (max-width: 600px) {
  .deck { grid-template-rows: auto clamp(8rem, 21vh, 11rem) minmax(0, 1fr) auto; gap: .4rem; padding-left: max(.4rem, env(safe-area-inset-left)); padding-right: max(.4rem, env(safe-area-inset-right)); }
  .dk-top { padding: .45rem .55rem; }
  .dk-house b { font-size: 1.05rem; }
  .dk-house small { font-size: .78rem; }
  .dk-port b { font-size: 1.15rem; }
  .dk-port small { display: none; }
  .dk-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; }
  .plq { padding: .2rem .45rem; }
  .plq b { font-size: .92rem; }
  .dk-feed { display: none; }
  .dk-dyn { justify-content: flex-end; }
  .dk-helm { flex: 1 1 auto; justify-content: center; }
  .stg-sub { -webkit-line-clamp: 2; font-size: .85rem; }
  .stg-plate { padding: .45rem .55rem .55rem; }
  .stg-plate b { font-size: 1rem; }
  .dk-nav button span { font-size: .62rem; }
}

/* phones held sideways: very little height */
@media (orientation: landscape) and (max-height: 560px) {
  .deck { grid-template-columns: 4.6rem minmax(0, 1fr) clamp(12rem, 30vw, 17rem); gap: .4rem; }
  .dk-top { padding: .3rem .55rem; }
  .dk-house small { display: none; }
  .dk-port small, .dk-port span { display: none; }
  .dk-house .chip { height: 1.6rem; }
  .plq { min-width: 0; padding: .15rem .45rem; }
  .plq span { font-size: .58rem; } .plq b { font-size: .88rem; }
  .dk-nav { gap: .2rem; }
  .dk-nav button { min-height: 2.8rem; font-size: 0; gap: 0; }
  .dk-nav button span { display: none; }
  .dk-face img, .dk-face em { width: 2.1rem; height: 2.1rem; font-size: .85rem; }
  .dk-nav .dk-fly button { width: 3rem; min-height: 2.8rem; }
  .dk-side { grid-template-rows: minmax(0, 1fr) auto; }
  .dk-feed { display: none; }
  .stg-sub { -webkit-line-clamp: 2; font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  #ambient .amb, .stg-layer { transition-duration: .01s; }
  #ambient .amb.on > *, .stg-idle .stg-img, #stage.talking .stg-talk .stg-img, .stg-wave s, #stage.talking .stg-plate, .deck .veil { animation: none; }
}

/* The Tally Book button in the tab rail: opens the statistics window. */
.dk-nav .dk-tally { color: var(--brass-hi); border-color: var(--edge); border-style: dashed; }
.dk-nav .dk-tally:hover:not(:disabled) { border-style: solid; }
.dk-nav .dk-tally.face { border-style: solid; }   /* the bookmaker's face replaces the dashed tally icon */

/* ============================================================================ MARKET == */
/* One tight table row per cargo: picture, name, price over what is aboard, a fat drag bar, a narrow button.
   Rows hug their content (no stretching to fill the pane) so the whole market sits in one glance. */
.deck .card.mk { display: flex; flex-direction: column; margin-bottom: 0; padding-top: .55rem; padding-bottom: .4rem; }
.mk-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem 1rem; margin-bottom: .2rem;
  padding-bottom: .25rem; border-bottom: 1px solid; border-image: linear-gradient(90deg, var(--edge-hi), transparent 70%) 1; }
.deck .mk-head h2 { margin: 0; padding: 0; border: 0; }
.mk-head .muted { font-size: .85rem; cursor: help; }
.mk-head .mk-hold { margin-left: auto; font: .8rem/1.2 var(--special); letter-spacing: .08em; color: var(--brass-hi); white-space: nowrap; }
.mk-head button.slim { align-self: center; }
.deck .mk .note { margin: .25rem 0; }

.mk-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.mk-table th { padding: .1rem .4rem .2rem; font: 400 .7rem/1.1 var(--special); letter-spacing: .08em; text-align: left; white-space: nowrap;
  color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); border-bottom: 1px solid var(--edge-hi); }
.mk-table th.n { text-align: right; }
.mk-table th.mk-scale span:last-child { float: right; }
.mk-table th.mk-scale span:first-child::before { content: "\25C2  "; }
.mk-table th.mk-scale span:last-child::after { content: "  \25B8"; }
.mk-table td { display: table-cell; padding: .14rem .4rem; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.mk-table tbody tr { transition: background .2s; }
.mk-table tbody tr:hover { background: color-mix(in srgb, var(--deck-brass) 6%, transparent); }
.mk-table tbody tr.buy { background: color-mix(in srgb, var(--deck-jade) 11%, transparent); }
.mk-table tbody tr.sell { background: color-mix(in srgb, var(--deck-oxblood) 15%, transparent); }

/* picture: no air above or below it, so the rule sits right under it */
.mk-table td.mk-ico { width: 1%; padding: .15rem .15rem .15rem .2rem; line-height: 0; }
body.player .mk-ico .gicon, .mk-ico img, .mk-ico video { display: block; width: 3.6rem; height: 3.6rem; margin: 0; object-fit: cover;
  border-radius: calc(var(--radius) * .5); box-shadow: 0 0 0 1px var(--edge-hi), 0 2px 6px rgba(0, 0, 0, .5); }
.mk-table td.mk-name { width: 1%; white-space: nowrap; }
.mk-name b { font: 400 1.08rem/1.1 var(--serif); color: var(--deck-ivory); }
.mk-name .tag { display: block; width: max-content; margin: .1rem 0 0; font-size: .68rem; }
/* Best known port for this cargo (player.js bestHtml(), 19 Nov 2026; moved from the old Ledger tab).
   Brass when the price is 4 months old or more. */
.mk-name .mk-best { display: block; margin-top: .12rem; font-size: .68rem; line-height: 1.1; color: var(--jade-hi); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-name .mk-best.old { color: var(--brass-hi); }

/* price big and bold, what is aboard small beneath it */
.mk-table td.mk-num { width: 1%; text-align: right; white-space: nowrap; line-height: 1; }
.mk-price { display: block; font: 800 1.42rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--brass-hi); letter-spacing: -.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.mk-have { display: block; margin-top: .12rem; font-size: .72rem; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.mk-have b { color: var(--deck-ivory); font-weight: 700; }
.mk-have s { opacity: .7; }
tr.buy .mk-have .mk-at { color: var(--jade-hi); }
tr.sell .mk-have .mk-at { color: var(--blood-hi); }

/* the drag bar: a fat track (its fill is drawn by player.js) and a tall brass handle */
.deck { --bar-tick: var(--brass-hi); --bar-held: color-mix(in srgb, var(--deck-brass) 34%, transparent);
  --bar-buy: var(--jade-hi); --bar-sell: var(--blood-hi); --bar-empty: color-mix(in srgb, var(--deck-night) 80%, #000); }
.mk-table td.mk-bar { padding-left: .55rem; padding-right: .55rem; }
.mk-range { --tw: 1.35rem; -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 7rem; height: 1.15rem; min-height: 0; margin: .45rem 0;
  padding: 0; border-radius: .58rem; cursor: grab; touch-action: none;
  border: 0 !important; box-shadow: inset 0 0 0 1px var(--rule), inset 0 2px 5px rgba(0, 0, 0, .65) !important; }
.mk-range:active { cursor: grabbing; }
.mk-range::-webkit-slider-runnable-track { height: 100%; background: transparent; border: 0; }
.mk-range::-moz-range-track { height: 100%; background: transparent; border: 0; }
.mk-range::-webkit-slider-thumb { -webkit-appearance: none; width: var(--tw); height: 2.05rem; margin-top: calc((1.15rem - 2.05rem) / 2); border-radius: .5rem;
  background: linear-gradient(90deg, transparent 44%, color-mix(in srgb, var(--deck-brass) 45%, #000) 44% 56%, transparent 56%),
    radial-gradient(ellipse at 40% 25%, #fff1c9, var(--deck-brass) 58%, color-mix(in srgb, var(--deck-brass) 55%, #000));
  border: 1px solid color-mix(in srgb, var(--deck-brass) 45%, #000);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .75), 0 0 0 3px color-mix(in srgb, var(--deck-brass) 20%, transparent); }
.mk-range::-moz-range-thumb { width: var(--tw); height: 2.05rem; border-radius: .5rem; box-sizing: border-box;
  background: linear-gradient(90deg, transparent 44%, color-mix(in srgb, var(--deck-brass) 45%, #000) 44% 56%, transparent 56%),
    radial-gradient(ellipse at 40% 25%, #fff1c9, var(--deck-brass) 58%, color-mix(in srgb, var(--deck-brass) 55%, #000));
  border: 1px solid color-mix(in srgb, var(--deck-brass) 45%, #000); box-shadow: 0 3px 8px rgba(0, 0, 0, .75); }
.mk-range:hover::-webkit-slider-thumb { box-shadow: 0 3px 8px rgba(0, 0, 0, .75), 0 0 0 4px color-mix(in srgb, var(--deck-brass) 32%, transparent); }
.mk-range:disabled { opacity: .35; cursor: not-allowed; }
.mk-range:disabled::-webkit-slider-thumb { visibility: hidden; }
.mk-range:disabled::-moz-range-thumb { visibility: hidden; }

/* the button: narrow and bold */
.mk-table td.mk-do { width: 1%; padding-left: 0; padding-right: .25rem; }
body.player button.mk-go { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
  width: 6.4rem; min-height: 2.35rem; padding: .18rem .35rem; line-height: 1.05; font-variant-numeric: tabular-nums; text-align: center; }
body.player button.mk-go b { font: 800 .86rem/1.05 var(--sans); letter-spacing: .01em; white-space: nowrap; }
body.player button.mk-go small { font: 700 .74rem/1 var(--sans); opacity: .92; white-space: nowrap; }
body.player button.mk-go:disabled { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--edge); color: var(--brass-hi); opacity: 1; }
body.player button.mk-go:disabled b { font: 700 .7rem/1.05 var(--special); letter-spacing: .07em; text-transform: uppercase; white-space: normal; }
body.player button.mk-go.buy { color: #eafff6; border-color: var(--jade-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-jade) 80%, #fff 10%), var(--deck-jade) 60%, color-mix(in srgb, var(--deck-jade) 70%, #000)); }
body.player button.mk-go.sell { color: #fff6e3; border-color: var(--blood-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 78%, #ff9b84 10%), var(--deck-oxblood) 55%, color-mix(in srgb, var(--deck-oxblood) 70%, #000)); }

/* slim buttons used by the market, fleet and shipyard */
body.player button.slim { padding: .3rem .65rem; font-size: .84rem; line-height: 1.2; white-space: nowrap; }

/* narrow panes (phones): smaller picture, price and button so the row still fits on one line */
@container pane (max-width: 620px) {
  body.player .mk-ico .gicon, .mk-ico img, .mk-ico video { width: 2.8rem; height: 2.8rem; }
  .mk-name b { font-size: .95rem; }
  .mk-price { font-size: 1.15rem; }
  .mk-table td { padding-left: .25rem; padding-right: .25rem; }
  .mk-range { min-width: 4.5rem; }
  body.player button.mk-go { width: 5.2rem; }
  .mk-head .mk-hold { margin-left: 0; }
}

/* while the market keeper, ship master, mayor or tax lady is on the (square) stage, frame her face */
@media (orientation: landscape) and (min-aspect-ratio: 1/1) {
  .deck.woman .stg-idle .stg-img { object-position: 50% 18%; animation: none; }
}

/* ================================================================== FLEET & SHIPYARD == */
/* Matches player.js fleetTab(): .fl-ships > .fl-ship cards (art | body) and the .yd-table shipyard.
   Sized like the Market rows so the tab no longer shows ship pictures at full width. */
.fl-ships { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 27rem), 1fr)); margin: .3rem 0 0; }
.fl-ship.fl-flagship { grid-column: 1 / -1; }
.fl-ship { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .8rem; align-items: center; min-width: 0;
  padding: .4rem .5rem .4rem .4rem; border: 1px solid var(--rule); border-radius: calc(var(--radius) * .7);
  background: color-mix(in srgb, var(--deck-night) 30%, transparent); }
.fl-art { line-height: 0; min-width: 0; }
body.player .fl-art .gicon, .fl-art .fl-img, .fl-art img, .fl-art video { display: block; width: 9.5rem; height: 7.1rem; max-width: 100%; margin: 0;
  object-fit: cover; border-radius: calc(var(--radius) * .5); box-shadow: 0 0 0 1px var(--edge-hi), 0 2px 6px rgba(0, 0, 0, .5); }
.fl-body { display: flex; flex-direction: column; gap: .32rem; min-width: 0; }
.fl-ship .fl-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.fl-ship .fl-name b { font: 400 1.05rem/1.15 var(--serif); color: var(--deck-ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fl-ship .fl-name .tag { font-size: .66rem; }
.fl-type { flex-basis: 100%; font-size: .76rem; line-height: 1.2; color: var(--muted); }
.fl-stat { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) max-content; align-items: center; gap: .45rem; }
.fl-lbl { font: .66rem/1 var(--special); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); }
.fl-v { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-stat .hull { height: 14px; border-radius: 4px; overflow: hidden; margin: 0; background: color-mix(in srgb, var(--deck-night) 60%, #000); box-shadow: inset 0 0 0 1px var(--rule); }
.fl-pips { display: flex; flex-wrap: wrap; gap: 2px 4px; min-width: 0; }
/* Each gun slot is a small cannon drawn with a mask: brass when mounted, a faint outline colour when empty. */
.fl-pips i { width: 1.55rem; height: 1rem; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20'%3E%3Cpath d='M3 5.6 26 4.2Q28.6 4.2 28.6 6.4V9.6Q28.6 11.8 26 11.8L3 10.4Q.9 10 .9 8T3 5.6Z'/%3E%3Crect x='26.6' y='3.2' width='3.4' height='9.6' rx='1'/%3E%3Ccircle cx='1.4' cy='8' r='1.4'/%3E%3Cpath d='M5.5 10.2H21L19 14.2H7.5Z'/%3E%3Ccircle cx='9' cy='15.6' r='3.6'/%3E%3Ccircle cx='17.8' cy='15.6' r='3.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20'%3E%3Cpath d='M3 5.6 26 4.2Q28.6 4.2 28.6 6.4V9.6Q28.6 11.8 26 11.8L3 10.4Q.9 10 .9 8T3 5.6Z'/%3E%3Crect x='26.6' y='3.2' width='3.4' height='9.6' rx='1'/%3E%3Ccircle cx='1.4' cy='8' r='1.4'/%3E%3Cpath d='M5.5 10.2H21L19 14.2H7.5Z'/%3E%3Ccircle cx='9' cy='15.6' r='3.6'/%3E%3Ccircle cx='17.8' cy='15.6' r='3.6'/%3E%3C/svg%3E") center / contain no-repeat;
  background: color-mix(in srgb, var(--deck-brass) 22%, transparent); }
.fl-pips i.on { background: linear-gradient(180deg, #fff1c9 0%, var(--brass-hi) 35%, var(--deck-brass) 75%, color-mix(in srgb, var(--deck-brass) 60%, #000) 100%); }
/* A cannon fills two mounts: one pip twice as wide, in red bronze. */
.fl-pips i.cn { width: calc(3.1rem + 4px); height: 1.2rem; background: color-mix(in srgb, #c8743a 30%, transparent); }
.fl-pips i.cn.on { background: linear-gradient(180deg, #ffe2c2 0%, #e59a5c 35%, #b0582a 75%, #5e2610 100%); }
/* Guns row (18 Nov 2026): the long "12 cannons + 0 · 24/24 mounts" line used to squeeze the pips into a one-wide
   column that ran down the card. Label and mounts text now share the top line; the pips get their own full line
   under the hull bar's column and wrap into short rows. */
.fl-stat:has(> .fl-pips) { grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-areas: "lbl v" ". pips"; row-gap: .3rem; align-items: center; }
.fl-stat:has(> .fl-pips) > .fl-lbl { grid-area: lbl; }
.fl-stat:has(> .fl-pips) > .fl-v { grid-area: v; white-space: normal; line-height: 1.2; }
.fl-stat:has(> .fl-pips) > .fl-pips { grid-area: pips; gap: 3px 4px; align-items: center; }
.fl-pips i { width: 1.15rem; height: .75rem; flex: none; }
.fl-pips i.cn { width: calc(2.3rem + 4px); height: .95rem; }
.fl-acts { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .15rem; }
body.player button.fl-btn { padding: .25rem .6rem; font-size: .8rem; line-height: 1.2; white-space: nowrap; min-height: 0; }
.mk-head button.fl-btn { align-self: center; }
.fl-ok { font: .76rem/1.2 var(--special); letter-spacing: .05em; color: var(--jade-hi); padding: .25rem .3rem; white-space: nowrap; }
.fl-none { margin: .3rem 0 0; font-size: .88rem; }

/* The fleet's three classes (18 Nov 2026): a heading per class with its job, count of limit and lock;
   a coloured edge on each ship card says where she sails: van (escorts, oxblood), line (merchantmen, brass),
   rear (cargo ships, jade). The shipyard repeats the same headings as row groups. */
.fl-class { margin: .55rem 0 0; }
.fl-class:first-of-type { margin-top: .3rem; }
.fl-class-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; margin: 0 0 .1rem; padding: .15rem 0 .2rem .55rem;
  border-left: 3px solid var(--cls, var(--deck-brass)); }
.fl-class-head b { font: 400 1rem/1.15 var(--serif); color: var(--deck-ivory); letter-spacing: .02em; }
.fl-class-sub { font-size: .76rem; color: var(--muted); }
.fl-class-n { margin-left: auto; font: .72rem/1 var(--special); letter-spacing: .08em; color: var(--brass-hi); white-space: nowrap; }
.fl-lock, .fl-full { font: .68rem/1 var(--special); letter-spacing: .06em; padding: .15rem .4rem; border-radius: 99px; white-space: nowrap;
  border: 1px solid var(--rule); color: var(--muted); }
.fl-full { color: var(--jade-hi); border-color: color-mix(in srgb, var(--jade-hi) 45%, transparent); }
.fl-escort { --cls: #b3402a; }
.fl-trader { --cls: var(--deck-brass); }
.fl-cargo { --cls: #3f9a7a; }
.fl-ship.fl-escort, .fl-ship.fl-trader, .fl-ship.fl-cargo { border-left: 3px solid var(--cls); }
.fl-cargo-ships { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.fl-ship.fl-cargo { grid-template-columns: 4.75rem minmax(0, 1fr); gap: .5rem; }
body.player .fl-cargo .fl-art :is(.gicon, .fl-img, img, video) { width: 4.75rem; height: 3.55rem; }
.fl-screen { font-size: .76rem; color: var(--jade-hi); white-space: nowrap; }
.fl-screen.thin { color: var(--vermilion, #d0573a); }
.yd-table tr.yd-head th { padding: .55rem .2rem .15rem; border-bottom: 1px solid var(--edge-hi); text-transform: none; letter-spacing: 0; font: inherit; }
.yd-table tr.yd-head .fl-class-head { margin: 0; }
.yd-table tbody.yd-class:first-of-type tr.yd-head th { padding-top: .2rem; }
.yd-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.yd-table th { padding: .1rem .4rem .2rem; font: 400 .7rem/1.1 var(--special); letter-spacing: .08em; text-align: left; white-space: nowrap;
  color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); border-bottom: 1px solid var(--edge-hi); }
.yd-table th.n, .yd-table td.n { text-align: right; }
.yd-table td { padding: .14rem .4rem; vertical-align: middle; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.yd-table tbody tr { transition: background .2s; }
.yd-table tbody tr:hover { background: color-mix(in srgb, var(--deck-brass) 6%, transparent); }
.yd-table tr.dim { opacity: .5; }
.yd-table td.yd-ico { width: 1%; padding: .15rem .15rem .15rem .2rem; line-height: 0; }
body.player .yd-ico .gicon, .yd-ico .yd-img, .yd-ico img, .yd-ico video { display: block; width: 3.6rem; height: 2.7rem; margin: 0; object-fit: cover;
  border-radius: calc(var(--radius) * .5); box-shadow: 0 0 0 1px var(--edge-hi), 0 2px 6px rgba(0, 0, 0, .5); }
.yd-table td.yd-name { white-space: nowrap; }
.yd-name b { font: 400 1.02rem/1.15 var(--serif); color: var(--deck-ivory); margin-right: .4rem; }
.yd-name .tag { font-size: .66rem; }
.yd-price { color: var(--brass-hi); font-weight: 700; white-space: nowrap; }
.yd-table td.yd-do { width: 1%; padding-left: .2rem; padding-right: .25rem; text-align: right; }

@container pane (max-width: 620px) {
  .fl-ships { grid-template-columns: 1fr; }
  .fl-cargo-ships { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
  .fl-ship { grid-template-columns: 6.4rem minmax(0, 1fr); gap: .6rem; }
  body.player .fl-art .gicon, .fl-art .fl-img, .fl-art img, .fl-art video { width: 6.4rem; height: 4.8rem; }
  .fl-pips i { width: 1rem; height: .65rem; }
  .fl-pips i.cn { width: calc(2rem + 4px); height: .85rem; }
  body.player .yd-ico .gicon, .yd-ico .yd-img, .yd-ico img, .yd-ico video { width: 2.8rem; height: 2.1rem; }
  .yd-table td, .yd-table th { padding-left: .25rem; padding-right: .25rem; }
  .yd-table th:nth-child(3), .yd-table td:nth-child(4) { display: none; } /* hull column (the Ship header spans two cells) */
}

/* Plaques while market trades are planned: the figure after the trades, the present one small beneath. */
.plq.plan b { color: var(--deck-ivory); }
.plq.plan.up b { color: var(--jade-hi); }
.plq.plan.down b { color: color-mix(in srgb, var(--blood-hi) 85%, var(--deck-ivory)); }
.plq.plan.bad b { color: var(--blood-hi); }
.plq.plan { border-color: var(--edge-hi); box-shadow: inset 0 1px 0 rgba(255, 236, 190, .1), 0 0 14px -6px var(--deck-brass); }
.plq small { display: block; margin-top: -.1rem; font: .62rem/1.1 var(--sans); color: var(--muted); white-space: nowrap; }
.dk-stats.over .plq.bad { animation: plqWarn 1.2s ease-in-out infinite; }
/* The debt clock under the Debt plaque: months until the collectors call; it pulses in the last month. */
.plq.due small { color: color-mix(in srgb, var(--blood-hi) 80%, var(--deck-ivory)); }
.plq.due-now { animation: plqWarn 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .plq.due-now { animation: none; box-shadow: 0 0 12px -2px var(--blood-hi); } }
@keyframes plqWarn { 50% { box-shadow: 0 0 16px -2px var(--blood-hi); } }

/* ------------------------------------------------------------- the Tally Book, in place -- */
/* Tally in the rail swaps the working pane and the side column (stage, log, helm) for the
   statistics, which then fill everything right of the rail. */
.dk-tallyhost { grid-area: main; display: none; position: relative; z-index: 1; min-height: 0; min-width: 0;
  border: 1px solid var(--edge); border-radius: calc(var(--radius) * 1.4); overflow: hidden;
  background: color-mix(in srgb, var(--deck-night) 55%, transparent); }
.deck[data-tab="tally"] { grid-template-areas: "top top top" "nav main main"; }
.deck[data-tab="tally"] .dk-main, .deck[data-tab="tally"] .dk-side { display: none; }
.deck[data-tab="tally"] .dk-tallyhost { display: block; animation: tallyIn .35s ease both; }
@keyframes tallyIn { from { opacity: 0; transform: translateX(14px); } }
.tally-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--deck-night); }
.dk-nav .dk-tally.on { border-style: solid; color: var(--brass-hi); border-color: var(--edge-hi);
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--deck-brass) 26%, transparent), color-mix(in srgb, var(--deck-oxblood) 22%, transparent) 75%); }
.tally-solo { position: fixed; inset: 0; z-index: 40; background: var(--deck-night); }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="tally"] { grid-template-areas: "top" "main" "main" "nav"; }
}
@media (prefers-reduced-motion: reduce) { .deck[data-tab="tally"] .dk-tallyhost { animation: none; } }

/* Tab rail pictures (the woman for that tab, or the port): square and as big as the rail allows, with the
   tab's name in bold white across the foot of the picture. --ti is the picture's side: capped by the
   rail's width and by the screen's height, so all five tabs, Tally and the captain still fit. */
.dk-nav { padding: .4rem .35rem; --ti: min(calc(5.4rem - 2px), calc((100dvh - 19.5rem) / 5)); }
.dk-nav button.face { display: grid; place-items: center; min-height: 0; padding: .25rem; gap: 0; }
.dk-nav button.face > * { grid-area: 1 / 1; }
.dk-nav .dk-tabimg { display: block; width: var(--ti); height: var(--ti); object-fit: cover; object-position: 50% 18%;
  border-radius: calc(var(--radius) * .6); box-shadow: 0 0 0 1px var(--edge-hi), 0 3px 8px rgba(0, 0, 0, .6); }
.dk-nav .dk-tabimg.port { object-position: 50% 50%; }
.dk-nav button.face span { align-self: end; width: var(--ti); max-width: none; padding: .9rem .1rem .22rem; box-sizing: border-box;
  border-radius: 0 0 calc(var(--radius) * .6) calc(var(--radius) * .6); text-align: center;
  font: 800 .78rem/1 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .88));
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .9); pointer-events: none; }
.dk-nav button.face.on span { color: #fff6dc; }
.dk-nav button.on .dk-tabimg { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 14px color-mix(in srgb, var(--deck-brass) 70%, transparent); }
.dk-nav button.face:not(.on) .dk-tabimg { filter: saturate(.8) brightness(.85); }
.dk-nav button.face:hover .dk-tabimg { filter: none; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .dk-nav { --ti: min(3.8rem, calc((100vw - 3rem) / 6 - .7rem)); }
  .dk-nav button.face span { font-size: .6rem; padding-top: .6rem; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .dk-nav { --ti: min(calc(4.6rem - 1.3rem), calc((100dvh - 9rem) / 5)); }
  .dk-nav button.face { padding: .15rem; }
}

/* ============================================== TAB RAIL LABELS & CAPTAIN (16 Nov 2026, 8:40 pm) == */
/* Every rail label is in MedievalSharp and always shown, on every screen size, so a tab can be read
   even when its picture is missing or small. The face is loaded here as well as in /fonts.css, so the
   rail never depends on which fonts Admin has picked. */
@font-face { font-family: 'SeaTrader Rail'; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/medievalsharp-latin-a242b60f.woff2") format('woff2'); }
.dk-nav { --rail-font: 'MedievalSharp', 'SeaTrader Rail', var(--special), serif; }
.dk-nav button, .dk-nav button span, .dk-nav button.face span, .dk-nav .dk-fly button span {
  font-family: var(--rail-font); font-weight: 400; font-style: normal; text-transform: none; }
.dk-nav button span { display: block !important; font-size: .82rem; line-height: 1.05; letter-spacing: .02em; }
.dk-nav button.face span { font-size: .92rem; padding: .95rem .1rem .25rem; color: #fff; }
.dk-nav .dk-face span { max-width: 4.8rem; color: var(--deck-ivory); }
.dk-nav .dk-fly button span { font-size: .78rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .dk-nav button span { font-size: .72rem; }
  .dk-nav button.face span { font-size: .7rem; padding-top: .6rem; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .dk-nav button { font-size: .62rem; gap: .1rem; }
  .dk-nav button span, .dk-nav button.face span { font-size: .62rem; }
  .dk-nav button.face span { padding-top: .45rem; }
}
/* the captain sits at the very foot of the rail */
.dk-nav .dk-me { flex: none; }
.dk-nav .dk-me .dk-face { min-height: 0; padding: .35rem .2rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) { .dk-nav .dk-me { flex: 1 1 0; } .dk-nav .dk-gap { display: none; } }

/* ============================================== RAIL: SMALLER BUTTONS, NAMES ALWAYS SHOWN (16 Nov 2026, 8:45 pm) == */
/* The tab names vanished on every tab that wasn't open or hovered: the dimming filter on those pictures put
   them in their own layer, painted over the name. The filter is gone; tabs that aren't open are dimmed by a
   dark veil that sits between the picture and the name, so the name is always on top and always readable. */
.dk-nav button.face:not(.on) .dk-tabimg, .dk-nav button.face:hover .dk-tabimg { filter: none !important; }
.dk-nav button.face { position: relative; isolation: isolate; }
.dk-nav button.face .dk-tabimg { position: relative; z-index: 1; }
.dk-nav button.face::after { content: ""; grid-area: 1 / 1; width: var(--ti); height: var(--ti); z-index: 2;
  border-radius: calc(var(--radius) * .6); background: rgba(10, 6, 3, .28); pointer-events: none; transition: background .2s; }
.dk-nav button.face.on::after, .dk-nav button.face:hover::after { background: transparent; }
.dk-nav button.face span, .dk-nav button span { position: relative; z-index: 3; display: block !important;
  visibility: visible !important; opacity: 1 !important; color: #fff; }
.deck { grid-template-columns: 6.6rem minmax(0, 1fr) clamp(15.5rem, 28vw, 25rem); }
.dk-nav { gap: .3rem; --ti: min(5.4rem, calc((100dvh - 19.5rem) / 5)); }
.dk-nav button { min-height: 3.8rem; }
.dk-nav button.face span { font-size: .9rem; padding: .8rem .1rem .2rem; }
.dk-nav button span { font-size: .74rem; }
.dk-face img, .dk-face em { width: 2.2rem; height: 2.2rem; font-size: .9rem; }
.dk-nav .dk-fly button { width: 3.8rem; min-height: 3.5rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .dk-nav { --ti: min(3.3rem, calc((100vw - 3rem) / 6 - .9rem)); }
  .dk-nav button { min-height: 3.1rem; }
  .dk-nav button.face span { font-size: .64rem; padding-top: .5rem; }
  .dk-face img, .dk-face em { width: 1.8rem; height: 1.8rem; font-size: .75rem; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .deck { grid-template-columns: 4.2rem minmax(0, 1fr) clamp(12rem, 30vw, 17rem); }
  .dk-nav { --ti: min(3.2rem, calc((100dvh - 9rem) / 5)); }
  .dk-nav button { min-height: 2.6rem; }
  .dk-nav button.face span, .dk-nav button span { font-size: .58rem; }
}

/* ------------------------------------------------- the dealer's card under the market keeper -- */
/* player.js dealerCard(): shown in the side column under the stage while the Market tab is open. */
.deck[data-tab="market"] .dk-side { gap: clamp(.45rem, .9vw, .85rem); }
.deck[data-tab="market"] .dk-dyn { display: block; flex: none; width: min(100cqw, 100cqh - 10.5rem); }
.deck[data-tab="market"] .dk-stage { width: min(100cqw, 100cqh - 10.5rem - clamp(.45rem, .9vw, .85rem)); }
.dl-card { padding: .6rem .8rem .65rem; background: var(--glass); border: 1px solid var(--edge); border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 236, 190, .07);
  }
.dl-card header { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.dl-card header span { font: .78rem/1.2 var(--special); letter-spacing: .1em; text-transform: uppercase; color: var(--brass-hi); }
.dl-card header b { font: 800 1.5rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--brass-hi); }
/* standing heat bar: red at 0, amber at 50, green at 100; lit up to the standing, dark beyond it */
.dl-standing { display: flex; align-items: center; gap: .5rem; margin: .35rem 0 .4rem; }
.dl-standing span { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dl-standing b { min-width: 1.8em; text-align: right; font: 700 .95rem/1 var(--sans); font-variant-numeric: tabular-nums;
  color: hsl(var(--rep-hue) 75% 62%); }
.dl-heat { position: relative; flex: 1 1 auto; height: 12px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(90deg, #c0392b, #e67e22 30%, #f1c40f 50%, #9acd32 72%, #27ae60);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45), 0 0 10px -4px hsl(var(--rep-hue) 75% 50%); }
.dl-heat i { position: absolute; top: 0; bottom: 0; left: var(--rep); right: 0;
  background: color-mix(in srgb, var(--deck-night) 85%, #000); box-shadow: inset 2px 0 0 var(--deck-ivory); }
.dl-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .22rem 0; border-top: 1px solid var(--rule); }
.dl-row span { font-size: .9rem; color: var(--deck-ivory); }
.dl-row small { margin-left: .4rem; font-size: .72rem; color: var(--muted); }
.dl-row b { font: 700 1.15rem/1.1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-row.pay b { color: color-mix(in srgb, var(--blood-hi) 85%, var(--deck-ivory)); }
.dl-row.get b { color: var(--jade-hi); }
.dl-row.cut b { color: var(--brass-hi); }

/* upright screens: the stage is a band across the top, so the card sits beside her instead */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="market"] .dk-side { flex-direction: row; justify-content: center; align-items: stretch; }
  .deck[data-tab="market"] .dk-stage { width: auto; height: 100cqh; max-width: 55cqw; }
  .deck[data-tab="market"] .dk-dyn { width: auto; flex: 1 1 0; max-width: 22rem; overflow: auto; }
}

/* ------------------------------------------------ outward clearance under the Mayor -- */
.deck[data-tab="chart"] .dk-side { gap: clamp(.45rem, .9vw, .85rem); }
.deck[data-tab="chart"] .dk-dyn { display: block; flex: 0 1 auto; min-height: 0; overflow: auto; width: min(100cqw, 100cqh - 18.5rem); }
.deck[data-tab="chart"] .dk-stage { flex: none; width: min(100cqw, 100cqh - 18.5rem - clamp(.45rem, .9vw, .85rem)); }

/* Aged, tea-stained paper rather than bright cream, so it sits in the dark deck without glaring;
   type sized up for reading at arm's length. Same height budget (18.5rem above), tighter padding. */
.cl-card { --paper: #b99d6f; --paper-hi: #cbb284; --ink: #1c130c; --ink-soft: #46372a; --form-rule: rgba(60, 40, 20, .42);
  position: relative; overflow: hidden; padding: .5rem .6rem .45rem .95rem; color: var(--ink);
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(70, 42, 18, .38) 100%),
    linear-gradient(100deg, rgba(90, 52, 22, .22), transparent 12%),
    repeating-linear-gradient(0deg, transparent 0 1.6rem, rgba(70, 48, 26, .1) 1.62rem),
    linear-gradient(135deg, var(--paper-hi), var(--paper));
  border: 1px solid #7d6236; border-radius: 3px;
  box-shadow: 0 18px 34px -22px #000, inset 0 0 34px rgba(64, 38, 14, .32), inset 0 0 0 1px rgba(255, 236, 190, .12); }
.cl-card::before { content: ""; position: absolute; top: 0; bottom: 0; left: .62rem; width: 1px; background: rgba(110, 36, 28, .5); }
.cl-head { position: relative; min-height: 2.9rem; padding: 0 7.6rem .3rem 0; border-bottom: 2px double rgba(40, 26, 12, .65); }
.cl-head > span { display: block; font: 700 .7rem/1.1 var(--special); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.cl-head h3 { margin: .1rem 0 0; font: 700 1.32rem/1 var(--serif); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.cl-pay { position: absolute; top: 0; right: 0; text-align: right; }
.cl-pay small { display: block; font: 700 .66rem/1 var(--special); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
.cl-pay b { display: block; margin-top: .15rem; font: 800 1.6rem/1 var(--sans); font-variant-numeric: tabular-nums; color: #5e1f19; }
.cl-meta { display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: .22rem 0 .16rem;
  font: 700 .68rem/1.15 var(--special); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.cl-rate { overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.cl-rate.credit, .cl-row.credit strong { color: #1d4a35; }
.cl-rate.surcharge, .cl-row.surcharge strong { color: #6a2019; }
.cl-section { margin-top: .18rem; }
.cl-section h4 { margin: 0; padding: .2rem .35rem; font: 800 .72rem/1 var(--special); letter-spacing: .09em; text-transform: uppercase;
  color: #e9d8b0; background: rgba(38, 26, 15, .9); }
.cl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .45rem; min-height: 1.5rem;
  padding: .08rem .24rem; border-bottom: 1px dotted var(--form-rule); }
.cl-row > span { min-width: 0; display: flex; align-items: baseline; gap: .35rem; overflow: hidden; font: 700 .88rem/1.1 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.cl-row span b { overflow: hidden; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.cl-row small { overflow: hidden; font: 600 .7rem/1.1 var(--sans); color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.cl-row strong { font: 800 .98rem/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-row.subtotal { min-height: 1.6rem; border-bottom: 0; border-top: 1px solid rgba(40, 26, 12, .75); }
.cl-row.subtotal span, .cl-row.subtotal strong { font-weight: 900; color: var(--ink); }
.cl-row.subtotal strong { font-size: 1.05rem; }
.cl-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: solid var(--form-rule); border-width: 0 1px 1px 0; }
.cl-boxes > span { min-width: 0; padding: .22rem .3rem .2rem; border: solid var(--form-rule); border-width: 1px 0 0 1px; }
.cl-boxes small { display: block; overflow: hidden; font: 700 .64rem/1.05 var(--special); letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.cl-boxes b { display: block; margin-top: .12rem; overflow: hidden; font: 800 .92rem/1 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.cl-foot { position: relative; margin-top: .24rem; padding-top: .22rem; border-top: 2px double rgba(40, 26, 12, .65); }
.cl-foot p { margin: 0; font-size: .8rem; line-height: 1.22; }
.cl-foot p + p { display: flex; justify-content: space-between; gap: .4rem; margin-top: .14rem; }
.cl-foot p > b { font-weight: 800; }
.cl-foot em { font-style: normal; font-weight: 800; color: #6a2019; }
.cl-foot em:empty { display: none; }
.cl-foot > small { display: block; margin-top: .14rem; font: 700 .64rem/1.1 var(--special); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.cl-status { padding: .2rem .34rem; border: 1px solid rgba(29, 74, 53, .55); background: rgba(29, 74, 53, .12); color: #1d4a35; }
.cl-status:empty { display: none; }
.cl-card.hiding .cl-status, .cl-card.slipping .cl-status { border-color: rgba(106, 32, 25, .6); background: rgba(106, 32, 25, .12); color: #6a2019; }
.cl-card.slipping .cl-pay b { text-decoration: line-through; text-decoration-thickness: 2px; }
.cl-note { margin: .55rem 0 0; font-size: .86rem; color: var(--ink-soft); }

.du-choice-h { margin-top: .9rem; }
.du-slipnote { color: color-mix(in srgb, var(--blood-hi) 70%, var(--deck-ivory)); }
/* tax collector's declaration slider (Set sail orders card) */
.tx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; margin: .3rem 0 .2rem; }
.tx-range { width: 100%; accent-color: var(--jade-hi); }
.tx-row.hiding .tx-range { accent-color: var(--blood-hi); }
.tx-out { display: flex; flex-direction: column; line-height: 1.15; min-width: 7.5rem; }
.tx-out b { font-variant-numeric: tabular-nums; }
.tx-out small { color: var(--muted); font-size: .78rem; }
.tx-tax { font: 700 1.1rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--brass-hi); white-space: nowrap; }
.tx-risk.bad { color: color-mix(in srgb, var(--blood-hi) 75%, var(--deck-ivory)); }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="chart"] .dk-side { flex-direction: row; justify-content: center; align-items: stretch; }
  .deck[data-tab="chart"] .dk-stage { width: auto; height: 100cqh; max-width: 55cqw; }
  .deck[data-tab="chart"] .dk-dyn { width: auto; flex: 1 1 0; max-width: 24rem; overflow: auto; }
  .cl-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* MARKET: what was paid, and profit or loss on a planned sale (16 Nov 2026, 10:05 pm) */
.mk-paid { display: block; margin-top: .1rem; font-size: .68rem; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-paid.up { color: var(--jade-hi); }
.mk-paid.down { color: var(--blood-hi); }
body.player button.mk-go em.mk-pl { display: block; margin-top: .08rem; padding: .05rem .35rem; border-radius: .3rem;
  font: 800 .72rem/1.05 var(--sans); font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.player button.mk-go em.mk-pl.up { color: #eafff6; background: color-mix(in srgb, var(--deck-jade) 85%, #000); box-shadow: inset 0 0 0 1px var(--jade-hi); }
body.player button.mk-go em.mk-pl.down { color: #ffd9cf; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px var(--blood-hi); }

/* Names in the game title font (16 Nov 2026): your house in the top bar,
   ship names on the Fleet cards, port names on the destination cards,
   and the stage plate (not while someone is speaking). */
.dk-house b, .fl-ship .fl-name b, .dest-title b,
#stage:not(.talking) .stg-plate b { font-family: var(--title); font-weight: 400; }

/* MARKET: profit/loss joined to the right side of the Sell button as its own segment (17 Nov 2026).
   The pair is one fixed width on every row so the drag bars stay aligned and never jump; the button
   fills whatever the +/- segment does not use, so there are no gaps. Dark ink on pale pills to read. */
.mk-table td.mk-do { padding-left: 0; padding-right: 0; }
.mk-act { display: flex; align-items: stretch; width: 12.6rem; gap: 0; }
body.player .mk-act button.mk-go { flex: 1 1 auto; width: auto; min-width: 0; }
body.player button.mk-go b { font-size: .92rem; }
body.player button.mk-go small { font-size: .8rem; }
.mk-pl-slot { display: flex; flex: 0 0 auto; min-width: 0; }
.mk-pl-slot:empty { display: none; }
body.player .mk-act.has-pl button.mk-go { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mk-act em.mk-pl { display: flex; align-items: center; justify-content: center; padding: 0 .6rem; cursor: help;
  border-radius: 0 .4rem .4rem 0; font: 900 1.12rem/1 var(--sans); font-style: normal;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.mk-act em.mk-pl.up { color: #06341f; background: #c9f7dc; box-shadow: inset 0 0 0 1.5px var(--jade-hi); }
.mk-act em.mk-pl.down { color: #6e0f04; background: #ffe1d8; box-shadow: inset 0 0 0 1.5px var(--blood-hi); }
@container pane (max-width: 620px) {
  .mk-act { width: 10.2rem; }
  .mk-act em.mk-pl { font-size: .92rem; padding: 0 .4rem; }
}

/* ======================================================================== PORT SCREEN == */
/* player.js portTab(): a ledger head of five figures, a tab rail (Arrival, Accounts, Log, News and, in
   the home port, Services), then the cards of the chosen view.
   Lettering follows the Art Bible: name headers (--serif) for card titles, special text (--special) only
   for a few words at a time (labels, dates, ranks), general text (--sans) for body, tables and buttons,
   and ledger figures (--figures) with tabular numerals for every amount. Colours are the eight deck colours. */
.pt { --figures: "Consolas", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pt-gap: clamp(.55rem, 1.1vw, .85rem); display: flex; flex-direction: column; gap: var(--pt-gap); }
.pt .n, .pt-transfer-action output, .pt-pl td.n, .pt-badge { font-family: var(--figures); font-variant-numeric: tabular-nums lining-nums; }
.pt .up { color: var(--jade-hi); }
.pt .down { color: var(--blood-hi); }

/* ---- tab rail: ledger index tabs, brass underline on the open one */
.pt-tabs { display: flex; gap: 0; margin: 0; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--edge-hi); }
.pt-tabs::-webkit-scrollbar { display: none; }
body.player .pt-tabs button.pt-tab { position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-width: max-content; min-height: 0; height: 2.6rem; padding: 0 1rem; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--muted); font: 600 .95rem/1 var(--sans); letter-spacing: .01em; white-space: nowrap; text-shadow: none; }
body.player .pt-tabs button.pt-tab::after { content: ""; position: absolute; left: .7rem; right: .7rem; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: transparent; transition: background .2s, box-shadow .2s; }
body.player .pt-tabs button.pt-tab:hover:not(:disabled) { color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-brass) 7%, transparent); }
body.player .pt-tabs button.pt-tab.on { color: var(--brass-hi);
  background: linear-gradient(180deg, transparent 15%, color-mix(in srgb, var(--deck-oxblood) 30%, transparent)); }
body.player .pt-tabs button.pt-tab.on::after { background: var(--deck-brass); box-shadow: 0 0 10px color-mix(in srgb, var(--deck-brass) 70%, transparent); }
body.player .pt-tabs button.pt-tab:active:not(:disabled) { transform: none; }
.pt-badge { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px; font-style: normal;
  font-size: .7rem; font-weight: 700; color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-storm) 70%, var(--deck-night));
  border: 1px solid color-mix(in srgb, var(--deck-storm) 60%, var(--deck-ivory) 15%); }
.pt-badge.warn { background: var(--deck-oxblood); border-color: color-mix(in srgb, var(--blood-hi) 60%, transparent); }

/* ---- views */
.pt-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pt-gap); align-items: start; }
.pt-view > .card { margin: 0; min-width: 0; }
.deck .pt .card h2 { font-size: clamp(1.12rem, 1.6vw, 1.32rem); }
/* Arrival: the landing card across the top, then Port Business (left) and At a Glance (right) on one row
   to keep the tab short. Narrow panes fall back to one column via the container queries below. */
.pt-arrival { align-items: stretch; }
.pt-arrival > .pt-land { grid-column: 1 / -1; }

/* card header: title left, controls right, one brass rule under both */
.pt-cardhead { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; margin-bottom: .6rem; padding-bottom: .45rem;
  border-bottom: 1px solid; border-image: linear-gradient(90deg, var(--edge-hi), transparent 80%) 1; }
.deck .pt .pt-cardhead h2 { margin: 0; padding: 0; border: 0; flex: 1 1 auto; min-width: 0; }

/* ---- buttons on this screen: general text, brass outline; one primary per card */
body.player .pt button.pt-go { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: 0; height: 2rem; min-width: 7.2rem; padding: 0 .85rem; border-radius: 999px;
  border-color: color-mix(in srgb, var(--deck-brass) 60%, transparent); color: var(--brass-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-lacquer) 92%, #fff 4%), color-mix(in srgb, var(--deck-night) 80%, var(--deck-lacquer)));
  font: 600 .84rem/1 var(--sans); letter-spacing: .01em; white-space: nowrap; }
body.player .pt button.pt-go:hover:not(:disabled) { color: var(--deck-night); border-color: var(--brass-hi);
  background: linear-gradient(180deg, var(--brass-hi), var(--deck-brass)); }
.pt button.pt-go > span, .pt button.pt-more > span { font-size: 1.15em; line-height: 0; }
body.player .pt button.pt-more { min-height: 0; height: auto; padding: .2rem 0; font: 600 .88rem/1.2 var(--sans); }
body.player .pt button.pt-read { display: inline-flex; align-items: center; gap: .5rem; min-height: 0; height: 2.35rem; padding: 0 1.05rem 0 .85rem;
  border-radius: 999px; font: 600 .9rem/1 var(--sans); letter-spacing: .01em; white-space: nowrap; }
.pt-read svg { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pt-actions { display: flex; justify-content: flex-end; margin-top: .65rem; }

/* ---- Arrival */
.pt-land { border-color: var(--edge) !important; background: linear-gradient(115deg, color-mix(in srgb, var(--deck-oxblood) 22%, transparent), var(--glass-2) 55%) !important; }
.pt-land > p { margin: 0; font: 1.02rem/1.45 var(--sans); }
.pt-sum { margin: 0 0 .45rem !important; font-weight: 600 !important; }
.pt-lead { list-style: none; margin: .35rem 0 .2rem; padding: 0; }
.pt-lead li { position: relative; padding: .28rem 0 .28rem 1.05rem; border: 0 !important; color: color-mix(in srgb, var(--deck-ivory) 82%, var(--deck-leather)); }
.pt-lead li::before { content: ""; position: absolute; left: .1rem; top: .78em; width: .38rem; height: .38rem; transform: rotate(45deg); background: var(--deck-brass); }

.pt-list { list-style: none; margin: 0; padding: 0; }
.pt-list li { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .5rem 0;
  border-bottom: 1px solid var(--rule); font: 1rem/1.35 var(--sans); }
.pt-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.pt-list li:first-child { padding-top: .15rem; }
.pt-list li > i { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font: 700 .85rem/1 var(--sans); font-style: normal;
  color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-leather) 70%, var(--deck-night)); border: 1px solid var(--edge); }
.pt-list li.up > i { background: color-mix(in srgb, var(--deck-jade) 75%, var(--deck-night)); border-color: color-mix(in srgb, var(--jade-hi) 50%, transparent); }
.pt-list li.ok > i { background: color-mix(in srgb, var(--deck-storm) 75%, var(--deck-night)); }
.pt-list li.warn > i { color: var(--deck-night); background: var(--deck-brass); border-color: var(--brass-hi); }
.pt-list li.down > i { background: var(--deck-oxblood); border-color: color-mix(in srgb, var(--blood-hi) 50%, transparent); }
.pt-list li.down > span { color: color-mix(in srgb, var(--blood-hi) 55%, var(--deck-ivory)); }

.pt-table { width: 100%; border-collapse: collapse; font: .97rem/1.3 var(--sans); }
.pt-table td { padding: .42rem .15rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.pt-table td:first-child { padding-left: 0; }
.pt-table td small { display: block; margin-top: .1rem; font: italic .78rem/1.25 var(--sans); color: var(--muted); }
.pt-table td.n { text-align: right; white-space: nowrap; padding-left: .8rem; padding-right: 0; font-size: .98rem; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-chip { display: inline-flex; align-items: center; margin: .12rem 0 .12rem .3rem; padding: .12rem .6rem; border: 1px solid var(--edge); border-radius: 999px;
  font: 600 .8rem/1.2 var(--sans); color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-night) 50%, transparent); white-space: nowrap; }
.pt-chip.up { border-color: color-mix(in srgb, var(--jade-hi) 55%, transparent); color: var(--jade-hi); background: color-mix(in srgb, var(--deck-jade) 22%, transparent); }
.pt-chip.down { border-color: color-mix(in srgb, var(--blood-hi) 55%, transparent); color: var(--blood-hi); background: color-mix(in srgb, var(--deck-oxblood) 22%, transparent); }
.pt-chip .chip { width: .6rem; height: .6rem; margin-right: .35rem; }

/* ---- Accounts */
.pt-seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border: 1px solid color-mix(in srgb, var(--deck-brass) 55%, transparent);
  border-radius: 999px; background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .15)); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55); }
body.player .pt-seg button { min-height: 0; height: 1.85rem; padding: 0 .95rem; border: 0; border-radius: 999px; background: transparent; box-shadow: none;
  color: var(--brass-hi); font: 600 .84rem/1 var(--sans); white-space: nowrap; text-shadow: none; }
body.player .pt-seg button:not([aria-pressed="true"]):hover:not(:disabled) { background: rgba(201, 163, 78, .14); }
body.player .pt-seg button[aria-pressed="true"] { color: var(--deck-night);
  background: linear-gradient(180deg, var(--brass-hi), var(--deck-brass) 60%, color-mix(in srgb, var(--deck-brass) 75%, #000));
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 245, 210, .6); }
.pt-pl tr.pt-grp td { padding: .85rem 0 .3rem; border-bottom: 1px solid var(--edge); font: 400 .74rem/1 var(--special); letter-spacing: .1em; color: var(--deck-brass); }
.pt-pl tr.pt-grp:first-child td { padding-top: .2rem; }
.pt-pl tr:not(.pt-grp):not(.pt-sub):not(.pt-total) td:first-child { padding-left: .8rem; }
.pt-pl tr.pt-sub td { font-weight: 700; border-top: 1px solid var(--edge); background: color-mix(in srgb, var(--deck-brass) 6%, transparent); }
.pt-pl tr.pt-sub td:first-child { padding-left: .8rem; font-style: italic; font-weight: 600; color: var(--muted); }
.pt-pl tr.pt-total td { padding-top: .6rem; border-top: 3px double var(--deck-brass); border-bottom: 0; font: 400 1.15rem/1.2 var(--serif); color: var(--brass-hi); }
.pt-pl tr.pt-total td.n { font: 700 1.3rem/1.2 var(--figures); }
.pt-pl tr.pt-total td.up { color: var(--jade-hi); }
.pt-pl tr.pt-total td.down { color: var(--blood-hi); }
.pt-unreal { margin: .75rem 0 0; padding: .55rem .75rem; border-left: 3px solid var(--deck-brass); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--deck-brass) 9%, transparent); font: .92rem/1.4 var(--sans); }
.pt-unreal b { font-family: var(--figures); }
.pt-fine { margin: .55rem 0 0; font: italic .8rem/1.35 var(--sans); }
/* Debts and dues: a headline panel for what is owed, then grouped rows with bold ledger figures. */
.pt-owe-hero { display: flex; flex-wrap: wrap; align-items: stretch; gap: .6rem 1rem; margin: 0 0 .5rem; padding: .7rem .9rem;
  border: 1px solid var(--edge); border-left: 4px solid var(--deck-brass); border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-brass) 10%, transparent), color-mix(in srgb, var(--deck-night) 55%, transparent)); }
.pt-owe-hero.debt { border-left-color: var(--deck-oxblood);
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-oxblood) 30%, transparent), color-mix(in srgb, var(--deck-night) 55%, transparent)); }
.pt-owe-hero.clear { border-left-color: var(--deck-jade);
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-jade) 24%, transparent), color-mix(in srgb, var(--deck-night) 55%, transparent)); }
.pt-owe-main { flex: 1 1 13rem; min-width: 0; }
.pt-owe-lbl { display: block; font: 400 .74rem/1.15 var(--special); letter-spacing: .09em; color: var(--deck-brass); }
.pt-owe-main b { display: block; margin: .2rem 0 .15rem; font: 800 clamp(1.6rem, 2.6vw, 2.1rem)/1.05 var(--figures);
  font-variant-numeric: tabular-nums lining-nums; color: var(--blood-hi); text-shadow: 0 2px 8px rgba(0, 0, 0, .55); }
.pt-owe-hero.clear .pt-owe-main b { font: 400 clamp(1.3rem, 2vw, 1.6rem)/1.1 var(--serif); color: var(--jade-hi); }
.pt-owe-main small { display: block; font: italic .8rem/1.25 var(--sans); color: var(--muted); }
.pt-owe-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; align-items: center; }
.pt-owe-stat { min-width: 7.5rem; padding-left: .85rem; border-left: 1px solid var(--edge); }
.pt-owe-stat .pt-amt, .pt-owe-stat .pt-count { display: block; margin-top: .22rem; font-size: 1.22rem; }
.pt-owetable td:first-child b { font-weight: 700; color: var(--deck-ivory); }
.pt-owetable tr.pt-grp td { padding: .8rem 0 .3rem; border-bottom: 1px solid var(--edge); font: 400 .74rem/1 var(--special); letter-spacing: .1em; color: var(--deck-brass); }
.pt-owetable tr.pt-grp:first-child td { padding-top: .25rem; }
.pt-owetable tr:not(.pt-grp) td:first-child { padding-left: .8rem; }
.pt-owetable tr.warn td { background: color-mix(in srgb, var(--deck-oxblood) 16%, transparent); }
.pt-owetable td.pt-val { text-align: right; white-space: nowrap; padding-left: .8rem; padding-right: .2rem; }
.pt-amt { font: 700 1.08rem/1.2 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); letter-spacing: .01em; }
.pt-count { font: 600 .9rem/1.2 var(--sans); color: var(--muted); white-space: nowrap; }
.pt-count b { margin-right: .2rem; font: 700 1.08rem/1.2 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); }
.pt-amt.up, .pt-count.up b { color: var(--jade-hi); }
.pt-amt.down, .pt-count.down b { color: var(--blood-hi); }
.pt-owetable .pt-chip { margin: 0; font-weight: 700; }
@media (max-width: 560px) {
  .pt-owe-stat { min-width: 0; flex: 1 1 40%; }
  .pt-owetable td.pt-val { white-space: normal; }
}

/* ---- Log: numbered ledger lines, like the captain's log window */
.pt-entries { list-style: none; counter-reset: ent; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pt-entries li { counter-increment: ent; display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: .5rem; align-items: baseline;
  padding: .45rem .7rem .45rem .45rem; border-left: 3px solid color-mix(in srgb, var(--deck-brass) 55%, transparent); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--deck-night) 70%, transparent); font: 1.02rem/1.4 var(--sans); }
.pt-entries li::before { content: counter(ent); text-align: right; font: 700 .8rem/1 var(--figures); color: var(--deck-brass); }

/* ---- News */
.pt-news-list { list-style: none; margin: 0; padding: 0; }
.pt-news-list li { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .7rem; align-items: baseline; padding: .5rem 0;
  border-bottom: 1px solid var(--rule); font: 1rem/1.4 var(--sans); }
.pt-news-list li:last-child { border-bottom: 0; }
.pt-news-list li.muted { display: block; }
.pt-when { font: 400 .74rem/1.2 var(--special); letter-spacing: .06em; color: var(--deck-brass); }
/* News heat map: --heat 0..1 from the server. Colour runs brass (warm) to crimson (hot); strength and the
   left ember bar scale with heat, so a headline cools to plain over two or three months. */
.pt-news-list li.pt-hot {
  --heat-c: color-mix(in srgb, #d23a24 calc(var(--heat) * 100%), var(--deck-brass));
  position: relative; margin: 0 -.6rem; padding-left: .6rem; padding-right: .6rem; border-radius: 4px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--heat-c) calc(var(--heat) * 55%), transparent) 0%,
    color-mix(in srgb, var(--heat-c) calc(var(--heat) * 22%), transparent) 55%,
    transparent 100%);
  box-shadow: inset calc(2px + var(--heat) * 4px) 0 0 color-mix(in srgb, var(--heat-c) calc(35% + var(--heat) * 65%), transparent);
  transition: background .6s ease, box-shadow .6s ease;
}
.pt-news-list li.pt-hot .pt-when { color: color-mix(in srgb, var(--deck-ivory) calc(var(--heat) * 100%), var(--deck-brass)); }
.pt-news-list li.pt-blaze .pt-story { font-weight: 700; }
.pt-news-list li.pt-blaze::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 14px color-mix(in srgb, #d23a24 50%, transparent); animation: pt-ember 3.2s ease-in-out infinite; }
@keyframes pt-ember { 0%, 100% { opacity: .25; } 50% { opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .pt-news-list li.pt-blaze::after { animation: none; opacity: .5; } }
.pt-wx { display: inline-block; min-width: 5.5rem; padding: .15rem .6rem; border-radius: 999px; text-align: center; font: 700 .8rem/1.2 var(--sans); border: 1px solid; }
.pt-wx.wx0, .pt-wx.wx1 { color: var(--jade-hi); border-color: color-mix(in srgb, var(--jade-hi) 45%, transparent); background: color-mix(in srgb, var(--deck-jade) 25%, transparent); }
.pt-wx.wx2 { color: var(--brass-hi); border-color: color-mix(in srgb, var(--deck-brass) 55%, transparent); background: color-mix(in srgb, var(--deck-brass) 14%, transparent); }
.pt-wx.wx3 { color: var(--deck-ivory); border-color: var(--blood-hi); background: var(--deck-oxblood); }

/* ---- Newspaper (20 Nov 2026): Log and News together. The news fills the left column; the right column is
   the weather glass, then this voyage's log and the earlier voyages (21 Nov 2026: the forecast moved off the
   full-width band at the top, and the bans row was dropped from this tab). */
/* 23 Nov 2026: Arrival and Newspaper share one column split, a third and two thirds (--pt-split). */
.pt-view { --pt-split: minmax(17rem, 1fr) minmax(0, 2fr); }
.pt-view.pt-paper { grid-template-columns: var(--pt-split); grid-template-rows: auto 1fr; grid-template-areas: "news glass" "news log"; }
.pt-paper > .pt-newscard, .pt-paper > .pt-col-news { grid-area: news; }
.pt-paper > .pt-wxboard { grid-area: glass; }
.pt-paper > .pt-col-log { grid-area: log; }
@container pane (max-width: 720px) {
  .pt-view.pt-paper { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "glass" "news" "log"; }
}

/* The weather glass itself (.pt-wxboard, .wxb-*) is styled in weather-glass.css. */
/* news tags: what a headline touches for this house */
.pt-story { min-width: 0; }
.pt-tags { display: flex; flex-wrap: wrap; gap: .25rem .35rem; margin-top: .25rem; }
.pt-tag { padding: .12rem .5rem; border: 1px solid color-mix(in srgb, var(--deck-storm) 70%, var(--deck-ivory)); border-radius: 999px;
  font: 700 .68rem/1.15 var(--sans); letter-spacing: .04em; color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-storm) 45%, transparent); }
.pt-tag.hold { border-color: var(--brass-hi); color: var(--deck-night); background: var(--deck-brass); }
.pt-tag.you { border-color: var(--rule); color: var(--muted); background: transparent; }
.pt-news-list li.pt-rel:not(.pt-hot) { margin: 0 -.6rem; padding-left: .6rem; padding-right: .6rem; border-radius: 4px; box-shadow: inset 3px 0 0 var(--deck-brass); }
.pt-news-list li.pt-own { opacity: .62; }
.pt-news-list.pt-older { margin-top: .2rem; }
.pt-newscard .pt-seg em { margin-left: .3rem; font: 700 .76rem/1 var(--figures); font-style: normal; }
body.player .pt button.pt-more { display: block; margin-top: .45rem; }
/* earlier voyages: one line each, opened one at a time */
.pt-voyages { list-style: none; margin: 0; padding: 0; }
.pt-voyages > li { border-bottom: 1px solid var(--rule); }
.pt-voyages > li:last-child { border-bottom: 0; }
body.player .pt button.pt-voy { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: .7rem; width: 100%; min-height: 0; height: auto;
  padding: .5rem .1rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-shadow: none; text-align: left; text-transform: none; letter-spacing: 0;
  font: 400 .95rem/1.25 var(--sans); color: var(--deck-ivory); }
body.player .pt button.pt-voy:hover:not(:disabled) { background: color-mix(in srgb, var(--deck-brass) 7%, transparent); }
.pt-voy b { font: 400 1.02rem/1.2 var(--serif); color: var(--brass-hi); }
.pt-voy span { font: 400 .78rem/1.2 var(--special); letter-spacing: .06em; color: var(--muted); }
.pt-voy em { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; text-align: center; font: 700 .76rem/1.3 var(--figures); font-style: normal;
  color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-storm) 55%, transparent); }
.pt-voyages .pt-entries { margin: .1rem 0 .6rem; }
.pt-voyages .pt-entries li { padding-block: .3rem; font-size: .92rem; }

/* ---- Port services, part of Arrival (20 Nov 2026) */
/* Arrival has two columns when the port has services: the port (Port business, At a Glance or the Mayor's
   Parlour) on the left, the house's affairs here on the right. One column on narrow panes. */
.pt-view.pt-arrival:has(> .pt-col) { grid-template-columns: var(--pt-split); align-items: start; }
.pt-view.pt-arrival > .pt-todo:only-child { grid-column: 1 / -1; }
@container pane (max-width: 900px) { .pt-view.pt-arrival:has(> .pt-col) { grid-template-columns: minmax(0, 1fr); } }
.pt-col { display: flex; flex-direction: column; gap: var(--pt-gap); min-width: 0; }
.pt-col > .card { margin: 0; min-width: 0; }
/* Port business in the narrow column: marker and sentence side by side, the button on its own line under the sentence,
   left-aligned with the text. Buttons shrink to their label instead of holding a 7rem minimum. */
.pt-col-port .pt-list li { grid-template-columns: 1.7rem minmax(0, 1fr); align-items: start; gap: .35rem .65rem; padding: .6rem 0; font-size: .95rem; line-height: 1.35; }
.pt-col-port .pt-list li > i { grid-row: 1 / span 2; margin-top: .05rem; }
.pt-col-port .pt-list li > span { grid-column: 2; }
.pt-col-port .pt-list li > button, .pt-col-port .pt-list li > b { grid-column: 2; justify-self: start; }
.pt-col-port .pt-list li > b { display: none; }
body.player .pt .pt-col-port .pt-list li > button.pt-go { min-width: 0; height: 1.8rem; padding: 0 .8rem; font-size: .8rem; }
/* A long label ("Services in <a long port name>") wraps inside its button instead of running into the next column (23 Nov 2026). */
body.player .pt .pt-col-port button.pt-go, body.player .pt .pt-col-port .pt-list li > button.pt-go { max-width: 100%; height: auto; min-height: 1.8rem; padding-block: .3rem; line-height: 1.2;
  white-space: normal; overflow-wrap: anywhere; text-align: left; border-radius: 1rem; }
.deck .pt .pt-service { container-type: inline-size; min-width: 0; padding: 0; overflow: hidden; border-color: var(--edge-hi); }
.pt-service.attn { border-left: 3px solid var(--deck-brass); }
.pt-service.attn.down { border-left-color: var(--deck-oxblood); }
/* Picture full width across the top with the name over it in white; under it the controls (left) and the figures
   (right). A narrow card stacks: picture, controls, figures. A card with no picture keeps its name above. */
.pt-service-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem .9rem; padding: 0 0 .85rem;
  grid-template-areas: "pic" "body" "data"; }
.pt-service:not(.has-pic) .pt-service-in { grid-template-areas: "head" "body" "data"; padding-top: .65rem; }
.pt-service-in > .pt-service-head, .pt-service-body, .pt-service-data { margin-left: .9rem; margin-right: .9rem; }
.pt-service-head { grid-area: head; min-width: 0; }
.pt-service-pic { grid-area: pic; position: relative; aspect-ratio: 32 / 9; overflow: hidden;
  border-bottom: 1px solid var(--edge); background: var(--deck-night); }
.pt-service-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.pt-service-pic::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to top, rgba(8, 5, 3, .82), rgba(8, 5, 3, .45) 55%, transparent); }
.pt-service-pic > .pt-service-head { position: absolute; z-index: 1; left: .9rem; right: .9rem; bottom: .65rem; margin: 0; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85); }
.deck .pt .pt-service-pic .pt-service-head h2 { color: #fff; }
.deck .pt .pt-service-pic .pt-service-head p { color: rgba(255, 255, 255, .9); }
.pt-service-data { grid-area: data; min-width: 0; }
.pt-service-body { grid-area: body; min-width: 0; }
@container (min-width: 32rem) {
  .pt-service.has-data .pt-service-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "pic pic" "body data"; }
  .pt-service.has-data:not(.has-pic) .pt-service-in { grid-template-areas: "head head" "body data"; }
}
.deck .pt .pt-service-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; padding: 0; border: 0; background: none;
  font-size: clamp(1.08rem, 1.5vw, 1.28rem); }
.pt-service-head p { margin: .15rem 0 0; font: .88rem/1.35 var(--sans); color: color-mix(in srgb, var(--deck-ivory) 82%, var(--deck-leather)); }
.pt-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: 0; }
@container (max-width: 31.99rem) { .pt-stats { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); } }
.pt-stat { min-width: 0; padding: .4rem .55rem .45rem; border: 1px solid var(--rule); border-radius: .4rem;
  background: color-mix(in srgb, var(--deck-night) 55%, transparent); }
.pt-stat dt { font: 400 .68rem/1.1 var(--special); letter-spacing: .09em; text-transform: uppercase; color: var(--deck-brass); }
.pt-stat dd { margin: .2rem 0 0; font: 700 1.08rem/1.15 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); overflow-wrap: anywhere; }
.pt-stat small { display: block; margin-top: .15rem; font: .74rem/1.25 var(--sans); color: var(--muted); }
.pt-stat.up dd { color: var(--jade-hi); }
.pt-stat.down dd { color: var(--blood-hi); }
.pt-stat.warn dd { color: var(--brass-hi); }
.pt-stat-bar { display: block; height: .32rem; margin-top: .3rem; border-radius: 999px; background: var(--bar-empty); overflow: hidden; }
.pt-stat-bar b { display: block; height: 100%; background: var(--deck-brass); }
.pt-service-flag { display: inline-grid; place-items: center; flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  font: 700 .78rem/1 var(--sans); font-style: normal; color: var(--deck-night); background: var(--deck-brass); border: 1px solid var(--brass-hi); }
.pt-service.down .pt-service-flag { color: var(--deck-ivory); background: var(--deck-oxblood); border-color: color-mix(in srgb, var(--blood-hi) 50%, transparent); }
.pt-service-note { margin: 0 0 .5rem; font: .88rem/1.3 var(--sans); color: var(--muted); }
.pt-service-note b { font-family: var(--figures); color: var(--deck-ivory); }
.pt-service-note.down b { color: var(--blood-hi); }
.pt-service.pt-flash { animation: ptFlash 1.6s ease-out; }
@keyframes ptFlash { 0%, 35% { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 18px color-mix(in srgb, var(--deck-brass) 55%, transparent); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .pt-service.pt-flash { animation: none; box-shadow: 0 0 0 2px var(--brass-hi); } }
.pt-service-body { display: flex; flex-direction: column; gap: .6rem; }
.pt-service-body:empty { display: none; }
.pt-service-body > p { margin: 0; font: .95rem/1.4 var(--sans); color: color-mix(in srgb, var(--deck-ivory) 85%, var(--deck-leather)); }
.pt-service-stock, .pt-transfer-scale, .pt-transfer-action { display: flex; align-items: center; justify-content: space-between; gap: .4rem .75rem; }
.pt-service-stock { flex-wrap: wrap; margin-bottom: .25rem; }
.pt-service-stock > b { font: 400 1rem/1.2 var(--serif); color: var(--brass-hi); }
.pt-service-stock span { font: .84rem/1.3 var(--sans); color: var(--muted); }
.pt-service-stock span b { font-family: var(--figures); color: var(--deck-ivory); }
.pt-transfer-scale { font: 400 .72rem/1 var(--special); letter-spacing: .08em; color: var(--deck-brass); }
.pt-service-good { padding-top: .6rem; border-top: 1px solid var(--rule); }
.pt-service-good:first-child { padding-top: 0; border-top: 0; }
.pt-transfer { margin-top: 0; }
.pt-transfer .pt-range { min-width: 0; margin: .45rem 0 .3rem; }
.pt-transfer-quick { margin: 0 0 .55rem; }
/* The All / half chips sit to the right of the slider (22 Nov 2026), so the figures and button come up under it. */
.pt-transfer-row { display: flex; align-items: center; gap: .6rem; margin: .45rem 0 .55rem; }
.pt-transfer-row .pt-range { flex: 1 1 8rem; min-width: 0; margin: 0; }
.pt-presets { display: flex; flex: none; align-items: center; gap: .3rem; margin: 0; }
.pt-presets > span { display: flex; gap: .25rem; }
.pt-presets > span + span { padding-left: .3rem; border-left: 1px solid var(--rule); }
body.player .pt-presets button { min-height: 0; height: 1.6rem; min-width: 2.1rem; padding: 0 .5rem; border-radius: 999px; font: 600 .78rem/1 var(--sans); }
.pt-transfer-action { flex-wrap: nowrap; }
.pt-transfer-action output { font-size: 1.2rem; font-weight: 700; color: var(--brass-hi); }
.pt-transfer-action[data-side="buy"] output { color: var(--jade-hi); }
.pt-transfer-action[data-side="sell"] output { color: var(--blood-hi); }
body.player .pt-transfer-action button { min-height: 0; height: 2.1rem; min-width: 7rem; padding: 0 .9rem; border-radius: 999px; font: 600 .88rem/1 var(--sans); }
body.player .pt-transfer-action:not([data-side=""]) button:not(:disabled) { color: #fff6e3; border-color: color-mix(in srgb, var(--deck-brass) 75%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 78%, #ff9b84 10%), var(--deck-oxblood) 55%, color-mix(in srgb, var(--deck-oxblood) 70%, #000)); }
.pt-service-body > button.primary { align-self: flex-start; }
.pt-service-in { align-items: start; }
.pt-bank-rest, .pt-bank-rest button { width: 100%; }
/* Mayor's commission: the year goal and the contract side by side (22 Nov 2026). */
@container (min-width: 32rem) {
  #svc-mayor_work .pt-service-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.4rem; align-items: start; }
  #svc-mayor_work .pt-service-body > p { grid-column: 1 / -1; }
  #svc-mayor_work .pt-commission { border-bottom: 0; }
}
/* Great house: the sell-back words in the left column, the button in the right. */
.pt-estate-sell { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem 1.2rem; }
.pt-estate-sell p { margin: 0; }
@container (max-width: 31.99rem) { .pt-estate-sell { grid-template-columns: minmax(0, 1fr); } }
.pt-estate-sell .pt-actions { margin: 0; justify-content: flex-end; }
body.player .pt .pt-estate-sell .pt-actions button { white-space: normal; height: auto; min-height: 2.4rem; max-width: 15rem; padding: .45rem 1rem; line-height: 1.2; text-align: center; }
.pt-estate-sell + .pt-estate-sell { margin-top: .8rem; padding-top: .8rem; border-top: 1px dotted var(--rule); }
/* Primary and secondary buttons in an action row (Take it / Not now, Build, Sell) share one size and shape. */
body.player .pt .pt-actions button.primary { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 0; height: 2rem;
  min-width: 7.2rem; padding: 0 .85rem; border-radius: 999px; font: 600 .84rem/1 var(--sans); letter-spacing: .01em; white-space: nowrap; }
.pt-commission .pt-actions { justify-content: flex-start; }
/* Late game (19 Nov 2026): port shares and the great house. */
.pt-share-facts { margin: 0 0 .7rem; padding: 0; list-style: none; font: .9rem/1.45 var(--sans); color: var(--deck-ivory); }
.pt-share-facts li { padding: .15rem 0; border-bottom: 1px dotted var(--rule); }
.pt-estate-path { display: flex; gap: .4rem; margin: 0 0 .7rem; padding: 0; list-style: none; }
.pt-estate-path li { flex: 1 1 0; padding: .45rem .5rem; border: 1px solid var(--edge); border-radius: .4rem; text-align: center;
  font: .82rem/1.3 var(--sans); color: var(--muted); }
.pt-estate-path li b { display: block; font: 400 1rem/1.2 var(--serif); color: var(--deck-ivory); }
.pt-estate-path li.built { border-color: var(--edge-hi); background: color-mix(in srgb, var(--deck-brass) 14%, transparent); }
.pt-estate-path li.built b { color: var(--brass-hi); }
.pt-estate-path li.next { border-style: dashed; border-color: var(--edge-hi); }
.pt-service-body .pt-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* The race card lives in the side column under the port art (player.js gameScreen()). The stage gives
   up 15rem of height for it; with many houses the card scrolls inside its own box. */
.deck[data-tab="port"] .dk-side { gap: clamp(.45rem, .9vw, .85rem); }
.deck[data-tab="port"] .dk-dyn { display: block; flex: 0 1 auto; min-height: 0; overflow: auto; width: min(100cqw, 100cqh - 15rem); }
.deck[data-tab="port"] .dk-stage { flex: none; width: min(100cqw, 100cqh - 15rem - clamp(.45rem, .9vw, .85rem)); }
.pt-race-side { margin: 0; padding: .55rem .75rem .65rem; }
.pt-race-side h2 { margin-bottom: .3rem; }
.pt-race-side > p { margin: 0 0 .35rem; font-size: .88rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="port"] .dk-side { flex-direction: row; justify-content: center; align-items: stretch; }
  .deck[data-tab="port"] .dk-stage { width: auto; height: 100cqh; max-width: 55cqw; }
  .deck[data-tab="port"] .dk-dyn { width: auto; flex: 1 1 0; max-width: 24rem; overflow: auto; }
}

@container pane (max-width: 560px) {
  .pt-view, .pt-view.pt-arrival:has(> .pt-col) { grid-template-columns: 1fr; }
  body.player .pt-tabs button.pt-tab { flex: none; padding: 0 .75rem; font-size: .88rem; }
}
@container pane (max-width: 720px) {
  .pt-view, .pt-view.pt-arrival:has(> .pt-col) { grid-template-columns: 1fr; }
}
@container pane (max-width: 420px) {
  .pt-seg { margin-left: 0; }
  .pt-list li { grid-template-columns: 1.7rem minmax(0, 1fr); }
  .pt-list li > button, .pt-list li > b { grid-column: 2; justify-self: start; }
}

/* ================================================================ THE MAYOR'S FAVOUR AND THE MONTH'S END == */
/* player.js portMonth() (21 Nov 2026): one card under Port business in the port column of Arrival. Her portrait is
   shown whole (never cropped, never a small round), the standing sits on five heat bands with a pin, and the chit
   below is a ledger slip: dotted rules, a double rule over the total. The card is its own container: in the narrow
   column everything stacks; from 24rem (a port with no services, or a one-column pane) her picture sits beside
   the standing. */
.deck .pt .pt-month { container-type: inline-size; display: flex; flex-direction: column; gap: .95rem; min-width: 0; border-color: var(--edge-hi); }
.pt-view.pt-arrival > .pt-todo, .pt-view.pt-arrival > .pt-month { align-self: start; }
.pt-month .pt-cardhead { margin-bottom: .5rem; }
.pm-favour { --heat: var(--deck-brass); display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
@container (min-width: 24rem) { .pm-favour { grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); align-items: start; } }
.pm-mayor { position: relative; margin: 0; overflow: hidden; border-radius: .5rem; border: 1px solid var(--edge-hi); background: var(--deck-night);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 10px 24px -14px #000, 0 0 22px -8px var(--heat); }
.pm-mayor img { display: block; width: 100%; height: auto; }
.pm-mayor figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.8rem .7rem .5rem;
  background: linear-gradient(180deg, transparent, rgba(12, 8, 6, .9) 78%); font: 400 .8rem/1.2 var(--special); letter-spacing: .09em; color: var(--brass-hi); }
.pm-standing { min-width: 0; }
.pm-stand-head { display: flex; align-items: baseline; gap: .5rem; }
.pm-stand-head .mp-lbl { flex: 1 1 auto; min-width: 0; }
.pm-tier { font: 700 1rem/1.1 var(--sans); color: color-mix(in srgb, var(--heat) 62%, var(--deck-ivory)); }
.pm-rep { font: 700 1.75rem/1 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); }
.pm-band { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; height: .85rem; margin: .5rem 0 .35rem; }
.pm-band > i { border-radius: 2px; background: var(--c); opacity: .26; }
.pm-band > i.on { opacity: 1; box-shadow: 0 0 12px -2px var(--c); }
.pm-pin { position: absolute; top: -.28rem; bottom: -.28rem; left: var(--at); width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: var(--deck-ivory); box-shadow: 0 0 0 1px rgba(0, 0, 0, .65), 0 0 9px color-mix(in srgb, var(--deck-ivory) 80%, transparent);
  animation: pmPin .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pmPin { from { left: 50%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pm-pin { animation: none; } }
.pm-steps { display: flex; justify-content: space-between; gap: .6rem; font: 600 .8rem/1.25 var(--sans); }
.pm-steps i { font-style: normal; font-size: .7em; }
.pm-steps .dn { color: var(--blood-hi); }
.pm-steps .up { color: var(--jade-hi); text-align: right; }
.pm-perks { margin-top: .7rem; }
.pm-perks caption { text-align: left; padding-bottom: .2rem; font: 400 .74rem/1.2 var(--special); letter-spacing: .09em; color: var(--deck-brass); }
.pm-perks td { padding-block: .34rem; font-size: .92rem; }
.pm-perks td:first-child { color: var(--muted); }
.pm-perks td.n { font: 700 .98rem/1.2 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); }
.pm-perks td.n.txt { font: 600 .9rem/1.25 var(--sans); white-space: normal; text-align: right; }
.pm-perks td.n.up { color: var(--jade-hi); }
.pm-perks td.n.down { color: var(--blood-hi); }
.pm-drift { margin: .5rem 0 0; font: italic .8rem/1.35 var(--sans); color: var(--muted); }
.pm-call { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; margin-top: .7rem; }
.pm-call .pt-chip { margin: 0; }
/* the chit */
.pm-chit { min-width: 0; }
/* THE HOLD MANIFEST (21 Nov 2026): one row per cargo under the Month's End card. */
.deck .pt .pt-hold { container-type: inline-size; min-width: 0; }
.pt-view.pt-arrival > .pt-hold { align-self: start; }
.pt-hold .pt-cardhead { margin-bottom: .5rem; }
.ph-table td b { font-weight: 600; }
.ph-qty { color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.ph-table td.n small { display: block; margin-top: .1rem; font: italic .78rem/1.25 var(--sans); color: var(--muted); }
.ph-table td.n small.up { color: var(--jade, #4f9b78); }
.ph-table td.n small.down { color: var(--oxblood, #b5483d); }
.ph-tag.warn { color: var(--oxblood, #b5483d); }
.ph-tag.hot { color: var(--brass, #c8a24a); }
.ph-tag.best { color: var(--jade, #4f9b78); }
.pm-favour + .pm-chit { padding-top: .9rem; border-top: 1px solid; border-image: linear-gradient(90deg, transparent, var(--edge-hi) 12%, var(--edge-hi) 88%, transparent) 1; }
.pm-table td { border-bottom-style: dotted; font-size: .94rem; }
.pm-table td.n { vertical-align: top; }
.pm-table tr.pt-grp td { padding: .75rem 0 .28rem; border-bottom: 1px solid var(--edge); font: 400 .72rem/1 var(--special); letter-spacing: .1em; color: var(--deck-brass); }
.pm-table tr.pt-grp:first-child td { padding-top: .1rem; }
.pm-table tr.pm-total td { padding-top: .5rem; border-top: 3px double var(--edge-hi); font-weight: 700; color: var(--deck-ivory); }
.pm-table tr.pm-total .pt-amt { font-size: 1.2rem; }
.pm-table tr.warn td { background: color-mix(in srgb, var(--deck-oxblood) 18%, transparent); }
.pm-table tr.warn td:first-child { padding-left: .4rem; }
.pm-table tr.warn td.n { padding-right: .4rem; }
.pm-table tr.pm-net td { padding-top: .55rem; border-top: 1px solid var(--edge-hi); border-bottom: 0; font-weight: 700; color: var(--deck-ivory); }
.pm-table tr.pm-net .pt-amt { font-size: 1.2rem; }
.pm-table .pt-amt.muted { color: var(--muted); font-weight: 400; }
.pm-watch { list-style: none; display: grid; gap: .35rem; margin: .75rem 0 0; padding: 0; font: .86rem/1.3 var(--sans); }
.pm-watch li { padding: .38rem .6rem; border: 1px solid var(--rule); border-left-width: 3px; border-radius: .35rem; color: var(--muted); }
.pm-watch li.warn { border-color: color-mix(in srgb, var(--deck-brass) 60%, transparent); color: var(--brass-hi); background: color-mix(in srgb, var(--deck-brass) 9%, transparent); }
.pm-watch li.down { border-color: color-mix(in srgb, var(--blood-hi) 55%, transparent); color: var(--blood-hi); background: color-mix(in srgb, var(--deck-oxblood) 20%, transparent); }

/* ================================================================ THE MAYOR'S PARLOUR == */
/* player.js mayorParlour(): opened from Call on the Mayor in Port business; takes At a Glance's place on
   Arrival while the stage shows the port's Mayor. Same Art Bible rules as the rest of the Port screen. */
/* The Parlour takes the whole width of the Port screen (above the columns) and lays itself out in two
   columns: the standing gauge and the purse on the left, what the gift buys on the right. */
/* 23 Nov 2026: the Parlour is a popup in the middle of the deck (player.js mayorPopup(), in the "over" region), not a
   card in the Port column, so it can never open out of sight above the pane. */
.deck .veil.mp-veil { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mp-veil > .pt-mayor { width: min(100%, 56rem); max-height: 100%; overflow-y: auto; margin: 0; padding: 1.1rem 1.4rem 1.2rem; gap: 1rem;
  scrollbar-width: thin; background-color: var(--deck-night) !important;
  box-shadow: 0 30px 70px -20px #000, 0 0 40px -10px color-mix(in srgb, var(--deck-brass) 35%, transparent); }
.pt-mayor .mp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem 1.8rem; align-items: start; }
.pt-mayor .mp-left, .pt-mayor .mp-right { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.pt-mayor .mp-greet { font-size: 1.15rem; }
.pt-mayor .mp-perks { font-size: 1rem; }
.pt-mayor .mp-actions { justify-content: flex-end; }
@container pane (max-width: 760px) { .pt-mayor .mp-body { grid-template-columns: minmax(0, 1fr); } }
.pt-mayor { display: flex; flex-direction: column; gap: .8rem; border-color: var(--edge-hi) !important;
  background: linear-gradient(115deg, color-mix(in srgb, var(--deck-oxblood) 26%, transparent), var(--glass-2) 55%) !important; }
.pt-mayor .pt-cardhead { margin-bottom: 0; }
.mp-greet { margin: 0; font: italic 1.02rem/1.4 var(--sans); color: color-mix(in srgb, var(--deck-ivory) 88%, var(--deck-leather)); }
.mp-note { margin: 0; padding: .55rem .75rem; border: 1px solid var(--edge); border-radius: 8px;
  background: color-mix(in srgb, var(--deck-brass) 9%, transparent); font: .92rem/1.4 var(--sans); }
.mp-lbl { font: 400 .74rem/1.15 var(--special); letter-spacing: .09em; color: var(--deck-brass); }
.mp-fig { font: 700 1.3rem/1.1 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); }
.mp-fig.up { color: var(--jade-hi); }

/* standing gauge: now (brass), what the gift would add (hatched jade), a tick at 50 */
.mp-gauge-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .4rem; }
.mp-gauge-head .mp-lbl { flex: 1 1 auto; min-width: 0; }
.mp-plus { padding: .1rem .5rem; border-radius: 999px; font: 700 .82rem/1.2 var(--figures); font-style: normal; color: var(--jade-hi);
  border: 1px solid color-mix(in srgb, var(--jade-hi) 55%, transparent); background: color-mix(in srgb, var(--deck-jade) 30%, transparent); }
.mp-bar { position: relative; height: 1.05rem; border-radius: 999px; overflow: hidden; border: 1px solid var(--edge);
  background: rgba(0, 0, 0, .45); }
.mp-bar > i { position: absolute; top: 0; bottom: 0; left: 0; }
.mp-now { width: var(--from); background: linear-gradient(90deg, var(--deck-leather), var(--deck-brass)); }
.mp-then { width: var(--to); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--deck-jade) 95%, transparent) 0 6px,
  color-mix(in srgb, var(--deck-jade) 55%, transparent) 6px 12px); transition: width .15s ease-out; }
.mp-tick { left: 50% !important; width: 2px; background: var(--deck-ivory); opacity: .55; }
.mp-gauge.grown .mp-then { display: none; }
.mp-gauge.grown .mp-now { background: linear-gradient(90deg, var(--deck-leather), var(--deck-brass) 70%, var(--jade-hi));
  animation: mpGrow 1.6s cubic-bezier(.2, .8, .2, 1) .25s both; }
@keyframes mpGrow { from { width: var(--from); } to { width: var(--to); } }
.mp-scale { display: flex; justify-content: space-between; gap: .5rem; margin-top: .25rem; font: 400 .7rem/1.2 var(--special); letter-spacing: .07em; color: var(--muted); }

/* the purse */
.mp-gift-head { display: flex; align-items: baseline; gap: .6rem; }
.mp-gift-head label { flex: 1 1 auto; font: 600 1rem/1.2 var(--sans); }
.mp-amount { font: 800 clamp(1.5rem, 2.4vw, 1.95rem)/1 var(--figures); font-variant-numeric: tabular-nums lining-nums; color: var(--brass-hi); }
.pt-mayor .mp-range { width: 100%; margin: .55rem 0 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-oxblood) 85%, #000), var(--deck-brass)); }
.mp-ends { display: flex; justify-content: space-between; margin-top: .3rem; font: 400 .72rem/1.2 var(--special); letter-spacing: .07em; color: var(--muted); }
.mp-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.mp-box { display: flex; flex-direction: column; gap: .2rem; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 8px;
  background: rgba(0, 0, 0, .26); }
.mp-box small { font: italic .8rem/1.3 var(--sans); color: var(--muted); }
.mp-tier { font: 400 1.15rem/1.15 var(--serif); color: var(--brass-hi); }
.mp-perks caption { text-align: left; padding-bottom: .25rem; font: 400 .74rem/1.2 var(--special); letter-spacing: .09em; color: var(--deck-brass); }
.mp-perks td:first-child { color: var(--muted); }
.mp-perks td.n { font-family: var(--figures); }
.mp-perks td.up { font-weight: 700; color: var(--jade-hi); }
.mp-actions { flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 0; }
.mp-actions > .muted { flex: 1 1 12rem; font: italic .8rem/1.3 var(--sans); }
body.player .pt-mayor button.mp-give { min-height: 0; height: 2.35rem; padding: 0 1.1rem; border-radius: 999px; font: 700 .92rem/1 var(--sans); }

/* her thanks */
.mp-thanks { padding: .7rem .9rem; border: 1px solid color-mix(in srgb, var(--jade-hi) 45%, transparent); border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--deck-jade) 32%, transparent), color-mix(in srgb, var(--deck-night) 45%, transparent));
  animation: mpIn .6s ease-out both; }
.mp-thanks .mp-lbl { color: var(--jade-hi); }
.mp-thanks p { margin: .35rem 0 0; font: italic 1.08rem/1.42 var(--sans); color: var(--brass-hi); }
@keyframes mpIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mp-gauge.grown .mp-now, .mp-thanks { animation: none; } .mp-then { transition: none; } }
@container pane (max-width: 720px) {
  .pt-view.pt-arrival:has(> .pt-mayor) { grid-template-columns: minmax(0, 1fr); }
}
@container pane (max-width: 420px) { .mp-boxes { grid-template-columns: minmax(0, 1fr); } }

/* ================================================ HOUSE CREST & CAPTAIN PORTRAIT (17 Nov 2026) == */
/* The top bar: the House's crest, bare (no frame), as big as the bar allows. On wide screens the House block
   stretches to the bar's full height (eating most of its padding) and the crest fills that height as a square;
   contain: size stops the 1024px picture from pushing the bar taller before the stretch. When the bar wraps
   (upright screens, short landscape phones) the crest takes a fixed size on its own row instead. */
.dk-top .dk-house { align-self: stretch; margin-block: -.4rem; }
.dk-house .crest.dk-crest { height: 100%; width: auto; aspect-ratio: 1; contain: size; margin: 0; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .dk-top .dk-house { align-self: auto; margin-block: 0; }
  .dk-house .crest.dk-crest { width: 3.4rem; height: 3.4rem; contain: none; } }
@media (orientation: landscape) and (max-height: 560px) {
  .dk-top .dk-house { align-self: auto; margin-block: 0; }
  .dk-house .crest.dk-crest { width: 2.7rem; height: 2.7rem; contain: none; } }
/* The captain at the foot of the rail, when the Captain has a portrait: the same square picture with the
   name in white across its foot as the tab pictures above it (it takes the rail's "face" rules). */
.dk-nav .dk-me .dk-face.face { padding: .25rem; gap: 0; }
.dk-nav .dk-face.face .dk-tabimg { width: var(--ti); height: var(--ti); border: 0; border-radius: calc(var(--radius) * .6);
  object-position: 50% 18%; box-shadow: 0 0 0 1px var(--edge-hi), 0 3px 8px rgba(0, 0, 0, .6); }
.dk-nav .dk-face.face span { max-width: none; color: #fff; }
.dk-me.open .dk-face.face .dk-tabimg { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 14px color-mix(in srgb, var(--deck-brass) 70%, transparent); }
.dk-me.open .dk-face.face::after { background: transparent; }

/* Away-port warehouses: "Sell all" (hold and store together) beside a cargo's stock line. */
body.player .pt button.pt-sellall { flex: none; margin-left: auto; padding: .2rem .6rem; font-size: .82em; line-height: 1.2;
  color: var(--deck-night, #1a120c); background: linear-gradient(180deg, #f3d27a, #c9963d); border: 1px solid var(--brass-hi, #f3d27a);
  border-radius: 999px; font-weight: 700; cursor: pointer; }
body.player .pt button.pt-sellall:hover:not(:disabled) { filter: brightness(1.08); }
body.player .pt button.pt-sellall:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------ the race (player.js standings()) --
   One compact ledger line per House: place · crest · identity · net worth. Used beside the port art
   and on the end screen. */
ol.race { list-style: none; margin: 0 0 .55rem; padding: 0; display: grid; gap: .4rem; }
.race-row { position: relative; display: grid; grid-template-columns: 1.75rem 2.2rem minmax(0, 1fr) auto; align-items: center; gap: .55rem;
  min-height: 3.8rem; padding: .38rem .65rem .38rem .5rem; border: 1px solid var(--rule); border-radius: 6px;
  background: color-mix(in srgb, var(--deck-night) 45%, transparent); }
.race-row.gold { border-color: color-mix(in srgb, #e9c25a 55%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, #e9c25a 16%, transparent), color-mix(in srgb, var(--deck-night) 45%, transparent) 70%); }
.race-row.silver { border-color: color-mix(in srgb, #cfd6dd 35%, transparent); }
.race-row.bronze { border-color: color-mix(in srgb, #c27a45 40%, transparent); }
.race-row.me { box-shadow: inset 3px 0 0 var(--brass-hi); }

/* A small struck place coin; the row border carries the podium colour without a space-hungry ribbon. */
.medal { box-sizing: border-box; position: relative; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; flex: none;
  color: var(--deck-ivory); border: 1px solid color-mix(in srgb, var(--deck-brass) 45%, transparent);
  background: color-mix(in srgb, var(--deck-night) 70%, transparent); }
.medal b { font: 700 .88rem/1 var(--serif); position: relative; z-index: 1; }
.medal.gold, .medal.silver, .medal.bronze { border: 0; color: #2a1a0c;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), inset 0 0 0 3px rgba(0,0,0,.18), 0 2px 5px rgba(0,0,0,.55); }
.medal.gold   { background: radial-gradient(circle at 32% 28%, #fff4c2, #f0c84a 38%, #b98617 75%, #7d5608); }
.medal.silver { background: radial-gradient(circle at 32% 28%, #ffffff, #d9dee3 38%, #9aa3ab 75%, #5f676e); }
.medal.bronze { background: radial-gradient(circle at 32% 28%, #ffd9b5, #d08a4f 38%, #9a5a2a 75%, #5e3315); color: #2a1206; }
.race-row { isolation: isolate; }

.race-crest .crest { display: block; width: 2.2rem; height: 2.2rem; margin: 0; border-radius: 50%; }
.race-crest { display: grid; place-items: center; }
.race-crest .chip { display: block; width: 1.1rem; height: 2rem; margin: 0; border-radius: 2px 2px 50% 50% / 2px 2px 22% 22%; }
.race-who { display: flex; flex-direction: column; gap: .18rem; min-width: 0; line-height: 1.2; }
.race-name { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.race-who .hname { min-width: 0; font: 400 1rem/1.15 var(--serif); color: var(--deck-ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-row.gold .race-who .hname { color: #f6dc8a; }
.race-you { display: inline-block; flex: none; padding: .04rem .38rem; border-radius: 999px; font: 600 .62rem/1.3 var(--sans);
  font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--deck-night); background: var(--brass-hi); }
.race-meta { display: flex; align-items: baseline; gap: .28rem; min-width: 0; color: var(--muted); }
.race-meta > i { flex: none; font-style: normal; }
.race-capt { min-width: 0; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-capt .rankname { font-variant: small-caps; }
.race-where { flex: none; font-size: .75rem; color: color-mix(in srgb, var(--deck-ivory) 72%, transparent); }
.race-worth { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.15; white-space: nowrap; }
.race-worth > small:first-child { font-family: var(--special); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); }
.race-worth b { font: 700 1.08rem/1.2 var(--serif); color: var(--deck-ivory); font-variant-numeric: tabular-nums; }
.race-worth b.down { color: var(--blood-hi); }
.race-worth > small:last-child { font-size: .74rem; color: var(--muted); }
.race-row.gold .race-worth > small:last-child { color: #f0d27a; }

/* Tight side column: the compact row remains readable without dropping identity details. */
.pt-race-side ol.race { gap: .35rem; }
.pt-race-side .race-row { gap: .45rem; padding-inline: .45rem .55rem; }
@container pane (max-width: 340px) {
  .race-row { grid-template-columns: 1.65rem 1.9rem minmax(0, 1fr) auto; gap: .4rem; }
  .medal { width: 1.65rem; height: 1.65rem; }
  .race-crest .crest { width: 1.9rem; height: 1.9rem; }
  .race-worth > small:first-child { display: none; }
  .race-capt .rankname { display: none; }
}

/* ------------------------------------------------------------------ voyage ribbon -- */
/* The whole game along the foot of the top bar, full width (player.js voyageRibbon). Silk ribbon in
   lacquer with brass hairlines and swallow-tail ends; the lit part runs a fixed jade > brass > oxblood
   gradient, the part still to sail shows the same gradient faintly. Last 10 months: month notches and a
   brass count. Last 3: an oxblood count and a pulsing seal. */
.dk-top.has-voy { padding-bottom: 2.75rem; }
.dk-voy { position: absolute; left: .95rem; right: .95rem; bottom: .55rem; height: 1.75rem;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .65rem;
  --voy-grad: linear-gradient(90deg, var(--deck-jade) 0%, color-mix(in srgb, var(--deck-jade) 55%, var(--deck-brass)) 30%,
    var(--deck-brass) 60%, color-mix(in srgb, var(--deck-brass) 42%, var(--deck-oxblood)) 82%, var(--deck-oxblood) 100%); }
.voy-from, .voy-left small { font: .7rem/1 var(--special); letter-spacing: .08em; white-space: nowrap;
  color: color-mix(in srgb, var(--deck-brass) 80%, var(--deck-ivory)); }
.voy-track { position: relative; height: 1.05rem; min-width: 0; }
.voy-silk { position: absolute; inset: 0; background: color-mix(in srgb, var(--deck-lacquer) 80%, #000);
  clip-path: polygon(0 0, 100% 0, calc(100% - .6rem) 50%, 100% 100%, 0 100%, .6rem 50%); }
.voy-silk::before, .voy-silk::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; z-index: 2;
  background: var(--deck-brass); opacity: .6; }
.voy-silk::before { top: 1px; } .voy-silk::after { bottom: 1px; }
.voy-ghost, .voy-fill { position: absolute; left: 0; right: 0; top: 3px; bottom: 3px;
  background: linear-gradient(180deg, rgba(255, 240, 200, .26), transparent 45%, rgba(0, 0, 0, .3)), var(--voy-grad); }
.voy-ghost { opacity: .17; }
.voy-fill { clip-path: inset(0 calc(100% - var(--p)) 0 0); transition: clip-path .9s ease; }
.voy-tick, .voy-notch { position: absolute; width: 1px; z-index: 1; }
.voy-tick { top: 3px; bottom: 3px; background: color-mix(in srgb, var(--deck-ivory) 45%, transparent); }
.voy-notch { top: 5px; bottom: 5px; background: color-mix(in srgb, var(--deck-ivory) 38%, transparent); }
.voy-ship { position: absolute; top: 50%; left: clamp(.7rem, var(--p), calc(100% - .7rem)); width: 1.6rem; height: 1.35rem; z-index: 3;
  transform: translate(-50%, -64%); color: var(--deck-ivory); transition: left .9s ease;
  filter: drop-shadow(0 1px 1.5px #000) drop-shadow(0 0 6px color-mix(in srgb, var(--deck-brass) 55%, transparent)); }
.voy-ship svg { display: block; width: 100%; height: 100%; }
.voy-seal { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--deck-oxblood) 62%, #e4705f), var(--deck-oxblood) 72%);
  border: 1px solid var(--deck-brass); color: var(--deck-ivory); font: 400 .95rem/1 var(--serif), serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(21, 16, 12, .35); }
.voy-left { display: flex; flex-direction: column; align-items: flex-end; gap: .14rem; min-width: 7.6rem; }
.voy-left b { font: 700 .9rem/1 "Consolas", "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums;
  color: var(--deck-ivory); white-space: nowrap; }
.dk-voy.near .voy-left b { color: var(--brass-hi); }
.dk-voy.end .voy-left b { color: var(--blood-hi); }
.dk-voy.end .voy-seal { animation: voySeal 1.6s ease-in-out infinite; }
@keyframes voySeal { 50% { box-shadow: 0 2px 6px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(21, 16, 12, .35), 0 0 14px 2px var(--blood-hi); } }
@media (prefers-reduced-motion: reduce) {
  .voy-fill, .voy-ship { transition: none; }
  .dk-voy.end .voy-seal { animation: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .6), 0 0 10px 1px var(--blood-hi); } }
@media (orientation: portrait) and (max-width: 600px) {
  .dk-top.has-voy { padding-bottom: 2.45rem; }
  .dk-voy { left: .55rem; right: .55rem; bottom: .45rem; gap: .45rem; }
  .voy-from, .voy-left small { display: none; } }
@media (orientation: landscape) and (max-height: 560px) {
  .dk-top.has-voy { padding-bottom: 1.95rem; }
  .dk-voy { bottom: .3rem; height: 1.4rem; }
  .voy-from, .voy-left small { display: none; }
  .voy-seal { width: 1.35rem; height: 1.35rem; font-size: .8rem; } }

/* ======================================================== MASTHEAD NAME & RANK (18 Nov 2026) == */
/* The port / date / months-left line under the House name is gone (the ribbon and port plate carry it);
   the House name and rank are much bigger and sit on one baseline, wrapping the rank under the name
   when the bar runs short of room. */
.dk-house > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .8rem; row-gap: .1rem; }
.dk-house b { font-size: clamp(1.9rem, 3.4vw, 3.1rem); line-height: 1; }
.dk-house .rankname { margin-left: 0; font: 400 clamp(1.25rem, 2vw, 1.9rem)/1 var(--title);
  font-variant: small-caps; letter-spacing: .04em; color: var(--brass-hi); text-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
@media (orientation: portrait) and (max-width: 600px) {
  .dk-house b { font-size: 1.6rem; }
  .dk-house .rankname { font-size: 1.1rem; } }
@media (orientation: landscape) and (max-height: 560px) {
  .dk-house b { font-size: 1.45rem; }
  .dk-house .rankname { font-size: 1rem; } }

/* MARKET: Trade all (18 Nov 2026). Each row gets a "Trade all" button right of the Buy/Sell button
   (sells everything aboard, or buys the most silver and hold allow); the header gets "Trade all
   cargo" beside the hold count (makes every lined-up trade, or sells the whole hold). */
.mk-table td.mk-alltd { width: 1%; padding-left: .3rem; padding-right: .25rem; }
body.player button.mk-all, body.player button.mk-allcargo { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .08rem; line-height: 1.05; text-align: center; font-variant-numeric: tabular-nums; }
body.player button.mk-all { width: 6.2rem; min-height: 2.35rem; padding: .18rem .35rem; }
body.player button.mk-all b, body.player button.mk-allcargo b { font: 700 .72rem/1.05 var(--special); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
body.player button.mk-all small, body.player button.mk-allcargo small { font: 700 .74rem/1 var(--sans); opacity: .92; white-space: nowrap; }
body.player button.mk-all.sell { color: #fff6e3; border-color: var(--blood-hi); background: color-mix(in srgb, var(--deck-oxblood) 55%, transparent); }
body.player button.mk-all.buy { color: #eafff6; border-color: var(--jade-hi); background: color-mix(in srgb, var(--deck-jade) 50%, transparent); }
body.player button.mk-all:disabled, body.player button.mk-allcargo:disabled { background: transparent; box-shadow: none; border-style: dashed;
  border-color: var(--edge); color: var(--brass-hi); opacity: .55; }
.mk-head .mk-allslot { display: flex; align-self: center; }
.mk-head .mk-hold + .mk-allslot { margin-left: .2rem; }
body.player button.mk-allcargo { padding: .22rem .8rem; min-height: 0; color: var(--brass-hi); }
/* Selling the whole hold wears the same oxblood as a row's "Trade all / Sell" (19 Nov 2026). */
body.player button.mk-allcargo.sell { color: #fff6e3; border-color: var(--blood-hi); background: color-mix(in srgb, var(--deck-oxblood) 55%, transparent); }
/* Cancel trade (22 Nov 2026): sits right of "Trade all cargo", clears every lined-up bar. */
body.player button.mk-cancel { padding: .22rem .8rem; min-height: 0; margin-left: .35rem; color: #fff6e3; border-color: var(--blood-hi);
  background: color-mix(in srgb, var(--deck-oxblood) 55%, transparent); }
body.player button.mk-cancel b { font: 700 .72rem/1.05 var(--special); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
body.player button.mk-cancel:disabled { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--edge); color: var(--brass-hi); opacity: .55; }
body.player button.mk-allcargo.lined { color: #fff6e3; border-color: var(--brass-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-brass) 55%, #000 10%), color-mix(in srgb, var(--deck-brass) 30%, #000)); }
@container pane (max-width: 620px) {
  body.player button.mk-all { width: 4.8rem; }
  body.player button.mk-all b { font-size: .62rem; }
}

/* ===================================================== MASTHEAD SPACING PASS (18 Nov 2026, b) == */
/* House name down a size, rank much smaller and on its own line under the name, the port plate no
   longer shrinks below its name (the house block gives way first), and the plaques tighter now that
   money reads short ($112K, $1.25M; exact sum in the tooltip). Guns: cannons drop to a small second line. */
.dk-house > div { display: flex; flex-direction: column; align-items: flex-start; row-gap: .15rem; min-width: 0; }
.dk-house b { font-size: clamp(1.35rem, 2.3vw, 2.05rem); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dk-house .rankname { font: 400 clamp(.72rem, .9vw, .88rem)/1 var(--title); letter-spacing: .08em; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.dk-house { flex: 0 1 auto; min-width: 0; }
.dk-port { flex: 1 0 auto; min-width: max-content; padding-inline: .4rem; }
.dk-port b { font-size: clamp(1.2rem, 1.9vw, 1.7rem); overflow: visible; text-overflow: clip; }
.plq { min-width: 4.6rem; padding: .3rem .6rem .34rem; }
.plq.guns { min-width: 3.8rem; }
.plq.guns small { margin-top: 0; font-size: .6rem; color: var(--brass-hi); }
@media (orientation: portrait) and (max-width: 600px) {
  .dk-house b { font-size: 1.3rem; }
  .dk-house .rankname { font-size: .72rem; }
  .dk-port { min-width: 0; } }
@media (orientation: landscape) and (max-height: 560px) {
  .dk-house b { font-size: 1.2rem; }
  .dk-house .rankname { font-size: .68rem; } }

/* Plaque second line (18 Nov 2026, c): a plaque's small line ("+ 60 cannons", the debt clock) no longer
   makes its plaque taller, so the row stays one height and no other figure shifts. The value line keeps
   the same box height (line-height 1 + bottom margin = 1.25em) and the small line sits in that margin. */
.plq:has(> small) b { line-height: 1; margin-bottom: .25em; }
.plq > small { position: absolute; right: .6rem; bottom: .2rem; margin: 0; line-height: 1; }
.plq.guns > small { font-size: .58rem; }
@media (orientation: portrait), (max-aspect-ratio: 1/1) { .plq > small { right: auto; left: .45rem; } }

/* ======================================================= MARKET PULSE (18 Nov 2026) == */
/* player.js Pulse: under the dealer's card in the Market tab's side column. The keeper's own price
   book for this port (12 months), roaming the cargoes moving most; a held cargo stays put. Fills the
   space left under the stage and folds its tiles away when that space is short. */
.deck[data-tab="market"] .dk-dyn { display: flex; flex-direction: column; gap: clamp(.45rem, .9vw, .85rem);
  flex: 1 1 auto; min-height: 0; }
.deck[data-tab="market"] .dk-dyn > .dl-card { flex: none; }
.mp-card { --mp-c: var(--jade-hi); container: mp / size; flex: 1 1 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: .3rem; padding: .55rem .8rem .6rem;
  background: var(--glass); border: 1px solid var(--edge); border-radius: calc(var(--radius) * 1.4);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 236, 190, .07);
  }
.mp-card.down { --mp-c: var(--blood-hi); }
.mp-card.boom { --mp-c: var(--brass-hi); }
.mp-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.mp-head span { font: .78rem/1.2 var(--special); letter-spacing: .1em; text-transform: uppercase; color: var(--brass-hi); }
.mp-name { font: 700 1rem/1.1 var(--serif); color: var(--deck-ivory); text-align: right; animation: mp-in .5s ease; }
.mp-now { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.mp-price { font: 800 1.45rem/1 var(--sans); font-variant-numeric: tabular-nums lining-nums; color: var(--deck-ivory); }
.mp-delta { font: 700 .9rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.mp-delta.up { color: var(--jade-hi); } .mp-delta.down { color: var(--blood-hi); }
.mp-tag { margin-left: auto; padding: .12rem .5rem; border-radius: 999px; font: 700 .7rem/1.2 var(--sans);
  letter-spacing: .08em; text-transform: uppercase; font-style: normal; animation: mp-throb 1.6s ease-in-out infinite; }
.mp-tag.boom { color: var(--deck-night); background: var(--brass-hi); }
.mp-tag.crash { color: var(--deck-ivory); background: var(--deck-oxblood); }
.mp-plot { position: relative; flex: 1 1 3.5rem; min-height: 2.6rem; color: var(--mp-c); cursor: pointer; }
.mp-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mp-line { fill: none; stroke: var(--mp-c); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mp-c) 55%, transparent)); transition: stroke .6s ease; }
.mp-area { transition: color .6s ease; }
.mp-base { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 4; }
.mp-dot { position: absolute; width: .6rem; height: .6rem; margin: -.3rem 0 0 -.3rem; border-radius: 50%;
  background: var(--mp-c); box-shadow: 0 0 0 2px var(--deck-night); pointer-events: none; }
.mp-dot::after { content: ""; position: absolute; inset: -.3rem; border-radius: 50%; border: 2px solid var(--mp-c);
  animation: mp-ping 2.2s ease-out infinite; }
.mp-axis { display: flex; justify-content: space-between; gap: .4rem; font: .66rem/1.2 var(--special); color: var(--muted); }
.mp-axis em { font: italic .68rem/1.2 var(--sans); text-align: center; opacity: .85; }
.mp-tiles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .45rem; margin-top: .1rem; }
.mp-tile { min-width: 0; padding: .35rem .5rem; border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--deck-night) 45%, transparent); border-radius: calc(var(--radius) * .8); }
.mp-tile > small { display: block; font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mp-mv { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem; font-size: .82rem; }
.mp-mv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--deck-ivory); }
.mp-mv b { font: 700 .82rem/1.3 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-mv.up b { color: var(--jade-hi); } .mp-mv.down b { color: var(--blood-hi); }
.mp-best-v { display: block; font: 800 1.05rem/1.25 var(--sans); font-variant-numeric: tabular-nums; color: var(--brass-hi); }
.mp-tile.best small:last-child { display: block; font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-tile.best > small:first-child::before { content: "♛ "; color: var(--brass-hi); }
.mp-none { margin: .15rem 0 0; font-size: .74rem; font-style: italic; color: var(--muted); }
/* the cargo row held on the chart */
.mk-table td[data-act="pulse_pin"] { cursor: pointer; }
.mk-table tr.mp-held .mk-name b { color: var(--brass-hi); }
.mk-table tr.mp-held .mk-ico { box-shadow: inset 3px 0 0 var(--brass-hi); }
@container mp (max-height: 12.5rem) { .mp-tiles { display: none; } }
@container mp (max-height: 7.5rem) { .mp-axis { display: none; } .mp-price { font-size: 1.15rem; } }
@container mp (max-height: 4.5rem) { .mp-plot { display: none; } }
@keyframes mp-ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes mp-throb { 50% { filter: brightness(1.35); } }
@keyframes mp-in { from { opacity: 0; transform: translateY(.2rem); } }
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .deck[data-tab="market"] .dk-dyn { flex-direction: column; }
  .deck[data-tab="market"] .dk-dyn > .dl-card { flex: none; } }
@media (prefers-reduced-motion: reduce) {
  .mp-dot::after, .mp-tag, .mp-name { animation: none; } }

/* ====================================================== MASTHEAD PORT NAME UP (19 Nov 2026) == */
/* The "in from {port}" line is gone, so the port name takes its room and goes up a size. */
.dk-port b { font-size: clamp(1.6rem, 2.7vw, 2.4rem); }
@media (orientation: portrait) and (max-width: 600px) {
  .dk-port b { font-size: 1.45rem; } }
@media (orientation: landscape) and (max-height: 560px) {
  .dk-port b { font-size: 1.4rem; } }

/* What a big trade really costs per unit (19 Nov 2026): average price and how many times the posted
   price, under the total on the trade button and on Trade all. Amber and red when it runs away. */
body.player .mk-avg { display: block; font: 600 .66rem/1.1 var(--sans); font-style: normal; opacity: .85; white-space: nowrap; margin-top: .08rem; }
body.player .mk-avg.amber { color: #ffd27a; opacity: 1; }
body.player .mk-avg.red { color: #ff8a7a; opacity: 1; font-weight: 800; }
/* Hidden for now (19 Nov 2026): the avg line hung off the buttons. Delete this rule to bring it back. */
body.player .mk-avg { display: none; }
body.player .dl-row.move b { color: #ffd27a; }

/* Bank the rest (19 Nov 2026), under the Set Sail orders. */
body.player .bank-rest { display: flex; gap: .6rem; align-items: center; justify-content: space-between; margin: .5rem 0;
  padding: .45rem .6rem; border: 1px solid color-mix(in srgb, #ffd27a 45%, transparent); border-radius: .5rem;
  background: color-mix(in srgb, #ffd27a 10%, transparent); font-size: .85rem; }
body.player .bank-rest span { flex: 1; }

/* The flagship (late game, 19 Nov 2026): her name box in the shipyard. */
.yd-flagname { display: block; width: 100%; max-width: 16rem; margin-top: .35rem; padding: .3rem .5rem; border-radius: .35rem;
  border: 1px solid var(--edge-hi); background: color-mix(in srgb, var(--deck-night) 70%, transparent); color: var(--deck-ivory);
  font: .88rem/1.2 var(--sans); }
.yd-flag .yd-name b { color: var(--brass-hi); }

/* The Mayor's commissions (late game, 19 Nov 2026). */
.pt-commission { padding: .55rem 0 .6rem; border-bottom: 1px dotted var(--rule); }
.pt-commission:last-of-type { border-bottom: 0; }
.pt-commission p { margin: 0 0 .25rem; }
.pt-commission-head { display: flex; align-items: center; gap: .5rem; font: 400 .78rem/1 var(--special); letter-spacing: .08em; color: var(--deck-brass); }
.pt-commission-what { font: 400 1.02rem/1.3 var(--serif); color: var(--deck-ivory); }
.pt-commission small { display: block; font: .82rem/1.35 var(--sans); color: var(--muted); }
.pt-commission-bar { height: .45rem; margin: .3rem 0; border-radius: 999px; background: color-mix(in srgb, var(--deck-brass) 18%, transparent); overflow: hidden; }
.pt-commission-bar i { display: block; height: 100%; background: var(--brass-hi); }
.pt-commission.offer { border: 1px dashed var(--edge-hi); border-radius: .4rem; padding: .55rem .65rem; margin: .4rem 0; }
.pt-commission .pt-actions { margin-top: .45rem; }

/* ------------------------------------------------- reputation swings (19 Nov 2026) -- */
/* The masthead heat bars flash on a change of standing here, with the change beside them. */
.plq.standing { position: relative; }
.plq.standing.rep-up { animation: repUp 1s ease-out 3; }
.plq.standing.rep-down { animation: repDown .9s ease-out 3; }
.plq-delta { position: absolute; right: -.35rem; top: -.75rem; padding: .05rem .38rem; border-radius: 999px;
  font: 700 .78rem/1.2 var(--sans); font-style: normal; color: #fff; pointer-events: none;
  animation: repDelta 3.2s ease-out forwards; }
.rep-up .plq-delta { background: var(--deck-jade); }
.rep-down .plq-delta { background: var(--deck-oxblood); }
@keyframes repUp { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--deck-jade) 80%, transparent); }
  100% { box-shadow: 0 0 0 .7rem transparent; } }
@keyframes repDown { 0%, 30% { transform: translateX(-2px); } 15%, 45% { transform: translateX(2px); }
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--deck-oxblood) 90%, transparent); }
  60%, 100% { transform: none; box-shadow: 0 0 0 .8rem transparent; } }
@keyframes repDelta { 0% { opacity: 0; transform: translateY(.4rem); } 12%, 75% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-.4rem); } }
@media (prefers-reduced-motion: reduce) { .plq.standing.rep-up, .plq.standing.rep-down, .plq-delta { animation: none; } }

/* The band card: the Mayor large on the left (whole picture, never cropped to a medallion), the band on the right. */
.band-move { width: min(46rem, calc(100% - 1.2rem)); max-height: calc(100dvh - 1.2rem); padding: 0; overflow: auto;
  color: var(--deck-ivory); background: var(--deck-lacquer); border: 1px solid color-mix(in srgb, var(--heat) 60%, var(--edge-hi));
  border-radius: var(--radius, 10px); box-shadow: 0 0 40px -10px var(--heat), 0 18px 50px -12px #000; }
.band-move::backdrop { background: #100b09d9; }
.band-move.fell::backdrop { background: radial-gradient(circle, #3a0d0fcc, #0c0606ee); }
.bm-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); min-height: min(28rem, 80dvh); }
.bm-mayor { margin: 0; position: relative; background: var(--deck-night); display: flex; align-items: flex-end; justify-content: center; }
.bm-mayor img { display: block; width: 100%; height: 100%; max-height: 80dvh; object-fit: contain; object-position: center bottom; }
.bm-mayor.nopic { min-height: 10rem; }
.bm-mayor figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .8rem; font-size: .8rem;
  color: var(--brass-hi); background: linear-gradient(transparent, #000c); }
.bm-body { padding: 1.2rem 1.3rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; }
.bm-eyebrow { margin: 0; color: var(--brass-hi); letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; }
.bm-body h2 { margin: 0; font: 400 1.8rem/1.15 var(--title); color: var(--heat); }
.bm-now { margin: .2rem 0 0; color: color-mix(in srgb, var(--deck-ivory) 75%, transparent); }
.bm-band { display: flex; align-items: center; gap: .6rem; padding: .7rem .8rem; border-radius: 8px;
  background: color-mix(in srgb, var(--heat) 14%, var(--deck-night)); border: 1px solid color-mix(in srgb, var(--heat) 45%, transparent); }
.bm-from { font-size: .8rem; opacity: .7; text-decoration: line-through; }
.bm-arrow { font-size: 1.3rem; color: var(--heat); }
.bm-heat { width: 5.6rem; height: 2rem; overflow: visible; filter: drop-shadow(0 0 6px var(--heat)); }
.bm-heat rect.off { fill: rgba(255, 236, 190, .07); stroke: rgba(255, 236, 190, .16); stroke-width: .6; }
.bm-band strong { font-size: 1.45rem; color: var(--heat); }
.bm-band em { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; opacity: .8; }
.band-move.fell.to-hostile .bm-band { animation: plqWarn 1.2s ease-in-out infinite; }
.bm-why { margin: .3rem 0 0; font-weight: 600; }
.bm-effect { margin: 0; color: color-mix(in srgb, var(--deck-ivory) 82%, transparent); line-height: 1.45; }
.bm-others { margin: .2rem 0 0; padding: 0; list-style: none; font-size: .85rem; display: grid; gap: .2rem; }
.bm-others li { padding-left: .6rem; border-left: 3px solid var(--heat); }
.bm-body button { margin-top: auto; align-self: flex-end; min-width: 9rem; }
@media (orientation: portrait), (max-width: 640px) {
  .bm-card { grid-template-columns: 1fr; }
  .bm-mayor img { max-height: 42dvh; }
}

/* A private lot on the Market tab. */
.mk-lot { display: flex; align-items: center; gap: .7rem; margin: .3rem 0 .5rem; padding: .5rem .7rem; border-radius: 8px;
  background: color-mix(in srgb, var(--heat) 12%, var(--deck-night)); border: 1px solid color-mix(in srgb, var(--heat) 50%, transparent); }
.mk-lot p { margin: 0; flex: 1; font-size: .9rem; }
.mk-lot-tag { color: var(--heat); font-weight: 700; white-space: nowrap; }
.yd-price.dear { color: var(--blood-hi); }

/* D1 (owner's decision, 20 Nov 2026): the port we are in wears the game title's own treatment, the gilded
   Uncial wordmark with its gleam (wordmark.css .st-wordmark-title), right in the masthead. The gleam crosses
   once when the bar is drawn and then every 12 seconds. */
.dk-port b { padding: 0 .12em; overflow: visible; font-family: "Ceremony Title", "Uncial Antiqua", Georgia, serif; font-weight: 400;
  letter-spacing: -.01em; line-height: 1.2; text-shadow: none; color: transparent;
  background: linear-gradient(110deg, transparent 43%, #fff8dc 49%, transparent 55%) -35% 0 / 250% 100% no-repeat,
    linear-gradient(#fff5d8 12%, #e6bd68 52%, #ac6e28 54%, #efd18e 78%, #ffd99b);
  -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: .6px #ffdfa173;
  filter: drop-shadow(0 2px 0 #5a3217) drop-shadow(0 4px 10px #07090e);
  animation: dkPortGleam 12s .4s ease-out infinite both; }
@keyframes dkPortGleam { 0% { background-position: 135% 0, 0 0; } 16%, 100% { background-position: -35% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .dk-port b { animation: none; } }

/* ------------------------------------------------------------------------ the helm -- */
/* Set sail's orders card (21 Nov 2026): standing orders | leaving port, a row of heat tags for anything
   worth a look before sailing, then Stay and Set sail on one bar. Three kinds of button so they stop
   looking alike: choices in a sunken track, small money buttons (oxblood pays out, jade keeps silver
   safe), and one big Set sail. --hue runs 118 (fine) down to 4 (bad), the route cards' scale. */
.deck .card.helm { padding-top: clamp(.6rem, 1.1vw, .85rem); padding-bottom: clamp(.6rem, 1.1vw, .85rem); }
.helm-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem 1.1rem; align-items: stretch; }
.helm-col { min-width: 0; display: flex; flex-direction: column; gap: .45rem; }
.helm-col + .helm-col { padding-left: 1.1rem; border-left: 1px solid var(--rule); }
.deck .card.helm h2 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1.75rem; margin: 0;
  padding-bottom: .3rem; font-size: clamp(1.02rem, 1.45vw, 1.22rem); }
.deck .card.helm h2 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.helm-ico { flex: none; width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.helm-quiet { margin: 0; min-height: 2.75rem; display: flex; align-items: center; color: var(--muted); font-size: .85rem; }

/* choices: a sunken track with the picked one raised in brass */
.helm-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border-radius: calc(var(--radius) * .9);
  background: color-mix(in srgb, var(--deck-night) 72%, #000); border: 1px solid var(--rule); box-shadow: inset 0 2px 7px rgba(0, 0, 0, .55); }
body.player .helm-seg button { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .2rem .45rem; min-width: 0; min-height: 2.5rem; padding: .3rem .55rem;
  color: var(--muted); background: transparent; border-color: transparent; box-shadow: none; font-size: .9rem; line-height: 1.15; }
.helm-lab { display: flex; align-items: center; justify-content: center; gap: .45rem; min-width: 0; }
.helm-lab > span { min-width: 0; }
body.player .helm-seg button:hover:not(:disabled) { color: var(--deck-ivory); border-color: var(--edge);
  background: color-mix(in srgb, var(--deck-leather) 38%, transparent); }
body.player .helm-seg button.on, body.player .helm-seg button.on:hover:not(:disabled) { color: var(--deck-night); border-color: var(--brass-hi);
  background: linear-gradient(180deg, var(--brass-hi), var(--deck-brass) 60%, color-mix(in srgb, var(--deck-brass) 75%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 246, 214, .55), 0 2px 8px -2px rgba(0, 0, 0, .7); }
body.player .helm-seg button.on.bad, body.player .helm-seg button.on.bad:hover:not(:disabled) { color: #fff1ea; border-color: var(--blood-hi); text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-oxblood) 78%, #ff9b84 10%), var(--deck-oxblood) 55%, color-mix(in srgb, var(--deck-oxblood) 70%, #000)); }
body.player .helm-seg button:disabled { opacity: .55; }
body.player .helm-seg button.on:disabled { opacity: .85; }

/* heat tags */
.heat-chip { --hue: 118; flex: none; display: inline-flex; align-items: center; gap: .28rem; padding: .2rem .45rem; border-radius: 1rem; white-space: nowrap;
  font: 700 .66rem/1 var(--special); font-style: normal; letter-spacing: .05em; text-transform: uppercase; text-shadow: none;
  color: hsl(var(--hue) 90% 82%); background: hsl(var(--hue) 62% 16% / .92); border: 1px solid hsl(var(--hue) 68% 46% / .9); }
.heat-chip .helm-ico { width: .85rem; height: .85rem; }

/* status strips: protection on the left, silver ashore on the right */
.helm-strip { --hue: 60; flex: 1 1 auto; display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .4rem .55rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--hue) 55% 45% / .55); border-left: 4px solid hsl(var(--hue) 72% 50%);
  background: linear-gradient(90deg, hsl(var(--hue) 55% 20% / .6), hsl(var(--hue) 45% 12% / .25)); }
.helm-strip-ico { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; color: hsl(var(--hue) 85% 78%);
  background: hsl(var(--hue) 60% 14% / .8); box-shadow: inset 0 0 0 1px hsl(var(--hue) 65% 45% / .7); }
.helm-strip-text { flex: 1 1 auto; min-width: 0; display: grid; gap: .14rem; }
.helm-strip-text b { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; color: hsl(var(--hue) 88% 82%);
  font: 800 .78rem/1.1 var(--special); letter-spacing: .07em; text-transform: uppercase; }
.helm-strip-text span { color: var(--deck-ivory); font: .78rem/1.28 var(--sans); }
.helm-strip.ok { padding-top: .3rem; padding-bottom: .3rem; }
.helm-strip.ok .helm-strip-text span { color: var(--muted); }
.helm-strip-act { flex: none; display: grid; justify-items: center; gap: .25rem; }
body.player button.helm-act { flex: none; min-height: 0; height: 2.15rem; padding: 0 .75rem; white-space: nowrap; font-size: .82rem; }
body.player button.helm-act.safe { color: #effff7; border-color: color-mix(in srgb, var(--jade-hi) 60%, transparent); text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-jade) 82%, #b8ffe0 14%), var(--deck-jade) 55%, color-mix(in srgb, var(--deck-jade) 70%, #000));
  box-shadow: inset 0 1px 0 rgba(210, 255, 235, .22), 0 6px 16px -9px var(--deck-jade); }
body.player button.helm-act.safe:hover:not(:disabled) { border-color: var(--jade-hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--deck-jade) 70%, #c9ffe8 24%), var(--deck-jade) 60%, color-mix(in srgb, var(--deck-jade) 75%, #000)); }
.helm .du-slipnote { margin: 0; font-size: .78rem; line-height: 1.3; }

/* before you sail */
.helm-checks { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .4rem; margin-top: .6rem; }
.helm-checks > small { margin-right: .15rem; color: var(--muted); font: 700 .62rem/1 var(--special); letter-spacing: .08em; text-transform: uppercase; }
.helm-chk, body.player button.helm-chk { --hue: 118; display: inline-flex; align-items: center; gap: .35rem; min-height: 0; height: 1.7rem; padding: 0 .6rem; border-radius: 1rem;
  font: 600 .76rem/1 var(--sans); white-space: nowrap; text-shadow: none; box-shadow: none;
  color: hsl(var(--hue) 90% 84%); background: hsl(var(--hue) 58% 15% / .9); border: 1px solid hsl(var(--hue) 65% 44% / .85); }
.helm-chk i { width: .5rem; height: .5rem; border-radius: 50%; background: hsl(var(--hue) 78% 52%); box-shadow: 0 0 7px hsl(var(--hue) 85% 55% / .9); }
body.player button.helm-chk:hover:not(:disabled) { color: #fff; border-color: hsl(var(--hue) 80% 62%); background: hsl(var(--hue) 60% 22% / .95); }

/* Stay and Set sail */
.helm-go { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .6rem; margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--rule); }
body.player button.helm-stay, body.player button.helm-sail { display: flex; align-items: center; justify-content: center; gap: .55rem; min-width: 0; min-height: 3rem; }
body.player button.helm-stay { color: color-mix(in srgb, var(--deck-ivory) 82%, var(--deck-leather)); background: transparent; box-shadow: none; font-size: .88rem; }
body.player button.helm-stay:hover:not(:disabled) { color: var(--deck-ivory); background: color-mix(in srgb, var(--deck-leather) 35%, transparent); }
body.player button.helm-sail { border-width: 2px; border-color: var(--brass-hi); font: 400 clamp(1.1rem, 1.7vw, 1.35rem)/1.1 var(--serif); letter-spacing: .02em;
  animation: helmReady 2.6s ease-in-out infinite; }
body.player button.helm-sail .helm-ico { width: 1.5rem; height: 1.5rem; }
body.player button.helm-sail:disabled { opacity: 1; animation: none; color: var(--muted); background: transparent; border: 1px dashed var(--edge); box-shadow: none; text-shadow: none;
  font: 600 .9rem/1.2 var(--sans); letter-spacing: 0; }
body.player button.helm-sail:disabled .helm-ico { width: 1.15rem; height: 1.15rem; opacity: .7; }
@keyframes helmReady {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 220, 200, .22), 0 0 0 0 color-mix(in srgb, var(--deck-brass) 0%, transparent), 0 6px 18px -8px var(--deck-oxblood); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 220, 200, .3), 0 0 0 3px color-mix(in srgb, var(--deck-brass) 28%, transparent), 0 0 22px -2px color-mix(in srgb, var(--deck-brass) 60%, transparent); }
}
@media (prefers-reduced-motion: reduce) { body.player button.helm-sail { animation: none; } }
.helm-go.ready { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: center; }
.helm-wait { display: flex; align-items: center; gap: .6rem; margin: 0; min-width: 0; color: var(--brass-hi); }
.helm-wait .helm-ico { width: 1.5rem; height: 1.5rem; }
.helm-wait span { display: grid; gap: .1rem; min-width: 0; }
.helm-wait b { font: 400 1.05rem/1.2 var(--serif); }
.helm-wait small { color: var(--muted); font-size: .78rem; }

/* middling panes (iPad landscape): each strip's button drops under its words so the words keep their width */
@container pane (max-width: 900px) {
  .helm-strip { flex-wrap: wrap; row-gap: .35rem; }
  .helm-strip-text { flex: 1 1 60%; }
  .helm-strip { align-content: center; }
  .helm-strip-act { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding-left: 2.5rem; }
}
/* narrow panes (portrait, phones): one column, the buttons stacked with Set sail first */
@container pane (max-width: 600px) {
  .helm-cols { grid-template-columns: minmax(0, 1fr); }
  .helm-col + .helm-col { padding-left: 0; border-left: 0; padding-top: .6rem; border-top: 1px solid var(--rule); }
  .helm-go, .helm-go.ready { grid-template-columns: minmax(0, 1fr); }
  .helm-go .helm-sail { order: -1; }
}

/* ---------------------------------------------------------------- helm picture panels -- */
/* Li Yue (standing orders) and the jailer (leaving port): two panels of one size, each picture filling its half
   of the panel to the top and bottom edge, flush to the outer edge and blended into the panel on the inside.
   The words and the one button sit on the other half; --hue is the heat colour (118 fine, 4 bad). */
.helm-panel { --hue: 60; --panel-h: 8.75rem; position: relative; flex: none; height: var(--panel-h); overflow: hidden; border-radius: var(--radius);
  border: 1px solid hsl(var(--hue) 55% 45% / .55);
  background: linear-gradient(90deg, hsl(var(--hue) 55% 20% / .65), hsl(var(--hue) 45% 12% / .3)); }
.helm-panel.face-right { background: linear-gradient(270deg, hsl(var(--hue) 55% 20% / .65), hsl(var(--hue) 45% 12% / .3)); }
.helm-panel.face-left { border-left-color: hsl(var(--hue) 72% 50%); }
.helm-panel.face-right { border-right-color: hsl(var(--hue) 72% 50%); }
.helm-face { position: absolute; top: 0; bottom: 0; width: 48%; display: block; pointer-events: none; }
.helm-face .helm-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: saturate(1.05) contrast(1.03); }
.face-left .helm-face { left: 0; -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent); mask-image: linear-gradient(90deg, #000 55%, transparent); }
.face-right .helm-face { right: 0; -webkit-mask-image: linear-gradient(270deg, #000 55%, transparent); mask-image: linear-gradient(270deg, #000 55%, transparent); }
.helm-panel-body { position: relative; z-index: 1; height: 100%; width: 54%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: .5rem .8rem; }
.face-left .helm-panel-body { margin-left: auto; align-items: flex-end; text-align: right; }
.face-right .helm-panel-body { margin-right: auto; align-items: flex-start; text-align: left; }
.helm-panel-body b { color: hsl(var(--hue) 88% 84%); font: 800 .82rem/1.2 var(--special); letter-spacing: .07em; text-transform: uppercase; text-shadow: 0 1px 3px #000; }
.helm-panel.ok .helm-panel-body b { font-weight: 700; letter-spacing: .03em; text-transform: none; font-size: .88rem; }
.helm-panel-act { display: flex; }
.helm-panel-act.right { justify-content: flex-end; }
.helm-panel-act.left { justify-content: flex-start; }
/* Bank: silver coin, dark engraved lettering */
body.player button.helm-act.coin { color: #1a1d22; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); font-weight: 800; border: 1px solid #f3f6f9;
  background: linear-gradient(180deg, #fbfcfd 0%, #d5dae0 38%, #aab1ba 52%, #cfd5dc 74%, #eef1f4 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(70, 78, 90, .45), 0 3px 10px -3px rgba(0, 0, 0, .7); }
body.player button.helm-act.coin:hover:not(:disabled) { border-color: #fff; filter: brightness(1.07);
  background: linear-gradient(180deg, #ffffff 0%, #e1e6eb 38%, #b9c0c8 52%, #d9dee4 74%, #f6f8fa 100%); }
@container pane (max-width: 600px) { .helm-panel { --panel-h: 8rem; } .helm-face { width: 42%; } .helm-panel-body { width: 58%; } }

/* ====================================================== SELL-BACK PRICE AND PURSE CONFIRM (21 Nov 2026) == */
/* Game 5 review, Phase 2. A big buy shows what it would sell straight back for, in the slot where a sale shows
   its profit; the dealer card sums the big buys; and a sale past the dealers' purse asks before it goes. */
.mk-act em.mk-pl.back { flex-direction: column; gap: .12rem; padding: 0 .5rem; font-size: .98rem; line-height: 1; }
.mk-act em.mk-pl.back small { font: 800 .56rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.mk-act em.mk-pl.back.ok { color: #3b2a0c; background: #f3e7c9; box-shadow: inset 0 0 0 1.5px var(--brass-hi); }
.mk-act em.mk-pl.back.amber { color: #4a2f00; background: #ffe2a3; box-shadow: inset 0 0 0 1.5px #e0a21f; }
.mk-act em.mk-pl.back.red { color: #6e0f04; background: #ffe1d8; box-shadow: inset 0 0 0 1.5px var(--blood-hi); }
@container pane (max-width: 620px) {
  .mk-act em.mk-pl.back { font-size: .86rem; padding: 0 .35rem; } }
.dl-row.back b { color: var(--brass-hi); }
.dl-row.back.amber b { color: #ffd27a; }
.dl-row.back.red b { color: #ff8a7a; }

.deck .purse-ask { display: flex; flex-direction: column; gap: .7rem; align-self: center; margin: auto; width: min(34rem, 100%);
  padding: clamp(1rem, 3vw, 1.6rem); border-color: var(--blood-hi); }
.deck .purse-ask header { display: flex; flex-direction: column; gap: .2rem; }
.deck .purse-ask ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; font-size: 1rem; line-height: 1.35; }
.deck .purse-ask p { margin: 0; }
.deck .purse-ask p.muted { font-size: .88rem; }
.deck .purse-ask footer { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .3rem; }
.deck .purse-ask footer button { min-height: 44px; }

/* Repaying the home moneylender from another port (23 Nov 2026): the merchant's terms and the report of what got home. */
.pt-remit-terms { margin: .55rem 0 0; font-size: .82rem; line-height: 1.35; opacity: .8; }
.pt-remit { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--rule, rgba(0,0,0,.15)); }
.pt-remit h4 { margin: 0 0 .4rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.pt-remit-rows { margin-top: .4rem; font-size: .82rem; }
.pt-remit-rows tr.warn td { color: var(--vermilion, #a6342a); }
.pt-remit-rows small { margin-left: .3rem; opacity: .85; }
