/* Pelah-ri — La table du capitaine.
   Layout and interaction live in style.css; this sheet owns the materials,
   lettering and object hierarchy. All assets ship locally, including fonts. */
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-italic.ttf") format("truetype");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
:root {
  --serif: "Alegreya", Georgia, serif;
  --ink: #33453d;
  --teal: #30594f;
  --gold: #92703c;
  --paper: #f1e8d4;
  --muted: #65705d;
  --line: #c9bca0;
  --wood: #373028;
  --ivory: #f0e3c5;
  --brass: #c2a36c;
  --fiber: url("/assets/interface/paper.svg");
  --timber: url("/assets/interface/wood.svg");
  --paper-shadow: 0 2px 3px #30291f14, 0 8px 24px #30291f26;
}
button {
  border-radius: 2px;
}
button:not(.ghost):not(:disabled):hover {
  border-color: #8f794f;
}
button.primary {
  background: var(--fiber), #31584d;
  border-color: #31584d;
  box-shadow:
    inset 0 0 0 1px #e1cc9626,
    0 2px 3px #27382d1a;
  color: #faf0d8;
}
button.primary:hover:not(:disabled) {
  background: var(--fiber), #24473e;
}
button.gold {
  background: var(--fiber), #dbc18a;
  color: #493c2b;
}
button.danger {
  color: #914b3c;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #b08237;
  outline-offset: 3px;
}
input,
select {
  border: 0;
  border-bottom: 1px solid #988867;
  border-radius: 0;
  background: #fffaf0a6;
  color: #33453d;
  padding: 12px;
  box-shadow: inset 0 1px 3px #5b4c3010;
}
input:focus,
select:focus {
  background-color: #fffcf4;
}
.eyebrow {
  color: #80663e;
  font-weight: 600;
  letter-spacing: 1.9px;
}
h2,
h3 {
  text-wrap: balance;
}
.brand-lockup {
  gap: 12px;
}
.brand-seal {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.brand {
  font: 500 27px/1.05 var(--serif);
  letter-spacing: 5px;
}
.topbar .eyebrow {
  color: #c2a36c;
  margin-top: 4px;
}

/* A narrow timber rail, screwed brass fittings and one paper resource strip. */
.game-shell .topbar {
  top: 10px;
  left: 16px;
  right: 16px;
  height: 56px;
  padding: 0 18px;
  background: var(--timber) repeat #373028;
  color: var(--ivory);
  border: 1px solid #92774d;
  border-radius: 3px;
  box-shadow:
    0 3px 8px #272c2440,
    inset 0 0 0 3px #c5a46b18;
}
.game-shell .topbar::before,
.game-shell .topbar::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(
    140deg,
    #f5dba0,
    #8b713f 48%,
    #483d2c 49%,
    #c3a56e 65%
  );
}
.game-shell .topbar::before {
  left: 6px;
}
.game-shell .topbar::after {
  right: 6px;
}
.game-shell .topbar .brand {
  font-size: 25px;
  white-space: nowrap;
}
.game-shell .topbar .brand-seal {
  width: 38px;
  height: 38px;
}
.game-shell .topbar .eyebrow {
  font-size: 8px;
}
.game-shell .topbar .ghost {
  color: #e9d9b5;
  border-radius: 50%;
}
.game-shell .topbar .ghost:hover {
  background: #c7b18421;
}
.game-shell .topbar .tag {
  border: 0;
  color: #c9bc9a;
  font-size: 9px;
  letter-spacing: 1px;
}
.topbar [data-action="music"][aria-pressed="true"] {
  background: #ccae692a;
  color: #ffe7a9;
}
.voyage-clock {
  gap: 8px;
}
.voyage-clock strong {
  font: 32px/1 var(--serif);
  color: #f6e4b9;
}
.voyage-clock .eyebrow {
  color: #c6b38b;
}
.voyage-clock > .round-limit {
  color: #b3ac93;
  white-space: nowrap;
}
.auction-clock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid #92774d;
  color: #e6cca0;
  white-space: nowrap;
  font: 14px/1 var(--serif);
}
.auction-clock .ui-icon,
.topbar .audio-button .ui-icon {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
@media (max-width: 840px) {
  .auction-clock-label {
    display: none;
  }
}
.audio-settings label {
  padding: 8px 0;
}
.audio-settings .volume-value {
  color: #806027;
  font-variant-numeric: tabular-nums;
}
.audio-settings input[type="range"] {
  margin: 0;
  padding: 0;
  accent-color: #806027;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.statusbar {
  background: var(--fiber), #f2e9d2;
  border: 1px solid #b5a17c;
  border-left: 3px solid #86704b;
  border-radius: 1px;
  box-shadow: var(--paper-shadow);
}
.captain strong {
  font: 500 19px/1.1 var(--serif);
}
.captain .eyebrow {
  color: #726846;
  letter-spacing: 1.6px;
}
.stat {
  border-left-color: #c9ba99;
}
.stat strong {
  font: 500 26px/1 var(--serif);
}
.stat strong,
.voyage-clock strong,
.score-chip,
.public-stats dd {
  font-variant-numeric: lining-nums tabular-nums;
}
.stat .ui-icon {
  width: 20px;
  height: 20px;
  color: #55735d;
  stroke-width: 1.35;
}
.gold-text,
.gold-text .ui-icon {
  color: #806027;
}
.sea-location {
  font: italic 15px/1.3 var(--serif);
  gap: 7px;
}
.sea-location small {
  color: #58694f;
  font:
    10px system-ui,
    sans-serif;
}
.vision-chip {
  border: 0;
  border-radius: 0;
  background: transparent;
  border-left: 1px solid #8d977c80;
  font:
    9px system-ui,
    sans-serif;
}
.opponent-link,
.dock-right .score-chip {
  background: var(--fiber), #eee5ce;
  border-color: #b5a17c;
  box-shadow: 0 2px 5px #39392319;
}
.opponent-link > span {
  font: 18px/1 var(--serif);
}
.opponent-link small {
  font:
    10px/1.5 system-ui,
    sans-serif;
  color: #65705d;
}
.dock-right .score-chip {
  font: 22px var(--serif);
  color: #78603b;
}

/* Instruments sit in a timber tray; their labels remain explicit. */
.instrument-bar {
  background: var(--timber) repeat #373028;
  border: 1px solid #92774d;
  border-radius: 3px;
  padding: 5px;
  gap: 1px;
  box-shadow:
    0 4px 9px #2e30274d,
    inset 0 0 0 2px #bba27320;
}
.instrument-bar .panel-toggle {
  color: #e8d8b1;
  background: transparent;
  min-width: 58px;
  min-height: 51px;
  padding: 4px 8px;
  gap: 4px;
  border-radius: 1px;
}
.instrument-bar .panel-toggle + .panel-toggle {
  border-left: 1px solid #cdb68130;
}
.instrument-bar .panel-toggle > span {
  font: 14px/1 var(--serif);
}
.instrument-bar .ui-icon {
  width: 21px;
  height: 21px;
  color: #ceb57f;
  stroke-width: 1.35;
}
.instrument-bar .panel-toggle:hover {
  color: #fff3d7;
  background: #e6d29f17;
}
.instrument-bar .panel-toggle[aria-expanded="true"] {
  background: #eadfbe;
  color: #3c4f3d;
  box-shadow: inset 0 -3px #ac8241;
}
.instrument-bar .panel-toggle[aria-expanded="true"] .ui-icon {
  color: #516849;
}
.instrument-bar .panel-toggle[aria-expanded="true"]:hover {
  background: #f5eacb;
  color: #3c4f3d;
}
.map-controls {
  background: #b5a17a;
  border: 1px solid #9c875b;
  border-radius: 2px;
  box-shadow: 0 2px 5px #39392320;
}
.map-controls button {
  background: var(--fiber), #f2e8d0;
  color: #4c644f;
}
.turn-controls {
  background: var(--fiber), #f2e8cf;
  border: 1px solid #b9a67d;
  border-top: 3px solid #9b7d47;
  box-shadow: var(--paper-shadow);
  position: relative;
}
.turn-controls::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid #8f7348;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ead6a4, #b18e55 65%, #695234);
  box-shadow: 1px 1px 2px #40331e55;
  position: absolute;
  right: 9px;
  top: -6px;
}
.event-feed > strong {
  color: #655738;
  font: 600 15px/1.3 var(--serif);
}
.event-summary {
  background: #fff8e787;
  border: 0;
  border-bottom: 1px solid #b9aa8977;
  color: #4c5c43;
}
.event-summary .balance {
  font-size: 11px;
  font-weight: 500;
  color: #4e634b;
}
.turn-actions button {
  font: 500 16px/1.2 var(--serif);
}
.turn-actions button:not(.primary) {
  background: #e7dcc1;
  border-color: #b9a67d;
}

/* Drawers are folios, with an inked title and a cotton-paper reading surface. */
.sidebar,
.game-shell .dock-left .sidebar {
  background: var(--fiber), #f1e8d4;
  border: 1px solid #b7a37f;
  border-top: 3px solid #8d7449;
  border-radius: 1px;
  box-shadow: var(--paper-shadow);
  scrollbar-color: #a19273 #e7dec8;
}
.panel-head,
.dock-left .sidebar .panel-head {
  background: var(--fiber), #e8ddc1;
  color: #4b563e;
  border-bottom: 1px solid #b7a37f;
  font: 500 22px/1.2 var(--serif);
}
.panel-head .ghost {
  color: #756847;
}
.quest {
  border-left: 1px solid #ad8d50;
  padding-left: 14px;
}
.quest h3 {
  font-size: 23px;
  line-height: 1.15;
}
.section-head {
  color: #78633e;
}
.log p {
  color: #536049;
  border-color: #c8bda1;
}
.log em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: #8c724a;
}
.crew-tabs {
  border-color: #b6a989;
}
.crew-tabs button {
  font-size: 10px;
  letter-spacing: 0.3px;
  color: #63705a;
}
.crew-tabs button.active {
  color: #365d4f;
  border-color: #957541;
}
#panel-crew .crew-cards {
  gap: 7px;
  padding-block: 4px;
}
#panel-crew .crew-card {
  background: var(--fiber), #fbf3df;
  border: 1px solid #c5b694;
  border-left: 3px solid var(--rarity);
  padding: 9px 8px;
  min-height: 64px;
  box-shadow: 0 2px 2px #5a4d3120;
  border-radius: 0;
}
#panel-crew .crew-card:hover {
  background-color: #fff9eb;
  border-color: #a78d5c;
}
.crew-card b {
  font: 500 17px/1.1 var(--serif);
}
.crew-card small {
  color: #636c55;
  font-size: 10px;
}
#panel-crew .portrait,
.portrait {
  background: var(--fiber), #59725c;
  border: 1px solid #7b8a66;
  border-radius: 50%;
  outline: 1px solid #9f8e6055;
  outline-offset: 2px;
  color: #f4e7c5;
}
#panel-crew .crew-card .attributes {
  font-size: 11px;
}
.crew-card .attributes .gold-text {
  font: 500 17px/1 var(--serif);
}
.crew-explanation {
  color: #5c6650;
}
.crew-capacity {
  color: #71735c;
  font-family: var(--serif);
  font-style: italic;
}
.legend-disclosure summary {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}
.navigation-grid button {
  background: #faf2dd;
  border-color: #c5b694;
}
.notice {
  background: #e5dcc480;
  border-left: 2px solid #ae8b4e;
  color: #4d5c47;
}
.sea-chip {
  border: 0;
  border-bottom: 1px solid #b7a37f;
  color: #5e6e55;
  padding-inline: 0;
}
.chart-context {
  background: var(--fiber), #f2e8d0;
  border-color: #ab8f5f;
  box-shadow: var(--paper-shadow);
}
.chart-context > strong {
  font-size: 20px;
  font-weight: 500;
  color: #5b543d;
}
.resource-info:hover::after,
.resource-info:focus-visible::after,
.title-slot:hover::after,
.title-slot:focus::after {
  background: var(--fiber), #fcf3dd;
  border-color: #b29b6e;
  color: #394e3f;
}
.turn-banner {
  background: var(--timber) repeat #373028;
  border-color: #b99b61;
  border-radius: 1px;
  font-size: 25px;
}

/* Decisions arrive on a signed folio. Headers and actions stay fixed while it scrolls. */
.overlay {
  background:
    radial-gradient(ellipse at 50% 35%, #273e3650, #1c2524c9),
    var(--timber) repeat #332e27;
  backdrop-filter: blur(5px);
}
.game-shell + .overlay {
  background: #202e2ac4;
}
.modal {
  --dialog-inset: 28px;
  background: var(--fiber), #f1e8d4;
  border: 1px solid #a68f63;
  border-top: 5px solid #66563c;
  border-radius: 2px;
  box-shadow:
    0 2px 0 #e4d4aa,
    0 5px 0 #665b46,
    0 7px 0 #bba77c,
    0 22px 70px #0c161a80;
}
.modal-heading {
  flex: 1;
  min-width: 0;
}
.modal-heading .eyebrow {
  font-size: 9px;
  color: #816538;
  margin: 0 0 6px;
  letter-spacing: 1.8px;
}
.modal-header {
  background: var(--fiber), #e8ddc1;
  border-bottom: 1px solid #c6b692;
  align-items: center;
  padding-block: 20px 17px;
}
.modal-header h2 {
  font: 500 35px/1.06 var(--serif);
  color: #3e5141;
}
.modal-header .close {
  border: 1px solid #bca97f;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 12px;
  padding: 0;
  color: #716045;
}
.modal .close:hover {
  background: #d9cbaa;
}
.modal .lead {
  color: #5e6854;
  font-size: 13px;
  line-height: 1.65;
}
.modal > .footer {
  background: var(--fiber), #e6dbc1;
  border-color: #c6b692;
}
.modal .footer .primary,
.modal-body > .primary,
#lobby-form > .primary {
  font: 500 18px/1.2 var(--serif);
  min-height: 44px;
}
.modal-body {
  scrollbar-color: #a19273 #e7dec8;
}
.modal-body > .eyebrow {
  color: #816538;
}
.modal .choice {
  background: var(--fiber), #fbf3df;
  border: 1px solid #c4b494;
  box-shadow: 0 2px 3px #4b432014;
  border-radius: 1px;
}
.modal .choice b {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
}
.modal .choice span {
  color: #5c6752;
}
.modal .choice .portrait {
  color: #f5e8c4;
}
.modal .choice.selected {
  border-color: #6d7f58;
  background: var(--fiber), #e5e6cc;
  box-shadow:
    inset 0 -3px #70805a,
    0 2px 3px #4b432020;
}
.modal .choice.selected::after {
  color: #48603c;
}
.modal .choice.primary {
  background: var(--fiber), #31584d;
  color: #faf0d8;
}
.modal .choice.primary b,
.modal .choice.primary span,
.modal .choice.primary small {
  color: inherit;
}
.modal .choice .gold-text {
  color: #836129;
}
.setup-banner {
  border-bottom: 1px solid #bbaa86;
}
.setup-banner img {
  filter: drop-shadow(2px 4px 2px #74664c26);
}
.modal:has([data-action="setup-submit"]) .modal-header {
  background: var(--fiber), #e4d7b7;
}
.modal:has([data-action="setup-submit"]) h3 {
  color: #78653f;
}
.modal .quest-choice b {
  font-size: 21px;
}
.setup-selection {
  color: #606b53;
}
.setup-selection strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}
.guide-section {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #c9b997;
}
.guide-section summary {
  font: 500 21px/1.2 var(--serif);
  color: #475a43;
  padding: 15px 0;
}
.guide-section p {
  padding-inline: 0;
  color: #59654f;
}
.card-art {
  background: radial-gradient(ellipse at 50% 35%, #9aa58277, #d6cfaf);
  border: 1px solid #b8a77d;
  border-radius: 50% 50% 2px 2px;
  color: #4d6a54;
}
.card-art img {
  border-radius: inherit;
}
.token-row .tag {
  border: 0;
  border-bottom: 1px solid #aa9870;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.crew-management {
  background: #e2d7bc44;
  border: 1px solid #c0ad85;
}
.crew-management summary {
  font: 500 19px/1.2 var(--serif);
  color: #5d6045;
}
.public-stats {
  border-color: #baaa85;
}
.public-stats dd {
  color: #4b634b;
}
.public-crew-card {
  background: var(--fiber), #faf1da;
  border-color: #c9b894;
}
.bid-footer label {
  font-size: 12px;
  font-weight: 500;
  color: #5f5b41;
}
.bid-footer input {
  font: 500 30px var(--serif);
  padding: 6px 10px;
  background: #fcf4df;
}
.modal:has(#bid) {
  border-top-color: #96723c;
}
.modal:has(#attack-hold) {
  border-top-color: #8b5848;
}
.modal:has(#attack-hold) .modal-heading .eyebrow {
  color: #8b5848;
}
.attack-estimate {
  border-color: #9c6652;
  background: #dfd3b94d;
}
.handoff {
  max-width: 560px;
  text-align: center;
}
.handoff .modal-header {
  text-align: center;
}
.handoff .modal-body {
  padding-block: 30px;
}
.handoff .modal-body > .star {
  display: block;
  font-size: 40px;
  color: #aa8a4d;
}
.handoff .primary {
  margin-top: 24px;
}
.result {
  text-align: center;
}
.result .modal-header {
  justify-content: center;
}
.result .trophy {
  color: #9e7a3d;
}
.captain-menu {
  max-width: 560px;
}
.captain-menu .modal-body {
  position: relative;
}
.captain-menu .modal-body::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 22px;
  width: 94px;
  height: 94px;
  background: url("/assets/interface/pelah-seal.svg") center / contain no-repeat;
  opacity: 0.45;
  pointer-events: none;
}
.captain-menu .lead {
  position: relative;
  max-width: 75%;
}
.ledger-menu {
  display: grid;
  gap: 0;
}
.ledger-menu button {
  padding: 15px 2px;
  border: 0;
  border-bottom: 1px solid #c5b494;
  border-radius: 0;
  background: transparent;
  font: 500 22px/1.2 var(--serif);
  text-align: left;
  box-shadow: none;
}
.ledger-menu button.primary {
  margin-bottom: 6px;
  color: #31584d;
  background: transparent;
}
.ledger-menu button.primary:hover {
  background: #c3cba750;
}
.ledger-menu button:not(.primary):hover {
  background: #e4d9bc;
}
.ledger-menu button small {
  display: block;
  margin-top: 3px;
  font:
    11px/1.5 system-ui,
    sans-serif;
  color: #647056;
}
.ledger-menu button > span {
  float: right;
  color: #947a48;
}
.ledger-menu button.danger {
  font:
    12px system-ui,
    sans-serif;
  border: 0;
  padding-top: 20px;
}

/* Preserve map space and touch targets at compact sizes. */
@media (min-width: 761px) {
  .game-shell {
    --instrument-top: 80px;
    --instrument-height: 52px;
  }
  .sea-location {
    top: 145px;
  }
  .dock-right .opponent-link,
  .dock-right .score-chip {
    height: var(--instrument-height);
  }
  .statusbar {
    gap: 12px;
    padding-block: 7px;
  }
  .captain {
    min-width: 130px;
    max-width: 200px;
  }
  .game-shell .dock-left .sidebar {
    max-height: calc(100dvh - 195px - var(--crewbar-height, 100px));
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .statusbar {
    gap: 8px;
    padding-inline: 8px 12px;
  }
  .captain {
    min-width: 108px;
    max-width: 130px;
    gap: 6px;
  }
  .stat {
    gap: 5px;
    padding-left: 8px;
  }
  .stat strong {
    font-size: 23px;
  }
  .captain-vessel {
    width: 28px;
  }
  .stat .ui-icon {
    width: 17px;
    height: 17px;
  }
}
@media (min-width: 761px) and (max-height: 800px) {
  .modal:has([data-action="setup-submit"]) .modal-header {
    padding-block: 13px;
  }
  .modal:has([data-action="setup-submit"]) .modal-header h2 {
    font-size: 30px;
  }
  .modal:has([data-action="setup-submit"]) .modal-body {
    padding-block: 12px;
  }
  .modal:has([data-action="setup-submit"]) .choices {
    margin-block: 10px;
  }
  .modal:has([data-action="setup-submit"]) .choice b {
    font-size: 18px;
  }
}
@media (max-width: 760px) {
  .game-shell,
  .game-shell:has(.prison-alert) {
    --map-top: 174px;
  }
  .brand-seal {
    width: 36px;
    height: 36px;
  }
  .brand-lockup {
    gap: 8px;
  }
  .game-shell .topbar {
    top: 6px;
    left: 8px;
    right: 8px;
    height: 48px;
    padding: 0 12px;
  }
  .game-shell .topbar .brand-seal {
    width: 30px;
    height: 30px;
  }
  .game-shell .topbar .brand {
    font-size: 21px;
    letter-spacing: 2px;
  }
  .game-shell .topbar .brand-lockup {
    gap: 5px;
  }
  .game-shell .topbar > .row:last-child {
    gap: 0;
  }
  .game-shell .topbar .ghost {
    padding: 6px;
    min-width: 36px;
    min-height: 40px;
  }
  .voyage-clock {
    gap: 3px;
  }
  .auction-clock {
    margin-left: 3px;
    padding-left: 5px;
  }
  .voyage-clock strong {
    font-size: 26px;
  }
  .statusbar {
    top: 66px;
    border-left-width: 2px;
    padding: 7px 10px;
  }
  .captain strong {
    font-size: 18px;
  }
  .stat strong {
    font-size: 23px;
  }
  .stat .ui-icon {
    width: 19px;
  }
  .sea-location {
    font-size: 14px;
  }
  .sea-location,
  .game-shell:has(.prison-alert) .sea-location {
    top: 156px;
  }
  .instrument-bar {
    padding: 4px;
  }
  .instrument-bar .panel-toggle {
    min-width: 48px;
    min-height: 48px;
    padding-inline: 5px;
  }
  .instrument-bar .panel-toggle > span {
    font-size: 13px;
  }
  .game-shell .dock-left .sidebar,
  .game-shell .dock-left #panel-crew {
    max-height: max(
      76px,
      calc(100dvh - var(--map-top, 160px) - var(--crewbar-height, 170px) - 26px)
    );
  }
  .modal {
    --dialog-inset: 16px;
  }
  .modal-header {
    padding-block: 15px 13px;
  }
  .modal-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 1.1px;
  }
  .modal-header h2 {
    font-size: 29px;
  }
  .modal-header .close {
    width: 40px;
    height: 40px;
  }
  .modal .choice b,
  .modal .quest-choice b {
    font-size: 20px;
  }
  .modal .choice span {
    font-size: 12px;
  }
  .modal .footer .primary {
    font-size: 17px;
  }
  .modal .choices {
    gap: 8px;
  }
  .ledger-menu button {
    font-size: 21px;
  }
  .turn-actions button {
    font-size: 16px;
  }
}
@media (max-width: 360px) {
  .voyage-clock .round-limit {
    display: none;
  }
}
@media (max-width: 380px) {
  .game-shell .topbar .brand {
    font-size: 18px;
  }
  .game-shell .topbar .brand-seal {
    width: 26px;
    height: 26px;
  }
  .game-shell .topbar .ghost {
    min-width: 32px;
  }
  .stat strong {
    font-size: 20px;
  }
  .stat {
    padding-inline: 4px;
    gap: 3px;
  }
  .stat .ui-icon {
    width: 16px;
    height: 18px;
  }
  .prison-alert {
    padding-inline: 4px;
    gap: 4px;
  }
}
@media (max-height: 559px) and (max-width: 760px) {
  .instrument-bar .panel-toggle {
    min-height: 38px;
    gap: 2px;
  }
  .instrument-bar .ui-icon {
    width: 18px;
    height: 18px;
  }
  .turn-actions button {
    font-size: 14px;
  }
}

/* The rare decisions get an object of their own, instead of another form heading. */
.auction-lot {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 4px 0 20px;
  border-bottom: 1px solid #c5b48f;
  margin-bottom: 18px;
}
.lot-sigil {
  flex: 0 0 86px;
  height: 104px;
  display: grid;
  place-items: center;
  font: 44px var(--serif);
  color: #ebdcad;
  background: var(--fiber), #64785d;
  border: 1px solid #8e8c67;
  border-radius: 42px 42px 2px 2px;
  box-shadow:
    inset 0 0 0 5px #e8d7a92b,
    2px 3px 3px #5e503126;
}
.auction-lot h3 {
  font: 500 29px/1.1 var(--serif);
  margin: 5px 0 8px;
}
.auction-lot p {
  color: #78613a;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.battle-muster {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.battle-muster > img {
  width: 92px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(3px 6px 3px #59463022);
}
.battle-muster .notice {
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .auction-lot {
    gap: 16px;
    padding-bottom: 16px;
  }
  .lot-sigil {
    flex-basis: 62px;
    height: 82px;
    font-size: 34px;
  }
  .auction-lot h3 {
    font-size: 25px;
  }
  .battle-muster {
    gap: 10px;
  }
  .battle-muster > img {
    width: 52px;
    height: 80px;
  }
  .battle-muster .notice {
    padding: 8px;
    font-size: 11px;
  }
}

/* Le registre du marchand : le lot et les deux plis désormais publics. */
.auction-result {
  max-width: 820px;
}
.auction-result .modal-header h2 {
  font-size: 34px;
}
.auction-verdict {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 0 24px;
  border-bottom: 1px solid #c7b995;
  margin-bottom: 24px;
}
.auction-verdict-seal {
  display: grid;
  place-items: center;
  flex: 0 0 60px;
  height: 60px;
  border: 1px solid #a9905e;
  border-radius: 50%;
  color: #786035;
  background: var(--fiber), #e8dcbf;
  box-shadow:
    inset 0 0 0 4px #f4ecd8,
    inset 0 0 0 5px #b7a276;
}
.auction-verdict-seal .ui-icon {
  width: 28px;
  height: 28px;
}
.auction-status {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 10px;
  font-weight: 700;
  color: #786035;
}
.auction-won .auction-status {
  color: #3c6551;
}
.auction-verdict h3 {
  font: 500 31px/1.15 var(--serif);
  margin: 5px 0 8px;
}
.auction-verdict p {
  margin: 0;
  color: #596150;
}
.auction-settlement {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
}
.auction-result-lot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 14px 16px;
  border: 1px solid #c8b993;
  background: var(--fiber), #e8dfc9;
  box-shadow: 2px 3px 0 #6e593312;
}
.auction-result-lot .lot-sigil {
  flex: none;
  margin-bottom: 16px;
}
.auction-result-lot h3 {
  font: 500 26px/1.1 var(--serif);
  margin: 7px 0;
}
.auction-result-lot p {
  font-size: 12px;
  color: #64634e;
  margin: 0 0 14px;
}
.auction-result-lot .lot-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.auction-lot-fate {
  border-top: 1px solid #c8b993;
  padding-top: 12px;
  margin-top: 18px;
  font: italic 16px var(--serif);
}
.auction-ledger h3 {
  font: 500 24px var(--serif);
  margin: 0 0 16px;
}
.auction-bid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #cfc3a7;
  padding: 18px 12px;
}
.auction-bid.is-winner {
  background: #536b4910;
  border-left: 3px solid #657a57;
  padding-left: 9px;
}
.auction-bid-captain {
  min-width: 0;
}
.auction-bid-captain strong {
  display: block;
  font: 600 24px var(--serif);
  overflow-wrap: anywhere;
}
.auction-bid-captain span,
.auction-bid-amount > span,
.auction-bid-amount small {
  display: block;
  font-size: 11px;
  color: #64634e;
}
.auction-bid-amount {
  text-align: right;
  flex-shrink: 0;
}
.auction-bid-amount strong {
  display: block;
  font: 500 30px var(--serif);
  color: #80652f;
  margin: 4px 0;
}
.auction-bid-amount .metric {
  font: inherit;
}
.auction-result .footer {
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.auction-followup {
  margin: 0;
  max-width: 400px;
  font-size: 12px;
  color: #58604f;
}
.auction-result .footer button {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .auction-result .modal-header h2 {
    font-size: 28px;
  }
  .auction-verdict {
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .auction-verdict-seal {
    flex-basis: 44px;
    height: 44px;
  }
  .auction-verdict h3 {
    font-size: 26px;
  }
  .auction-verdict p {
    font-size: 12px;
  }
  .auction-settlement {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .auction-result-lot {
    position: relative;
    align-items: start;
    text-align: left;
    padding: 16px 14px 16px 92px;
    min-height: 130px;
  }
  .auction-result-lot .lot-sigil {
    position: absolute;
    left: 14px;
    top: 20px;
    width: 62px;
  }
  .auction-result-lot h3 {
    font-size: 23px;
  }
  .auction-result-lot p {
    margin-bottom: 10px;
  }
  .auction-result-lot .lot-stats {
    justify-content: start;
    gap: 8px;
  }
  .auction-lot-fate {
    margin-top: 12px;
    padding-top: 8px;
    font-size: 14px;
  }
  .auction-ledger h3 {
    font-size: 22px;
    margin-bottom: 6px;
  }
  .auction-bid {
    padding: 12px 10px;
  }
  .auction-bid-captain strong {
    font-size: 22px;
  }
  .auction-result .footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .auction-result .footer button {
    width: 100%;
  }
}

/* Comptes rendus : un feuillet, des résultats chiffrés, puis une seule action. */
.report-modal {
  max-width: 720px;
}
.report-modal .modal-header .eyebrow {
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 1.2px;
  color: #685335;
}
.report-modal .modal-header h2 {
  font-size: 36px;
  line-height: 1.15;
}
.report-kind-combat {
  border-top-color: #965b43;
}
.report-kind-warning {
  border-top-color: #965b43;
}
.report-intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.report-emblem {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  color: #665334;
  border: 1px solid #b09a70;
  background: #e7d9b9;
  border-radius: 50%;
}
.report-emblem .ui-icon {
  width: 26px;
  height: 26px;
}
.report-intro h3 {
  margin: 0;
  font: 500 28px/1.25 var(--serif);
  overflow-wrap: anywhere;
}
.report-balance > h3,
.report-consequence > h3 {
  margin: 0 0 12px;
  font:
    600 16px/1.4 system-ui,
    sans-serif;
  color: #33453d;
}
.report-balance ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
}
.report-reward,
.report-detail {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c8b999;
  background: #fbf6e9;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-reward > .ui-icon,
.report-detail > .ui-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: #715c36;
}
.report-reward > div {
  min-width: 0;
}
.report-label {
  display: block;
  font-size: 13px;
  color: #53604c;
}
.report-reward strong {
  display: block;
  margin-top: 4px;
  font: 600 27px/1.15 var(--serif);
  color: #29473a;
}
.report-reward p,
.report-detail p,
.report-consequence p {
  margin: 8px 0 0;
  font:
    14px/1.55 system-ui,
    sans-serif;
  color: #445341;
}
.report-detail {
  grid-column: 1 / -1;
}
.report-detail p {
  margin: 0;
}
.report-combat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.report-vessel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #b9a58a;
  background: #ebe2d1;
  overflow-wrap: anywhere;
}
.report-vessel.is-yours {
  background: #faf5e8;
  border-color: #6d8270;
}
.report-side {
  font-weight: 650;
  font-size: 14px;
  color: #334c3d;
}
.report-side > span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: #59634e;
}
.report-vessel h3 {
  margin: 14px 0 6px;
  font: 500 23px/1.2 var(--serif);
}
.report-force {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: #344c3e;
}
.report-force strong {
  font: 600 56px/1.1 var(--serif);
}
.report-force > span {
  font-size: 14px;
}
.report-outcome {
  display: inline-block;
  padding: 4px 9px;
  margin-top: 10px;
  border: 1px solid #b2a183;
  background: #f4ecdb;
  font-size: 13px;
  font-weight: 600;
  color: #5b4837;
}
.report-explanation {
  margin: 12px 0 20px;
  color: #4e5c49;
  font-size: 13px;
  line-height: 1.5;
}
.report-consequence {
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 3px solid #9a6b4a;
}
.report-consequence > h3 {
  margin-bottom: 4px;
}
.report-consequence > p {
  margin-top: 0;
}
.report-followup {
  font-size: 13px;
  line-height: 1.5;
  color: #4b5945;
}
.report-modal > .footer {
  gap: 12px;
  align-items: center;
}
.report-modal > .footer .primary {
  font:
    600 16px/1.35 system-ui,
    sans-serif;
}
@media (max-width: 760px) {
  .report-modal .modal-header h2 {
    font-size: 29px;
  }
  .report-modal .modal-header .eyebrow {
    font-size: 11px;
    letter-spacing: 0.6px;
  }
  .report-modal .modal-body {
    padding-block: 18px;
  }
  .report-intro {
    gap: 12px;
    margin-bottom: 20px;
  }
  .report-intro h3 {
    font-size: 25px;
  }
  .report-balance ul {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-reward {
    padding: 14px;
  }
  .report-reward strong {
    font-size: 26px;
  }
  .report-vessel {
    padding: 12px;
  }
  .report-vessel h3 {
    font-size: 21px;
  }
  .report-force strong {
    font-size: 44px;
  }
  .report-modal > .footer {
    flex-direction: column;
    align-items: stretch;
  }
  .report-modal > .footer .primary {
    width: 100%;
    min-height: 48px;
  }
}

.report-balance ul:has(> li:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 360px) {
  .report-force strong {
    font-size: 36px;
  }
}
@media (max-width: 360px) {
  .report-combat {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-vessel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
  }
  .report-side,
  .report-vessel h3,
  .report-outcome {
    grid-column: 1;
  }
  .report-outcome {
    justify-self: start;
    white-space: nowrap;
  }
  .report-force {
    grid-column: 2;
    grid-row: 1 / span 3;
    flex-direction: column;
    align-items: center;
    align-self: center;
    gap: 0;
  }
}

/* Engraved symbols: a shared drawing, scale and baseline on every paper sheet. */
.metric,
.crew-stats {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}
.crew-stats {
  flex-wrap: wrap;
  gap: 6px 12px;
  font:
    11px/1.4 system-ui,
    sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
}
.metric {
  white-space: nowrap;
}
.metric .ui-icon {
  width: 16px;
  height: 16px;
}
.modal .choice .crew-stats,
.modal .choice .metric {
  display: inline-flex;
}
.crew-card .crew-stats {
  justify-content: flex-end;
  gap: 6px;
}
.crew-card .metric {
  gap: 3px;
}
.crew-card .metric .ui-icon {
  width: 13px;
  height: 13px;
}
.token-row .crew-stats {
  gap: 10px 18px;
  padding-block: 8px;
  border-bottom: 1px solid #aa9870;
  font-size: 13px;
}
.lot-stats {
  color: #78613a;
}
.public-crew-card .crew-stats {
  margin-top: 6px;
  color: var(--muted);
}
.portrait .ui-icon {
  width: 23px;
  height: 23px;
  transform: none;
}
.card-art > .ui-icon {
  width: 88px;
  height: 88px;
  stroke-width: 1;
}
.lot-sigil > .ui-icon {
  width: 44px;
  height: 44px;
  stroke-width: 1.25;
}
.title-slot .symbol {
  flex: 0 0 24px;
  color: #806538;
}
.title-slot .symbol .ui-icon {
  width: 24px;
  height: 24px;
}
/* Faction medallions keep their identity in setup, crew, auction and inspection. */
.portrait[data-sea="wreck"],
.lot-sigil[data-sea="wreck"] {
  background-color: #587c7d;
  border-color: #829592;
}
.portrait[data-sea="mist"],
.lot-sigil[data-sea="mist"] {
  background-color: #657953;
  border-color: #8d966b;
}
.portrait[data-sea="gold"],
.lot-sigil[data-sea="gold"] {
  background-color: #968050;
  border-color: #b49c63;
}
.card-art[data-sea="wreck"] {
  color: #466568;
}
.card-art[data-sea="mist"] {
  color: #536844;
}
.card-art[data-sea="gold"] {
  color: #806027;
}
.stat[data-resource="attack"] .ui-icon {
  color: #965e48;
}
.stat[data-resource="power"] .ui-icon,
.stat[data-resource="soul"] .ui-icon {
  color: #806538;
}

/* One timber rail owns captain data; the map and turn controls keep their nodes. */
.game-shell .topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(220px, 300px) auto;
  gap: 18px;
  height: 76px;
  padding-inline: 20px;
}
.game-shell .topbar .brand {
  font-size: 22px;
  letter-spacing: 3px;
}
.game-shell .topbar .brand-seal {
  width: 30px;
  height: 34px;
}
.topbar .statusbar {
  position: static;
  inset: auto;
  height: auto;
  min-width: 0;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.topbar .captain {
  min-width: 0;
  max-width: 250px;
  flex: 0 1 250px;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 8px;
}
.topbar .captain strong {
  color: var(--ivory);
  font-size: 17px;
}
.topbar .captain .eyebrow {
  display: block;
  color: #c6b38b;
  letter-spacing: 1px;
  white-space: nowrap;
  margin: 0 0 5px;
}
.topbar .captain-vessel {
  width: 26px;
  height: 36px;
}
.resource-counts {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.topbar .stat {
  gap: 6px;
  padding-inline: 12px;
  border-left: 1px solid #c2a36c45;
  color: #f0e3c5;
}
.topbar .stat strong {
  font-size: 26px;
}
.topbar .stat strong small {
  color: #c9bc9a;
}
.topbar .stat .ui-icon {
  width: 20px;
  height: 20px;
  color: #c6b38b;
}
.topbar .gold-text strong,
.topbar .gold-text .ui-icon {
  color: #efd296;
}
.topbar .turn-label {
  position: static;
  display: flex;
  min-width: 0;
  gap: 8px;
}
.topbar .opponent-link,
.topbar .score-chip {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ivory);
  padding: 6px;
  height: 44px;
  min-width: 0;
}
.topbar .opponent-link {
  flex: 1;
  gap: 6px;
}
.topbar .opponent-link > span {
  min-width: 0;
  max-width: none;
  flex: 1;
  white-space: nowrap;
  font-size: 16px;
}
.topbar .opponent-link small {
  color: #c9bc9a;
  font-size: 9px;
}
.topbar .opponent-link img {
  width: 23px;
  height: 32px;
  flex-shrink: 0;
}
.topbar .opponent-link .ui-icon {
  width: 16px;
  margin: 0;
}
.topbar .score-chip {
  flex-shrink: 0;
  gap: 4px;
  color: #efd296;
  font: 23px var(--serif);
  border-left: 1px solid #c2a36c45;
  border-radius: 0;
  padding-left: 10px;
}
.topbar .opponent-link:hover,
.topbar .score-chip:hover {
  background: #c7b18421;
}
.game-shell .topbar .header-tools {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 0;
}
.game-shell .topbar .header-tools .tag {
  display: block;
  grid-column: 1 / -1;
  padding: 0;
  text-align: center;
  font-size: 8px;
}
.game-shell .topbar .header-tools .ghost {
  min-width: 34px;
  min-height: 34px;
  padding: 5px;
}
.game-shell .sea-location {
  top: 96px;
}
@media (min-width: 1200px) and (max-width: 1500px) {
  .game-shell .topbar {
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(130px, 185px) auto;
  }
  .topbar .brand-lockup > div > .eyebrow {
    display: none;
  }
  .game-shell .topbar .brand {
    font-size: 20px;
  }
  .topbar .stat {
    padding-inline: 9px;
  }
  .topbar .statusbar {
    gap: 10px;
  }
  .topbar .voyage-clock {
    display: grid;
    grid-template-columns: auto auto;
    gap: 2px 4px;
  }
  .topbar .voyage-clock .eyebrow,
  .topbar .auction-clock {
    grid-column: 1 / -1;
  }
  .topbar .auction-clock {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}
@media (min-width: 761px) {
  .game-shell {
    --instrument-top: 100px;
  }
  .game-shell .dock-right {
    grid-template-rows: 32px 0 minmax(0, 1fr) auto;
  }
  .game-shell .dock-left .sidebar {
    max-height: calc(100dvh - 195px - var(--crewbar-height, 100px));
  }
}
@media (max-width: 1199px) {
  .game-shell .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 6px 14px;
    height: 122px;
    padding: 8px 16px;
  }
  .topbar .brand-lockup {
    grid-column: 1;
    grid-row: 1;
  }
  .topbar .voyage-clock {
    grid-column: 2;
    grid-row: 1;
  }
  .game-shell .topbar .header-tools {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }
  .topbar .statusbar {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }
  .topbar .turn-label {
    grid-column: 3;
    grid-row: 1;
    justify-content: end;
  }
  .game-shell .sea-location {
    top: 140px;
  }
  .game-shell {
    --instrument-top: 150px;
  }
}
@media (max-width: 760px) {
  .game-shell .topbar {
    height: 164px;
    gap: 4px 8px;
    padding: 6px 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: 40px 66px 34px;
  }
  .game-shell .topbar .header-tools {
    grid-column: 3;
    grid-template-columns: repeat(4, 30px);
  }
  .game-shell .topbar .header-tools .ghost {
    min-width: 30px;
  }
  .topbar .brand-lockup > div > .eyebrow {
    display: none;
  }
  .game-shell .topbar .brand {
    font-size: 19px;
    letter-spacing: 2px;
  }
  .game-shell .topbar .brand-seal {
    width: 25px;
    height: 28px;
  }
  .topbar .voyage-clock {
    gap: 3px;
  }
  .topbar .voyage-clock strong {
    font-size: 27px;
  }
  .game-shell .topbar .voyage-clock .eyebrow {
    display: block;
    font-size: 7px;
    letter-spacing: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }
  .topbar .statusbar {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-self: stretch;
  }
  .topbar .captain {
    display: flex;
    flex: 0 0 100%;
    max-width: none;
    height: 26px;
  }
  .topbar .captain > div {
    display: flex;
    min-width: 0;
    gap: 8px;
  }
  .topbar .captain .eyebrow {
    flex-shrink: 0;
    font-size: 7px;
    letter-spacing: 0.5px;
    margin: 0;
  }
  .topbar .captain strong {
    font-size: 16px;
  }
  .topbar .captain-vessel {
    width: 20px;
    height: 25px;
  }
  .resource-counts {
    width: 100%;
    justify-content: space-between;
  }
  .topbar .stat {
    padding-inline: 6px;
    gap: 4px;
    border-left: 1px solid #c2a36c45;
  }
  .topbar .stat:first-child {
    border: 0;
    padding-left: 0;
  }
  .topbar .stat strong {
    font-size: 24px;
  }
  .topbar .stat .ui-icon {
    width: 18px;
    height: 18px;
  }
  .topbar .turn-label {
    grid-row: 3;
    grid-column: 1 / -1;
    border-top: 1px solid #c2a36c45;
  }
  .topbar .opponent-link,
  .topbar .score-chip {
    height: 32px;
    padding-block: 2px;
  }
  .topbar .opponent-link > span {
    max-width: none;
    flex: 1;
    font-size: 15px;
  }
  .topbar .opponent-link small {
    display: inline;
    margin-left: 8px;
    font-size: 8px;
  }
  .topbar .opponent-link img {
    width: 18px;
    height: 25px;
  }
  .game-shell .sea-location,
  .game-shell:has(.prison-alert) .sea-location {
    top: 178px;
  }
  .game-shell,
  .game-shell:has(.prison-alert) {
    --map-top: 200px;
  }
}
@media (max-width: 380px) {
  .game-shell .topbar .brand-seal,
  .topbar .opponent-link small {
    display: none;
  }
  .game-shell .topbar .brand {
    font-size: 18px;
  }
  .topbar .stat {
    padding-inline: 4px;
    gap: 3px;
  }
  .topbar .stat strong {
    font-size: 22px;
  }
  .topbar .stat .ui-icon {
    width: 16px;
  }
}
@media (max-width: 760px) {
  .topbar .resource-info[data-resource="coin"]:hover::after,
  .topbar .resource-info[data-resource="coin"]:focus-visible::after {
    left: 0;
  }
}
@media (max-width: 760px) {
  .game-shell .topbar .prison-alert,
  .game-shell .topbar .opponent-link,
  .game-shell .topbar .score-chip {
    min-height: 32px;
    min-width: 32px;
  }
}
@media (max-width: 410px) {
  .topbar .voyage-clock {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 0 3px;
  }
  .topbar .voyage-clock .eyebrow {
    grid-row: span 2;
  }
  .topbar .voyage-clock strong {
    font-size: 23px;
  }
  .topbar .auction-clock {
    grid-column: 2 / -1;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    font-size: 12px;
  }
  .topbar .auction-clock .ui-icon {
    width: 12px;
    height: 12px;
  }
}

.fleet-marker {
  --fleet-ink: #665128;
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}
.fleet-marker[data-hostile="true"] {
  --fleet-ink: #752d28;
}
.fleet-motion .fleet-marker {
  transition: transform 360ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .fleet-motion .fleet-marker {
    transition: none;
  }
}
.fleet-marker img {
  position: absolute;
  width: 50px;
  height: 56px;
  object-fit: contain;
  top: -49px;
  left: -25px;
  filter: sepia(0.25) drop-shadow(0 2px 2px #29363380);
}
.fleet-marker[data-hostile="true"] img {
  filter: sepia(0.55) hue-rotate(325deg) saturate(1.35)
    drop-shadow(0 2px 2px #39232299);
}
.fleet-marker span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  left: -9.5px;
  top: -3px;
  border: 1px solid #ebd4a2;
  border-radius: 50%;
  color: #fff3d7;
  background: var(--fleet-ink);
  box-shadow: 0 1px 3px #33261588;
}
.fleet-marker[data-hostile="true"] span {
  border-radius: 4px;
}
.fleet-marker .ui-icon {
  width: 12px;
  height: 12px;
}
.fleet-hero {
  gap: 12px;
  padding: 0;
}
.fleet-hero > img {
  width: 66px;
  height: 73px;
}
.fleet-hero h2 {
  margin: 4px 0;
}
.fleet-type[data-hostile="true"] {
  color: var(--burgundy, #752d28);
}
.fleet-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
  padding: 10px 0;
}
.fleet-stats dd {
  font-size: 17px;
}
.fleet-stats dd .ui-icon,
.map-legend .ui-icon {
  width: 14px;
  height: 14px;
}
.fleet-dialog .fleet-hero {
  margin-bottom: 8px;
}
.fleet-dialog .fleet-hero p {
  margin: 0;
}
.fleet-dialog .footer > button {
  margin-inline-start: auto;
}
@media (max-width: 380px) {
  .fleet-stats dd {
    font-size: 14px;
  }
  .fleet-stats dd .metric {
    gap: 3px;
  }
}

/* Keep navigation help above the chart calendar while it is being read. */
.game-shell .topbar:has(.movement-info:hover, .movement-info:focus) {
  z-index: 13;
}

/* The calendar shares the chart's brass and paper, with independent clocks. */
.upcoming-events {
  position: fixed;
  z-index: 12;
  top: var(--instrument-top, 100px);
  right: var(--chart-edge, 20px);
  width: 244px;
  background: var(--fiber), #f2e8d0;
  color: #454735;
  border: 1px solid #ad9569;
  border-top: 3px solid #8c764b;
  border-radius: 2px;
  box-shadow: var(--paper-shadow);
}
.events-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  color: #594b30;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  font: 20px var(--serif);
}
.events-toggle > .ui-icon {
  width: 23px;
  height: 23px;
}
.events-toggle > span:first-of-type {
  flex: 1;
}
.events-toggle small {
  display: block;
  margin-top: 2px;
  color: #766c51;
  font:
    9px system-ui,
    sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.events-chevron {
  font:
    18px system-ui,
    sans-serif;
}
.upcoming-events ul {
  list-style: none;
  padding: 0 12px 5px;
  margin: 0;
  max-height: calc(100dvh - var(--instrument-top, 100px) - 250px);
  overflow-y: auto;
}
.upcoming-events ul[hidden] {
  display: none;
}
.upcoming-event {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 7px 0;
  border-top: 1px solid #b7a27b55;
}
.upcoming-event > .ui-icon {
  width: 19px;
  height: 19px;
  color: #7f7049;
  flex-shrink: 0;
}
.upcoming-event > span:first-of-type {
  flex: 1;
}
.upcoming-event strong {
  display: block;
  font: 16px var(--serif);
}
.upcoming-event small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #736b56;
}
.event-deadline {
  border: 1px solid #b8a27880;
  border-radius: 2px;
  padding: 4px 5px;
  font: 13px var(--serif);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.upcoming-event.is-due {
  color: #934c32;
}
.is-due .event-deadline {
  background: #ae684018;
  border-color: #a16d4e70;
}
.upcoming-event:focus-visible {
  outline: 2px solid #8d6d38;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .upcoming-events {
    top: 204px;
    right: 10px;
    width: 216px;
  }
  .events-toggle {
    padding: 7px 10px;
    font-size: 17px;
    min-height: 44px;
  }
  .upcoming-events:has([aria-expanded="false"]) {
    width: 142px;
  }
  .events-toggle small {
    font-size: 8px;
    letter-spacing: 0;
  }
  .upcoming-events ul {
    max-height: calc(100dvh - 290px - var(--crewbar-height, 180px));
  }
  .upcoming-event {
    min-height: 43px;
    gap: 7px;
  }
  .upcoming-event strong {
    font-size: 15px;
  }
}

.has-deadline .events-toggle > .ui-icon {
  color: #934c32;
}

/* The supplied landscape image includes paper margins. Crop them in CSS so the
   original stays intact and every overlay follows the same card coordinates. */
.card-detail {
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.character-sheet {
  position: relative;
  width: 100%;
  aspect-ratio: 1120 / 1260;
  background: url("/assets/characters/card-frame.png") center / 178.57% 102.7%
    no-repeat;
  color: #344d52;
  font-family: var(--serif);
  container-type: inline-size;
}
.character-sea {
  position: absolute;
  top: 3%;
  left: 4.4%;
  width: 13.5%;
  height: 12%;
  display: grid;
  place-items: center;
}
.character-sea .ui-icon {
  width: 62%;
  height: 62%;
}
.character-affiliation {
  position: absolute;
  inset: 3% 6% auto 19%;
  height: 7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 3.8cqw;
  line-height: 1.1;
}
.character-affiliation > span {
  font-size: 3.2cqw;
}
.character-portrait {
  position: absolute;
  inset: 16% 10% 31%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 3%;
  text-align: center;
  font-size: 5.8cqw;
  line-height: 1.1;
}
.character-portrait img {
  width: 100%;
  min-height: 0;
  flex: 1;
  object-fit: contain;
}
.character-placeholder {
  margin-block: auto;
  font-size: 3.6cqw;
  font-style: italic;
  color: #627577;
}
.character-rarity {
  position: absolute;
  inset: 69% 10% auto;
  text-align: center;
  font-size: 4cqw;
}
.character-ability {
  position: absolute;
  inset: 75% 12% auto;
  display: grid;
  gap: 2px;
  text-align: center;
  font-size: 3.5cqw;
  line-height: 1.15;
}
.character-ability > strong {
  font-size: 4cqw;
}
.character-stats {
  position: absolute;
  inset: 86% 16% auto;
  font-size: 4.3cqw;
}
.character-stats .crew-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.character-stats .ui-icon {
  width: 4.5cqw;
  height: 4.5cqw;
}
.character-controls {
  min-width: 0;
}
.character-controls > .token-row {
  margin-bottom: 18px;
}
/* Sea tint is confined to the frame; the paper and future portrait keep their
   original colors, with a warm paper wash. Rarity uses matte pigments without
   highlight shadows; its palette stays independent of the sea and remains static. */
.character-sheet {
  background: url("/assets/characters/card-frame.png") center / 178.57% 102.7%
    no-repeat;
  isolation: isolate;
  background-color: #fff8e9;
  background-blend-mode: multiply;
  color: var(--sea-ink);
  --sea-ink: #466270;
  --frame-filter: sepia(1) hue-rotate(155deg) saturate(0.62) brightness(0.83);
  --seal: #435c62;
  --jewel: #d2e0e4;
  --rarity-metal: #617a80;
}
.character-sheet:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/assets/characters/card-frame.png") center / 178.57% 102.7%
    no-repeat;
  filter: var(--frame-filter);
  opacity: 0.58;
  clip-path: polygon(
    evenodd,
    4% 1%,
    96% 1%,
    96% 98%,
    4% 98%,
    4% 1%,
    18% 3%,
    18% 10%,
    94% 10%,
    94% 3%,
    18% 3%,
    8% 13%,
    8% 73%,
    92% 73%,
    92% 13%,
    8% 13%,
    8% 75%,
    8% 93%,
    92% 93%,
    92% 75%,
    8% 75%
  );
}
.character-sheet[data-sea="mist"] {
  --sea-ink: #53654f;
  --frame-filter: sepia(1) hue-rotate(58deg) saturate(0.48) brightness(0.83);
}
.character-sheet[data-sea="gold"] {
  --sea-ink: #78613e;
  --frame-filter: sepia(1) saturate(0.72) brightness(0.83);
}
.character-sheet[data-rarity="1"] {
  --seal: #476451;
  --jewel: #c5d6b9;
  --rarity-metal: #637f5c;
}
.character-sheet[data-rarity="2"] {
  --seal: #3d5e7a;
  --jewel: #bfdaea;
  --rarity-metal: #587e9f;
}
.character-sheet[data-rarity="3"] {
  --seal: #886728;
  --jewel: #fae7a6;
  --rarity-metal: #a98437;
}
.character-sheet[data-rarity="4"] {
  --seal: #735276;
  --jewel: #edc8e0;
  --rarity-metal: #9c7099;
}
.character-rarity-seal {
  position: absolute;
  right: 10.2%;
  top: 15.3%;
  width: 8%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--rarity-metal) 19%, #ece3d2);
  border: 1px solid color-mix(in srgb, var(--rarity-metal) 55%, transparent);
  color: color-mix(in srgb, var(--seal) 85%, #665d4a);
  clip-path: polygon(3% 4%, 96% 0, 100% 95%, 1% 100%);
}
.character-rarity-seal > span {
  transform: rotate(-45deg);
  font-size: 3.4cqw;
  line-height: 1;
}
.character-sea {
  color: var(--sea-ink);
}
.character-placeholder {
  color: var(--sea-ink);
  opacity: 0.62;
  font-size: 3.4cqw;
}
.character-affiliation {
  inset: 3% 6% auto 19%;
}
.character-portrait {
  inset: 17% 11% 33%;
  font-size: 5.6cqw;
}
.character-rarity {
  inset: 67.3% 9% auto;
  display: grid;
  justify-items: center;
  gap: 1.1cqw;
  font-size: 3.9cqw;
  line-height: 1;
}
.character-gems {
  display: flex;
  justify-content: center;
  gap: 1.5cqw;
}
.character-gem {
  display: block;
  width: 1.8cqw;
  height: 1.8cqw;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--seal) 60%, #c2b9a5);
  opacity: 0.8;
}
.character-ability {
  inset: 75% 12% auto;
  font-size: 3.3cqw;
}
.character-stats {
  inset: 86% 16% auto;
}
.character-portrait:before {
  content: "";
  position: absolute;
  inset: 3% 10% 18%;
  border: 1px solid currentColor;
  border-radius: 50% 50% 4% 4%;
  opacity: 0.045;
  pointer-events: none;
}
.character-sheet[data-rarity="3"]:after,
.character-sheet[data-rarity="4"]:after {
  content: "";
  position: absolute;
  inset: 14% 7.5% 29%;
  border: 1px solid color-mix(in srgb, var(--rarity-metal) 60%, #9b927b);
  pointer-events: none;
  opacity: 0.27;
  clip-path: polygon(
    0 0,
    18% 0,
    18% 1%,
    1% 1%,
    1% 18%,
    0 18%,
    0 0,
    82% 0,
    100% 0,
    100% 18%,
    99% 18%,
    99% 1%,
    82% 1%,
    82% 0,
    100% 82%,
    100% 100%,
    82% 100%,
    82% 99%,
    99% 99%,
    99% 82%,
    100% 82%,
    18% 100%,
    0 100%,
    0 82%,
    1% 82%,
    1% 99%,
    18% 99%
  );
}
@media (max-width: 760px) {
  .card-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .character-sheet {
    max-width: 340px;
    justify-self: center;
  }
}

.navigation-dialog {
  width: min(440px, 100%);
}
