/* ═══════════════════════════════════════════════════════════════════════════
   It's Just Business — Authentic Tabletop Board Stylesheet
   Deep Perimeter Tiles, Bold Legible Names, Compact Center Stadium
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Board Master Container ──────────────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: 125px repeat(9, 1fr) 125px;
  grid-template-rows:    125px repeat(9, 1fr) 125px;
  width: min(850px, calc(100vh - 75px), calc(100vw - 520px));
  height: min(850px, calc(100vh - 75px), calc(100vw - 520px));
  aspect-ratio: 1 / 1;
  border: 4px solid var(--red);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgba(0,0,0,0.22), 0 4px 14px rgba(0,0,0,0.12);
  position: relative;
  overflow: hidden;
  user-select: none;
}

@media (max-width: 1024px) and (min-width: 681px) {
  .board {
    width: min(680px, calc(100vw - 20px));
    height: min(680px, calc(100vw - 20px));
    grid-template-columns: 95px repeat(9, 1fr) 95px;
    grid-template-rows:    95px repeat(9, 1fr) 95px;
  }
}

@media (max-width: 680px) {
  .board {
    width: min(96vw, calc(100vh - 165px), 390px);
    height: min(96vw, calc(100vh - 165px), 390px);
    border-width: 2.5px;
    border-radius: 8px;
    grid-template-columns: 48px repeat(9, 1fr) 48px;
    grid-template-rows:    48px repeat(9, 1fr) 48px;
  }

  .tile-name {
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
  }
  .tile-price {
    font-size: 7px !important;
    font-weight: 900 !important;
    padding: 1px 3px !important;
  }
  .tile-icon {
    font-size: 12px !important;
    line-height: 1 !important;
  }
  .tile-owner-banner {
    height: 11px !important;
    font-size: 7px !important;
    padding: 0 2px !important;
  }
  .tile--bottom .tile-band, .tile--top .tile-band { height: 10px !important; }
  .tile--left .tile-band, .tile--right .tile-band { width: 10px !important; }
  .tile--bottom .tile-content { padding-top: 11px !important; padding-bottom: 12px !important; }
  .tile--top .tile-content    { padding-top: 12px !important; padding-bottom: 11px !important; }
  .tile--left .tile-content   { padding-top: 2px !important; padding-bottom: 12px !important; padding-right: 11px !important; }
  .tile--right .tile-content  { padding-top: 2px !important; padding-bottom: 12px !important; padding-left: 11px !important; }

  .tile--corner { padding: 3px 2px !important; }
  .tile--corner .corner-icon { font-size: 20px !important; }
  .tile--corner .corner-title { font-size: 7.5px !important; font-weight: 900 !important; }
  .tile--corner .corner-sub { font-size: 6px !important; }

  .center-turn-pill { padding: 3px 8px !important; gap: 4px !important; }
  .center-turn-token { font-size: 16px !important; }
  .center-turn-name { font-size: 10.5px !important; }
  .center-turn-action { font-size: 8.5px !important; }

  .card-deck {
    width: 36px !important;
    height: 50px !important;
    border-radius: 5px !important;
  }
  .deck-icon { font-size: 14px !important; }
  .deck-title { font-size: 7px !important; }

  .die-box {
    width: 34px !important;
    height: 34px !important;
    border-width: 1.5px !important;
    padding: 3px !important;
  }
  .die-pip {
    width: 5px !important;
    height: 5px !important;
  }
  .center-roll-btn {
    padding: 5px 12px !important;
    font-size: 11px !important;
  }
}

/* ── Tile Structure (100% Upright, High Contrast) ────────────────────────── */
.tile {
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  box-sizing: border-box;
  overflow: hidden;
}
.tile:hover {
  background: var(--red-light);
  z-index: 20;
  box-shadow: 0 0 0 2px var(--red);
}

/* ── Inward-Facing Color Headers ─────────────────────────────────────────── */
.tile-band {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
/* Bottom row: Band at TOP of tile */
.tile--bottom .tile-band { top: 0; left: 0; right: 0; height: 18px; border-bottom: 1.5px solid rgba(0,0,0,0.15); }
/* Top row: Band at BOTTOM of tile */
.tile--top .tile-band    { bottom: 0; left: 0; right: 0; height: 18px; border-top: 1.5px solid rgba(0,0,0,0.15); }
/* Left col: Band at RIGHT of tile */
.tile--left .tile-band   { top: 0; bottom: 0; right: 0; width: 18px; border-left: 1.5px solid rgba(0,0,0,0.15); }
/* Right col: Band at LEFT of tile */
.tile--right .tile-band  { top: 0; bottom: 0; left: 0; width: 18px; border-right: 1.5px solid rgba(0,0,0,0.15); }

/* ── Tile Content Area (Always Upright, Bold & Clear) ────────────────────── */
.tile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 2;
  text-align: center;
  box-sizing: border-box;
}

.tile--bottom .tile-content { padding-top: 20px; padding-bottom: 22px; padding-left: 3px; padding-right: 3px; gap: 3px; }
.tile--top .tile-content    { padding-top: 22px; padding-bottom: 20px; padding-left: 3px; padding-right: 3px; gap: 3px; }
.tile--left .tile-content   { padding-top: 4px;  padding-bottom: 20px; padding-left: 6px; padding-right: 22px; gap: 3px; }
.tile--right .tile-content  { padding-top: 4px;  padding-bottom: 20px; padding-left: 22px; padding-right: 6px; gap: 3px; }

.tile-icon {
  font-size: 20px;
  line-height: 1;
}

.tile-name {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.18;
  text-align: center;
  word-break: normal;
  max-width: 96%;
}

.tile-price {
  font-size: 10.5px;
  font-weight: 900;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--red-light);
  padding: 1.5px 5px;
  border-radius: 4px;
}

/* ── Corner Tiles (START, JAIL, REST HOUSE, POLICE) ──────────────────────── */
.tile--corner {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  gap: 4px;
  text-align: center;
  border: 1.5px solid var(--border);
}
.tile--corner .corner-icon {
  font-size: 36px;
  line-height: 1;
}
.tile--corner .corner-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.tile--corner .corner-sub {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

/* ── House & Hotel Markers ───────────────────────────────────────────────── */
.tile-buildings {
  position: absolute;
  display: flex;
  gap: 2px;
  z-index: 5;
}
.tile--bottom .tile-buildings { top: 2px; left: 50%; transform: translateX(-50%); }
.tile--top .tile-buildings    { bottom: 2px; left: 50%; transform: translateX(-50%); }
.tile--left .tile-buildings   { top: 50%; right: 3px; transform: translateY(-50%); flex-direction: column; }
.tile--right .tile-buildings  { top: 50%; left: 3px; transform: translateY(-50%); flex-direction: column; }

.house-marker {
  width: 9px; height: 9px;
  background: #16a34a;
  border: 1px solid #14532d;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.hotel-marker {
  width: 16px; height: 10px;
  background: #dc2626;
  border: 1.5px solid #7f1d1d;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* ── Prominent Horizontal Ownership Pill Badge ────────────────────────────── */
.tile-owner-banner {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  border-radius: 3px;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.tile--bottom .tile-owner-banner { bottom: 2px; left: 3px; right: 3px; height: 16px; }
.tile--top .tile-owner-banner    { top: 2px; left: 3px; right: 3px; height: 16px; }
.tile--left .tile-owner-banner   { bottom: 2px; left: 3px; right: 20px; height: 16px; }
.tile--right .tile-owner-banner  { bottom: 2px; left: 20px; right: 3px; height: 16px; }

.tile.mortgaged { opacity: 0.65; }
.tile.mortgaged::after {
  content: 'MORTGAGED';
  position: absolute;
  inset: 0;
  background: rgba(139,0,0,0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* ── Compact Inner Center Stadium ────────────────────────────────────────── */
.board-center {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at center, var(--bg-card) 0%, var(--bg-panel) 100%);
  border: 1.5px solid var(--border-soft);
  position: relative;
  padding: 12px 14px;
  overflow: hidden;
}

/* Top Center Header */
.center-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  z-index: 10;
}

.center-turn-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid var(--red);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.center-turn-pill.my-turn {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}
[data-theme="dark"] .center-turn-pill.my-turn {
  background: #052e16;
  border-color: #22c55e;
}

.center-turn-token { font-size: 20px; line-height: 1; }
.center-turn-name { font-size: 12.5px; font-weight: 900; color: var(--text); }
.center-turn-action { font-size: 10.5px; font-weight: 700; color: var(--red); }
.center-turn-pill.my-turn .center-turn-action { color: #16a34a; }

.center-pot-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--gold-light);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

/* Middle Center: Decks & Tactile 3D Dice Arena */
.center-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  margin: auto 0;
  z-index: 10;
  gap: 16px;
}

.card-deck {
  width: 52px;
  height: 74px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  flex-shrink: 0;
}
.card-deck:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 20px rgba(0,0,0,0.22); }
.deck--chance, .deck--kismat {
  background: linear-gradient(135deg, #b8860b 0%, #d4af37 100%);
  color: #fff;
  border: 2px solid #fff;
  transform: rotate(-4deg);
}
.deck--community, .deck--khazana {
  background: linear-gradient(135deg, #8b0000 0%, #b91c1c 100%);
  color: #fff;
  border: 2px solid #fff;
  transform: rotate(4deg);
}
.deck-icon { font-size: 20px; line-height: 1; }
.deck-title { font-family: var(--font-display); font-size: 8.5px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── 3D Dice Display Arena ───────────────────────────────────────────────── */
.dice-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dice-pair {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.die-box {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 2px solid var(--red);
  border-radius: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.14);
  transition: transform 0.15s;
}
[data-theme="dark"] .die-box {
  background: #181824;
  border-color: #ef4444;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.die-pip {
  width: 7.5px;
  height: 7.5px;
  background: var(--red);
  border-radius: 50%;
  justify-self: center;
  align-self: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
[data-theme="dark"] .die-pip { background: #ef4444; }

.die-box.rolling {
  animation: diceRollPhysics 0.65s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes diceRollPhysics {
  0%   { transform: rotate(0deg) scale(1) translateY(0); }
  25%  { transform: rotate(-35deg) scale(1.15) translateY(-12px); }
  50%  { transform: rotate(25deg) scale(1.1) translateY(-6px); }
  75%  { transform: rotate(-15deg) scale(1.05) translateY(-2px); }
  100% { transform: rotate(0deg) scale(1) translateY(0); }
}

.roll-status-badge {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--text);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 2px 10px;
  box-shadow: var(--shadow-sm);
}

/* Center Roll Button */
.center-roll-btn {
  background: var(--red);
  color: #fff;
  border: 2px solid var(--red-hover);
  padding: 7px 18px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139,0,0,0.35);
  transition: transform 0.1s, background var(--transition), box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.center-roll-btn:hover {
  background: var(--red-hover);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(139,0,0,0.45);
}
.center-roll-btn:active { transform: translateY(1px); }

.board-center-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 160px;
  font-weight: 900;
  color: var(--border-soft);
  opacity: 0.15;
  pointer-events: none;
  font-family: var(--font-display);
  z-index: 1;
}

/* ── Player Pawns ────────────────────────────────────────────────────────── */
.pawn-cluster {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
}

.pawn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  cursor: default;
}
.pawn.moving {
  transform: scale(1.4) translateY(-6px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 30;
}
