/* Shared table styling: dominoes, Mexican Train, Chicken Foot */

#game.cg-domino-game {
  --dm-tile-w: 40px;
  --dm-tile-h: 76px;
  --dm-tile-chain-w: 76px;
  --dm-tile-chain-h: 40px;
  --dm-slot-min-w: 46px;
  --dm-slot-min-h: 92px;
  --dm-pip-max-w: 28px;
  --dm-pip-max-h: 44px;
  --dm-pip-chain-max-w: 40px;
  --dm-pip-chain-max-h: 28px;
  --dm-pip-dot-max: 9px;
}

.dm-lobby-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.dm-lobby-icon {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

.dm-lobby-brand .logo.dm-lobby-title {
  font-family: var(--font);
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #f0fdf4;
  text-shadow: 0 2px 24px rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, #ecfdf5 0%, #a7f3d0 45%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dm-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dm-topbar-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.dm-topbar-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--accent-light);
}

.dm-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: min(960px, 96vw);
  margin-left: auto;
  margin-right: auto;
}
.dm-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.45;
}
.dm-chain-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}
.dm-chain-scroll {
  width: 100%;
  min-height: 88px;
  overflow-x: auto;
  padding: 14px 12px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(6, 78, 59, 0.5) 0%, rgba(15, 23, 42, 0.75) 100%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(52, 211, 153, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.35);
}
.dm-chain-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-height: 96px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.dm-chain-slot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--dm-slot-min-w, 46px);
  min-height: var(--dm-slot-min-h, 92px);
  padding: 0 3px;
}

.dm-tile {
  flex-shrink: 0;
  width: var(--dm-tile-w, 40px);
  height: var(--dm-tile-h, 76px);
  border-radius: 8px;
  background: linear-gradient(165deg, #fffef9 0%, #f0e8d8 48%, #e4d8c4 100%);
  border: 1px solid #5c4838;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -3px 6px rgba(80, 60, 45, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  color: #1a1410;
}

.dm-tile.dm-tile-chain {
  flex-direction: row;
  width: var(--dm-tile-chain-w, 76px);
  height: var(--dm-tile-chain-h, 40px);
}

.dm-tile-half {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  min-height: 0;
}

.dm-tile-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, #4a3b2e 15%, #4a3b2e 85%, transparent);
  opacity: 0.95;
  flex-shrink: 0;
}
.dm-tile-chain .dm-tile-bar.dm-tile-bar-v {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #4a3b2e 15%, #4a3b2e 85%, transparent);
}

.dm-pip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  width: 100%;
  height: 100%;
  max-width: var(--dm-pip-max-w, 28px);
  max-height: var(--dm-pip-max-h, 44px);
  margin: auto;
}

.dm-tile-chain .dm-pip-grid {
  max-width: var(--dm-pip-chain-max-w, 40px);
  max-height: var(--dm-pip-chain-max-h, 28px);
}

.dm-pip-empty,
.dm-pip-dot {
  place-self: center;
  width: 70%;
  height: 70%;
  max-width: var(--dm-pip-dot-max, 9px);
  max-height: var(--dm-pip-dot-max, 9px);
  min-width: 3px;
  min-height: 3px;
}

.dm-pip-dot {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4a4540, #0f0c0b 70%);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.4);
}

.dm-pip-empty {
  visibility: hidden;
}

.dm-pip-num-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.dm-pip-num {
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #1a1410;
}

.dm-tile-chain .dm-pip-num {
  font-size: 0.8rem;
}

.dm-hand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 14px 8px;
  width: 100%;
}
.dm-tile.dm-hand {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.dm-tile.dm-hand:hover {
  transform: translateY(-3px);
  filter: brightness(1.03);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    0 10px 22px rgba(0, 0, 0, 0.4);
}
.dm-tile.dm-hand.selected {
  outline: 3px solid rgba(56, 189, 248, 0.95);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    0 0 0 4px rgba(56, 189, 248, 0.22);
}
.dm-tile.dm-hand.pickable-src {
  box-shadow:
    inset 0 0 0 2px rgba(52, 211, 153, 0.65),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 4px 12px rgba(16, 185, 129, 0.2);
}

.dm-tile.dm-tile-chain.dm-chain-arm {
  transform: none;
}

.dm-chain-slot--opener {
  min-width: calc(var(--dm-slot-min-w, 46px) + 2px);
}

/* All domino table games — narrow side rails, board uses center column */
#game.cg-domino-game {
  max-width: min(1480px, 100%);
  --cg-players-rail-w: clamp(132px, 12vw, 188px);
  --cg-log-rail-w: clamp(148px, 14vw, 208px);
}

/* Chicken Foot, Mexican Train, Dominoes — board fills height; hand in bottom dock */
#game.cg-domino-spread {
  --cg-players-rail-w: clamp(108px, 10vw, 152px);
  --cg-log-rail-w: clamp(124px, 11.5vw, 176px);
  /* Table chain — scales up on large screens */
  --dm-chain-v-w: clamp(28px, 3.6vmin, 40px);
  --dm-chain-v-h: clamp(50px, 6.4vmin, 72px);
  --dm-chain-h-w: clamp(50px, 6.4vmin, 72px);
  --dm-chain-h-h: clamp(28px, 3.6vmin, 40px);
  --dm-slot-min-w: clamp(30px, 3.8vmin, 44px);
  --dm-slot-min-h: clamp(52px, 6.6vmin, 76px);
  --dm-chain-pip-max-w: clamp(18px, 2.4vmin, 28px);
  --dm-chain-pip-max-h: clamp(26px, 3.2vmin, 40px);
  --dm-chain-pip-hz-max-w: clamp(26px, 3.2vmin, 40px);
  --dm-chain-pip-hz-max-h: clamp(18px, 2.4vmin, 28px);
  --dm-chain-pip-dot-max: clamp(5px, 0.65vmin, 8px);
  /* Your hand (larger, easier to tap) */
  --dm-hand-w: 38px;
  --dm-hand-h: 72px;
  --dm-hand-pip-max-w: 26px;
  --dm-hand-pip-max-h: 40px;
  --dm-hand-pip-dot-max: 8px;
}

#game.cg-domino-spread .cg-game-layout {
  flex: 1 1 0;
  min-height: 0;
}

#game.cg-domino-spread .cg-game-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

#game.cg-domino-spread .cg-game-body > .table-area {
  grid-row: 1;
  min-height: 0;
}

#game.cg-domino-spread .cg-game-body > .error-msg,
#game.cg-domino-spread .cg-game-body > p.error-msg {
  grid-row: 2;
  margin: 0;
  padding: 2px 8px 0;
}

#game.cg-domino-spread .cg-game-body > .cg-domino-hand-dock {
  grid-row: 3;
  margin-top: 0;
}

/* Before spread layout runs, keep lobby status compact */
#game.cg-domino-spread .table-area > .status-zone:not(.cg-board-status) {
  flex-shrink: 0;
  padding: 4px 8px;
  margin: 0 0 4px;
}

#game.cg-domino-spread .table-area {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 4px 8px 2px;
}

#game.cg-domino-spread .table-area .status-zone,
#game.cg-domino-spread .dm-wrap > .status-zone.cg-board-status {
  flex-shrink: 0;
}

/* Compact turn + hint strip (domino spread boards) */
#game.cg-domino-spread .dm-wrap > .status-zone.cg-board-status {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  width: 100%;
  margin: 0 0 4px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

#game.cg-domino-spread .cg-board-status .turn-text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

#game.cg-domino-spread .cg-board-status .winner-text {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

#game.cg-domino-spread .cg-board-status .winner-text:empty {
  display: none;
}

#game.cg-domino-spread .cg-board-status .direction-text {
  margin: 0;
  flex: 1 1 100%;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

#game.cg-domino-spread .dm-wrap {
  position: relative;
  max-width: none;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  gap: 2px;
  display: flex;
  flex-direction: column;
}

#game.cg-domino-spread .dm-wrap > .dm-chain-label {
  display: none;
}

#game.cg-domino-spread .dm-wrap:has(.cg-board-status) .dm-meta {
  display: none;
}

#game.cg-domino-spread .dm-meta {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: auto;
  max-width: min(420px, 72%);
  z-index: 4;
  margin: 0;
  padding: 3px 7px;
  font-size: 9px;
  line-height: 1.25;
  text-align: left;
  pointer-events: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
}

#game.cg-domino-spread .dm-chain-scroll {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 8px 8px;
  display: block;
  align-content: stretch;
}

#game.cg-domino-spread .dm-chain-row {
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-height: min(100%, 100%);
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
}

#game.cg-domino-spread .dm-chain-row.mt-board-host,
#game.cg-domino-spread .dm-chain-row.cf-board-host {
  display: block;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  width: max-content;
  min-width: max-content;
  max-width: none;
  min-height: max-content;
  margin: 0 auto;
  padding: 4px;
  box-sizing: border-box;
}

#game.cg-domino-spread .dm-chain-row.mt-board-host .mt-board,
#game.cg-domino-spread .dm-chain-row.cf-board-host .cf-board {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

#game.cg-domino-spread .dm-chain-slot {
  min-width: var(--dm-slot-min-w);
  min-height: var(--dm-slot-min-h);
  padding: 0 1px;
}

/* Chain tiles only (not hand) */
#game.cg-domino-spread .dm-chain-slot .dm-tile {
  width: var(--dm-chain-v-w);
  height: var(--dm-chain-v-h);
}

#game.cg-domino-spread .dm-chain-slot .dm-tile.dm-tile-chain {
  width: var(--dm-chain-h-w);
  height: var(--dm-chain-h-h);
}

#game.cg-domino-spread .dm-chain-slot .dm-pip-grid {
  max-width: var(--dm-chain-pip-max-w);
  max-height: var(--dm-chain-pip-max-h);
}

#game.cg-domino-spread .dm-chain-slot .dm-tile-chain .dm-pip-grid {
  max-width: var(--dm-chain-pip-hz-max-w);
  max-height: var(--dm-chain-pip-hz-max-h);
}

#game.cg-domino-spread .dm-chain-slot .dm-pip-empty,
#game.cg-domino-spread .dm-chain-slot .dm-pip-dot {
  max-width: var(--dm-chain-pip-dot-max);
  max-height: var(--dm-chain-pip-dot-max);
}

#game.cg-domino-spread .dm-chain-slot .dm-pip-num {
  font-size: 0.65rem;
}

#game.cg-domino-spread .dm-chain-slot .dm-tile-bar {
  height: 2px;
}

#game.cg-domino-spread .dm-chain-slot .dm-tile-chain .dm-tile-bar.dm-tile-bar-v {
  width: 2px;
}

/* Bottom hand dock — one compact row at the viewport bottom */
#game.cg-domino-spread .cg-domino-hand-dock {
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2px 8px max(2px, env(safe-area-inset-bottom, 0px));
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  min-height: 0;
  max-height: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.94) 0%, rgba(6, 9, 18, 0.99) 100%);
  box-sizing: border-box;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  backdrop-filter: none;
}

#game.cg-domino-spread .cg-domino-hand-dock #dmEndPick {
  flex-shrink: 0;
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
}

#game.cg-domino-spread .cg-domino-hand-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 8px 12px;
  min-height: 0;
  width: 100%;
}

#game.cg-domino-spread .cg-domino-hand-dock .section-title,
#game.cg-domino-spread .cg-domino-hand-dock .cg-domino-hand-label {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 2px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  align-self: flex-end;
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-actions {
  flex: 0 0 auto;
  margin: 0 0 2px;
  align-self: flex-end;
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row {
  flex: 1 1 auto;
  min-height: calc(var(--dm-hand-h) + 2px);
  max-height: calc(var(--dm-hand-h) + 6px);
  gap: 8px;
  padding: 0 2px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-end;
  -webkit-overflow-scrolling: touch;
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row .dm-tile.dm-hand {
  width: var(--dm-hand-w);
  height: var(--dm-hand-h);
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row .dm-pip-grid {
  max-width: var(--dm-hand-pip-max-w);
  max-height: var(--dm-hand-pip-max-h);
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row .dm-pip-empty,
#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row .dm-pip-dot {
  max-width: var(--dm-hand-pip-dot-max);
  max-height: var(--dm-hand-pip-dot-max);
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-hand-row .dm-pip-num {
  font-size: 0.88rem;
}

#game.cg-domino-spread .cg-domino-hand-dock .dm-tile.dm-hand.selected {
  outline-width: 2px;
}

/* Players rail — compact list at top; free space goes to the center board */
#game.cg-domino-spread .cg-game-players-rail {
  align-items: flex-start;
}

#game.cg-domino-spread .cg-game-players-rail > .panel {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  align-self: stretch;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  padding: 8px 8px 6px;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow-y: auto;
}

#game.cg-domino-spread .cg-game-players-rail .section-title {
  margin-bottom: 6px;
  font-size: 11px;
}

#game.cg-domino-spread .cg-game-players-rail .players-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-template-columns: 1fr;
  overflow: visible;
  min-height: 0;
  flex: 0 0 auto;
}

#game.cg-domino-spread .cg-game-players-rail .player-card {
  padding: 7px 8px;
}

#game.cg-domino-spread .cg-game-players-rail .player-name {
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 3px;
}

#game.cg-domino-spread .cg-game-players-rail .player-stats {
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  #game.cg-domino-spread {
    --dm-chain-v-w: 24px;
    --dm-chain-v-h: 44px;
    --dm-chain-h-w: 44px;
    --dm-chain-h-h: 24px;
    --dm-slot-min-w: 28px;
    --dm-slot-min-h: 48px;
    --dm-hand-w: 32px;
    --dm-hand-h: 60px;
    --dm-hand-pip-max-w: 22px;
    --dm-hand-pip-max-h: 34px;
  }

  #game.cg-domino-spread .table-area {
    padding: 2px 6px 0;
  }

  #game.cg-domino-spread .cg-domino-hand-dock {
    padding: 2px 6px max(2px, env(safe-area-inset-bottom, 0px));
  }

  #game.cg-domino-spread .cg-domino-hand-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Mexican Train hub layout */
.mt-board-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px;
  text-align: center;
}

.mt-board {
  position: relative;
  margin: 0 auto;
  overflow: visible;
  flex-shrink: 0;
}

.mt-hub-slot,
.mt-node-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.mt-hub-slot .dm-tile,
.mt-node-slot .dm-tile {
  width: var(--dm-chain-v-w, 26px);
  height: var(--dm-chain-v-h, 44px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.mt-node-slot .dm-tile.dm-tile-chain {
  width: var(--dm-chain-h-w, 44px);
  height: var(--dm-chain-h-h, 26px);
}

.mt-hub-slot .dm-tile {
  outline: 2px solid rgba(56, 189, 248, 0.55);
}

.mt-node-double .dm-tile {
  outline: 1px solid rgba(250, 204, 21, 0.5);
}

.mt-open-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.mt-open-mexican {
  border-color: rgba(244, 114, 182, 0.7);
  color: #fbcfe8;
}

.mt-open-hub-start {
  border-color: rgba(56, 189, 248, 0.65);
  color: #bae6fd;
}

.mt-open-double {
  border-color: rgba(250, 204, 21, 0.75);
  color: #fde68a;
}

.mt-open-legal {
  border-style: solid;
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.85);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
}

.mt-open-legal:hover {
  background: rgba(16, 185, 129, 0.9);
}

.mt-mexican-badge,
.mt-double-badge {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

.mt-mexican-badge {
  background: rgba(131, 24, 67, 0.85);
  color: #fbcfe8;
}

.mt-double-badge {
  background: rgba(120, 53, 15, 0.88);
  color: #fde68a;
  bottom: 36px;
}

.mt-train-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 0;
  pointer-events: none;
}

.mt-mexican-label {
  color: #fbcfe8;
  background: rgba(131, 24, 67, 0.72);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(244, 114, 182, 0.55);
  z-index: 2;
}

.mt-tracks {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 0;
}

.mt-track-mexican {
  filter: drop-shadow(0 0 4px rgba(244, 114, 182, 0.45));
}

.mt-track-own {
  filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.35));
}

.mt-node-slot.mt-private-train .dm-tile {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 0 1px color-mix(in srgb, var(--mt-seat-color, #94a3b8) 55%, transparent);
}

.mt-node-slot.mt-mexican-train .dm-tile {
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(244, 114, 182, 0.65);
}

.mt-node-slot.mt-train-own .dm-tile {
  outline: 2px solid rgba(52, 211, 153, 0.55);
  outline-offset: 1px;
}

.mt-node-slot.mt-train-marked .dm-tile {
  outline: 1px dashed rgba(250, 204, 21, 0.75);
  outline-offset: 1px;
}

.mt-train-token {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.mt-train-token-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  background: rgba(15, 23, 42, 0.92);
  border: 2px solid var(--mt-seat-color, #94a3b8);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.mt-train-token-mexican .mt-train-token-icon {
  width: 38px;
  height: 38px;
  font-size: 18px;
  border-color: var(--mt-mexican-color, #f472b6);
  background: rgba(88, 28, 58, 0.92);
  color: #fbcfe8;
}

.mt-train-token-pip {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  color: #0f172a;
  background: var(--mt-seat-color, #e2e8f0);
  border: 1px solid rgba(15, 23, 42, 0.5);
}

.mt-train-token-cap {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #e2e8f0;
  max-width: 72px;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.mt-train-token-mexican .mt-train-token-cap {
  color: #fbcfe8;
}

.mt-train-token-own .mt-train-token-icon {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.4);
}

.mt-open-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-direction: column;
  min-width: 32px;
  min-height: 32px;
  padding: 4px 6px;
}

.mt-open-slot-icon {
  font-size: 11px;
  line-height: 1;
  opacity: 0.95;
}

.mt-open-slot-pip {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.mt-open-hub-start {
  border-color: var(--mt-seat-color, rgba(56, 189, 248, 0.65));
  background: rgba(15, 23, 42, 0.88);
}

.mt-open-hub-start .mt-open-slot-icon {
  font-size: 14px;
}

.mt-open-mexican {
  border-width: 2px;
  border-style: solid;
  border-color: var(--mt-mexican-color, #f472b6);
  background: rgba(88, 28, 58, 0.9);
  color: #fbcfe8;
  min-width: 36px;
}

.mt-open-mexican .mt-open-slot-icon {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.mt-open-train-end {
  border-color: var(--mt-seat-color, rgba(148, 163, 184, 0.55));
}

.mt-train-label {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid color-mix(in srgb, var(--mt-seat-color, #64748b) 50%, transparent);
  color: color-mix(in srgb, var(--mt-seat-color, #cbd5e1) 85%, #fff);
  z-index: 2;
}

/* Chicken Foot spider board */
#game.cg-domino-spread .dm-chain-row.cf-board-host,
#game.cg-domino-spread .dm-chain-scroll:has(.cf-board) {
  align-items: center;
  justify-content: center;
}

.cf-board-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px;
  text-align: center;
}

.cf-board {
  position: relative;
  margin: 0 auto;
}

.cf-node-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.cf-node-slot .dm-tile {
  width: var(--dm-chain-v-w, 26px);
  height: var(--dm-chain-v-h, 44px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cf-node-slot .dm-tile.dm-tile-chain {
  width: var(--dm-chain-h-w, 44px);
  height: var(--dm-chain-h-h, 26px);
}

.cf-node-double .dm-tile {
  outline: 1px solid rgba(250, 204, 21, 0.45);
}

.cf-open-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 999px;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
  line-height: 1;
}

.cf-open-leg {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fde68a;
}

.cf-open-legal {
  border-style: solid;
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.85);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
}

.cf-open-legal:hover {
  background: rgba(16, 185, 129, 0.9);
}

.cf-legs-badge {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(120, 53, 15, 0.88);
  color: #fde68a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

.dm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.dm-actions.hidden {
  display: none !important;
}
