/* Founders tabletop layer. Original material and artwork; rules remain in engine. */
body[data-ak-ui] {
  --ak-surface-canvas: #211f1c;
  --ak-surface-panel: #e5ddcb;
  --ak-surface-muted: #d4cbb7;
  --ak-surface-raised: #3c3731;
  --ak-surface-inverse: #211f1c;
  --ak-text-primary: #ece4d4;
  --ak-text-secondary: #b9ae9b;
  --ak-text-inverse: #26231f;
  --ak-signal-info: #ddbc75;
  --ak-signal-action: #d8b45f;
  --ak-focus-color: #efcb72;
  --paper: #e5ddcb;
  --ink: #302a22;
  --steel: #302d28;
  --rust: #a6402b;
  background: #211f1c;
  color: #ece4d4;
}
body.in-game {
  background: #24221f;
}
[data-ak-ui] button:focus-visible,
[data-ak-ui] input:focus-visible,
[data-ak-ui] select:focus-visible {
  outline: 3px solid #f2ca72;
  outline-offset: 3px;
}
[data-ak-ui] .eyebrow {
  color: #cfb374;
  letter-spacing: 0.08em;
}
[data-ak-ui] .topbar {
  border-bottom: 1px solid #5c5140;
  background: #211f1c;
}
.topbar .brand-mark {
  border-color: #d5c7aa;
}
.topbar .brand-mark:after {
  background: #a6402b;
}
.topbar .brand small {
  color: #b8a991;
}
[data-ak-ui] button.ak-button {
  border-color: #8a7a61;
  color: inherit;
}
[data-ak-ui] button.primary {
  color: #272217;
  background: #d8b45f;
  border-color: #e4c77f;
  box-shadow: inset 0 -3px #8b6f39;
}
[data-ak-ui] button.primary:hover:not(:disabled) {
  background: #ebcb7e;
}
[data-ak-ui] button.primary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}
[data-ak-ui] input,
[data-ak-ui] select {
  color: #302a22;
  background: #eee6d5;
  border-color: #a99b81;
}
[data-ak-ui] .topbar {
  min-height: 52px;
  height: 52px;
  padding: 4px 20px;
}
.in-game .topbar {
  min-height: 48px;
  height: 48px;
}
.in-game .brand-mark {
  width: 22px;
  height: 22px;
  border-width: 2px;
}
.in-game .brand b {
  font-size: 15px;
}
.in-game .brand small {
  display: none;
}
.in-game .top-meta {
  gap: 7px;
}
.in-game .top-meta button {
  padding: 4px 12px;
  min-height: 36px;
}
.game-hud {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  background: #37322b;
  border-bottom: 1px solid #665941;
  font-variant-numeric: tabular-nums;
}
.hud-player {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 13px;
}
.hud-player i {
  width: 9px;
  height: 9px;
  background: var(--player-color);
  box-shadow: 0 0 0 2px #ddd0b54a;
}
.hud-player b {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-player span {
  font-size: 10px;
  color: #baa98f;
}
.hud-resources {
  display: flex;
  gap: 19px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.game-hud .resource {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: none;
  min-width: 0;
  font-size: 10px;
  color: #c5b9a3;
}
.game-hud .resource strong {
  font-size: 19px;
  line-height: 1;
  color: #f5ebd6;
  font-weight: 700;
  order: 0;
}
.game-hud .resource svg {
  width: 16px;
  height: 19px;
  flex-shrink: 0;
  stroke: #e5d5ae;
  fill: none;
}
.hud-score {
  white-space: nowrap;
  font-size: 11px;
  color: #d1c1a4;
}
.hud-score > b {
  font-size: 21px;
  color: #efcc77;
}
.hud-score span {
  border-left: 1px solid #78674d;
  margin-left: 12px;
  padding-left: 12px;
}
.playfield {
  background: #292620;
}
.phasebar {
  border-color: #635740;
}
.phase-title {
  color: #f1e6cd;
}
.phase-title span,
.round small,
.map-legend {
  color: #b7a88b;
}
.map-toolbar {
  color: #c8bda6;
}
.map-toolbar button {
  color: #ddd0b8;
}
.map-viewport {
  background-color: #b2a183;
  background-image:
    linear-gradient(#c7b59436, #9a896334), url("/assets/wasteland-board-v2.png");
  background-size: cover;
  background-position: center;
  border: 1px solid #7a6748;
  box-shadow: inset 0 0 40px #30271846;
}
.map-svg .route-line {
  stroke: #f3e6c7;
  stroke-width: 4px;
  filter: drop-shadow(0 1px 1px #392a1d);
}
.map-svg .node .main {
  fill: #e9debf;
  stroke: #65543b;
  stroke-width: 1.5;
}
.map-svg .node .node-id {
  fill: #30291f;
}
.map-svg .event-label {
  fill: #54442e;
}
.map-svg .route-label {
  fill: #342c20;
}
.map-svg .node.legal .main,
.map-svg .node.selected .main {
  stroke: #ffcf59;
  stroke-width: 4px;
  fill: #fff0c8;
}
.map-svg .route-select.legal > rect:nth-of-type(2) {
  stroke: #d78c27;
  stroke-width: 4px;
}
.map-svg .route-select:focus-visible,
.map-svg .node:focus-visible {
  outline: 3px solid #9c351f;
  outline-offset: 5px;
}
.command-panel {
  background: #34302a;
  border-left: 1px solid #5d513f;
  color: #e8ddc7;
}
.command-panel .connection {
  font-size: 10px;
  color: #b8b49b;
  border-bottom: 1px solid #5d513f;
  padding-bottom: 9px;
  display: block;
}
.command-panel .connection:before {
  background: #9eac76;
}
.command-panel .section-heading {
  margin: 14px 0 10px;
}
.command-panel .section-heading h3 {
  color: #cdbb97;
  font-size: 12px;
  letter-spacing: 0.15em;
}
.action-button {
  color: #e8ddc7;
  background: #413a30;
  border-color: #655844;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14px;
}
.action-button:hover,
.action-button[aria-pressed="true"] {
  color: #ffe7a0;
  background: #55462d;
  border-color: #c8a553;
}
.action-button span {
  color: #d4ad5d;
}
.action-form {
  background: #27241f;
  border-color: #685941;
  padding: 12px;
}
.action-form p,
.prompt > p {
  font-size: 12px;
  color: #c1b49d;
}
.action-form label {
  font-size: 12px;
}
.command-panel .choice {
  color: #e8ddc7;
  background: #443b2e;
  border-color: #7a6748;
  padding: 10px;
}
.command-panel .choice small {
  color: #c5b89f;
}
.command-panel .choice:hover {
  border-color: #e5bf6a;
  background: #51452f;
}
.prompt {
  border: 0;
  background: none;
  padding: 0;
}
.prompt > h3 {
  font-size: 17px;
  color: #f2e5c9;
  margin: 7px 0 10px;
}
.prompt .eyebrow {
  color: #d8b45f;
}
.other-player {
  color: #d2c4ab;
  border-color: #61533d;
  font-size: 12px;
}
.other-player:hover {
  background: #463d2e;
}
.other-player.active {
  background: #413a2d;
}
.other-players {
  margin-top: 22px;
  border-color: #6b5b40;
}
.select-card-hint {
  padding: 20px 10px;
  text-align: center;
  border: 1px dashed #9b8255;
  color: #f1ce7e;
  font-size: 13px;
  margin: 18px 0;
}
.select-card-hint small {
  font-size: 11px;
  color: #b8a789;
}
.selection-preview {
  border-top: 3px solid #d8b45f;
  background: #e5ddcb;
  color: #302a22;
  padding: 13px;
  margin: 14px 0;
}
.selection-preview .selection-label {
  font-size: 10px;
  font-weight: 700;
  color: #6e5628;
  margin-bottom: 6px;
}
.selection-preview h3 {
  color: #302a22;
  font-size: 20px;
}
.selection-preview p {
  font-size: 12px;
  margin: 8px 0;
  color: #534631;
}
.selection-preview .selected-payment {
  font-weight: 700;
  border-bottom: 1px solid #b5a685;
  padding-bottom: 8px;
}
.selection-preview .full-card-effect {
  white-space: pre-line;
  line-height: 1.8;
  font-size: 13px;
}
.selection-preview button {
  width: 100%;
  margin-top: 8px;
  font-size: 13px;
}
.command-panel .footnote {
  font-size: 11px;
  color: #a99a80;
}
.library {
  background: #2b2823;
  border-color: #66583e;
  color: #e5d8be;
}
.library-tabs {
  border-color: #6d5d41;
  gap: 26px;
}
.library-tabs button {
  color: #b6a88c;
}
.library-tabs button[aria-selected="true"] {
  color: #f1d18d;
  border-color: #c9a35b;
}
.library-content {
  background: #2b2823;
  color: #e5d8be;
}
.board-subtitle {
  color: #b7a98d;
  font-size: 11px;
  margin: 0 0 5px;
}
.card-zone-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  min-height: 24px;
}
.card-zone-heading span {
  font-size: 10px;
  color: #c2ad84;
}
.card-row {
  gap: 12px;
  padding: 12px 6px 18px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #8e7853 #2b2823;
}
[data-ak-ui] .game-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 146px;
  width: 146px;
  height: 210px;
  min-height: 210px;
  position: relative;
  padding: 5px 5px 4px 11px;
  border: 1px solid #968269;
  border-left: 7px solid var(--card-color);
  border-top: 1px solid #968269;
  border-radius: 4px;
  color: #302a22;
  text-align: left;
  background: #d9cdb4;
  box-shadow:
    2px 4px 0 #171512,
    inset 0 0 0 1px #f3e6ce;
  overflow: hidden;
  isolation: isolate;
  transform-origin: 50% 100%;
}
.game-card .card-category {
  display: block;
  font-size: 8px;
  line-height: 13px;
  color: #76664c;
  letter-spacing: 0.02em;
}
.game-card .card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 27px;
  gap: 3px;
  border-bottom: 1px solid #9c8c6a;
}
.game-card .card-title b {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.game-card .card-title i {
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  min-width: 21px;
  line-height: 23px;
  height: 23px;
  text-align: center;
  background: #3e382d;
  color: #f5e3b7;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.card-art {
  height: 65px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 4px;
  background-color: #75654c;
  background-image: url("/assets/facility-industry-v2.png");
  background-size: cover;
  background-position: var(--art-position, 50%) center;
  border-bottom: 2px solid var(--card-color);
  overflow: hidden;
}
.art-note {
  position: absolute;
  right: 3px;
  bottom: 2px;
  color: #fff3cf;
  background: #252018b8;
  font-size: 6px;
  line-height: 10px;
  padding: 0 3px;
}
.role-art {
  background-image:
    linear-gradient(#29261edb, #514732d6), url("/assets/nomad-city-v2.png");
}
.role-emblem {
  font:
    38px Georgia,
    serif;
  color: #e5d0a1;
  text-shadow: 0 2px #171410;
}
.pattern-art {
  background-image: none;
  background-color: #c5b797;
}
.mini-pattern {
  display: grid;
  grid-template-columns: repeat(3, 15px);
  grid-auto-rows: 15px;
  gap: 3px;
}
.mini-pattern i {
  border: 1px solid #564b3659;
}
.card-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 25px;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #afa080;
  font-size: 8px;
  line-height: 1.2;
}
.card-cost > span {
  display: flex;
  align-items: center;
  gap: 1px;
  color: #615137;
}
.card-cost svg {
  height: 12px;
  width: 11px;
  fill: none;
  stroke: #493c28;
  stroke-width: 1.5;
}
.card-cost .money-cost {
  margin-left: auto;
  font-size: 8px;
}
.card-effect {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.55;
  padding: 5px 0 2px;
  flex: 1;
  color: #3d3528;
  white-space: pre-line;
}
.card-footer {
  font-size: 7px;
  color: #7b694b;
  border-top: 1px solid #af9d79;
  line-height: 12px;
}
[data-ak-ui] .game-card[aria-pressed="true"] {
  transform: translateY(-8px);
  border-color: #ffe3a1;
  box-shadow:
    0 0 0 2px #e6bd65,
    0 7px 14px #0008;
}
.game-card[aria-pressed="true"]:after {
  content: "✓ 已选";
  position: absolute;
  top: 43px;
  right: 3px;
  padding: 1px 5px;
  background: #d7b35e;
  color: #302514;
  font-size: 9px;
  font-weight: 800;
}
.card-radio {
  display: block;
  flex: 0 0 146px;
  margin: 0 !important;
  cursor: pointer;
  position: relative;
}
.card-radio input {
  position: absolute;
  left: 10px;
  top: 6px;
  width: 16px;
  min-height: 16px;
  z-index: 2;
  opacity: 0;
}
.card-radio:has(input:checked) .game-card {
  outline: 3px solid #d9b25d;
  transform: translateY(-6px);
}
.card-radio:has(input:focus-visible) .game-card {
  outline: 3px solid #f9d17b;
  outline-offset: 3px;
}
.radio-caption {
  display: block;
  font-size: 10px;
  margin-top: 7px;
}
.card-field {
  border: 0;
  padding: 0;
  min-width: 0;
}
/* The cool laboratory grammar belongs only to city inspection, not the whole board. */
.library[data-terra-faction="rhine-lab"] {
  background: #dce0d7;
  color: #30392f;
  border-top: 2px solid #7e9560;
}
.library[data-terra-faction="rhine-lab"] .library-content {
  background: #e3e7de;
  color: #30392f;
}
.library[data-terra-faction="rhine-lab"] .library-tabs button {
  color: #616b58;
}
.library[data-terra-faction="rhine-lab"]
  .library-tabs
  button[aria-selected="true"] {
  color: #30422a;
  border-color: #8da85d;
}
.library.has-card-choices {
  background: #2b2823;
  color: #e5d8be;
  border-color: #66583e;
}
.library.has-card-choices .library-content {
  background: #2b2823;
  color: #e5d8be;
}
.library.has-card-choices .library-tabs button {
  color: #b6a88c;
}
.library.has-card-choices .library-tabs button[aria-selected="true"] {
  color: #f1d18d;
  border-color: #c9a35b;
}
[data-ak-ui] #detail {
  color: #302a22;
  background: #e5ddcb;
  border-color: #978264;
  max-height: 85dvh;
  overflow: auto;
}
#detail .eyebrow {
  color: #776033;
}
#detail p {
  white-space: pre-line;
}
#detail small {
  color: #74644b;
}
#detail .detail-cost {
  background: #d1c4a8;
  color: #4e412d;
  border-color: #aa956c;
}
.landing .intro {
  background: linear-gradient(90deg, #211f1cfa, #211f1cd9);
}
.landing {
  background: #29241d;
}
.landing .preview {
  background: #57432f url("/assets/nomad-city-v2.png") center/cover;
}
.landing .preview .map-svg {
  opacity: 0.15;
}
.landing .preview-caption {
  background: linear-gradient(transparent, #21170bdc);
  color: #f3e0ba;
}
.landing .entry {
  background: #3b3327;
  border-color: #716046;
}
.landing .intro p {
  color: #c6b89d;
}
.landing .footnote {
  color: #b3a489;
}
.lobby {
  color: #e5d8be;
}
.lobby .seat {
  background: #39332a;
  border-color: #716047;
}
.lobby .seat.empty {
  background: #2c2821;
}
.lobby .lobby-command,
.lobby .help-bar {
  background: #3b3428;
  border-color: #766343;
  color: #d8c9ab;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .game-card {
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      border-color 180ms ease;
  }
  [data-ak-ui] .game-card:hover {
    transform: translateY(-6px);
    border-color: #dabc7f;
    box-shadow: 0 7px 14px #0008;
  }
  [data-ak-ui] .game-card[aria-pressed="true"]:hover {
    transform: translateY(-10px);
  }
}
@media (min-width: 761px) {
  .workspace {
    height: calc(100dvh - 92px);
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-rows: minmax(0, 1fr) 280px;
    max-width: none;
  }
  .playfield {
    padding: 10px 16px 0;
  }
  .phasebar {
    padding-bottom: 7px;
  }
  .phasebar .eyebrow {
    font-size: 9px;
  }
  .phase-title {
    font-size: 18px;
  }
  .phase-title span {
    display: inline;
    margin-left: 10px;
    font-size: 10px;
  }
  .round {
    font-size: 24px;
  }
  .map-toolbar {
    min-height: 28px;
    margin: 0;
    font-size: 10px;
  }
  .map-toolbar button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 15px;
  }
  .map-viewport {
    flex: 1;
    min-height: 0;
    max-height: none;
    height: auto;
  }
  .command-panel {
    padding: 14px;
    grid-row: 1/-1;
  }
  .command-panel .actions {
    gap: 7px;
  }
  .command-panel .choice-list {
    max-height: none;
  }
  .library {
    grid-column: 1;
    grid-row: 2;
    padding: 0 16px;
    overflow: hidden;
  }
  .library-tabs {
    height: 36px;
    gap: 25px;
  }
  .library-tabs button {
    min-height: 36px;
    font-size: 11px;
    padding: 5px 1px;
  }
  .library-content,
  .workspace[data-library-open="true"] .library-content {
    display: block;
    position: static;
    height: 244px;
    max-height: none;
    overflow: auto;
    background: #2b2823;
    border: 0;
    padding: 3px 0;
    box-shadow: none;
  }
  .library.has-card-choices .library-content {
    padding-top: 3px;
  }
  .library.has-card-choices .card-row {
    padding-top: 10px;
  }
  .has-card-choices .game-card {
    height: 190px;
    min-height: 190px;
    flex-basis: 136px;
    width: 136px;
  }
  .has-card-choices .card-art {
    height: 55px;
  }
  .library .city-bench {
    min-width: 0;
  }
  .library .city-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .library .city-cell {
    min-height: 64px;
  }
  .library .review-dock p {
    max-height: 110px;
    overflow: auto;
  }
  .landing,
  .lobby {
    max-height: calc(100dvh - 52px);
  }
}
@media (min-width: 761px) and (max-height: 760px) {
  .workspace {
    grid-template-rows: minmax(0, 1fr) 248px;
  }
  .library-content,
  .workspace[data-library-open="true"] .library-content {
    height: 212px;
  }
  .game-card .card-art {
    height: 50px;
  }
  [data-ak-ui] .game-card {
    height: 184px;
    min-height: 184px;
    flex-basis: 136px;
    width: 136px;
  }
  .has-card-choices .game-card {
    height: 171px;
    min-height: 171px;
  }
  .card-zone-heading {
    min-height: 21px;
  }
  .card-zone-heading span {
    font-size: 9px;
  }
  .map-legend {
    padding: 3px 0;
    font-size: 9px;
  }
  .phase-title {
    font-size: 16px;
  }
  .phase-title span {
    display: none;
  }
}
@media (max-width: 760px) {
  html,
  body[data-ak-ui] {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }
  .in-game .topbar {
    padding: 0 max(10px, env(safe-area-inset-right)) 0
      max(10px, env(safe-area-inset-left));
    height: 44px;
    min-height: 44px;
  }
  .in-game .brand b {
    font-size: 12px;
  }
  .in-game .brand {
    gap: 8px;
  }
  .in-game .brand-mark {
    width: 16px;
    height: 16px;
  }
  .in-game .brand-mark:after {
    inset: 3px;
  }
  .in-game .top-meta {
    gap: 3px;
  }
  .in-game .top-meta .room-id-label {
    display: none;
  }
  .in-game .top-meta button {
    min-height: 40px;
    padding: 3px 7px;
    font-size: 11px;
  }
  .game-hud {
    height: auto;
    min-height: 64px;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 3px 10px;
  }
  .hud-player {
    font-size: 11px;
    flex: 1;
  }
  .hud-player span {
    font-size: 9px;
  }
  .hud-player b {
    max-width: 100px;
  }
  .hud-score {
    font-size: 10px;
  }
  .hud-score > b {
    font-size: 17px;
  }
  .hud-score span {
    margin-left: 5px;
    padding-left: 5px;
  }
  .hud-resources {
    flex: 0 0 100%;
    order: 3;
    justify-content: space-between;
    gap: 6px;
  }
  .game-hud .resource {
    gap: 3px;
    font-size: 8px;
  }
  .game-hud .resource strong {
    font-size: 16px;
  }
  .game-hud .resource svg {
    width: 13px;
    height: 14px;
  }
  .mobile-tabs {
    position: static;
    order: 0;
    background: #2b2822;
    border-color: #665638;
    padding: 0 12px;
    gap: 0;
    margin: 0;
  }
  .mobile-tabs button {
    font-size: 12px;
    min-height: 40px;
    color: #bdb096;
  }
  .mobile-tabs button[aria-selected="true"] {
    color: #f1d18d;
    border-color: #cba75c;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .playfield {
    padding: 10px 10px 0;
  }
  .phasebar {
    padding-bottom: 6px;
  }
  .phasebar .eyebrow {
    font-size: 9px;
  }
  .phase-title {
    font-size: 15px;
  }
  .phase-title span {
    font-size: 9px;
  }
  .round {
    font-size: 22px;
  }
  .map-viewport {
    height: clamp(245px, 40dvh, 380px);
    min-height: 245px;
  }
  .map-toolbar {
    margin: 2px 0;
    font-size: 9px;
  }
  .map-toolbar button {
    min-height: 36px;
  }
  .map-legend {
    font-size: 8px;
    gap: 8px;
    padding: 5px 0;
    flex-wrap: wrap;
  }
  .playfield > .help-bar {
    display: none;
  }
  .command-panel {
    padding: 12px;
    border: 0;
    min-height: 0;
  }
  .workspace[data-mobile-tab="map"] .command-panel {
    display: none;
  }
  .workspace[data-mobile-tab="map"] .library {
    display: block;
  }
  .workspace[data-mobile-tab="commands"] .command-panel {
    display: block;
    min-height: 0;
  }
  .workspace[data-mobile-tab="commands"] .library.has-card-choices {
    display: block;
    order: 2;
  }
  .workspace[data-mobile-tab="city"] .command-panel {
    display: block;
    order: 0;
  }
  .workspace[data-mobile-tab="city"] .library {
    order: 1;
  }
  .library {
    padding: 0 10px 10px;
    min-width: 0;
    width: 100%;
  }
  .library-tabs {
    height: 40px;
    gap: 0;
    justify-content: space-between;
    overflow: auto;
  }
  .library-tabs button {
    font-size: 10px;
    min-height: 40px;
    padding: 5px 3px;
    white-space: nowrap;
  }
  .library-content {
    position: static;
    display: block;
    padding: 4px 0;
    background: #2b2823;
    max-height: none;
    overflow: visible;
  }
  .card-row {
    width: 100%;
    max-width: 100%;
    padding: 12px 4px 16px;
    gap: 10px;
  }
  [data-ak-ui] .game-card {
    flex-basis: 145px;
    width: 145px;
    height: 211px;
    min-height: 211px;
  }
  .card-zone-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .card-zone-heading strong {
    font-size: 12px;
  }
  .card-zone-heading span {
    font-size: 9px;
  }
  .game-card .card-title b {
    font-size: 14px;
  }
  .game-card .card-effect {
    font-size: 10px;
  }
  .select-card-hint {
    margin: 10px 0;
    padding: 10px;
  }
  .selection-preview {
    margin: 10px 0;
  }
  .selection-preview .full-card-effect {
    font-size: 14px;
  }
  .selection-preview button {
    min-height: 44px;
  }
  .library .city-bench {
    grid-template-columns: minmax(0, 1fr);
  }
  .library .city-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .specimen-stage {
    padding: 8px;
  }
  .city-cell {
    min-width: 0;
    padding: 7px;
  }
  .city-cell b {
    font-size: 11px;
  }
  .landing .preview {
    min-height: 300px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.preview-illustration {
  margin: 10px -3px 6px;
  height: 90px;
  background: #7a694d url("/assets/facility-industry-v2.png") center 47% / cover;
  border-bottom: 3px solid #9b452d;
}
.preview-illustration.role-preview {
  background-image:
    linear-gradient(#29261edb, #514732d6), url("/assets/nomad-city-v2.png");
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-preview > span {
  font:
    52px Georgia,
    serif;
  color: #ead6a8;
}
.choice-cards .card-footer {
  color: #4c3b1d;
  font-size: 9px;
  font-weight: 700;
  line-height: 15px;
}
.map-svg .node rect.main {
  fill: #e9debf;
  stroke: #65543b;
  stroke-width: 1.5;
}
.map-svg .node.legal rect.main,
.map-svg .node.selected rect.main {
  stroke: #efba47;
  stroke-width: 4px;
  fill: #fff0c8;
}
[data-ak-ui] .map-svg {
  background: transparent;
}
[data-ak-ui] .library .game-card {
  background: #d9cdb4;
  border-left: 7px solid var(--card-color);
  border-right: 1px solid #968269;
  border-bottom: 1px solid #968269;
}
/* Wide board reflow and short-screen card clearance. */
.in-game .top-meta button.ak-button {
  width: auto;
  min-width: 64px;
  max-width: 80px;
  flex: 0 0 auto;
  padding: 4px 10px;
}
@media (min-width: 761px) {
  [data-ak-ui] .map-svg.wide-map .node-id {
    font-size: 19px;
  }
  [data-ak-ui] .map-svg.wide-map .event-label {
    font-size: 12px;
  }
  [data-ak-ui] .map-svg.wide-map .route-label {
    font-size: 11px;
  }
  .map-svg.wide-map .node rect.main {
    stroke-width: 1.5;
  }
  .map-svg.wide-map .node.legal rect.main,
  .map-svg.wide-map .node.selected rect.main {
    stroke-width: 3px;
  }
}
@media (min-width: 761px) and (max-height: 760px) {
  .library .card-row {
    padding-top: 8px;
    padding-bottom: 9px;
  }
  .library.has-card-choices .card-row {
    padding-top: 9px;
    padding-bottom: 8px;
  }
  [data-ak-ui] .library .game-card {
    height: 166px;
    min-height: 166px;
  }
  [data-ak-ui] .library.has-card-choices .game-card {
    height: 158px;
    min-height: 158px;
  }
  .library .game-card .card-art {
    height: 39px;
  }
  .library .game-card .card-category {
    line-height: 11px;
  }
  .library .game-card .card-title {
    min-height: 24px;
  }
  .library .game-card .card-cost {
    min-height: 22px;
  }
  .library .board-subtitle {
    font-size: 10px;
    line-height: 14px;
    margin-bottom: 2px;
  }
  .library-content,
  .workspace[data-library-open="true"] .library-content {
    overflow-y: auto;
    padding-bottom: 4px;
  }
}
@media (max-width: 760px) {
  .in-game .top-meta button.ak-button {
    min-width: 40px;
    max-width: none;
    padding: 3px 7px;
  }
}
#card-preview-title:focus-visible {
  outline: 2px solid #7c5d23;
  outline-offset: 4px;
}
.role-art img,
.role-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 20%;
  display: block;
}
.role-art,
.role-preview {
  position: relative;
}
.role-category-emblem {
  position: absolute;
  bottom: 3px;
  right: 4px;
  width: 20px;
  height: 20px;
  text-align: center;
  font:
    17px/20px Georgia,
    serif;
  color: #f1dcac;
  background: #28231dcf;
}
/* Official role art, supplied with individual source records. */
.role-art img {
  object-fit: cover;
  object-position: center top;
  transform: scale(1.8);
  transform-origin: 50% 0;
}
.role-preview img {
  object-fit: cover;
  object-position: center top;
  transform: scale(1.45);
  transform-origin: 50% 0;
}
.preview-illustration.role-preview {
  overflow: hidden;
  height: 100px;
}
.role-preview .role-category-emblem {
  font:
    17px/20px Georgia,
    serif;
  z-index: 1;
}
[data-ak-ui] .game-card.role-card .card-art {
  height: 93px;
}
.role-card .card-effect {
  -webkit-line-clamp: 2;
}
.role-dossier-art {
  position: relative;
  height: 230px;
  overflow: hidden;
  background:
    linear-gradient(#29261edb, #514732d6),
    url("/assets/nomad-city-v2.png") center/cover;
  margin: 14px 0;
}
.role-dossier-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (min-width: 761px) and (max-height: 760px) {
  [data-ak-ui] .library .game-card.role-card .card-art {
    height: 64px;
  }
  .library .game-card.role-card .card-cost {
    min-height: 17px;
    padding: 2px 0;
  }
  .library .game-card.role-card .card-effect {
    -webkit-line-clamp: 1;
    padding-top: 2px;
  }
}
/* Read both skills directly in hand. Never shrink or clamp rules to save space. */
[data-ak-ui] .library .game-card.role-card {
  flex: 0 0 190px;
  width: 190px;
  height: auto;
  min-height: 320px;
  padding: 7px 8px 6px 10px;
  overflow: visible;
}
[data-ak-ui] .library .game-card.role-card .card-category {
  font-size: 10px;
  line-height: 15px;
}
[data-ak-ui] .library .game-card.role-card .card-title {
  min-height: 29px;
}
[data-ak-ui] .library .game-card.role-card .card-title b {
  font-size: 16px;
}
[data-ak-ui] .library .game-card.role-card .card-art {
  height: 70px;
}
[data-ak-ui] .library .game-card.role-card .card-cost {
  min-height: 18px;
  padding: 3px 0;
}
.role-card .role-skills {
  display: grid;
  gap: 8px;
  padding: 7px 0;
  flex: none;
}
.role-skill {
  display: block;
  border-bottom: 1px solid #b3a386;
  padding-bottom: 7px;
}
.role-skill:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.skill-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.skill-heading strong {
  font-size: 12px;
  line-height: 1.45;
  color: #322a1e;
}
.skill-type {
  display: inline-block;
  padding: 1px 5px;
  background: #d6b05b;
  color: #362912;
  font-size: 10px;
  line-height: 16px;
  font-weight: 800;
}
.scheme-skill .skill-type {
  background: #9d4934;
  color: #fff3d9;
}
.role-skill .skill-copy {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: #30281d;
  white-space: normal;
  overflow: visible;
}
[data-ak-ui] .library .game-card.role-card .card-footer {
  margin-top: auto;
  font-size: 10px;
  line-height: 16px;
}
.role-zone .card-row {
  align-items: stretch;
  height: auto;
  max-height: none;
  padding-top: 12px;
  padding-bottom: 18px;
}
@media (min-width: 761px) {
  /* A short screen may scroll the page; the map and full-size rule text retain room. */
  html:has(body.in-game .role-zone) {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.in-game:has(.role-zone) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .workspace:has(.role-zone) {
    height: auto;
    min-height: calc(100dvh - 92px);
    grid-template-rows: minmax(370px, 1fr) auto;
    overflow: visible;
  }
  .workspace:has(.role-zone) .command-panel {
    max-height: calc(100dvh - 92px);
    position: sticky;
    top: 0;
    align-self: start;
  }
  .library.role-zone {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .library.role-zone .library-content,
  .workspace[data-library-open="true"] .library.role-zone .library-content {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 6px 0;
  }
  .library.role-zone .board-subtitle {
    font-size: 11px;
    line-height: 17px;
  }
  .library.role-zone .card-zone-heading {
    min-height: 25px;
  }
  .library.role-zone .card-zone-heading span {
    font-size: 10px;
  }
}
@media (max-width: 760px) {
  [data-ak-ui] .library .game-card.role-card {
    flex-basis: 240px;
    width: 240px;
    min-height: 340px;
    padding: 8px 10px;
  }
  [data-ak-ui] .library .game-card.role-card .card-art {
    height: 100px;
  }
  .role-card .role-skills {
    gap: 9px;
    padding: 9px 0;
  }
  .role-skill .skill-copy {
    font-size: 13px;
    line-height: 1.5;
  }
  .skill-heading strong {
    font-size: 13px;
  }
  .skill-type {
    font-size: 11px;
    line-height: 17px;
  }
  .role-zone .card-row {
    padding-bottom: 20px;
  }
}

/* Decision controls remain immediately available after selecting a card. */
.command-panel .prompt {
  animation: none;
}

[data-ak-ui] .library .covered-role-card {
  border-color: #e7be58;
  box-shadow: 0 0 0 2px #d6ad51;
}
.covered-role-card .card-footer {
  background: #d6b05b;
  color: #302411;
  padding: 3px;
  font-weight: 800;
}
/* Per-name facility illustrations. Transparent isometric assets stay fully visible. */
.card-art.facility-art,
.preview-illustration.facility-preview,
.facility-dossier-art,
.facility-review-art {
  background-color: #e3d8bf;
  background-image: linear-gradient(150deg, #eee5d1, #d3c3a2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.facility-icon {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  padding: 3px;
}
.card-art.facility-art .facility-icon {
  flex: none;
}
.preview-illustration.facility-preview {
  height: 112px;
  border-color: #a18a5e;
}
.facility-dossier-art {
  height: 210px;
  margin: 14px 0;
  border: 1px solid #b8a786;
}
.facility-review-art {
  height: 105px;
  margin: 8px 0;
  border: 1px solid #b4bda7;
}
.city-cell .city-facility-icon {
  display: block;
  width: 100%;
  height: 42px;
  object-fit: contain;
  object-position: center;
  padding: 2px;
  margin: 4px 0;
}
.public-city .public-facility-icon {
  display: block;
  width: 100%;
  height: 45px;
  object-fit: contain;
  object-position: center;
  margin: 5px 0;
}
.preview-illustration.pattern-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d5c9ad;
  height: 108px;
}
.pattern-preview .mini-pattern {
  grid-template-columns: repeat(3, 24px);
  grid-auto-rows: 24px;
  gap: 4px;
}
.city-cell,
.public-city button {
  height: auto;
}
@media (max-width: 760px) {
  .city-cell .city-facility-icon {
    height: 40px;
  }
  .facility-dossier-art {
    height: 180px;
  }
}
[data-ak-ui] .library .game-card.facility-card {
  height: auto;
  min-height: 190px;
  overflow: visible;
}
.game-card.facility-card .card-effect {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  font-size: 11px;
  line-height: 1.5;
  flex: none;
}
.game-card.facility-card .card-footer {
  margin-top: auto;
}

[data-ak-ui] .library .game-card.facility-card .card-art {
  height: 82px;
  flex: none;
}
[data-ak-ui] .library .game-card.facility-card {
  min-height: 230px;
}

/* Facility illustrations and complete rules keep their space on short screens. */
@media (min-width: 761px) {
  html:has(body.in-game .library[data-terra-faction="rhine-lab"]) {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.in-game:has(.library[data-terra-faction="rhine-lab"]) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .workspace:has(.library[data-terra-faction="rhine-lab"]) {
    height: auto;
    min-height: calc(100dvh - 92px);
    grid-template-rows: minmax(370px, 1fr) auto;
    overflow: visible;
  }
  .workspace:has(.library[data-terra-faction="rhine-lab"]) .command-panel {
    max-height: calc(100dvh - 92px);
    position: sticky;
    top: 0;
    align-self: start;
  }
  .library[data-terra-faction="rhine-lab"] {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .library[data-terra-faction="rhine-lab"] .library-content {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 6px 0;
  }
}

.library[data-terra-faction="rhine-lab"] {
  --ak-text-primary: #28372c;
  --ak-text-secondary: #606b5c;
  --ak-signal-info: #49623b;
}
.library[data-terra-faction="rhine-lab"] .review-dock {
  background: #e3e7de;
  color: #28372c;
}
.library[data-terra-faction="rhine-lab"] .review-dock h3,
.library[data-terra-faction="rhine-lab"] .sample-state strong {
  color: #28372c;
}
.library[data-terra-faction="rhine-lab"] .review-dock p,
.library[data-terra-faction="rhine-lab"] .review-dock small {
  color: #606b5c;
}
.library[data-terra-faction="rhine-lab"] .eyebrow {
  color: #49623b;
}

/* Expansion sheets share the same brass, paper and industrial rhythm. */
.mode-picker {
  margin: 16px 0;
  display: grid;
  gap: 8px;
}
.mode-picker select {
  width: 100%;
}
.expert-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}
.expert-option input {
  width: 18px;
  height: 18px;
  accent-color: #b89645;
}
.mode-note {
  font-size: 12px !important;
  line-height: 1.65 !important;
  margin: 0 !important;
  color: #bdb69f;
}
.expansion-workbench {
  padding: 0 4px 20px;
}
.company-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(205px, 1fr));
  gap: 14px;
  min-width: 0;
}
.company-board {
  background: #dfd5bd;
  color: #302e25;
  border: 1px solid #9d9377;
  min-width: 0;
}
.company-board header {
  position: relative;
  padding: 14px 16px;
  background: #393a30;
  color: #f2ead6;
  border-bottom: 3px solid #b39554;
}
.company-board header h3 {
  font-size: 20px;
  margin: 5px 40px 2px 0;
}
.company-board header strong {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-size: 26px;
}
.company-board header strong small {
  font-size: 10px;
  font-weight: 400;
}
.company-track {
  display: grid;
  gap: 5px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}
.company-level {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 9px;
  background: #eee5cf;
  border: 1px solid #b9ad90;
  border-left: 3px solid #a49b83;
  border-radius: 2px;
  text-align: left;
}
.company-level-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  gap: 2px;
  padding: 3px 0 4px;
  background: #d5cab0;
  color: #4c4739;
  border-radius: 2px;
}
.company-level-number small {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .08em;
}
.company-level-number b {
  font-size: 25px;
  line-height: 1;
}
.company-level-body {
  min-width: 0;
}
.company-level-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-bottom: 6px;
}
.company-level-kind {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid #a58e60;
  background: #e2d6b8;
  color: #58492d;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: .04em;
}
.company-level-kind.reward {
  background: #d9e2ce;
  border-color: #8f9c7d;
  color: #405035;
}
.company-level-status {
  color: #746b58;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.company-level-effect {
  display: block;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: #3b382e;
}
.company-level.pending {
  background: #ddd6c5;
}
.company-level.reached {
  border-left-color: #6b8161;
  background: #e3e3ce;
}
.company-level.reached .company-level-status {
  color: #4e6545;
}
.company-level.current {
  border-color: #947037;
  border-left: 4px solid #a2762e;
  padding-left: 8px;
  background: #fbefd0;
  box-shadow: inset 0 0 0 1px #fff5de;
}
.company-level.current .company-level-number {
  background: #806334;
  color: #fff4d7;
}
.company-level.current .company-level-status {
  color: #775120;
  font-weight: 800;
}
[data-ak-ui] .game-card.company-choice-card,
[data-ak-ui] .library .game-card.company-choice-card {
  flex: 0 0 310px;
  width: 310px;
  min-width: 310px;
  height: auto;
  min-height: 0;
  padding: 10px 8px 5px;
  transform: none;
}
.game-card.company-choice-card .card-title {
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.company-current-summary {
  margin-left: auto;
  font-size: 10px;
  color: #66583c;
  white-space: nowrap;
}
.profile-copy.company-track {
  display: grid;
  gap: 5px;
  padding: 0;
  flex: 1;
  width: 100%;
}
.game-card.company-choice-card .card-footer {
  margin-top: 8px;
}
.company-board footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 10px;
  font-size: 11px;
}
.company-board footer span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.company-board footer i {
  background: var(--player-color);
  width: 7px;
  height: 7px;
}
.identity-board,
.lab-board {
  border: 1px solid #8e7b52;
  background: #302e26;
  padding: 18px 20px;
  margin: 0 0 18px;
  color: #eee7d4;
}
.identity-board h3,
.lab-board h3 {
  margin: 5px 0 12px;
  font-size: 22px;
}
.identity-board > p {
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.8;
}
.identity-counters,
.expansion-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  margin: 12px 0 18px;
}
.identity-counters b {
  color: #edc16e;
  margin-left: 5px;
}
.identity-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.identity-choice {
  padding: 12px;
  background: #444034;
  border-top: 3px solid #b39554;
}
.identity-choice.locked {
  opacity: 0.65;
}
.identity-choice h4 {
  margin: 6px 0;
  font-size: 15px;
}
.identity-choice p,
.lab-board p {
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-line;
}
.identity-choice small {
  color: #e1c995;
  font-size: 11px;
}
.lab-board {
  margin-top: 18px;
}
.lab-board strong {
  color: #ddc583;
}
.route-select.highway > rect:nth-of-type(2) {
  fill: #d4b35d;
  stroke: #625027;
}
.library:has(.expansion-workbench) {
  height: auto;
  min-height: 0;
  max-height: none;
}
.library:has(.expansion-workbench) .library-content {
  max-height: none;
  overflow: visible;
}
.ongoing-roles .card-row {
  margin: 12px 0;
}
.ongoing-roles h3 {
  font-size: 17px;
}
.library-tabs {
  overflow-x: auto;
  white-space: nowrap;
}
.library-tabs button {
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .company-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
  .identity-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .mobile-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .mobile-tabs button {
    flex: 1 0 54px;
  }
  .workspace[data-mobile-tab="enterprise"] .library {
    display: block;
  }
  .workspace[data-mobile-tab="enterprise"] .playfield,
  .workspace[data-mobile-tab="enterprise"] .command-panel {
    display: none;
  }
  .company-grid {
    grid-template-columns: 1fr;
  }
  .identity-choices {
    grid-template-columns: 1fr;
  }
  .identity-board,
  .lab-board {
    padding: 14px;
  }
  .company-level p,
  .identity-choice p,
  .identity-board > p,
  .lab-board p {
    font-size: 13px;
  }
  .company-board header h3 {
    font-size: 22px;
  }
}
.card:has(.profile-copy),
.game-card:has(.profile-copy) {
  width: 280px;
  min-width: 280px;
  min-height: 270px;
  height: auto;
  transform: none;
}
.profile-copy {
  display: block;
  white-space: pre-line;
  text-align: left;
  font-size: 13px;
  line-height: 1.85;
  padding: 12px 3px;
  flex: 1;
}
.library:has(.profile-copy) {
  height: auto;
  max-height: none;
}
.library:has(.profile-copy) .library-content {
  max-height: none;
  overflow: visible;
}

.map-status {
  font-size: 8px;
  font-weight: 700;
  fill: #783d2f;
}
@media (min-width: 761px) {
  html:has(.library .expansion-workbench),
  html:has(.library .profile-copy) {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.in-game:has(.library .expansion-workbench),
  body.in-game:has(.library .profile-copy) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .workspace:has(.expansion-workbench),
  .workspace:has(.profile-copy) {
    height: auto;
    min-height: calc(100dvh - 92px);
    grid-template-rows: minmax(350px, 40vh) auto;
    overflow: visible;
  }
  .workspace:has(.expansion-workbench) .command-panel,
  .workspace:has(.profile-copy) .command-panel {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: calc(100dvh - 92px);
  }
  .library:has(.expansion-workbench),
  .library:has(.profile-copy) {
    overflow: visible;
    max-height: none;
  }
}
.public-expansion {
  margin-top: 24px;
}
.public-expansion .company-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.public-expansion .identity-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .public-expansion .company-grid,
  .public-expansion .identity-choices {
    grid-template-columns: 1fr;
  }
}
.saved-rooms {
  margin: 22px 0 12px;
  padding-top: 15px;
  border-top: 1px solid #605844;
}
.saved-rooms .button-row {
  margin-top: 10px;
  flex-wrap: wrap;
}
.saved-rooms button {
  font-size: 12px;
}

/* Companion controls use the same paper, brass and stamped-label language. */
.bot-setup {
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid #716046;
  border-bottom: 1px solid #716046;
}
.bot-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.bot-fields > div,
.bot-lobby-controls > div {
  min-width: 0;
}
.bot-fields select,
.bot-lobby-controls select {
  width: 100%;
  min-width: 0;
}
.landing .bot-note {
  margin: 8px 0 10px;
  font-size: 11px;
  line-height: 1.6;
}
.bot-setup > button {
  width: 100%;
  white-space: normal;
}
.bot-badge {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid #9f8655;
  color: #e0c17d;
  font: 600 10px/1.4 sans-serif;
  vertical-align: middle;
  white-space: nowrap;
}
#detail .bot-badge {
  color: #685025;
  border-color: #9d8251;
}
.seat .bot-badge {
  align-self: flex-start;
}
.seat button {
  align-self: flex-start;
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 11px;
}
.bot-lobby-controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid #716046;
  background: #332d24;
}
.bot-lobby-controls label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.bot-lobby-controls small {
  flex-basis: 100%;
  color: #baad93;
}
.bot-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  margin: 4px 0;
  border-left: 3px solid #b99a59;
  background: #3b3426;
  color: #e0c17d;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.bot-status small {
  display: block;
  color: #c6b89d;
  font-size: 10px;
}
.bot-status.paused {
  border-left-color: #c07a59;
}
.bot-status button {
  flex-shrink: 0;
  padding: 6px 8px;
  font-size: 11px;
}
.command-panel > .bot-status {
  display: none;
}
@media (max-width: 760px) {
  .workspace[data-mobile-tab="commands"] .command-panel > .bot-status {
    display: flex;
  }
  .bot-lobby-controls {
    gap: 10px;
    padding: 10px;
  }
  .bot-lobby-controls > div {
    flex: 1;
  }
  .other-player > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* Let narrow lobby tracks shrink below their children's intrinsic widths. */
.lobby .seat {
  min-width: 0;
  overflow-wrap: anywhere;
}
.lobby .seat .bot-badge,
.lobby .seat button {
  max-width: 100%;
  white-space: normal;
}
@media (max-width: 1050px) {
  .lobby .players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Review: readiness, true turn state and explicit action commitments. */
.lobby-readiness {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin: -12px 0 22px;
  padding: 12px 14px;
  border: 1px solid #746343;
  background: #332d24;
  font-size: 13px;
}
.lobby-readiness b {
  margin-left: 6px;
  color: #edcd85;
  font-variant-numeric: tabular-nums;
}
.lobby-readiness small {
  flex: 1 1 250px;
  color: #c5b79a;
  font-size: 12px;
}
.lobby .seat-ready {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #cbbd9f;
}
.start-command {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 260px;
}
.start-command small {
  font-size: 11px;
  line-height: 1.5;
  color: #c7b89b;
}
.phase-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 5px 0 7px;
  list-style: none;
  color: #a99e88;
  font-size: 11px;
  font-weight: 500;
}
.phase-track li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.phase-track li > span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #786a51;
  font-size: 9px;
}
.phase-track li[aria-current="step"] {
  color: #efcf8a;
  font-weight: 700;
}
.phase-track li[aria-current="step"] > span {
  background: #d8b45f;
  color: #29231b;
  border-color: #d8b45f;
}
.phase-track .complete > span {
  border-bottom: 2px solid #c1a66a;
}
.turn-order {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 6px 0;
}
.turn-order > small {
  flex-shrink: 0;
  color: #b9aa8c;
  font-size: 10px;
}
[data-ak-ui] .turn-seat {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 2px 5px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 7px;
  flex: 1;
  border: 1px solid #675c47;
  background: #332f27;
  text-align: left;
  color: #d1c6af;
  font-size: 11px;
}
.turn-seat i {
  width: 5px;
  height: 9px;
  background: var(--player-color);
  align-self: center;
}
.turn-seat > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.turn-seat small {
  grid-column: 2;
  font-size: 9px;
  color: #b9ac90;
  white-space: normal;
}
[data-ak-ui] .turn-seat.current {
  border-color: #d8b45f;
  box-shadow: inset 0 -2px #d8b45f;
}
.turn-seat.current small {
  color: #efd08c;
}
.action-group {
  margin-bottom: 16px;
}
.action-group h4 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 8px;
  font-size: 13px;
  color: #594526;
}
.action-group h4 small {
  font-size: 10px;
  font-weight: 400;
  color: #716249;
}
.action-group.main .action-button {
  border-left: 3px solid #89682f;
  background: #eee4cd;
  font-weight: 700;
}
.action-group.end {
  padding-top: 12px;
  border-top: 1px solid #b3a081;
}
.action-group.end .action-button {
  background: #d8c597;
  border-color: #8e713d;
  font-weight: 700;
}
.decision-nudge {
  display: none;
}
[data-ak-ui] .turn-seat:focus-visible,
[data-ak-ui] .decision-nudge:focus-visible {
  outline: 3px solid #edc66d;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .lobby-command .command-buttons {
    align-items: start;
    flex-wrap: wrap;
    gap: 14px;
  }
  .start-command {
    flex: 1 1 145px;
    min-width: 0;
  }
  .start-command button {
    width: 100%;
  }
  [data-ak-ui] .decision-nudge {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 15;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
    border: 0;
    border-bottom: 2px solid #a47e39;
    background: #d8b45f;
    color: #29231b;
    text-align: left;
    box-shadow: 0 2px 5px #0004;
  }
  .decision-nudge > span {
    min-width: 0;
  }
  .decision-nudge b,
  .decision-nudge small {
    display: block;
  }
  .decision-nudge b {
    font-size: 12px;
  }
  .decision-nudge small {
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    color: #393022;
  }
  .decision-nudge > strong {
    font-size: 11px;
    flex-shrink: 0;
  }
  .turn-order {
    flex-wrap: wrap;
  }
  .turn-order > small {
    flex-basis: 100%;
    font-size: 9px;
  }
  [data-ak-ui] .turn-seat {
    padding: 5px 4px;
    min-height: 42px;
  }
  .turn-seat > span {
    font-size: 10px;
  }
  .turn-seat small {
    font-size: 8px;
  }
  .phase-track {
    margin: 4px 0;
    font-size: 10px;
    gap: 8px;
  }
  .phase-track li > span {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
  .choice-cards,
  .city-bench,
  .command-panel {
    scroll-margin-top: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .turn-seat,
  .decision-nudge,
  .phase-track {
    animation: none;
    transition: none;
  }
}

/* Keep action headings legible on the dark command desk. */
.action-group h4 {
  color: #e6d6b8;
}
.action-group h4 small {
  color: #bfb297;
}
.action-group.main .action-button,
.action-group.end .action-button {
  color: #392d1c;
}
.action-group.main .action-button span,
.action-group.end .action-button span {
  color: #755624;
}
.action-group.main .action-button:hover,
.action-group.main .action-button[aria-pressed="true"],
.action-group.end .action-button:hover,
.action-group.end .action-button[aria-pressed="true"] {
  background: #e4c786;
  color: #302519;
  border-color: #a67e35;
}
@media (max-width: 760px) {
  .lobby {
    margin-top: 22px;
  }
  .lobby .room-heading {
    margin-bottom: 24px;
  }
  .lobby-readiness {
    padding: 9px 12px;
    margin-bottom: 14px;
    gap: 8px 14px;
  }
  .lobby .seat {
    padding: 10px 12px;
    min-height: 145px;
  }
  .lobby .seat > small {
    font-size: 10px;
    line-height: 1.3;
  }
  .lobby .seat strong {
    margin: 5px 0;
    font-size: 18px;
    line-height: 1.25;
  }
  .lobby .seat .bot-badge {
    font-size: 9px;
    padding: 1px 4px;
  }
  .lobby .seat-ready {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.3;
  }
  .lobby .seat button.ak-button {
    display: block;
    min-height: 44px;
    padding: 6px 10px;
    margin-top: 5px;
  }
  .lobby .lobby-command {
    margin-top: 16px;
    padding: 16px;
  }
  .lobby-command .command-buttons {
    margin-top: 12px;
  }
}

/* Original board presentation. Artwork and measured overlays share one square space. */
.map-viewport {
  background: #46423e;
  border: 1px solid #807566;
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}
.map-viewport #map-scale {
  height: auto;
  min-height: 0;
  min-width: calc(1000px * var(--map-zoom, 1));
}
[data-ak-ui] .map-viewport .map-svg.original-board {
  display: block; width: 100%; min-width: 0; height: auto; background: transparent;
}
.original-board .board-art { pointer-events: none; }
.original-board .board-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.original-board .board-resource-cover { fill: #676d79; stroke: none; }
.original-board .board-node-id { fill: #fff; font-size: 9px; font-weight: 800; letter-spacing: .2px; }
.original-board .board-resource { fill: #f3ead2; pointer-events: none; }
.original-board .board-resource svg path { fill: #e9dca91c; stroke: #eee3bf; stroke-width: 1.5; stroke-linejoin: round; }
.original-board .board-resource text { font-size: 9px; font-weight: 600; }
.original-board .board-unexplored > path { fill: #c9cdd1; stroke: #c9cdd1; stroke-width: .7; }
.original-board .board-unexplored > circle { fill: none; stroke: #bbc0c7; stroke-width: .8; }
.original-board .board-unexplored text { fill: #cbd0d5; font-weight: 500; }
.original-board .board-target-highlight { fill: none; stroke: none; pointer-events: none; }
.original-board .legal .board-target-highlight { stroke: #ffe07b; stroke-width: 2.5; }
.original-board .selected .board-target-highlight { stroke: #82f1ef; stroke-width: 2.7; }
.original-board [role="button"]:focus-visible { outline: none; }
.original-board [role="button"]:focus-visible .board-target-highlight { stroke: #fff; stroke-width: 3; stroke-dasharray: 5 3; }
.original-board .board-node > :not(.board-hit),
.original-board .board-route > :not(.board-hit) { pointer-events: none; }
.original-board .influence-marker.empty rect { stroke: #a7b4b2; stroke-width: .6; }
.original-board .influence-marker.occupied rect { stroke: #fff5dc; stroke-width: 1.2; }
.original-board .board-highway { stroke: #f3cf77; stroke-width: 1.7; fill: none; }
.original-board .board-road-cover rect { fill: #d8c692; stroke: #7c7153; stroke-width: .5; }
.original-board .board-road-cover text { fill: #403b2a; font-size: 8px; font-weight: 700; }
.original-board .city-hull { stroke: #fff2cc; stroke-width: 1.2; stroke-linejoin: round; }
.original-board .city-deck { fill: none; stroke: #f8edcd; stroke-width: .8; }
.original-board .city-wheel { fill: #35423b; stroke: #f2e3be; stroke-width: .7; }
.map-svg.original-board .city-pin { fill: #fff; font-size: 8px; font-weight: 800; }
.original-board .board-base-warning { fill: #fff0b4; font-size: 7px; font-weight: 700; }
.original-board .board-status { fill: #ffdf89; font-size: 7px; font-weight: 700; paint-order: stroke; stroke: #676d79; stroke-width: 2; }
.map-legend { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 7px 0; font-size: 10px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 9px; height: 7px; border: 1px solid #b5aa83; display: inline-block; }
.map-legend .legend-city { height: 9px; background: #7c8e94; clip-path: polygon(0 0,100% 0,100% 70%,50% 100%,0 70%); }
.map-viewport[data-overview="true"] #map-scale { width: 100%; height: 100%; min-width: 0; }
[data-ak-ui] .map-viewport[data-overview="true"] .map-svg.original-board { width: 100%; height: 100%; }
.landing .preview .original-board { min-width: 0; width: 100%; height: auto; }
@media (min-width: 761px) {
  html:has(.workspace .original-board), body[data-ak-ui]:has(.workspace .original-board) { height: auto; min-height: 100%; overflow: auto; }
  .workspace:has(.original-board) { height: auto; min-height: calc(100dvh - 92px); grid-template-rows: auto auto; overflow: visible; }
  .workspace:has(.original-board) .playfield { min-height: 0; }
  .workspace:has(.original-board) .map-viewport { flex: none; height: min(70dvh, 760px); min-height: 440px; max-height: none; }
}
@media (max-width: 760px) {
  .map-viewport { height: min(65dvh, 600px); min-height: 360px; max-height: none; }
  .map-viewport #map-scale { min-width: calc(1000px * var(--map-zoom, 1)); }
  .map-viewport[data-overview="true"] #map-scale { min-width: 0; }
  .map-legend { font-size: 9px; gap: 5px 10px; }
  .map-toolbar button { padding-left: 7px; padding-right: 7px; }
}

/* Keep original-board selection outlines clear of legacy route rectangle rules. */
[data-ak-ui] .map-svg.original-board .board-target-highlight { fill: none; stroke: none; pointer-events: none; }
[data-ak-ui] .map-svg.original-board .legal > .board-target-highlight { fill: none; stroke: #ffe07b; stroke-width: 2.5; }
[data-ak-ui] .map-svg.original-board .selected > .board-target-highlight { fill: none; stroke: #82f1ef; stroke-width: 2.7; }
[data-ak-ui] .map-svg.original-board [role="button"]:focus-visible > .board-target-highlight { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 5 3; }
.playfield > .selected-info {
  color: #24372f;
  background: #f6f2e8;
  border-left-color: #4a7468;
  line-height: 1.7;
  overflow-wrap: anywhere;
  min-width: 0;
  box-sizing: border-box;
}
.playfield > .selected-info b { color: #24372f; font-weight: 800; }
/* PRTS item art: keep resource names visible alongside the shared icons. */
.resource-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
}
.resource-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  white-space: nowrap;
  gap: 1px;
  font-weight: 650;
}
.resource-inline .resource-icon { width: 1.65em; height: 1.65em; margin: -.28em 0; }
.game-hud .resource .resource-icon { width: 29px; height: 29px; }
.card-cost .resource-icon { width: 22px; height: 22px; }
.company-level .resource-inline .resource-icon { width: 22px; height: 22px; }
.selection-preview .company-track { padding: 0; margin: 12px 0; }
.selection-preview .company-level { grid-template-columns: 28px minmax(0, 1fr); padding: 8px 6px; gap: 6px; }
.selection-preview .company-level-effect { font-size: 12px; }
.original-board .board-resource-icon { pointer-events: none; }
.library:has(.company-choice-card) .library-content,
.workspace[data-library-open="true"] .library:has(.company-choice-card) .library-content {
  height: auto;
  max-height: none;
  overflow: visible;
}
@media (max-width: 760px) {
  .playfield > .selected-info { width: 100%; max-width: 100%; font-size: 12px; }
  .game-hud .resource .resource-icon { width: 24px; height: 24px; }
  .game-hud .resource { gap: 1px; }
  .in-game .top-meta { max-width: none; }
  .in-game .top-meta button.ak-button { min-height: 44px; height: 44px; }
}

/* Ownership belongs only to the resource card body, never its region header or influence slots. */
.original-board .board-resource-cover.city-owned { fill: var(--city-body); stroke: var(--city-color); stroke-width: 2.5; }
.original-board .city-hull { stroke-width: 1.8; }
.original-board .city-deck { stroke-width: 1.1; }
.original-board .board-resource-cover.city-owned ~ .board-resource text { fill: #fff; }

.start-draw { max-width: 1160px; margin: 0 auto; padding: 44px max(24px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 16px 56px; align-items: center; }
.draw-intro { grid-column: 1 / -1; }
.draw-intro h1 { margin: 10px 0 12px; font-size: clamp(28px, 4vw, 46px); line-height: 1.2; }
.draw-intro h1:focus { outline: none; }
.draw-intro p { font-size: 14px; line-height: 1.8; color: #b9c4bd; }
.draw-intro .connection { display: inline-block; margin-top: 4px; }
.draw-stage { min-width: 0; padding: 18px 0; text-align: center; }
.draw-wheel-wrap { position: relative; width: min(100%, 382px); aspect-ratio: 1; margin: 0 auto; }
.draw-wheel-clip { width: 100%; height: 100%; overflow: hidden; border-radius: 50%; filter: drop-shadow(0 12px 22px #0006); }
.draw-wheel { display: block; width: 100%; height: 100%; transform: rotate(var(--draw-rotation)); animation: opening-wheel var(--draw-duration) cubic-bezier(.12,.64,.13,1) var(--draw-delay) both; }
.draw-wheel path { stroke: #e9e8cf; stroke-width: 1.5; }
.draw-wheel text { fill: #fff; font-size: 15px; font-weight: 800; paint-order: stroke; stroke: #15251f; stroke-width: 1.5; stroke-linejoin: round; }
.draw-wheel .draw-sector-number { font-size: 10px; font-weight: 500; }
.draw-pointer { position: absolute; z-index: 2; top: 0; left: 50%; width: 24px; height: 31px; transform: translate(-50%, -20%); background: #f3dc8e; clip-path: polygon(0 0,100% 0,50% 100%); filter: drop-shadow(0 2px 1px #111); }
.draw-hub { position: absolute; inset: 35%; border: 2px solid #e9d29a; border-radius: 50%; background: #172d25; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8px; box-shadow: 0 2px 12px #0008; overflow: hidden; }
.draw-hub small { color: #e6cb82; font-size: 11px; }
.draw-hub b { max-width: 100%; margin-top: 5px; font-size: 15px; overflow-wrap: anywhere; line-height: 1.3; }
.draw-status { margin: 20px 0 0; min-height: 2.8em; color: #e3d8ac; font-size: 13px; line-height: 1.5; }
.draw-results { padding: 24px; border: 1px solid #7e90744d; background: #172920e6; }
.draw-results h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 18px; margin: 0 0 20px; }
.draw-results h2 small { font-weight: 400; font-size: 11px; color: #b7c3b4; }
.draw-results ol { list-style: none; padding: 0; margin: 0; }
.draw-results li, .draw-pending > span { display: flex; align-items: center; gap: 10px; min-height: 57px; border-top: 1px solid #abb89d26; }
.draw-results li:first-child { background: #e2c77b10; }
.draw-rank, .draw-pending b { display: grid; place-items: center; flex: 0 0 28px; font-size: 23px; color: #dfcf9c; font-weight: 700; }
.draw-results li > i { flex: 0 0 9px; height: 28px; background: var(--player-color); }
.draw-results li > b { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.draw-results li > small { margin-left: auto; flex-shrink: 0; text-align: right; font-size: 10px; color: #c8cfbf; }
.draw-pending > span { color: #9fac9c; }
.draw-pending i { width: 42%; height: 10px; background: #ffffff0e; }
.draw-pending small { margin-left: auto; font-size: 11px; }
.draw-order-note { margin: 18px 0; color: #acb8a7; font-size: 12px; line-height: 1.7; }
.draw-continue { border-top: 1px solid #abb89d26; padding-top: 18px; }
.draw-continue button { width: 100%; min-height: 46px; }
.draw-continue small { display: block; margin-top: 9px; text-align: center; font-size: 11px; color: #aebaa8; }
.draw-continue p { margin: 0; text-align: center; color: #e1d49f; font-size: 13px; line-height: 1.7; }
.start-draw button:focus-visible { outline: 3px solid #fff4b3; outline-offset: 4px; }
@keyframes opening-wheel { from { transform: rotate(0deg); } to { transform: rotate(var(--draw-rotation)); } }
@media (max-width: 760px) {
  .start-draw { grid-template-columns: minmax(0, 1fr); padding: 26px max(18px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)); gap: 0; }
  .draw-intro { grid-column: auto; }
  .draw-intro h1 { font-size: 30px; }
  .draw-intro p { font-size: 12px; }
  .draw-stage { padding: 22px 8px 4px; }
  .draw-wheel-wrap { width: min(100%, 300px); }
  .draw-results { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .draw-wheel { animation: none; }
  .start-draw[data-revealed="false"] .draw-wheel { transform: rotate(0deg); }
}
