/* Physical ratios: 110 mm flat-to-flat hex, 24 mm Org, 63 × 88 mm card.
   The radius-two board spans four hex widths and five hex heights. */
.board-window {
  overflow: visible;
  padding: 6px;
}
.board {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: 8 / 8.660254038;
  padding: 0;
  container-type: inline-size;
}
.board-note {
  min-height: 4.5em;
}
.board-tiles {
  display: contents;
}
.action-area,
.era-hex {
  position: absolute;
  box-sizing: border-box;
  width: 25%;
  height: 20%;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #f4f1e8;
  color: #111;
  text-align: center;
  overflow: hidden;
  line-height: 1.1;
  left: calc(50% + var(--hex-x, 0) * 18.75% - 12.5%);
  top: calc(50% + var(--hex-y, 0) * 20% - 10%);
  padding: 2% 3%;
  gap: 0;
}
.action-area strong {
  font-size: clamp(8px, 2.1cqw, 17px);
  letter-spacing: 0;
}
.action-area small,
.era-hex span {
  font-size: clamp(8px, 1.8cqw, 14px);
}
.era-hex {
  background: #222;
  color: #fff;
}
.action-area[aria-pressed="true"] {
  background: #f6d782;
}
.action-area:focus-visible {
  background: #f2cc60;
  outline: none;
}
.hex-orgs {
  height: 10cqw;
  width: 17cqw;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 0.3cqw;
  position: relative;
}
.org-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--kit-color);
  color: #111;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.05em;
  box-shadow: 0 1px 2px #0003;
}
.org-token[data-equipped="true"] {
  border-style: double;
  border-width: 4px;
  background: #ffefb7;
}
.hex-orgs .org-token {
  width: 4.724cqw;
  font-size: clamp(6px, 1.3cqw, 11px);
}
.hex-orgs.crowded .org-token {
  position: absolute;
  left: calc(var(--token-column) * 2.7cqw);
  top: calc(var(--token-row) * 1.8cqw);
}
.initiative-marker {
  border: 1px solid currentColor;
  border-radius: 99px;
  padding: 0 0.4em;
}
.setup-preview-label {
  color: var(--muted);
  font-size: 0.8rem;
}
.player-roster {
  max-height: 72vh;
}
.player-mat {
  padding: 14px;
  border-left: 4px solid var(--kit-color);
}
.player-mat h3 {
  margin: 4px 0;
}
.institution-ability,
.mat-score {
  font-size: 0.75rem;
  line-height: 1.5;
}
.holding-track {
  margin: 8px 0;
}
.track-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.track-cells {
  display: flex;
  gap: 2px;
}
.track-cell {
  flex: 1;
  min-width: 0;
  max-width: 25px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #eee;
  font-size: 0.65rem;
}
.holding-cube {
  background: var(--kit-color);
  color: white;
  outline: 2px solid #111;
  outline-offset: -2px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
}
.org-supply {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.supply-label {
  font-size: 0.7rem;
  align-self: center;
}
.available-orgs,
.reserve-orgs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.reserve-orgs .org-token {
  border-style: dashed;
}
.shared-cards {
  margin-top: 16px;
}
.card-section h3 {
  font-size: 0.85rem;
}
.table-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 12px;
}
.table-card {
  width: 126px;
  aspect-ratio: 63 / 88;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: #faf5e8;
  color: #111;
  border: 1px solid #222;
  border-radius: 6px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}
.table-card strong {
  font-size: 0.95rem;
  line-height: 1.2;
}
.table-card small,
.table-card span {
  font-size: 0.65rem;
}
.table-card.card-back {
  background: #181818;
  color: white;
}
.card-dialog {
  width: min(90vw, 480px);
  max-height: 85dvh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #111;
}
.card-dialog::backdrop {
  background: #0009;
}
.card-dialog p,
.card-dialog blockquote {
  line-height: 1.6;
  white-space: pre-line;
}
.card-dialog blockquote {
  margin: 20px 0;
  color: #444;
}
.shared-cards,
.card-section,
.institution-panel {
  min-width: 0;
}
@media (max-width: 700px) {
  .player-roster {
    max-height: none;
  }
  .org-token {
    min-width: 0;
  }
}
/* Keep all mats visible; the board remains the primary play surface. */
.live-dashboard {
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  grid-template-areas: "board decision" "score score" "ledger ledger";
}
.institution-panel {
  max-height: none;
  overflow: visible;
}
.player-roster {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  max-height: none;
}
.board {
  background: transparent;
}
.action-area,
.era-hex {
  transform: scale(0.97);
}
.action-area:hover:not(:disabled),
.era-hex {
  background: #222;
  color: #fff;
}
.action-area[aria-pressed="true"] {
  background: #f6d782;
}
.action-area:focus-visible {
  background: #f6d782;
  color: #111;
  box-shadow: none;
}
.table-card:hover:not(:disabled),
.table-card:focus-visible {
  background: #f6d782;
  color: #111;
}
.table-card small {
  color: inherit;
}
.shared-cards {
  padding: 16px;
}
.command-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.command-fields #start-game {
  grid-column: 1 / -1;
  justify-self: start;
}
.command-fields label {
  min-width: 0;
}
.command-fields small {
  letter-spacing: normal;
}
.setup-inventory {
  margin: 16px 0 0;
  font-size: 0.8rem;
}
@media (max-width: 800px) {
  .live-dashboard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "board" "decision" "score" "ledger";
  }
  .command-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .player-roster {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A sticky decision pane must not float over the mats in later grid rows. */
.decision-console {
  position: static;
  align-self: start;
  max-height: none;
}

/* The institution card turns only for final recognition. Text remains readable. */
.recognized-identity { border-bottom: 4px solid currentColor; }
.recognized-identity::after { content: "▲"; transform: rotate(180deg); text-align: center; }
