.table-surface {
  display: none;
}
.play-screen.table-mode .canvas-wrap {
  display: none;
}
.play-screen.table-mode .table-surface {
  display: block;
  overflow: auto;
  min-height: 0;
  flex: 1;
  background: #163841;
  touch-action: pan-y;
}
.play-screen.table-mode .game-footer {
  min-height: 34px;
}
.play-screen.table-mode .play-body {
  min-height: 0;
}
.table-layout {
  width: min(1120px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 0.85fr);
  gap: 22px;
  padding: 20px;
  color: #e7f2ed;
}
.board-main {
  min-width: 0;
}
.board-turn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  font-size: 15px;
}
.board-turn > span:last-child {
  margin-left: auto;
  color: #b8d5d1;
  font-size: 12px;
}
.turn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dbad64;
}
.turn-dot.your-turn {
  background: #92e4b5;
  box-shadow: 0 0 0 4px #82daa416;
}
.chess-board {
  display: grid;
  position: relative;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  border: 10px solid #a57845;
  border-radius: 12px;
  box-shadow:
    0 12px 25px #051c3580,
    inset 0 0 15px #84551f7a;
  overflow: hidden;
  width: 100%;
}
.gomoku-board {
  aspect-ratio: 1;
  background:
    linear-gradient(#f3cd90af, #efc284bf),
    url("./assets/scenes/gomoku.webp") center/cover;
}
.xiangqi-board {
  aspect-ratio: 9/10;
  background:
    linear-gradient(#f1d49f44, #e8c38844),
    url("./assets/scenes/xiangqi.webp") center/cover;
}
.board-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  min-height: 0;
  cursor: pointer;
  touch-action: manipulation;
  outline-offset: -2px;
}
.board-cell:disabled {
  opacity: 1;
  cursor: default;
}
.board-cell:before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      #755528b5 50%,
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      transparent calc(50% - 0.5px),
      #755528b5 50%,
      transparent calc(50% + 0.5px)
    );
}
.board-cell:nth-child(15n + 1):before {
  background-size: 100% 100%;
}
.gomoku-board .board-cell:hover:not(:disabled):not(:has(.stone)) {
  background: #32907438;
  border-radius: 50%;
}
.stone {
  width: 86%;
  aspect-ratio: 1;
  z-index: 1;
  border-radius: 50%;
  box-shadow: 2px 3px 3px #3c271964;
}
.stone.black {
  background: radial-gradient(
    circle at 32% 25%,
    #606c7e,
    #222835 45%,
    #090f19 85%
  );
  border: 1px solid #111a26;
}
.stone.white {
  background: radial-gradient(circle at 32% 25%, white, #f5f0e5 40%, #bbb8ac);
  border: 1px solid #dfd4b8;
}
.board-cell.last:after {
  content: "";
  width: 18%;
  aspect-ratio: 1;
  border: 2px solid #ed864b;
  position: absolute;
  z-index: 3;
  border-radius: 3px;
}
.chess-piece {
  position: relative;
  z-index: 2;
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: radial-gradient(circle at 30% 22%, #fff8db, #e8c891 70%, #ae7b42);
  box-shadow:
    1px 3px 2px #5a352f70,
    inset 0 0 0 3px #efcb946e;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  font-family: serif;
  font-weight: 700;
}
.chess-piece.red {
  color: #a23528;
}
.chess-piece.black {
  color: #263b3e;
}
.board-cell.selected .chess-piece {
  outline: 3px solid #47bc97;
}
.board-cell.legal:after {
  content: "";
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  background: #299b78bb;
  border-radius: 50%;
  z-index: 4;
}
.river {
  position: absolute;
  top: 45%;
  height: 10%;
  left: 5.6%;
  right: 5.6%;
  background: #e9cc95;
  color: #806039;
  font: 600 27px serif;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1;
  pointer-events: none;
}
.board-cell.winning .stone {
  outline: 3px solid #e8b048;
}
.table-message {
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  min-height: 24px;
  color: #d8eade;
}
.board-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}
.opponent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #bfd1b33b;
  border-radius: 13px;
  padding: 14px;
  background: #234951;
}
.opponent-portrait {
  width: 70px;
  height: 88px;
  object-fit: contain;
}
.opponent-card span {
  font-size: 10px;
  color: #d4bc85;
  display: block;
}
.opponent-card strong {
  display: block;
  font-size: 18px;
  margin: 5px 0;
}
.opponent-card small {
  color: #b4cfc9;
  font-size: 11px;
}
.table-info,
.move-list {
  border-radius: 12px;
  background: #ffffff08;
  border: 1px solid #acc5be24;
  padding: 16px;
}
.table-info h3,
.move-list h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #f1d6a0;
}
.table-info p {
  font-size: 12px;
  line-height: 1.9;
  color: #bed4cc;
  margin: 0;
}
.table-toolbar {
  display: flex;
  gap: 8px;
}
.table-toolbar button {
  flex: 1;
}
.table-surface button[data-table-action] {
  border-radius: 8px;
  border: 1px solid #a5c8b462;
  background: #e9d4a4;
  color: #274b51;
  padding: 10px 12px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 700;
  touch-action: manipulation;
}
.table-surface button[data-table-action]:hover {
  filter: brightness(1.08);
}
.table-surface button[data-table-action]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.table-surface button.quiet {
  background: #264c54;
  color: #d9e8d9;
}
.board-note {
  color: #adc5bf;
  line-height: 1.8;
  font-size: 11px;
}
.move-list p {
  display: flex;
  gap: 10px;
  margin: 8px 0;
  font-size: 12px;
  color: #c6d9d0;
}
.move-list p small {
  margin-left: auto;
}
.city-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  max-width: 1300px;
}
.city-board {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
  aspect-ratio: 1;
  position: relative;
  border-radius: 17px;
  border: 6px solid #bfdcb0;
  background: #a1b79d;
  gap: 2px;
  box-shadow: 0 10px 28px #06273780;
}
.city-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #fff2d0;
  border-radius: 4px;
  padding: 3px 0 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  touch-action: manipulation;
  overflow: visible;
}
.city-tile .district {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 13px;
  background: var(--district);
  border-radius: 3px 3px 0 0;
  display: grid;
  place-items: center;
  color: #17353a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}
.city-tile.property-tile {
  background: color-mix(in srgb, var(--district) 28%, #fff8df);
  padding-top: 13px;
}
.city-tile.same-district {
  box-shadow: inset 0 0 0 2px var(--district);
  background: color-mix(in srgb, var(--district) 45%, #fff8df);
}
.city-tile.property-tile.occupied {
  background: color-mix(in srgb, var(--district) 38%, #fff8df);
}
.owner-marker {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 6;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1.5px solid #fffbe5;
  border-radius: 50%;
  color: #17353a;
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
}
.city-tile .building {
  width: 70%;
  height: 0;
  flex: 1;
  min-height: 0;
  object-fit: contain;
  pointer-events: none;
}
.city-tile strong {
  font-size: 8px;
  color: #355349;
  line-height: 1.1;
  white-space: nowrap;
}
.city-tile small {
  display: none;
  color: #7b7556;
  font-size: 9px;
  line-height: 1.1;
}
.city-tile.selected {
  outline: 3px solid #ffe587;
  z-index: 2;
}
.city-tile.occupied {
  background: #fffbbd;
}
.city-tokens {
  position: absolute;
  bottom: 18%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.city-tokens img {
  width: 55%;
  height: auto;
  margin: 0 -10%;
  filter: drop-shadow(0 2px 1px #23383d80);
}
.city-tokens img.active-token {
  transform: translateY(-9%);
}
.city-tile .roadblock {
  position: absolute;
  width: 60%;
  height: 60%;
  top: 0;
  left: 0;
  object-fit: contain;
  z-index: 4;
}
.city-center {
  grid-row: 2/11;
  grid-column: 2/11;
  background:
    linear-gradient(#113e3228, #214b3277),
    url("./assets/scenes/tycoon.webp") center/cover;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  min-height: 0;
}
.city-center .eyebrow {
  color: #f1e8b2;
  font-size: 10px;
}
.city-center h2 {
  color: #fff0be;
  font-size: 30px;
  margin: 6px 0 3px;
  text-shadow: 0 2px 4px #174037;
}
.dice-stage {
  position: relative;
  width: auto;
  height: auto;
  margin: 8px auto;
}
.dice-faces {
  display: flex;
  justify-content: center;
  gap: 13px;
  padding: 8px 12px;
}
.die-face {
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  padding: 9px;
  border: 1px solid #fef6d8;
  border-radius: 11px;
  background: linear-gradient(145deg, #fffefa 5%, #f6eed5 67%, #d9c38d);
  box-shadow:
    3px 5px 0 #ad925e,
    6px 10px 12px #08292580,
    inset 1px 2px 3px #fff;
  transform: rotate(-7deg);
}
.die-face:nth-child(2) {
  transform: rotate(6deg);
}
.die-face:nth-child(3) {
  transform: rotate(-3deg);
}
.die-pip {
  align-self: center;
  justify-self: center;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #284440;
  box-shadow:
    inset 0 1px 2px #071c1c80,
    0 1px 0 #fff;
}
.die-face.one .die-pip {
  background: #b84839;
  width: 12px;
  height: 12px;
}
.die-unknown {
  grid-area: 1/1/4/4;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #71826d;
}
.dice-caption {
  display: inline-block;
  margin-top: 10px;
  color: #fff6cf;
  font-size: 12px;
  background: #173b3edb;
  padding: 5px 10px;
  border-radius: 10px;
}
.dice-stage.rolling {
  animation: dice-bounce 0.12s alternate 6;
}
@keyframes dice-bounce {
  to {
    transform: translateY(-8px) rotate(7deg);
  }
}
.city-center p {
  font-size: 13px;
  line-height: 1.7;
  color: #fffbe5;
  background: #183d46bf;
  padding: 10px 14px;
  border-radius: 9px;
  max-width: 100%;
  margin: 8px 0;
}
.city-center small {
  font-size: 10px;
  color: #fcf1cf;
  margin-top: 12px;
}
.city-center .waiting {
  padding: 12px;
  color: #e8f0dd;
  font-size: 12px;
}
.table-surface .city-center .roll-button {
  background: #ffc86b;
  border-color: #fff1b6;
  box-shadow: 0 4px 0 #826c3e;
  color: #224650;
  font-size: 15px;
  min-width: 146px;
}
.wallet-strip {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  background: #285058;
  border: 1px solid #e4d7a62e;
}
.wallet-strip span {
  font-size: 11px;
  color: #afceca;
}
.wallet-strip b {
  display: block;
  font-size: 18px;
  color: #ffe7b0;
  margin-top: 3px;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #ffffff08;
  margin-bottom: 5px;
}
.roster-row.active {
  border-color: #e3d6a48c;
  background: #315852;
}
.roster-row.out {
  opacity: 0.4;
}
.roster-row img {
  width: 43px;
  height: 48px;
  object-fit: contain;
}
.roster-row span {
  flex: 1;
}
.roster-row strong {
  display: block;
  font-size: 13px;
}
.roster-row small {
  font-size: 10px;
  color: #b1cebf;
}
.roster-row > b {
  font-size: 14px;
  color: #f4dfa8;
}
.city-management {
  background: #f6f0dd;
  color: #365449;
  border-radius: 10px;
  border: 1px solid #cbd8b8;
  overflow: hidden;
}
.city-management summary {
  font-size: 13px;
  font-weight: 700;
  padding: 13px;
  cursor: pointer;
  background: #e9edda;
}
.city-management summary b {
  float: right;
}
.city-management p {
  line-height: 1.6;
}
.hand-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
}
.hand-cards button[data-table-action] {
  padding: 6px 3px;
  background: #fffbee;
  border-color: #d7dcc2;
}
.hand-cards img {
  width: 56px;
  height: 50px;
  object-fit: contain;
}
.hand-cards strong {
  display: block;
  font-size: 11px;
}
.hand-cards small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 5px;
  color: #657960;
}
.hand-cards > p {
  grid-column: 1/-1;
  font-size: 12px;
}
.card-target {
  margin: 0 10px 10px;
  background: #e1ead8;
  padding: 10px;
  border-radius: 7px;
}
.card-target p {
  font-size: 11px;
}
.card-target > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.card-target button[data-table-action] {
  padding: 7px;
  min-height: 32px;
  font-size: 11px;
}
.stock-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid #d9dfcc;
}
.stock-row > span {
  flex: 1;
  font-size: 12px;
}
.stock-row small {
  display: block;
  font-size: 10px;
  color: #71816d;
  margin-top: 3px;
}
.stock-row b {
  font-size: 12px;
}
.stock-row .up {
  color: #ba634b;
}
.stock-row .down {
  color: #448c72;
}
.table-surface .stock-row button {
  padding: 5px;
  min-height: 34px;
  background: #e1e9d8;
}
.city-management .table-toolbar {
  padding: 10px;
}
.market-news {
  padding: 0 12px;
  font-size: 11px;
  color: #6c7858;
}
.property-card {
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.property-card > img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.property-card strong {
  font-size: 14px;
}
.property-card p,
.property-card small {
  font-size: 11px;
  margin: 5px 0;
}
.city-log {
  padding: 0 12px;
}
.city-log p {
  font-size: 11px;
  border-bottom: 1px solid #dae0cc;
  padding-bottom: 8px;
}
.city-log small {
  display: block;
  font-size: 9px;
  color: #7e8c70;
}
.decision-card {
  margin-top: 14px;
  background: #fff0cc;
  color: #355249;
  padding: 14px;
  border: 2px solid #f7cc77;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.decision-image {
  width: 78px;
  height: 78px;
  object-fit: contain;
}
.decision-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
}
.decision-card p {
  margin: 0 0 10px;
  font-size: 12px;
}
.decision-card button {
  margin-right: 5px;
}
.market-cards {
  display: flex;
  gap: 7px;
}
.market-cards button {
  flex: 1;
}
.market-cards img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.market-cards strong,
.market-cards small {
  display: block;
  font-size: 10px;
}
.shop-card {
  display: block;
}
.dice-choice {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
@media (max-width: 850px) {
  .table-layout {
    gap: 14px;
    padding: 14px;
    grid-template-columns: minmax(0, 1.6fr) minmax(190px, 0.8fr);
  }
  .city-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .city-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .city-center {
    padding: 18px;
  }
  .city-tile strong {
    font-size: 9px;
  }
  .city-tile small {
    font-size: 8px;
  }
}
@media (max-width: 550px) {
  .table-layout {
    grid-template-columns: 1fr;
    padding: 13px 8px;
    gap: 10px;
  }
  .chess-board {
    border-width: 6px;
  }
  .chess-piece {
    font-size: 23px;
    border-width: 1.5px;
  }
  .table-layout .board-sidebar {
    gap: 10px;
  }
  .opponent-card {
    padding: 8px;
  }
  .opponent-portrait {
    width: 44px;
    height: 48px;
  }
  .opponent-card strong {
    font-size: 15px;
  }
  .opponent-card small {
    font-size: 11px;
  }
  .table-info {
    padding: 11px;
  }
  .move-list {
    display: none;
  }
  .board-turn {
    font-size: 13px;
  }
  .board-turn > span:last-child {
    font-size: 11px;
  }
  .table-message {
    font-size: 12px;
  }
  .city-sidebar {
    display: flex;
  }
  .city-board {
    gap: 1px;
    border-width: 3px;
    border-radius: 9px;
  }
  .city-tile {
    padding: 2px 0 0;
    border-bottom-width: 2px;
  }
  .city-tile .district {
    height: 3px;
  }
  .city-tile strong {
    font-size: 7px;
  }
  .city-tile small {
    display: none;
  }
  .city-tile .building {
    width: 80%;
    height: 64%;
  }
  .city-center {
    padding: 8px;
  }
  .city-center h2 {
    font-size: 22px;
  }
  .city-center p {
    font-size: 11px;
    padding: 7px;
    margin: 4px 0;
  }
  .city-center .eyebrow {
    font-size: 8px;
  }
  .dice-stage {
    width: 68px;
    height: 65px;
    margin: 3px;
  }
  .dice-stage b {
    width: 25px;
    height: 25px;
    font-size: 16px;
  }
  .city-center small {
    font-size: 8px;
    margin-top: 9px;
  }
  .table-surface .city-center .roll-button {
    font-size: 12px;
    min-height: 37px;
    min-width: 115px;
    padding: 8px;
  }
  .decision-card {
    gap: 7px;
    padding: 10px;
  }
  .decision-image {
    width: 55px;
    height: 60px;
  }
  .decision-card h3 {
    font-size: 14px;
  }
  .wallet-strip {
    margin: 10px 0;
  }
  .table-mode .game-hud #detail {
    max-height: 32px;
    overflow: hidden;
  }
  .table-mode .score-count {
    display: none;
  }
  .hand-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .board-note {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dice-stage.rolling {
    animation: none;
  }
}
/* Keep the entire board visible on landscape tablets. */
@media (min-width: 700px) and (orientation: landscape) {
  .chess-board {
    width: min(100%, calc(100dvh - 284px));
    margin-inline: auto;
  }
  .xiangqi-board {
    width: min(100%, calc((100dvh - 284px) * 0.9));
  }
  .city-board {
    width: min(100%, calc(100dvh - 285px));
    margin-inline: auto;
  }
  .city-center h2 {
    font-size: 25px;
  }
  .city-center p {
    font-size: 12px;
  }
  .city-center {
    padding: 10px;
  }
  .dice-stage {
    width: 80px;
    height: 75px;
    margin: 2px;
  }
  .table-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
    padding: 15px 20px;
  }
  .chess-piece {
    font-size: 26px;
  }
}
.board-cell:before {
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  border-radius: 0;
}
.board-cell:before {
  display: none;
}
.board-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.board-cell .stone,
.board-cell .chess-piece {
  pointer-events: none;
}
.vehicle-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: #f4e7bc;
  font-size: 11px;
}
.table-surface .vehicle-controls button {
  padding: 5px 8px;
  min-height: 28px;
  font-size: 10px;
  background: #28584fb3;
  color: #eef1d5;
}
.table-surface .vehicle-controls button[aria-pressed="true"] {
  background: #f1d181;
  color: #38534b;
}
.stock-chart {
  width: 62px;
  height: 28px;
}
.decision-card {
  animation: card-reveal 0.24s ease-out;
}
@keyframes card-reveal {
  from {
    transform: translateY(9px);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.traveler {
  position: absolute;
  z-index: 12;
  width: 9%;
  aspect-ratio: 128/160;
  background-size: 400% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px #16384e70);
}
.traveler-0 {
  background-image: url("./assets/animations/tycoon-player.png");
}
.traveler-1 {
  background-image: url("./assets/animations/tycoon-red.png");
}
.traveler-2 {
  background-image: url("./assets/animations/tycoon-green.png");
}
.traveler-3 {
  background-image: url("./assets/animations/tycoon-purple.png");
}
.city-map-scroll {
  max-width: 100%;
  overflow: auto;
  touch-action: pan-x pan-y;
  border-radius: 12px;
}
.city-map-scroll.zoomed {
  height: min(68dvh, 620px);
}
.city-map-scroll.zoomed .city-board {
  width: 820px;
  min-width: 820px;
  height: 820px;
  margin: 0;
}
.table-surface button.map-zoom {
  margin-left: 7px;
  background: #274e54;
  color: #d6e8da;
  padding: 5px 8px;
  min-height: 29px;
  font-size: 10px;
}
.city-map-scroll.zoomed .city-tile strong {
  font-size: 13px;
}
.city-map-scroll.zoomed .city-tile .building {
  height: 0;
  flex: 1;
}
.city-map-scroll.zoomed .city-tile small {
  display: block;
  font-size: 11px;
}
.district-panel {
  background: #21464c;
  border: 1px solid #bbd9c333;
  border-radius: 13px;
  padding: 12px;
  margin-bottom: 14px;
}
.district-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}
.district-heading strong {
  color: #f8edcc;
  font-size: 13px;
}
.district-heading span {
  color: #c2d9c7;
  font-size: 11px;
}
.district-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.table-surface button.district-key {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: #173b41;
  border: 1px solid color-mix(in srgb, var(--district) 40%, #284e50);
  padding: 7px 9px;
  min-width: 0;
  min-height: 46px;
  color: #eaf4e8;
}
.table-surface button.district-key[aria-pressed="true"] {
  border-color: var(--district);
  box-shadow: inset 0 0 0 1px var(--district);
  background: #31564e;
}
.district-key > i,
.district-badge > i {
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-style: normal;
  color: #183c3c;
  font-size: 12px;
  font-weight: 800;
}
.district-key span {
  min-width: 0;
}
.district-key strong {
  display: block;
  font-size: 12px;
}
.district-key small {
  display: block;
  font-size: 10px;
  color: #c3d8c4;
  white-space: nowrap;
  margin-top: 2px;
}
.district-panel > p {
  color: #bdcebe;
  font-size: 10px;
  margin: 9px 0 0;
}
.district-badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #315343;
  padding: 4px 7px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--district) 22%, #fffbed);
  margin: 7px 0 2px;
}
.district-badge > i {
  background: var(--district);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
}
.facility-badge {
  background: #e2e8d8;
  font-weight: 500;
}
.district-details {
  padding: 0 13px 14px;
}
.district-details > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.district-details > div:first-child > strong {
  font-size: 11px;
  color: #47664f;
}
.district-details p {
  color: #526b4e;
  font-size: 11px;
  margin: 8px 0;
}
.district-properties {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.table-surface button.district-property {
  background: #fffced;
  border-left: 5px solid var(--district);
  text-align: left;
  padding: 7px 8px;
  min-height: 45px;
  font-size: 11px;
}
.district-property strong,
.district-property small {
  display: block;
}
.district-property small {
  font-size: 10px;
  color: #768366;
  margin-top: 3px;
}
.table-surface button.district-property[aria-current="true"] {
  outline: 2px solid var(--district);
  outline-offset: -2px;
}
.decision-card .district-offer {
  font-size: 12px;
  margin: 6px 0;
}
@media (max-width: 550px) {
  .district-panel {
    padding: 10px;
    margin-bottom: 11px;
  }
  .district-heading strong {
    font-size: 12px;
  }
  .district-heading span {
    font-size: 10px;
  }
  .district-legend {
    gap: 5px;
  }
  .table-surface button.district-key {
    padding: 6px;
    gap: 5px;
    min-height: 45px;
  }
  .district-key > i {
    width: 24px;
    height: 24px;
  }
  .district-key strong {
    font-size: 11px;
  }
  .district-key small {
    font-size: 9px;
  }
  .city-tile .district {
    height: 9px;
    font-size: 8px;
  }
  .city-tile.property-tile {
    padding-top: 9px;
  }
  .city-tile.property-tile .building {
    height: 0;
    width: 68%;
  }
  .owner-marker {
    width: 13px;
    height: 13px;
    font-size: 7px;
  }
  .dice-stage {
    width: auto;
    height: auto;
    margin: 3px 0;
  }
  .dice-faces {
    gap: 9px;
    padding: 7px 8px;
  }
  .die-face {
    width: 43px;
    height: 43px;
    border-radius: 8px;
    padding: 7px;
    gap: 2px;
  }
  .die-pip {
    width: 6px;
    height: 6px;
  }
  .die-face.one .die-pip {
    width: 9px;
    height: 9px;
  }
  .die-unknown {
    font-size: 24px;
  }
  .dice-caption {
    font-size: 10px;
    margin-top: 8px;
    padding: 4px 8px;
  }
}
@media (min-width: 700px) and (orientation: landscape) {
  .city-layout .city-board {
    width: min(100%, calc(100dvh - 440px));
  }
  .city-center .dice-stage {
    width: auto;
    height: auto;
  }
  .city-center > .eyebrow {
    display: none;
  }
  .city-center h2 {
    font-size: 22px;
    margin: 4px 0;
  }
  .city-center p {
    font-size: 11px;
    padding: 8px;
    margin: 6px 0;
    max-height: 62px;
    overflow: auto;
  }
  .city-center .dice-faces {
    gap: 10px;
    padding: 6px 10px;
  }
  .city-center .die-face {
    width: 48px;
    height: 48px;
    padding: 7px;
    gap: 2px;
  }
  .city-center .die-pip {
    width: 7px;
    height: 7px;
  }
  .city-center .die-face.one .die-pip {
    width: 10px;
    height: 10px;
  }
  .city-center .dice-caption {
    font-size: 11px;
    padding: 4px 8px;
    margin-top: 8px;
  }
}
@media (min-width: 1000px) and (orientation: landscape) {
  .district-legend {
    grid-template-columns: repeat(6, 1fr);
  }
  .table-surface button.district-key {
    padding: 6px;
    gap: 5px;
  }
  .district-key > i {
    width: 22px;
    height: 25px;
    font-size: 11px;
  }
  .district-key strong {
    font-size: 11px;
  }
  .district-key small {
    font-size: 9px;
  }
}
@media (max-width: 550px) {
  .hand-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hand-cards small {
    display: none;
  }
  .hand-cards strong {
    font-size: 12px;
  }
  .hand-cards img {
    width: 64px;
    height: 58px;
  }
  .card-target p {
    font-size: 12px;
  }
  .card-target button[data-table-action] {
    font-size: 12px;
    min-height: 38px;
  }
  .city-map-scroll.zoomed .city-board {
    width: 660px;
    min-width: 660px;
    height: 660px;
  }
  .city-map-scroll.zoomed .city-tile strong {
    font-size: 10px;
  }
  .board-turn .map-zoom {
    font-size: 9px;
  }
  .city-center .eyebrow {
    display: none;
  }
}
