@font-face {
  font-family: Fallback;
  src: local("Georgia");
}
* {
  box-sizing: border-box;
}
:root {
  --ink: #29483e;
  --teal: #173c40;
  --gold: #a38b52;
  --paper: #f4efe3;
  --muted: #68765f;
  --line: #d9d4c4;
  --serif: Georgia, "Times New Roman", serif;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.5 system-ui,
    -apple-system,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff9ed;
  color: var(--ink);
  padding: 9px 13px;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  background: #e6ddc6;
  border-color: #b6a77e;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #bb9651;
  outline-offset: 3px;
}
button.primary {
  background: var(--teal);
  color: #f5efdc;
  border-color: var(--teal);
}
button.primary:hover {
  background: #2c5354;
}
button.gold {
  background: #d6bc7b;
  border-color: #d6bc7b;
  color: #253c3a;
}
button.ghost {
  background: transparent;
  border-color: transparent;
}
button.danger {
  color: #a35345;
}
input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fffcf4;
  color: var(--ink);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
h2 {
  font-size: 28px;
}
h3 {
  font-size: 20px;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.3px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--gold);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.spread {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 12px;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 3px 9px;
}
.brand {
  font-family: var(--serif);
  letter-spacing: 4px;
  font-size: 24px;
}
.star {
  font-size: 27px;
  color: var(--gold);
}
/* An atlas, a captain's ledger, and brass navigation instruments. */
.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 23px;
  letter-spacing: 5px;
}
.topbar .eyebrow {
  font-size: 8px;
  letter-spacing: 2px;
}
.topbar .star {
  font-size: 38px;
}
.landing {
  min-height: 100svh;
  background: #ece7d7;
  position: relative;
  overflow: hidden;
}
.landing::before,
.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23706040' opacity='.22' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  opacity: 0.22;
  z-index: 1;
}
.landing .topbar,
.hero,
.landing-foot {
  position: relative;
  z-index: 2;
}
.landing .topbar {
  margin: 0 36px;
  padding: 0;
  border-color: #b5b6a4;
}
.hero {
  max-width: 1440px;
  margin: auto;
  min-height: calc(100svh - 184px);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  padding: 52px 72px 54px;
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.hero-copy > .eyebrow {
  color: #6d7664;
  font-size: 9px;
  letter-spacing: 2.5px;
}
.hero h1 {
  font-size: clamp(62px, 6.8vw, 104px);
  line-height: 0.99;
  letter-spacing: -5px;
  margin: 30px 0 25px;
}
.hero h1 i {
  color: #6e8066;
  font-weight: 400;
}
.hero .intro {
  font: 17px/1.7 var(--serif);
  color: #677262;
  margin-bottom: 32px;
}
.hero-actions {
  max-width: 365px;
  display: grid;
  gap: 9px;
}
.embark {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 16px 20px;
  background: transparent;
  border-color: #a7ae99;
  font-size: 13px;
}
.embark small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.65;
}
.embark > span:last-child {
  font-size: 25px;
}
.port-links {
  display: flex;
  flex-wrap: wrap;
  padding-top: 6px;
}
.port-links button {
  font-size: 11px;
  padding: 8px 0;
  margin-right: 15px;
  border-bottom: 1px solid #aeb39e;
}
.atlas-art {
  position: relative;
  margin: 0 -45px 0 -25px;
  height: 590px;
  display: grid;
  place-items: center;
}
.atlas-art::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 110%;
  background: radial-gradient(ellipse, #72988a38, transparent 65%);
}
.atlas-ring {
  position: absolute;
  width: 86%;
  aspect-ratio: 1;
  border: 1px solid #87977f59;
  border-radius: 50%;
}
.ring-outer::before,
.ring-outer::after {
  content: "";
  position: absolute;
  background: #87977f40;
}
.ring-outer::before {
  height: 1px;
  width: 120%;
  top: 50%;
  left: -10%;
  transform: rotate(-25deg);
}
.ring-outer::after {
  width: 1px;
  height: 120%;
  left: 50%;
  top: -10%;
  transform: rotate(-25deg);
}
.ring-inner {
  width: 72%;
  border-style: dashed;
  opacity: 0.6;
}
.chart-map {
  position: absolute;
  width: 105%;
  opacity: 0.3;
  mix-blend-mode: multiply;
  transform: rotate(-14deg);
  mask-image: radial-gradient(ellipse, #000 10%, transparent 64%);
}
.ship-orbit {
  position: relative;
  width: 66%;
  transform: rotate(-9deg);
}
.hero .ship {
  width: 100%;
  max-height: 470px;
  object-fit: contain;
  filter: drop-shadow(15px 28px 14px #425d4633);
  animation: afloat 8s ease-in-out infinite;
}
.chart-north {
  position: absolute;
  top: -5px;
  left: 48%;
  text-align: center;
  font: 12px var(--serif);
  color: #7d8a71;
}
.chart-north::first-line {
  font-size: 10px;
}
.chart-note {
  position: absolute;
  left: 0;
  top: 29%;
  font: 14px/1.5 var(--serif);
  color: #7b8772;
  transform: rotate(-12deg);
}
.chart-note i {
  font-size: 12px;
}
.atlas-art figcaption {
  position: absolute;
  bottom: 8px;
  font: italic 23px var(--serif);
  text-align: center;
}
.atlas-art figcaption span {
  font: 9px monospace;
  margin-right: 10px;
  color: #8b8e74;
}
.atlas-art figcaption small {
  display: block;
  margin-top: 9px;
  font: 11px var(--serif);
  color: #818873;
}
.chart-coordinate {
  position: absolute;
  right: 0;
  bottom: 100px;
  writing-mode: vertical-rl;
  font: 9px monospace;
  letter-spacing: 2px;
  color: #8c947d;
}
.landing-foot {
  display: flex;
  align-items: center;
  gap: 48px;
  margin: 0 36px;
  min-height: 108px;
  border-top: 1px solid #b5b6a4;
}
.landing-foot p {
  font: 16px var(--serif);
}
.landing-foot p span {
  color: #9c956f;
  margin-right: 10px;
  font-style: italic;
}
.landing-foot > small {
  margin-left: auto;
  color: #7a826f;
  text-align: right;
  font-size: 10px;
}
@keyframes afloat {
  50% {
    transform: translateY(-9px) rotate(2deg);
  }
}

.game-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 360px;
  overflow: hidden;
  background: #cbd1bd;
  isolation: isolate;
}
[hidden] {
  display: none !important;
}
.board-wrap {
  position: absolute;
  inset: 0;
}
.board-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.board-wrap canvas:active {
  cursor: grabbing;
}
.game-shell .topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 3;
  padding: 0 26px;
  background: #193c38f5;
  color: #ede7d3;
  border-bottom: 1px solid #b1a16c;
}
.game-shell .topbar .ghost {
  color: #e2dfcb;
  padding: 7px 11px;
}
.game-shell .topbar .ghost:hover {
  background: #36564a;
}
.game-shell .topbar .tag {
  border-color: #6a7e67;
  font-size: 8px;
}
.voyage-clock {
  display: flex;
  align-items: center;
  gap: 12px;
}
.voyage-clock strong {
  font: 30px var(--serif);
}
.voyage-clock > span:last-child {
  color: #8f9f87;
  font: 12px var(--serif);
}
.statusbar {
  position: absolute;
  top: 82px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 22px 13px 16px;
  z-index: 3;
  background: #f5efddf0;
  border: 1px solid #b6b99d;
  box-shadow: 0 3px 12px #304c3810;
}
.captain {
  min-width: 180px;
  max-width: 250px;
}
.captain strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 18px var(--serif);
}
.captain .eyebrow {
  font-size: 8px;
  color: #7b865f;
  margin-bottom: 4px;
}
.stat {
  border-left: 1px solid #c7cbb4;
  padding-left: 18px;
}
.stat strong {
  display: block;
  font: 24px/1.15 var(--serif);
}
.stat strong small {
  font-size: 12px;
  color: #858d76;
}
.stat label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #75816c;
}
.turn-label {
  position: absolute;
  top: 96px;
  right: 26px;
  display: grid;
  gap: 5px;
  text-align: right;
  z-index: 2;
  font: italic 13px var(--serif);
  color: #62735e;
}
.turn-label .eyebrow {
  color: #506649;
  font-style: normal;
}
.sea-location {
  position: absolute;
  top: 174px;
  left: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sea-color);
  font-size: 12px;
  pointer-events: none;
}
.sea-location small {
  color: #61715d;
  margin-left: 4px;
  font-size: 10px;
}
.sea-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sea-color);
}
.dock-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chart-tools {
  display: flex;
  gap: 4px;
  pointer-events: auto;
  width: fit-content;
}
.dock-left,
.dock-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.game-shell::after {
  opacity: 0.08;
}
.panel-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  background: #f6f2e7;
  border-color: #aeb69b;
  font-size: 11px;
}
.panel-toggle > span {
  margin-left: auto;
  color: #8b895e;
  font-size: 16px;
  line-height: 1;
}
.panel-toggle[aria-expanded="true"] {
  background: #294d43;
  border-color: #294d43;
  color: #f6efd9;
}
.sidebar {
  position: absolute;
  z-index: 4;
  width: 278px;
  padding: 0 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: #f6f2e7;
  border: 1px solid #b6b99d;
  box-shadow: 0 4px 16px #2b4c3912;
}
.leftbar,
.journal {
  left: 24px;
  top: 204px;
  max-height: calc(100% - 236px - var(--dock-left-height, 240px));
}
.journal {
  width: 315px;
}
.rightbar {
  right: 24px;
  top: 164px;
  max-height: calc(100% - 196px - var(--dock-right-height, 180px));
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f2e7;
  border-bottom: 1px solid #c8c9b1;
  margin: 0 -20px 18px;
  padding: 7px 12px 7px 20px;
  font: 15px var(--serif);
}
.panel-head button {
  padding: 5px 10px;
}
.section-head {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #788477;
  margin-bottom: 15px;
}
.quest {
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  margin-bottom: 24px;
}
.quest h3 {
  font-size: 18px;
  margin: 5px 0 9px;
}
.progress {
  height: 3px;
  background: #d8d8c9;
  overflow: hidden;
  margin: 12px 0 6px;
}
.progress span {
  display: block;
  background: #8a9c75;
  height: 100%;
}
.title-slot {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #d6d3c580;
  align-items: center;
}
.title-slot .symbol {
  font-size: 21px;
  color: #a29471;
  width: 22px;
  text-align: center;
}
.title-slot small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.title-slot strong {
  font-size: 12px;
  font-weight: 500;
}
.map-hint {
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
  margin-left: auto;
}
.map-controls {
  display: flex;
  gap: 1px;
  border: 1px solid #adb69a;
  background: #adb69a;
}
.map-controls button {
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #f4efdde8;
  font-size: 18px;
}
.map-controls button[aria-pressed="false"] {
  color: #9b9d87;
}
.crewbar {
  position: absolute;
  z-index: 5;
  left: 24px;
  right: 24px;
  bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 278px;
  gap: 12px;
  align-items: end;
  pointer-events: none;
}
.crew-main,
.turn-controls {
  pointer-events: auto;
  border: 1px solid #b3b99d;
  background: #f6f2e7;
  box-shadow: 0 3px 12px #344c3310;
  min-width: 0;
}
.crew-main {
  padding: 0 15px 12px;
}
.crew-main:has([hidden]) {
  padding-bottom: 0;
}
.crew-toggle,
.crew-toggle[aria-expanded="true"] {
  width: calc(100% + 30px);
  margin: 0 -15px;
  padding: 10px 15px;
  font:
    12px/1.5 system-ui,
    sans-serif;
  border: 0;
  background: transparent;
  color: #3a5949;
}
.crew-tabs {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0 0 7px;
  border-bottom: 1px solid #d1d0b8;
}
.crew-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 6px 0;
  color: #7c8773;
  font-size: 9px;
}
.crew-tabs button.active {
  color: #294b41;
  border-bottom-color: #a99356;
}
.crew-tabs .small {
  margin-left: auto;
  font-size: 9px;
}
.crew-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}
.turn-controls {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.turn-controls p {
  text-align: center;
  color: #7b826c;
  font-size: 10px;
}
.turn-controls .primary {
  padding: 12px 6px;
}
.turn-controls .ghost {
  padding: 4px;
  font-size: 10px;
}
.sea-chip {
  padding: 3px 7px;
  border: 1px solid var(--line);
  display: inline-block;
  font-size: 10px;
  margin: 9px 0 15px;
  color: #728170;
}
.action-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}
.action-list button {
  text-align: left;
  font-size: 12px;
}
.action-list button small {
  display: block;
  opacity: 0.7;
  font-size: 10px;
}
.notice {
  font-size: 12px;
  padding: 10px;
  background: #e9e8d8;
  border-left: 2px solid #b2a371;
  line-height: 1.7;
  margin: 12px 0;
}
.log {
  display: grid;
  gap: 10px;
}
.log p {
  font-size: 11px;
  color: #7c8377;
  line-height: 1.6;
  border-bottom: 1px solid #e3ded0;
  padding-bottom: 9px;
}
.log em {
  font-style: normal;
  color: #9d8d64;
  font-size: 9px;
  display: block;
}
.crew-card {
  border: 1px solid #d5ceba;
  border-top: 3px solid var(--rarity, #bbc4b3);
  border-radius: 4px;
  padding: 9px;
  width: 161px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  background: linear-gradient(120deg, #fffaf0, #e8e5d8);
  text-align: left;
  min-height: 104px;
}
.crew-card.empty {
  border: 1px dashed #d4cfbf;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa794;
  font-size: 10px;
  letter-spacing: 1px;
}
.portrait {
  background: #597969;
  border-radius: 50% 50% 35% 35%;
  height: 39px;
  color: #e4dcc2;
  display: grid;
  place-content: center;
  font: 24px var(--serif);
  overflow: hidden;
}
.portrait img {
  width: 38px;
  height: 42px;
  object-fit: cover;
  object-position: 50% 25%;
  transform: scale(1.5);
}
.crew-card b {
  font: 13px/1.2 var(--serif);
  display: block;
  min-height: 32px;
}
.crew-card small {
  font-size: 9px;
  color: #7e8273;
}
.crew-card .attributes {
  grid-column: span 2;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #d9d5c5;
  padding-top: 4px;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #0d292bdc;
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}
.modal {
  background: var(--paper);
  border: 1px solid #d8c9a1;
  box-shadow: 0 25px 100px #0005;
  border-radius: 2px;
  padding: 30px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}
.modal .close {
  position: absolute;
  right: 16px;
  top: 12px;
}
.modal > h2 {
  margin: 7px 0 10px;
  font-size: 34px;
}
.modal .lead {
  color: #7a8275;
  margin: 0 0 20px;
}
.modal .choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}
.choice {
  padding: 15px;
  text-align: left;
  background: #eeebdf;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 125px;
}
.choice.selected {
  border-color: #406c64;
  background: #e1e8d9;
  box-shadow: inset 0 0 0 1px #406c64;
}
.choice b {
  font: 18px var(--serif);
}
.choice span {
  font-size: 11px;
  color: #768274;
}
.choice .portrait {
  width: 35px;
}
.modal .quest-choice {
  min-height: 110px;
}
.modal .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
}
.modal .footer small {
  max-width: 400px;
  color: #868776;
}
.rules-list {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.rules-list p {
  font-size: 13px;
  line-height: 1.7;
}
.rules-list b {
  display: block;
  color: #3d5d52;
}
.setup-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}
.setup-banner img {
  height: 68px;
  width: 60px;
  object-fit: contain;
}
.handoff {
  text-align: center;
  max-width: 480px;
  padding: 50px;
}
.handoff .star {
  font-size: 60px;
}
.handoff p {
  color: #7a8275;
  margin: 15px 0 25px;
}
.gold-text {
  color: #a68a4f;
}
.result {
  text-align: center;
  padding: 40px;
}
.result .trophy {
  font-size: 60px;
  color: var(--gold);
}
.result h2 {
  font-size: 42px;
  margin: 8px 0 16px;
}
.result p {
  margin-bottom: 22px;
}
.results-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 25px;
}
.results-row strong {
  font: 40px var(--serif);
  display: block;
}
.connection {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: #a56745;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 100;
  background: #1c3938;
  color: #f4ecd6;
  padding: 12px 22px;
  border: 1px solid #b69a60;
  max-width: 90vw;
  border-radius: 4px;
  box-shadow: 0 5px 30px #0003;
  opacity: 0;
  transition: 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.card-detail {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
}
.card-art {
  background: linear-gradient(135deg, #8b9d86, #344c4d);
  border: 7px solid #dbd7c8;
  min-height: 220px;
  display: grid;
  place-content: center;
  font: 90px var(--serif);
  color: #d8c8a0;
}
.card-art img {
  width: 170px;
  height: 235px;
  object-fit: cover;
}
.token-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.token-row .tag {
  background: #ebe4d1;
}
.soul-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
}
.soul-row small {
  display: block;
}
.soul-row button {
  padding: 4px 10px;
}
.off {
  display: none !important;
}
.crew-card {
  border-radius: 1px;
  border-top-width: 2px;
  background: #faf5e6;
  min-height: 91px;
  width: 154px;
  padding: 8px;
}
.crew-card.empty {
  font: italic 11px var(--serif);
  letter-spacing: 0;
  background: #e2e0cc25;
}
.crew-card b {
  font-size: 13px;
}
.crew-card:hover:not(:disabled) {
  transform: translateY(-2px);
}
.portrait {
  border-radius: 0;
  background: #607b64;
}
.overlay {
  background: #17382fe8;
}
.modal {
  border-top: 4px solid #a38b52;
  background: #f1ebdb;
}
.modal::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid #b6af8d55;
  pointer-events: none;
}
.choice {
  border-radius: 1px;
}
.log p {
  color: #5f705f;
}
.board-wrap canvas:focus-visible {
  outline: 2px solid #a38b52;
  outline-offset: -4px;
}
@media (min-width: 1700px) {
  .hero {
    padding-top: 80px;
    padding-bottom: 80px;
  }
  .atlas-art {
    height: 670px;
  }
}
@media (max-width: 1100px) {
  .hero {
    padding: 50px 40px;
    grid-template-columns: 1fr 1fr;
  }
  .hero h1 {
    font-size: 76px;
  }
  .atlas-art {
    height: 510px;
    margin-right: -30px;
  }
  .landing-foot {
    gap: 24px;
  }
  .landing-foot p {
    font-size: 13px;
  }
  .statusbar {
    gap: 14px;
    padding: 12px;
  }
  .stat {
    padding-left: 12px;
  }
  .captain {
    min-width: 145px;
    max-width: 180px;
  }
  .captain strong {
    font-size: 16px;
  }
  .crew-tabs {
    gap: 12px;
  }
  .crew-tabs .small {
    display: none;
  }
  .rightbar,
  .leftbar {
    width: 250px;
  }
  .crewbar {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px;
  }
  .turn-label {
    font-size: 11px;
  }
  .turn-label .eyebrow {
    font-size: 8px;
  }
}
@media (max-width: 760px) {
  .landing .topbar {
    margin: 0 22px;
    height: 70px;
  }
  .landing .topbar > button {
    font-size: 10px;
    padding-right: 0;
  }
  .hero {
    padding: 36px 28px;
    grid-template-columns: 1fr;
    overflow: hidden;
  }
  .hero-copy {
    max-width: 460px;
  }
  .hero h1 {
    font-size: clamp(58px, 11vw, 88px);
    letter-spacing: -3px;
  }
  .hero .intro {
    font-size: 16px;
  }
  .atlas-art {
    position: absolute;
    top: 8px;
    right: -120px;
    width: 400px;
    height: 400px;
    opacity: 0.18;
    pointer-events: none;
  }
  .chart-note,
  .atlas-art figcaption,
  .chart-coordinate,
  .chart-north {
    display: none;
  }
  .hero-actions {
    max-width: 420px;
  }
  .landing-foot {
    margin: 0 22px;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 15px 25px;
    min-height: 0;
  }
  .landing-foot p {
    font-size: 12px;
  }
  .landing-foot > small {
    width: 100%;
    text-align: left;
    font-size: 9px;
  }
  .game-shell .topbar {
    padding: 0 12px;
    height: 56px;
  }
  .brand {
    font-size: 18px;
    letter-spacing: 3px;
  }
  .topbar .star {
    font-size: 28px;
  }
  .game-shell .topbar .eyebrow,
  .game-shell .topbar .tag {
    display: none;
  }
  .game-shell .topbar .row {
    gap: 4px;
  }
  .voyage-clock {
    gap: 6px;
  }
  .voyage-clock strong {
    font-size: 25px;
  }
  .statusbar {
    top: 68px;
    left: 12px;
    right: 12px;
    padding: 10px 12px;
    gap: 0;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .captain {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 9px;
    margin-bottom: 7px;
    border-bottom: 1px solid #c6c9b1;
    min-width: 0;
  }
  .captain .eyebrow {
    margin: 0;
    font-size: 7px;
    flex-shrink: 0;
  }
  .captain strong {
    font-size: 14px;
  }
  .stat {
    padding: 0 12px;
    border: 0;
  }
  .stat:nth-child(2) {
    padding-left: 0;
  }
  .stat:last-child {
    padding-right: 0;
  }
  .stat strong {
    font-size: 22px;
  }
  .stat label {
    font-size: 7px;
  }
  .turn-label {
    display: none;
  }
  .sea-location {
    top: 181px;
    left: 12px;
    font-size: 11px;
  }
  .chart-tools {
    flex: 1 1 240px;
    width: auto;
    gap: 4px;
  }
  .chart-tools .panel-toggle {
    flex: 1;
    padding: 8px;
    gap: 4px;
    font-size: 11px;
  }
  .sidebar,
  .leftbar,
  .rightbar,
  .journal {
    top: 212px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(
      100% - 236px - var(--crewbar-height, 190px) - env(safe-area-inset-bottom)
    );
    padding: 0 16px 16px;
  }
  .panel-head {
    margin: 0 -16px 14px;
    padding-left: 16px;
  }
  .crewbar {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .turn-controls {
    padding: 8px;
    gap: 3px;
    justify-content: center;
  }
  .turn-controls > .ghost {
    display: none;
  }
  .turn-controls .primary {
    padding: 9px 4px;
    font-size: 12px;
  }
  .turn-controls p {
    font-size: 9px;
  }
  .crew-main {
    padding: 0 12px 10px;
  }
  .crew-toggle,
  .crew-toggle[aria-expanded="true"] {
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 10px 12px;
  }
  .crew-tabs {
    justify-content: space-between;
    gap: 8px;
  }
  .crew-tabs button {
    font-size: 8px;
  }
  #panel-crew {
    max-height: calc(100dvh - 330px);
    overflow-y: auto;
  }
  .card-detail {
    grid-template-columns: 1fr;
  }
  .card-art {
    display: none;
  }
  .modal {
    padding: 22px;
  }
  .modal > h2 {
    font-size: 28px;
  }
  .overlay {
    padding: 12px;
  }
}
@media (max-width: 540px) {
  .modal .choices {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .choice,
  .modal .quest-choice {
    min-height: 0;
    padding: 12px;
  }
  .choice b {
    font-size: 16px;
  }
  .modal .footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal {
    max-height: 92dvh;
  }
  .handoff {
    padding: 32px 22px;
  }
}
@media (max-height: 650px) and (min-width: 761px) {
  .turn-label {
    display: none;
  }
  .statusbar {
    gap: 12px;
  }
  .crew-cards .crew-card {
    min-height: 80px;
  }
}
@media (max-height: 580px) and (max-width: 760px) {
  .game-shell .topbar {
    height: 44px;
  }
  .statusbar {
    top: 52px;
    padding: 7px 10px;
  }
  .captain {
    display: none;
  }
  .sea-location {
    top: 117px;
  }
  .sidebar,
  .leftbar,
  .rightbar,
  .journal {
    top: 142px;
    max-height: calc(100% - 166px - var(--crewbar-height, 190px));
  }
  .turn-controls p {
    display: none;
  }
  #panel-crew {
    max-height: calc(100dvh - 320px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.chart-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  vertical-align: middle;
}
.navigation-tip {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #52664f;
}

/* Keep the current phase and recent consequences beside the turn controls. */
.event-feed {
  text-align: left;
  margin-bottom: 8px;
  border-bottom: 1px solid #b6b99d;
  padding-bottom: 8px;
}
.event-feed > strong {
  display: block;
  font-size: 12px;
  color: #294d43;
  margin-bottom: 5px;
}
.event-summary {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background: #fff9e9;
  font-size: 11px;
  line-height: 1.4;
}
.event-summary span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 4px;
}
.event-summary .balance {
  color: #294d43;
  font-weight: 700;
}
.event-summary small {
  display: block;
  color: #656b56;
}
.crew-explanation {
  margin: 4px 12px 8px;
  max-width: 800px;
  font-size: 11px;
  line-height: 1.5;
  color: #52664f;
}
.map-legend {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  border-top: 1px solid #c8c9b1;
  padding-top: 12px;
  font-size: 11px;
  color: #52664f;
}
.sea-checklist {
  padding-left: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.8;
}
.crew-management {
  padding: 12px;
  border: 1px solid #b6b99d;
  margin: 12px 0;
}
.crew-management summary {
  cursor: pointer;
  font-weight: bold;
}
.crew-management .choices {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.crew-management .crew-card {
  min-width: 0;
  width: 100%;
}
@media (max-width: 760px) {
  .event-summary span {
    -webkit-line-clamp: 1;
  }
  .event-summary span:not(:last-of-type) {
    display: none;
  }
  .event-summary {
    padding: 4px 6px;
  }
  .event-feed {
    margin-bottom: 5px;
    padding-bottom: 5px;
  }
  .crew-explanation {
    max-height: 58px;
    overflow-y: auto;
  }
}
@media (max-height: 650px) {
  .event-summary span {
    -webkit-line-clamp: 1;
  }
  .event-summary span:not(:last-of-type) {
    display: none;
  }
  .event-summary small {
    display: none;
  }
  .crew-explanation {
    display: none;
  }
}
@media (max-height: 580px) and (max-width: 760px) {
  .event-feed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-bottom: 3px;
  }
  .event-feed > strong {
    font-size: 10px;
    margin: 0;
  }
  .event-summary {
    width: auto;
    flex-shrink: 0;
    padding: 4px;
  }
  .event-summary span {
    display: none;
  }
  .event-summary::after {
    content: "Bilan du tour ↗";
    font-size: 10px;
  }
}

.title-slot {
  position: relative;
  cursor: help;
}
.title-slot:hover::after,
.title-slot:focus::after {
  content: attr(data-description);
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 12px;
  border: 1px solid #687b63;
  background: #f5f0df;
  color: #263e35;
  box-shadow: 0 4px 16px #243b3540;
  font: 13px/1.5 sans-serif;
  pointer-events: none;
}
.prison-alert {
  padding: 6px 10px;
  color: #713e37;
  border-color: #975b4a;
}
.prison-alert small {
  display: block;
  font-size: 10px;
  max-width: 150px;
  white-space: normal;
}

.movement-info {
  position: relative;
  cursor: help;
}
.movement-info:hover::after,
.movement-info:focus::after {
  content: attr(data-description);
  position: absolute;
  top: calc(100% + 16px);
  left: -100px;
  width: 280px;
  z-index: 30;
  padding: 12px;
  border: 1px solid #687b63;
  background: #f5f0df;
  color: #263e35;
  box-shadow: 0 4px 16px #243b3540;
  font: 13px/1.5 sans-serif;
  pointer-events: none;
  text-align: left;
}
@media (max-width: 760px) {
  .prison-alert {
    width: 100%;
    margin-top: 8px;
  }
  .prison-alert small {
    display: inline;
    margin-left: 8px;
    max-width: none;
  }
  .game-shell:has(.prison-alert) .sea-location {
    top: 229px;
  }
}

.collapse-all {
  width: 32px;
  min-width: 32px;
  padding: 4px;
  border: 1px solid #a4ad93;
  background: #f2eedc;
  color: #37584f;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: -3px;
}
.collapse-all:hover,
.collapse-all:focus-visible {
  background: #dce7d5;
  outline: 2px solid #678575;
  outline-offset: 2px;
}

.vision-chip {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 7px;
  border: 1px solid #a6b29b80;
  border-radius: 12px;
  background: #f4f0d580;
}
@media (max-width: 760px) {
  .vision-chip {
    font-size: 8px;
    padding: 3px 5px;
  }
}

/* Keep the title and decision visible while dialog content scrolls. */
body.dialog-open {
  overflow: hidden;
}
.modal {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  max-height: calc(100dvh - 48px);
}
.modal-header {
  display: flex;
  align-items: start;
  gap: 16px;
  padding: 22px 28px 16px;
  border-bottom: 1px solid #cdc5ad;
  flex-shrink: 0;
}
.modal-header h2 {
  flex: 1;
  font-size: 30px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.modal .close {
  position: static;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 8px;
}
.modal-body {
  padding: 22px 28px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.modal > .footer {
  padding: 16px 28px;
  margin: 0;
  border-top: 1px solid #cdc5ad;
  flex-shrink: 0;
  background: #f1ebdb;
}
.modal::after {
  display: none;
}
.modal .lead,
.choice span,
.modal .footer small {
  color: #52614f;
}
.choice .portrait {
  color: #fff5d6;
  font-size: 24px;
}
.choice.selected {
  position: relative;
  border-color: #315e4d;
  padding-right: 30px;
}
.choice.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 9px;
  color: #315e4d;
  font-weight: 800;
}
.guide-section {
  border: 1px solid #d0cab7;
  background: #f8f3e7;
}
.guide-section summary {
  padding: 14px;
  cursor: pointer;
  font-weight: 650;
  color: #29483e;
}
.guide-section p {
  padding: 0 14px 16px;
}
.guide-section summary:focus-visible {
  outline: 3px solid #a38b52;
  outline-offset: -3px;
}
.modal-body .rules-list {
  margin: 0;
}
.crew-tabs button,
.crew-tabs .small,
.crew-card small {
  font-size: 11px;
  color: #52614f;
}
.stat label {
  font-size: 10px;
  color: #52614f;
}
.map-controls button {
  min-width: 40px;
  height: 40px;
}
.crew-capacity {
  flex: 0 0 140px;
  align-self: center;
  padding: 12px;
  font-size: 12px;
  color: #52614f;
  border-left: 1px solid var(--line);
}
.event-summary span {
  -webkit-line-clamp: 2;
}
@media (max-width: 760px) {
  .modal {
    max-height: calc(100dvh - 24px);
  }
  .overlay {
    padding: 12px;
  }
  .modal-header {
    padding: 16px;
    gap: 8px;
  }
  .modal-header h2 {
    font-size: 25px;
  }
  .modal-body {
    padding: 16px;
  }
  .modal > .footer {
    padding: 12px 16px;
    gap: 8px;
  }
  .modal > .footer small {
    display: none;
  }
  .modal .choice span {
    font-size: 13px;
  }
  .game-shell .topbar button {
    min-width: 44px;
    min-height: 44px;
  }
  .chart-tools .panel-toggle,
  .collapse-all {
    min-height: 44px;
  }
  .stat label {
    font-size: 10px;
  }
  .captain .eyebrow {
    font-size: 9px;
  }
}
.navigation-controls,
.legend-disclosure {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.navigation-controls summary,
.legend-disclosure summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 650;
}
.navigation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.navigation-grid button {
  font-size: 12px;
  padding: 8px;
  min-height: 44px;
}
.navigation-grid small {
  display: block;
  font-size: 10px;
}
.panel-toggle[aria-expanded="true"]:hover,
.panel-toggle[aria-expanded="true"]:focus-visible {
  background: #315b4d;
  color: #fff5df;
}
.crew-explanation {
  margin: 6px 0;
  max-height: none;
  overflow: visible;
}
.crew-explanation summary {
  cursor: pointer;
  padding: 4px 0;
}
.crew-explanation p {
  padding: 8px 0;
}
@media (max-width: 760px) {
  .crew-tabs button {
    font-size: 10px;
    min-height: 40px;
  }
  .crew-tabs {
    gap: 8px;
    flex-wrap: wrap;
  }
  .game-shell:has(.prison-alert) .sidebar {
    top: 260px;
    max-height: calc(100% - 284px - var(--crewbar-height, 190px));
  }
}
@media (max-height: 580px) and (max-width: 760px) {
  .chart-tools .panel-toggle,
  .collapse-all {
    min-height: 32px;
  }
  .map-controls button {
    height: 32px;
  }
  .crew-tabs button {
    min-height: 30px;
  }
}
/* Functional gold uses an ink tone; ornamental borders keep their patina. */
.gold-text {
  color: #78602c;
}
.choice .gold-text {
  color: #78602c;
}
.turn-actions {
  display: flex;
  gap: 6px;
}
.turn-actions button {
  flex: 1;
  min-height: 44px;
  padding: 8px;
  font-size: 12px;
}
.setup-selection {
  font-size: 12px;
  line-height: 1.5;
}
.setup-selection small {
  display: block;
  margin-top: 6px;
}
.navigation-controls {
  margin: 0 0 16px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 8px;
}
@media (max-width: 760px) {
  .game-shell {
    --map-top: 220px;
  }
  .game-shell:has(.prison-alert) {
    --map-top: 270px;
  }
  .sidebar,
  .game-shell:has(.prison-alert) .sidebar {
    top: auto;
    bottom: calc(var(--crewbar-height, 240px) + 24px);
    max-height: max(
      60px,
      min(
        28dvh,
        calc(
          100% - var(--map-top) - 100px - var(--crewbar-height, 240px) - 24px
        )
      )
    );
  }
  .modal .choice:has(.portrait) {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 3px 12px;
  }
  .choice .portrait {
    grid-row: span 3;
    align-self: center;
  }
  .choice:has(.portrait) b,
  .choice:has(.portrait) > span:not(.portrait),
  .choice:has(.portrait) small {
    grid-column: 2;
  }
  .modal > .footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal > .footer .setup-selection small {
    display: none;
  }
  .dock-toolbar {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .chart-tools {
    flex: 1 1 auto;
    min-width: 0;
  }
  .chart-tools .panel-toggle {
    padding: 6px 3px;
    font-size: 10px;
    gap: 2px;
  }
  .collapse-all {
    min-width: 26px;
    width: 26px;
  }
  .map-controls button {
    width: 30px;
    min-width: 30px;
  }
  .map-hint {
    flex-shrink: 0;
  }
  .crew-card {
    min-height: 80px;
  }
  .crew-explanation summary {
    font-size: 11px;
  }
  .turn-controls p {
    font-size: 10px;
  }
}
@media (max-height: 580px) and (max-width: 760px) {
  .game-shell,
  .game-shell:has(.prison-alert) {
    --map-top: 140px;
  }
  .turn-actions button {
    min-height: 30px;
    padding: 5px;
  }
}
.bid-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px !important;
}
.bid-footer label {
  font-weight: 650;
}
.bid-footer input {
  margin-top: 4px;
}
.bid-actions {
  display: flex;
  gap: 8px;
}
.bid-actions button {
  flex: 1;
  min-height: 44px;
}
#bid-error:empty {
  display: none;
}
#bid-error {
  color: #8b3d2e;
}
#panel-details:has(.navigation-controls[open])
  > button[data-action="opponent"] {
  display: none;
}
.navigation-controls[open] > p {
  display: none;
}
.navigation-controls[open] > summary {
  padding: 6px 0;
}
.navigation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.navigation-grid button {
  padding: 6px 3px;
}
@media (max-width: 760px) and (min-height: 581px) {
  #panel-details:has(.navigation-controls[open]) {
    max-height: 240px;
  }
}

/* Compact instruments: values first, explanations on focus or hover. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ui-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}
.statusbar {
  gap: 12px;
  padding: 8px 14px 8px 8px;
}
.captain {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  max-width: 220px;
}
.captain > div {
  min-width: 0;
}
.captain-vessel {
  width: 36px;
  height: 42px;
  object-fit: contain;
}
.captain strong {
  font-size: 16px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 12px;
  min-height: 32px;
}
.stat strong {
  font-size: 22px;
}
.stat strong small {
  font: 11px system-ui;
  margin-left: 3px;
  color: #52614f;
}
.resource-info {
  position: relative;
  cursor: help;
}
.resource-info:hover::after,
.resource-info:focus-visible::after {
  content: attr(data-description);
  position: absolute;
  top: calc(100% + 16px);
  left: -40px;
  width: 250px;
  z-index: 30;
  padding: 12px 14px;
  background: #faf5e8;
  color: #29483e;
  border: 1px solid #a7b29a;
  box-shadow: 0 6px 24px #233c3820;
  font: 12px/1.6 system-ui;
  text-align: left;
  pointer-events: none;
}
.prison-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 40px;
}
.prison-alert .ui-icon {
  width: 18px;
}
.turn-label {
  top: 82px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 14px system-ui;
}
.opponent-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  text-align: left;
  background: #f6f2e7;
  border-color: #b6b99d;
}
.opponent-link img {
  width: 34px;
  height: 42px;
  object-fit: contain;
  transform: scaleX(-1);
}
.opponent-link span {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opponent-link small {
  display: block;
  font-size: 10px;
  color: #52614f;
}
.opponent-link .ui-icon {
  width: 18px;
  margin-left: 4px;
}
.score-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px;
  font-size: 14px;
}
.sea-location {
  top: 158px;
}
.leftbar,
.journal {
  top: 190px;
  max-height: calc(100% - 220px - var(--dock-left-height, 180px));
}
.vessel-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 0;
}
.vessel-summary img {
  width: 76px;
  height: 92px;
  object-fit: contain;
}
.vessel-summary h2 {
  line-height: 1.2;
}
.opponent-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 6px 8px 20px;
}
.opponent-hero > img {
  width: 128px;
  height: 146px;
  object-fit: contain;
}
.opponent-hero p {
  margin-top: 10px;
}
.public-stats {
  display: flex;
  gap: 32px;
  margin: 4px 0 28px;
  padding: 20px 0;
  border-block: 1px solid var(--line);
}
.public-stats dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.public-stats dd {
  margin: 8px 0 0;
  font: 28px var(--serif);
}
.public-crew {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px;
}
.public-crew-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: #faf5e8;
}
.public-crew-card .portrait {
  width: 42px;
  height: 48px;
  flex-shrink: 0;
}
.public-crew-card strong {
  font: 16px var(--serif);
}
.public-crew-card small {
  display: block;
  margin-top: 6px;
  color: #52614f;
}
.privacy-note {
  display: flex;
  gap: 10px;
  align-items: start;
  font-size: 12px;
  color: #52614f;
  padding-top: 12px;
}
.privacy-note .ui-icon {
  width: 18px;
  height: 18px;
}
.crew-cards {
  gap: 12px;
}
@media (min-width: 761px) {
  .crew-card {
    width: 176px;
    min-height: 104px;
    padding: 12px;
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }
  .crew-card .portrait {
    height: 44px;
  }
  .crew-card b {
    font-size: 14px;
  }
  .turn-controls {
    padding: 14px;
    gap: 10px;
  }
  .event-feed {
    margin-bottom: 0;
  }
  .event-summary {
    padding: 8px 10px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .captain {
    min-width: 120px;
    max-width: 150px;
  }
  .statusbar {
    gap: 8px;
  }
  .stat {
    padding-left: 8px;
  }
  .opponent-link {
    gap: 8px;
    padding: 8px;
  }
  .opponent-link span {
    max-width: 90px;
  }
}
@media (max-width: 760px) {
  .captain {
    width: 100%;
    max-width: none;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  .captain-vessel {
    width: 26px;
    height: 30px;
  }
  .captain > div {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .statusbar {
    padding: 8px 12px;
    gap: 0;
  }
  .stat {
    padding: 0 6px;
    gap: 5px;
  }
  .stat .ui-icon {
    width: 18px;
  }
  .stat strong {
    font-size: 20px;
  }
  .prison-alert {
    width: auto;
    margin: 0 0 0 4px;
    padding: 5px;
    min-height: 32px;
  }
  .turn-label {
    display: none;
  }
  .sea-location,
  .game-shell:has(.prison-alert) .sea-location {
    top: 178px;
  }
  .game-shell:has(.prison-alert) {
    --map-top: 220px;
  }
  .resource-info:hover::after,
  .resource-info:focus-visible::after {
    left: -25px;
    width: 200px;
  }
  .movement-info:hover::after,
  .movement-info:focus-visible::after {
    left: -130px;
  }
  .opponent-hero {
    gap: 18px;
    padding-inline: 0;
  }
  .opponent-hero > img {
    width: 90px;
    height: 110px;
  }
  .public-stats {
    gap: 18px;
    justify-content: space-between;
  }
  .public-stats dt {
    flex-direction: column;
    align-items: start;
    gap: 4px;
    font-size: 11px;
  }
  .public-crew {
    grid-template-columns: 1fr;
  }
  .leftbar,
  .journal {
    top: auto;
    max-height: max(
      60px,
      min(
        28dvh,
        calc(
          100% - var(--map-top) - 100px - var(--crewbar-height, 240px) - 24px
        )
      )
    );
  }
}
@media (max-height: 580px) and (max-width: 760px) {
  .captain {
    display: none;
  }
  .sea-location,
  .game-shell:has(.prison-alert) .sea-location {
    top: 109px;
  }
  .game-shell:has(.prison-alert) {
    --map-top: 140px;
  }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .captain {
    min-width: 110px;
    max-width: 110px;
  }
  .captain-vessel {
    width: 28px;
  }
  .statusbar {
    gap: 6px;
    padding-right: 10px;
  }
  .stat {
    padding-left: 6px;
    gap: 5px;
  }
  .stat strong {
    font-size: 20px;
  }
}
@media (min-width: 761px) {
  .crew-main:has(#panel-crew[hidden]) {
    width: fit-content;
    min-width: 240px;
  }
  .turn-controls > [data-action="objectives"] {
    display: none;
  }
}
.modal > .bid-footer {
  align-items: stretch;
}
.bid-actions {
  width: 100%;
}
@media (max-width: 760px) {
  .resource-info[data-resource="soul"]:hover::after,
  .resource-info[data-resource="soul"]:focus-visible::after {
    left: auto;
    right: 0;
  }
  .resource-info[data-resource="coin"]:hover::after,
  .resource-info[data-resource="coin"]:focus-visible::after {
    left: -20px;
  }
  .public-stats {
    gap: 12px;
  }
}

/* Shared rails: dialog content, controls and desktop chart instruments. */
.modal {
  --dialog-inset: 28px;
}
.modal-header,
.modal > .footer {
  padding-left: var(--dialog-inset);
  padding-right: calc(var(--dialog-inset) + var(--dialog-gutter, 0px));
}
.modal-body {
  padding-inline: var(--dialog-inset);
}
.modal-header {
  align-items: center;
}
/* The title receives programmatic focus; interactive controls keep their focus ring. */
.modal-header h2:focus {
  outline: none;
}
.modal-header .close {
  align-self: center;
}
.modal label:has(input, select) {
  display: grid;
  gap: 6px;
}
.bid-footer input {
  margin-top: 0;
}
.modal input,
.modal select,
.modal .stack > button,
.modal > .footer button {
  min-height: 44px;
}
.modal .choices {
  align-items: stretch;
}
.choice {
  position: relative;
  padding-right: 30px;
}
.quest-choice > small {
  margin-top: auto;
}
.crew-card {
  grid-template-rows: 1fr auto;
}
.crew-card:hover:not(:disabled) {
  transform: none;
}
.public-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.public-stats dt {
  min-height: 24px;
}
.public-stats dd {
  font-variant-numeric: tabular-nums;
}
@media (min-width: 761px) {
  .game-shell {
    --chart-edge: 24px;
    --side-width: 278px;
    --panel-top: 188px;
  }
  .statusbar {
    left: var(--chart-edge);
    height: 60px;
  }
  .turn-label {
    right: var(--chart-edge);
    gap: 12px;
  }
  .opponent-link,
  .score-chip {
    height: 60px;
  }
  .score-chip {
    min-width: 72px;
    justify-content: center;
  }
  .crewbar {
    left: var(--chart-edge);
    right: var(--chart-edge);
    grid-template-columns: minmax(0, 1fr) var(--side-width);
    gap: 12px;
  }
  .sidebar,
  .leftbar,
  .rightbar,
  .journal {
    top: var(--panel-top);
    width: var(--side-width);
    max-height: calc(
      100% - var(--panel-top) - var(--crewbar-height, 180px) - 40px
    );
  }
  .leftbar,
  .journal {
    left: var(--chart-edge);
  }
  .rightbar {
    right: var(--chart-edge);
  }
  .dock-toolbar {
    align-items: center;
    gap: 8px;
  }
  .chart-tools .panel-toggle,
  .collapse-all {
    height: 40px;
    min-height: 40px;
  }
  .map-controls {
    height: 40px;
  }
  .map-controls button {
    height: 38px;
    min-height: 38px;
  }
  .crew-toggle {
    min-height: 40px;
  }
  .panel-head {
    min-height: 44px;
    padding-block: 4px;
    margin-bottom: 16px;
  }
  .panel-head button {
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .vessel-summary {
    gap: 12px;
    margin-block: 12px;
  }
  .vessel-summary img {
    width: 56px;
    height: 76px;
    flex-shrink: 0;
  }
  .vessel-summary h2 {
    font-size: 20px !important;
  }
  .vessel-summary .eyebrow {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .crew-management .choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .crew-management .crew-card {
    width: 100%;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .game-shell {
    --side-width: 250px;
  }
}
@media (max-width: 760px) {
  .modal {
    --dialog-inset: 16px;
  }
  .public-stats {
    gap: 12px;
  }
  .public-stats dt {
    min-height: 52px;
  }
  .modal .choice {
    padding-right: 30px;
  }
}
@media (min-width: 761px) {
  .crew-main:has(#panel-crew:not([hidden])) {
    width: fit-content;
    max-width: 100%;
  }
  .crew-tabs {
    gap: 16px;
  }
  .crew-tabs .small {
    display: none;
  }
  .modal .choices:has([data-action="defend"]) .choice {
    min-height: 96px;
  }
  .landing {
    --landing-edge: clamp(40px, 5vw, 72px);
    --landing-inner: 1296px;
  }
  .landing .topbar,
  .landing-foot {
    width: calc(100% - 2 * var(--landing-edge));
    max-width: var(--landing-inner);
    margin-inline: auto;
  }
  .hero {
    max-width: calc(var(--landing-inner) + 2 * var(--landing-edge));
    padding-inline: var(--landing-edge);
  }
}
.loot-choices .choice {
  min-height: 120px;
}
.loot-choices .primary small {
  color: inherit;
}
@media (min-width: 761px) and (max-height: 800px) {
  .modal:has([data-action="setup-submit"]) .modal-header {
    padding-block: 16px;
  }
  .modal:has([data-action="setup-submit"]) .modal-body {
    padding-block: 16px;
  }
  .modal:has([data-action="setup-submit"]) .setup-banner {
    padding-bottom: 8px;
    gap: 12px;
  }
  .modal:has([data-action="setup-submit"]) .setup-banner img {
    width: 38px;
    height: 44px;
  }
  .modal:has([data-action="setup-submit"]) h3 {
    font-size: 18px;
    margin-top: 12px !important;
  }
  .modal:has([data-action="setup-submit"]) .choices {
    margin-block: 12px;
  }
  .modal:has([data-action="setup-submit"]) .choice {
    padding: 12px 28px 12px 12px;
    gap: 6px;
  }
  .modal:has([data-action="setup-submit"]) .choice b {
    font-size: 16px;
  }
  .modal:has([data-action="setup-submit"]) .choice small {
    font-size: 11px;
  }
  .modal [data-action="setup-card"] {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-content: center;
    column-gap: 10px;
    min-height: 92px;
  }
  .modal [data-action="setup-card"] .portrait {
    grid-row: span 3;
    width: 32px;
    align-self: center;
  }
  .modal [data-action="setup-card"] > :not(.portrait) {
    grid-column: 2;
  }
  .setup-selection small {
    display: none;
  }
}
/* Reserve the same scrollbar space on both sides, keeping every dialog centered. */
.modal-body {
  scrollbar-gutter: stable both-edges;
}
.modal-header,
.modal > .footer {
  padding-left: calc(var(--dialog-inset) + var(--dialog-gutter, 0px));
}
.sidebar {
  scrollbar-color: #718369 #e4e3d4;
}
.scroll-cue {
  display: none;
  margin-left: auto;
  margin-right: 8px;
  color: #536749;
  font: 16px/1 system-ui;
  cursor: help;
}
.has-overflow .scroll-cue {
  display: inline-flex;
  align-items: center;
}
.opponent-link img,
.opponent-hero > img {
  filter: sepia(0.6) hue-rotate(320deg);
}
.loot-choices .choice b {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  width: 100%;
}
.loot-choices .choice b > span {
  color: inherit;
  font: inherit;
}
.loot-choices .choice b .ui-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.loot-choices .choice > small {
  margin-top: auto;
}
@media (min-width: 761px) {
  .dock-toolbar {
    justify-content: flex-start;
  }
  .map-hint {
    margin-left: 0;
  }
}
@media (min-width: 761px) {
  .navigation-grid button {
    font-size: 11px;
    white-space: nowrap;
  }
  .navigation-grid small {
    white-space: normal;
  }
}
@media (min-width: 761px) and (max-height: 800px) {
  .hero {
    padding-block: 24px;
  }
  .hero h1 {
    font-size: clamp(56px, 5vw, 72px);
    margin-block: 16px;
  }
  .hero .intro {
    margin-bottom: 20px;
  }
  .atlas-art {
    height: 420px;
  }
}
@media (min-width: 761px) and (max-height: 800px) {
  .hero h1 {
    letter-spacing: -0.04em;
  }
  .ship-orbit {
    width: min(48%, 300px);
    transform: translateY(-28px) rotate(-9deg);
  }
  .hero .ship {
    max-height: 300px;
  }
  .ring-outer {
    width: 400px;
    max-width: 90%;
  }
  .ring-inner {
    width: 340px;
    max-width: 78%;
  }
}

/* One desktop column: only the inspection content yields space to turn actions. */
@media (min-width: 761px) {
  .dock-right {
    position: fixed;
    top: 82px;
    bottom: 20px;
    right: var(--chart-edge);
    width: var(--side-width);
    display: grid;
    grid-template-rows: 60px auto minmax(0, auto);
    align-content: start;
    gap: 12px;
  }
  .dock-right:has(#panel-details[hidden]) {
    grid-template-rows: 60px auto;
  }
  .dock-right .turn-label {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(64px, max-content);
    gap: 8px;
    pointer-events: auto;
  }
  .dock-right .opponent-link {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    gap: 8px;
  }
  .dock-right .opponent-link > span {
    min-width: 0;
    flex: 1;
    white-space: nowrap;
  }
  .dock-right .opponent-link img {
    width: 28px;
    flex-shrink: 0;
  }
  .dock-right .opponent-link .ui-icon {
    flex-shrink: 0;
    margin: 0;
  }
  .dock-right .score-chip {
    min-width: 0;
    padding: 8px;
    gap: 4px;
    border-color: #b6b99d;
    background: #f6f2e7;
  }
  .dock-right .rightbar {
    --inspection-inset: max(0px, calc(16px - var(--panel-gutter, 0px)));
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    max-height: none;
    padding: 0 var(--inspection-inset) 12px;
    pointer-events: auto;
    scrollbar-gutter: stable both-edges;
  }
  .rightbar .panel-head {
    margin: 0 calc(-1 * var(--inspection-inset));
    padding-inline: var(--inspection-inset) 0;
  }
  .rightbar .navigation-controls {
    margin: 0 0 12px;
    padding: 0 0 8px;
  }
  .rightbar .navigation-controls summary,
  .rightbar .legend-disclosure summary {
    font-size: 12px;
    line-height: 1.5;
    padding-block: 10px;
  }
  .rightbar .navigation-controls[open] > summary {
    padding-block: 6px;
  }
  .rightbar .legend-disclosure {
    margin-top: 12px;
    padding-top: 0;
  }
  .dock-right .turn-controls {
    padding: 16px;
    gap: 12px;
  }
  .dock-right .event-feed {
    display: grid;
    gap: 8px;
    padding: 0;
    border: 0;
  }
  .dock-right .event-feed > strong,
  .dock-right .event-summary span {
    margin: 0;
  }
  .dock-right .event-summary span {
    -webkit-line-clamp: 1;
  }
  .dock-right .turn-actions {
    display: grid;
    gap: 8px;
  }
  .dock-right .turn-actions button {
    min-height: 44px;
    padding: 10px 12px;
  }
  .dock-right .turn-controls > p {
    display: none;
  }
}
.inspection-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.inspection-content > *,
.inspection-content .action-list {
  margin: 0;
}
.inspection-content > h2 {
  margin: 0 !important;
}
.inspection-content > .eyebrow + h2 {
  margin-top: -8px !important;
}
.inspection-content .vessel-summary {
  margin: 0;
  gap: 12px;
}
.inspection-content .vessel-summary h2 {
  margin-block: 4px 0;
  line-height: 1.2;
}
.inspection-content .vessel-summary img {
  width: 44px;
  height: 56px;
}
.inspection-content .sea-chip {
  margin: 0;
  justify-self: start;
}
.sea-rules summary {
  cursor: pointer;
  color: #52614f;
  font-size: 12px;
  padding-block: 6px;
}
.sea-rules p {
  margin-top: 4px;
}
@media (max-width: 760px) {
  /* The mobile inspection drawer remains above the bottom action dock. */
  .dock-right .rightbar {
    position: fixed;
    pointer-events: auto;
  }
}
