:root {
  --board-size: 760px;
  --corner-size: 104px;
  --tile-width: 61.33px;
  --tile-height: 104px;
  --board-bg: #cde6d0;
  --board-border: #1e293b;
  --rot-x: 46deg;
  --rot-z: -45deg;
  --zoom: 0.92;
  --pan-x: 0px;
  --pan-y: 12px;
}

* {
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at 30% 35%, #162238 0%, #0b1120 65%, #060913 100%);
  color: #f8fafc;
  overflow-x: hidden;
  margin: 0;
}

/* ================= 3D PERSPECTIVE STAGE ================= */
.stage-viewport {
  perspective: 1700px;
  perspective-origin: 50% 44%;
  overflow: hidden;
  position: relative;
  cursor: grab;
}
.stage-viewport:active {
  cursor: grabbing;
}

.board-world {
  width: var(--board-size);
  height: var(--board-size);
  position: relative;
  transform-style: preserve-3d;
  transform: translate3d(var(--pan-x), var(--pan-y), 0px)
             scale(var(--zoom))
             rotateX(var(--rot-x))
             rotateZ(var(--rot-z));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Extruded 3D Board Base */
.board-surface {
  width: 100%;
  height: 100%;
  background: var(--board-bg);
  border: 6px solid #182232;
  border-radius: 10px;
  position: relative;
  transform-style: preserve-3d;
  box-shadow:
    -12px 12px 0px #0f172a,
    -22px 22px 0px #090d16,
    -35px 38px 55px rgba(0, 0, 0, 0.78),
    inset 0 0 35px rgba(20, 60, 35, 0.14);
}

/* Side Thickness Lips for 3D Slab Feel */
.board-surface::before {
  content: '';
  position: absolute;
  left: -6px;
  bottom: -24px;
  width: calc(100% + 12px);
  height: 20px;
  background: linear-gradient(90deg, #1e293b, #334155);
  transform-origin: top;
  transform: rotateX(-90deg);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.board-surface::after {
  content: '';
  position: absolute;
  left: -24px;
  top: -6px;
  width: 20px;
  height: calc(100% + 12px);
  background: linear-gradient(180deg, #0f172a, #1e293b);
  transform-origin: right;
  transform: rotateY(90deg);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Center Classic Artwork */
.board-center {
  position: absolute;
  top: var(--corner-size);
  left: var(--corner-size);
  width: calc(var(--board-size) - 2 * var(--corner-size) - 12px);
  height: calc(var(--board-size) - 2 * var(--corner-size) - 12px);
  background: radial-gradient(circle, #d6ecd9 0%, #bfe0c4 100%);
  border: 2px solid #1e293b;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monopoly-banner {
  transform: rotate(-45deg) translateZ(3px);
  background: linear-gradient(180deg, #ef233c 0%, #c1121f 100%);
  border: 4px solid #ffffff;
  outline: 3px solid #111827;
  padding: 12px 34px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  text-align: center;
}
.monopoly-banner span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 44px;
  letter-spacing: 5px;
  color: #ffffff;
  text-shadow: 2px 3px 0px #111827;
  display: block;
  line-height: 1;
}
.monopoly-sub {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fef08a;
  text-transform: uppercase;
  margin-top: 4px;
}

/* 3D Stacked Card Decks on Center */
.deck-stack-3d {
  position: absolute;
  width: 112px;
  height: 74px;
  transform-style: preserve-3d;
  pointer-events: none;
}
.deck-chest {
  top: 64px;
  left: 52px;
  transform: rotate(-45deg);
}
.deck-chance {
  bottom: 64px;
  right: 52px;
  transform: rotate(-45deg);
}

.deck-tray {
  position: absolute;
  inset: 0;
  border: 2px dashed #1e293b;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.08);
  transform: translateZ(1px);
}

.deck-body {
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  transform-style: preserve-3d;
  transform: translateZ(10px);
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1.5px solid #1e293b;
  box-shadow:
    -2px 2px 0 #cbd5e1,
    -4px 4px 0 #94a3b8,
    -7px 8px 14px rgba(0, 0, 0, 0.42);
}
.deck-body::before {
  content: '';
  position: absolute;
  left: -1px;
  bottom: -10px;
  width: calc(100% + 2px);
  height: 10px;
  background: repeating-linear-gradient(
    to bottom,
    #f8fafc 0px,
    #cbd5e1 1.5px,
    #f1f5f9 3px
  );
  border-left: 1px solid #334155;
  border-right: 1px solid #334155;
  border-bottom: 1px solid #1e293b;
  transform-origin: top;
  transform: rotateX(-90deg);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.deck-body::after {
  content: '';
  position: absolute;
  left: -10px;
  top: -1px;
  width: 10px;
  height: calc(100% + 2px);
  background: repeating-linear-gradient(
    to right,
    #e2e8f0 0px,
    #94a3b8 1.5px,
    #cbd5e1 3px
  );
  border-top: 1px solid #334155;
  border-bottom: 1px solid #334155;
  border-left: 1px solid #1e293b;
  transform-origin: right;
  transform: rotateY(90deg);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.deck-card-mid {
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  border: 1.5px solid #1e293b;
  transform: translateZ(12px) rotate(1.8deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.deck-top-card {
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  border: 2px solid #ffffff;
  outline: 1.5px solid #1e293b;
  transform: translateZ(15px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease;
}

.deck-chest .deck-card-mid,
.deck-chest .deck-top-card {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #ffffff;
}
.deck-chance .deck-card-mid,
.deck-chance .deck-top-card {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #ffffff;
}

.deck-stack-3d.drawing .deck-top-card {
  animation: deckCardDraw 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes deckCardDraw {
  0% { transform: translateZ(15px) translateY(0) scale(1); }
  45% { transform: translateZ(46px) translateY(-14px) rotateZ(-6deg) scale(1.08); }
  100% { transform: translateZ(15px) translateY(0) scale(1); }
}

/* Free Parking Pot Badge in Center */
.pot-indicator {
  position: absolute;
  top: 52px;
  right: 52px;
  transform: rotate(-45deg) translateZ(4px);
  background: rgba(15, 23, 42, 0.88);
  border: 2px solid #facc15;
  color: #fef08a;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  text-align: center;
}

/* ================= TILES ================= */
.tile {
  position: absolute;
  background: #e6f3e8;
  border: 1.5px solid #1e293b;
  color: #0f172a;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tile:hover {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #f59e0b;
}
.tile.mortgaged {
  background: #cbd5e1 !important;
}
.tile.mortgaged .color-bar {
  filter: grayscale(0.75) brightness(0.75);
}
.tile.mortgaged .tile-name,
.tile.mortgaged .tile-price,
.tile.mortgaged .tile-icon {
  opacity: 0.45;
}
.tile.mortgaged::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(15, 23, 42, 0.16) 0px,
    rgba(15, 23, 42, 0.16) 4px,
    transparent 4px,
    transparent 8px
  );
  transform: translateZ(1px);
  pointer-events: none;
}
.tile.mortgaged::after {
  content: 'HIPOTECA';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 54%;
  transform: translateY(-50%) translateZ(2.5px);
  padding: 2px 0;
  text-align: center;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #ef4444;
  border-radius: 3px;
  color: #fca5a5;
  font-weight: 900;
  font-size: 7.5px;
  letter-spacing: 0.4px;
  pointer-events: none;
}

/* Edge Orientations */
.tile-bottom {
  width: var(--tile-width);
  height: var(--tile-height);
  bottom: 0;
}
.tile-left {
  width: var(--tile-width);
  height: var(--tile-height);
  transform-origin: center center;
}
.tile-top {
  width: var(--tile-width);
  height: var(--tile-height);
  top: 0;
}
.tile-right {
  width: var(--tile-width);
  height: var(--tile-height);
  transform-origin: center center;
}

.tile-corner {
  width: var(--corner-size);
  height: var(--corner-size);
  background: #dff0e2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
}

.color-bar {
  height: 22px;
  width: 100%;
  border-bottom: 1.5px solid #1e293b;
  position: relative;
  transform-style: preserve-3d;
}

.tile-name {
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  padding: 3px 2px 0;
  text-transform: uppercase;
  letter-spacing: -0.2px;
}

.tile-icon {
  font-size: 18px;
  line-height: 1;
  text-align: center;
  margin: auto 0;
}

.tile-price {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding-bottom: 5px;
  color: #1e293b;
}

/* Owner Bunting Flag (Bandeirinha de São João) */
.owner-marker {
  position: absolute;
  left: 50%;
  margin-left: -15px;
  bottom: -19px;
  width: 30px;
  height: 22px;
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(0, 0, 0, 0.24) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 64%, 0 100%);
  transform: translateZ(4px);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* ================= 3D RELIEF HOUSES & HOTELS ================= */
.buildings-rack {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.b-shadow {
  position: absolute;
  inset: -2px;
  background: radial-gradient(ellipse at center, rgba(2, 6, 23, 0.55) 20%, transparent 78%);
  transform: translateZ(0.5px);
  pointer-events: none;
}

/* --- 3D House Miniature (walls + gabled pitched roof) --- */
.house-3d {
  width: 11px;
  height: 11px;
  position: relative;
  transform-style: preserve-3d;
  animation: popBuild 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.h-wall {
  position: absolute;
  border: 0.5px solid #052e16;
}

.h-front {
  width: 11px;
  height: 8px;
  left: 0;
  bottom: 0;
  transform-origin: bottom;
  transform: rotateX(-90deg);
  background:
    linear-gradient(90deg, transparent 2px, #fef08a 2px, #fef08a 4px, transparent 4px, transparent 7px, #fef08a 7px, #fef08a 9px, transparent 9px) 0 2px / 11px 2.5px no-repeat,
    linear-gradient(90deg, transparent 4.5px, #052e16 4.5px, #052e16 6.5px, transparent 6.5px) 0 5px / 11px 3px no-repeat,
    linear-gradient(180deg, #22c55e, #15803d);
}

.h-back {
  width: 11px;
  height: 8px;
  left: 0;
  top: 0;
  transform-origin: top;
  transform: rotateX(90deg);
  background:
    linear-gradient(90deg, transparent 2px, #fde047 2px, #fde047 4px, transparent 4px, transparent 7px, #fde047 7px, #fde047 9px, transparent 9px) 0 2px / 11px 2.5px no-repeat,
    linear-gradient(180deg, #16a34a, #14532d);
}

.h-left {
  width: 13px;
  height: 11px;
  left: 0;
  top: 0;
  transform-origin: left;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #14532d, #15803d);
  clip-path: polygon(0 0, 62% 0, 100% 50%, 62% 100%, 0 100%);
}

.h-right {
  width: 13px;
  height: 11px;
  right: 0;
  top: 0;
  transform-origin: right;
  transform: rotateY(90deg);
  background: linear-gradient(270deg, #16a34a, #22c55e);
  clip-path: polygon(100% 0, 38% 0, 0 50%, 38% 100%, 100% 100%);
}

.h-roof {
  position: absolute;
  left: -0.5px;
  width: 12px;
  height: 7.6px;
  border: 0.6px solid #052e16;
  border-radius: 1px;
}

.h-roof-front {
  bottom: 0;
  transform-origin: bottom;
  transform: translateZ(8px) rotateX(-41deg);
  background: linear-gradient(180deg, #4ade80, #16a34a);
}

.h-roof-back {
  top: 0;
  transform-origin: top;
  transform: translateZ(8px) rotateX(41deg);
  background: linear-gradient(0deg, #22c55e, #15803d);
}

/* --- 3D Hotel Miniature (tall 2-story building + pitched roof + H) --- */
.hotel-3d {
  width: 26px;
  height: 15px;
  position: relative;
  transform-style: preserve-3d;
  animation: popBuild 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ht-wall {
  position: absolute;
  border: 0.6px solid #450a0a;
}

.ht-front {
  width: 26px;
  height: 14px;
  left: 0;
  bottom: 0;
  transform-origin: bottom;
  transform: rotateX(-90deg);
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, #fef08a 3px 6px, transparent 6px 8px) 1px 2px / 24px 3px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 3px, #fef08a 3px 6px, transparent 6px 8px) 1px 6.5px / 24px 3px no-repeat,
    linear-gradient(90deg, transparent 10.5px, #450a0a 10.5px, #450a0a 15.5px, transparent 15.5px) 0 10px / 26px 4px no-repeat,
    linear-gradient(180deg, #ef4444, #b91c1c);
}

.ht-back {
  width: 26px;
  height: 14px;
  left: 0;
  top: 0;
  transform-origin: top;
  transform: rotateX(90deg);
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, #fde047 3px 6px, transparent 6px 8px) 1px 2px / 24px 3px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 3px, #fde047 3px 6px, transparent 6px 8px) 1px 6.5px / 24px 3px no-repeat,
    linear-gradient(180deg, #dc2626, #991b1b);
}

.ht-left {
  width: 19.5px;
  height: 15px;
  left: 0;
  top: 0;
  transform-origin: left;
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #7f1d1d, #991b1b);
  clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%);
}

.ht-right {
  width: 19.5px;
  height: 15px;
  right: 0;
  top: 0;
  transform-origin: right;
  transform: rotateY(90deg);
  background: linear-gradient(270deg, #b91c1c, #ef4444);
  clip-path: polygon(100% 0, 28% 0, 0 50%, 28% 100%, 100% 100%);
}

.ht-roof {
  position: absolute;
  left: -1px;
  width: 28px;
  height: 9.8px;
  border: 0.7px solid #450a0a;
  border-radius: 1.5px;
}

.ht-roof-front {
  bottom: 0;
  transform-origin: bottom;
  transform: translateZ(14px) rotateX(-36deg);
  background: linear-gradient(180deg, #f87171, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ht-roof-front span {
  font-size: 7.5px;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 1px 1px #450a0a;
  line-height: 1;
}

.ht-roof-back {
  top: 0;
  transform-origin: top;
  transform: translateZ(14px) rotateX(36deg);
  background: linear-gradient(0deg, #ef4444, #991b1b);
}

@keyframes popBuild {
  0% { transform: translateZ(26px) scale(0.4); opacity: 0; }
  100% { transform: translateZ(0px) scale(1); opacity: 1; }
}

/* ================= 3D PLAYER TOKENS IN RELIEF ================= */
.tokens-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.player-token-3d {
  position: absolute;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  transform-style: preserve-3d;
  transition: left 0.22s ease-out, top 0.22s ease-out;
  z-index: 40;
}

/* Upright Billboard Token standing in 3D space */
.token-standee {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transform: translateZ(20px) rotateZ(45deg) rotateX(-46deg);
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.88);
  position: relative;
  transition: transform 0.25s ease;
}

.token-shadow {
  position: absolute;
  width: 26px;
  height: 26px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.55) 0%, rgba(2, 6, 23, 0.25) 48%, transparent 74%);
  transform: translateZ(3px);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.player-token-3d.hopping .token-standee {
  animation: tokenHop 0.22s ease-in-out;
}

.player-token-3d.hopping .token-shadow {
  animation: tokenShadowHop 0.22s ease-in-out;
}

.player-token-3d.active-turn .token-standee {
  box-shadow:
    0 0 0 3px #facc15,
    0 3px 0 rgba(15, 23, 42, 0.9),
    0 0 12px rgba(250, 204, 21, 0.65);
}

@keyframes tokenHop {
  0%, 100% { transform: translateZ(20px) rotateZ(45deg) rotateX(-46deg) scale(1); }
  50% { transform: translateZ(46px) rotateZ(45deg) rotateX(-46deg) scale(1.12); }
}

@keyframes tokenShadowHop {
  0%, 100% { transform: translateZ(3px) scale(1); opacity: 1; }
  50% { transform: translateZ(3px) scale(0.72); opacity: 0.5; }
}

/* ================= 3D PHYSICS DICE ON BOARD CENTER ================= */
.dice-arena {
  position: absolute;
  top: var(--corner-size);
  left: var(--corner-size);
  width: calc(var(--board-size) - 2 * var(--corner-size) - 12px);
  height: calc(var(--board-size) - 2 * var(--corner-size) - 12px);
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 60;
}

.die-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  transform-style: preserve-3d;
  will-change: transform;
}

.die-shadow {
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.65) 0%, transparent 74%);
  transform: translateZ(1px);
  will-change: transform, opacity;
}

.die-3d {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.die-face {
  position: absolute;
  width: 36px;
  height: 36px;
  background: linear-gradient(145deg, #ffffff 0%, #e2e8f0 100%);
  border: 1.5px solid #94a3b8;
  border-radius: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 5px;
  place-items: center;
  backface-visibility: hidden;
  box-shadow: inset 0 0 6px rgba(15, 23, 42, 0.12);
}

.die-face.face-1 { transform: translateZ(18px); }
.die-face.face-6 { transform: rotateY(180deg) translateZ(18px); background: linear-gradient(145deg, #f8fafc, #cbd5e1); }
.die-face.face-2 { transform: rotateY(90deg) translateZ(18px); background: linear-gradient(145deg, #f8fafc, #dbe2ea); }
.die-face.face-5 { transform: rotateY(-90deg) translateZ(18px); background: linear-gradient(145deg, #f1f5f9, #cbd5e1); }
.die-face.face-3 { transform: rotateX(90deg) translateZ(18px); background: linear-gradient(145deg, #f8fafc, #dbe2ea); }
.die-face.face-4 { transform: rotateX(-90deg) translateZ(18px); background: linear-gradient(145deg, #f1f5f9, #cbd5e1); }

.pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
}
.pip.red {
  background: #dc2626;
  width: 8px;
  height: 8px;
}

/* ================= REALISTIC PROPERTY DEED CARD ================= */
.deed-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #faf5e8;
  color: #0f172a;
  border-radius: 14px;
  padding: 10px;
  border: 2px solid #cbd5e1;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.55);
  position: relative;
}

.deed-card-inner {
  min-height: 368px;
  display: flex;
  flex-direction: column;
  border: 2px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #fcf8ee 0%, #f5edd8 100%);
  position: relative;
}

.deed-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.deed-card-header {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid #1e293b;
  border-radius: 5px;
  padding: 8px 10px;
  text-align: center;
  margin-bottom: 10px;
}

.deed-card-subtitle {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: 0.9;
}

.deed-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.15;
  margin-top: 2px;
}

.deed-rent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(30, 41, 59, 0.16);
}
.deed-rent-row:last-child {
  border-bottom: none;
}

.deed-footer-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px solid #1e293b;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.deed-stamp-mortgaged {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  border: 4px solid #dc2626;
  color: #dc2626;
  background: rgba(255, 255, 255, 0.86);
  padding: 4px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ================= TABLE ZONES AROUND BOARD ================= */
.table-zones-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.table-polygon-outline {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateZ(-4px);
  pointer-events: none;
  opacity: 0.45;
}

.player-table-zone {
  position: absolute;
  width: 440px;
  min-height: 120px;
  background: linear-gradient(180deg, #d6ecd9 0%, #cde6d0 55%, #bfe0c4 100%);
  border: 2.5px solid #182232;
  border-radius: 12px;
  padding: 0;
  transform-origin: 50% 0%;
  transform-style: preserve-3d;
  pointer-events: auto;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.player-table-zone.active-turn {
  border-color: #eab308;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.45), 0 12px 28px rgba(250, 204, 21, 0.32);
}

.player-table-zone.bankrupt {
  opacity: 0.42;
}

.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9.5px 9.5px 0 0;
  border-bottom: 2px solid #182232;
}

.zone-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px;
  transform-style: preserve-3d;
}

.zone-cash-stack {
  width: 92px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.08);
  border: 1.5px dashed rgba(24, 34, 50, 0.28);
  border-radius: 8px;
  padding: 6px 4px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.zone-cash-stack.cash-pulse-in {
  background: rgba(16, 185, 129, 0.24);
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
  transform: scale(1.07) translateZ(6px);
}

.zone-cash-stack.cash-pulse-out {
  background: rgba(244, 63, 94, 0.18);
  border-color: #e11d48;
  transform: scale(0.95);
}

.cash-bills-pile-3d {
  position: relative;
  width: 82px;
  height: 40px;
  transform-style: preserve-3d;
}

.cash-brick-3d {
  position: absolute;
  width: 30px;
  height: 19px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.cash-brick-shadow {
  position: absolute;
  inset: -2px;
  background: rgba(15, 23, 42, 0.34);
  filter: blur(2px);
  border-radius: 3px;
  transform: translate3d(2px, 2px, 0.5px);
}

.cash-side {
  position: absolute;
  border: 1px solid var(--bill-border);
  background: repeating-linear-gradient(
    0deg,
    var(--bill-bg) 0px,
    var(--bill-bg) 2px,
    var(--bill-edge) 2px,
    var(--bill-edge) 3.2px
  );
  backface-visibility: hidden;
}

.cash-side-front {
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--stack-h);
  transform-origin: bottom center;
  transform: rotateX(-90deg);
}

.cash-side-back {
  left: 0;
  top: 0;
  width: 100%;
  height: var(--stack-h);
  transform-origin: top center;
  transform: rotateX(90deg);
}

.cash-side-left {
  left: 0;
  top: 0;
  width: var(--stack-h);
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--bill-bg) 0px,
    var(--bill-bg) 2px,
    var(--bill-edge) 2px,
    var(--bill-edge) 3.2px
  );
  transform-origin: left center;
  transform: rotateY(-90deg);
}

.cash-side-right {
  right: 0;
  top: 0;
  width: var(--stack-h);
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--bill-bg) 0px,
    var(--bill-bg) 2px,
    var(--bill-edge) 2px,
    var(--bill-edge) 3.2px
  );
  transform-origin: right center;
  transform: rotateY(90deg);
}

.cash-brick-top {
  position: absolute;
  inset: 0;
  background: var(--bill-bg);
  border: 1.5px solid var(--bill-border);
  border-radius: 3px;
  color: var(--bill-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7.5px;
  font-weight: 900;
  transform: translateZ(var(--stack-h));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cash-band {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.55);
  border-left: 1px solid rgba(15, 23, 42, 0.22);
  border-right: 1px solid rgba(15, 23, 42, 0.22);
}

.cash-top-label {
  position: relative;
  z-index: 1;
}

.cash-bills-empty {
  width: 44px;
  height: 22px;
  border: 1.5px dashed rgba(100, 116, 139, 0.55);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
}

.zone-cash-total {
  font-size: 9.5px;
  font-weight: 900;
  color: #065f46;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.25;
}

.zone-cash-total.low {
  color: #be123c;
  background: rgba(255, 228, 230, 0.9);
  border-color: rgba(244, 63, 94, 0.45);
}

.zone-cash-total.rich {
  color: #92400e;
  background: rgba(254, 243, 199, 0.95);
  border-color: rgba(245, 158, 11, 0.65);
}

.zone-cards-grid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.zone-prop-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  align-items: center;
}

.zone-prop-group.multi {
  background: rgba(15, 23, 42, 0.09);
}

.mini-deed-card {
  width: 50px;
  height: 66px;
  background: #faf5e8;
  color: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.42);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  position: relative;
}
.mini-deed-card:hover {
  transform: translateY(-4px) translateZ(6px) scale(1.08);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.55);
  z-index: 10;
}
.mini-deed-card.mortgaged {
  background: repeating-linear-gradient(
    -45deg,
    rgba(220, 38, 38, 0.13) 0px,
    rgba(220, 38, 38, 0.13) 4px,
    transparent 4px,
    transparent 8px
  ), #f8eaea;
  border-color: #ef4444;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.38);
}
.mini-deed-card.mortgaged:hover {
  box-shadow: 0 8px 14px rgba(239, 68, 68, 0.55);
}
.mini-deed-card.mortgaged .mini-deed-bar {
  filter: saturate(0.55) brightness(0.85);
}
.mini-deed-card.mortgaged .mini-deed-name {
  opacity: 0.55;
}
.mini-deed-card.mortgaged::after {
  content: 'HIPOTECA';
  position: absolute;
  top: 52%;
  left: -4px;
  right: -4px;
  transform: translateY(-50%) rotate(-12deg);
  background: rgba(153, 27, 27, 0.94);
  color: #fef2f2;
  border-top: 1px solid #fca5a5;
  border-bottom: 1px solid #fca5a5;
  font-size: 6.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 1.5px 0;
  pointer-events: none;
}
.mini-deed-card.mortgaged .mini-deed-meta {
  color: #b91c1c;
}

.mini-deed-bar {
  height: 12px;
  width: 100%;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 900;
  color: #ffffff;
}

.mini-deed-name {
  font-size: 6.5px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  padding: 2px;
  text-transform: uppercase;
  overflow: hidden;
}

.mini-deed-meta {
  font-size: 7px;
  font-weight: 900;
  text-align: center;
  padding-bottom: 2px;
  color: #334155;
}

/* ================= TOP LIGHT-MODE PLAYERS BAR ================= */
.board-players-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
}

.board-player-card {
  background: linear-gradient(180deg, #d6ecd9 0%, #cde6d0 55%, #bfe0c4 100%);
  border: 2px solid #182232;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.board-player-card.active-turn {
  border-color: #eab308;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.45), 0 8px 18px rgba(250, 204, 21, 0.25);
}

.board-player-card.bankrupt {
  opacity: 0.48;
}

.board-player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  border-bottom: 1.5px solid #182232;
}

.board-player-card-body {
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ================= BOARD EVENT FEED & TILE PULSE ================= */
.board-messages-stack {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(440px, calc(100% - 24px));
}

.board-event-feed {
  position: absolute;
  top: 54px;
  left: 12px;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  width: min(410px, calc(100% - 28px));
}

/* ================= UNOWNED BANK PROPERTIES BOX (BOTTOM-LEFT) ================= */
.bank-deeds-box {
  position: absolute;
  left: 12px;
  bottom: 70px;
  z-index: 32;
  width: min(264px, calc(100% - 24px));
  background: linear-gradient(180deg, #d6ecd9 0%, #cde6d0 55%, #bfe0c4 100%);
  border: 2px solid #182232;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
}

@media (min-width: 1400px) {
  .bank-deeds-box {
    bottom: 12px;
  }
}

.bank-deeds-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: #182232;
  color: #f8fafc;
}

.bank-deeds-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  padding: 7px;
  max-height: 205px;
  overflow-y: auto;
  justify-content: flex-start;
  align-items: center;
}

.bank-prop-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  padding: 1.5px;
  border-radius: 5px;
  align-items: center;
}

.bank-prop-group.multi {
  background: rgba(15, 23, 42, 0.09);
}

.bank-mini-deed {
  width: 34px;
  height: 44px;
  background: #faf5e8;
  color: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.32);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.bank-mini-deed:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.bank-mini-deed-bar {
  height: 9px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
}

.bank-mini-deed-name {
  font-size: 5.5px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  padding: 1px;
  text-transform: uppercase;
  overflow: hidden;
}

.bank-mini-deed-price {
  font-size: 6.5px;
  font-weight: 900;
  text-align: center;
  padding-bottom: 1px;
  color: #065f46;
}

.board-event-toast {
  width: 100%;
  background: linear-gradient(180deg, #fffdf7 0%, #faf5e8 100%);
  color: #0f172a;
  border: 2px solid #182232;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: none;
  animation: eventSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.board-event-toast.tone-good { border-color: #059669; }
.board-event-toast.tone-bad  { border-color: #e11d48; }
.board-event-toast.tone-warn { border-color: #d97706; }
.board-event-toast.tone-card { border-color: #ea580c; }
.board-event-toast.deck-chance-toast { border-color: #ea580c; }
.board-event-toast.deck-chest-toast  { border-color: #0284c7; }

.board-event-toast.leaving {
  animation: eventFadeOut 0.26s ease-in forwards;
}

@keyframes eventSlideIn {
  0% { opacity: 0; transform: translateY(-12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes eventFadeOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

.event-mini-deed {
  width: 58px;
  min-width: 58px;
  height: 74px;
  background: #faf5e8;
  color: #0f172a;
  border: 1.5px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.event-mini-deed-bar {
  height: 15px;
  border-bottom: 1.5px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 900;
}

.event-deck-card {
  width: 58px;
  min-width: 58px;
  height: 74px;
  border-radius: 7px;
  border: 2px solid #ffffff;
  outline: 1.5px solid #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.event-deck-card.deck-chance {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}
.event-deck-card.deck-chest {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.tile.tile-flash-good {
  animation: tilePulseGood 1.1s ease-out;
}
.tile.tile-flash-bad {
  animation: tilePulseBad 1.1s ease-out;
}
.tile.tile-flash-warn {
  animation: tilePulseWarn 1.1s ease-out;
}

@keyframes tilePulseGood {
  0%   { box-shadow: inset 0 0 0 3px #10b981, 0 0 18px rgba(16, 185, 129, 0.9); }
  100% { box-shadow: none; }
}
@keyframes tilePulseBad {
  0%   { box-shadow: inset 0 0 0 3px #f43f5e, 0 0 18px rgba(244, 63, 94, 0.9); }
  100% { box-shadow: none; }
}
@keyframes tilePulseWarn {
  0%   { box-shadow: inset 0 0 0 3px #f59e0b, 0 0 18px rgba(245, 158, 11, 0.9); }
  100% { box-shadow: none; }
}

.prompt-pop {
  animation: promptPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes promptPop {
  0%   { opacity: 0.7; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* ================= CARD APPEAR & ACQUIRE FLIGHT ================= */
@keyframes deedCardEnter {
  0%   { opacity: 0; transform: translateY(18px) scale(0.88); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.deed-card-enter {
  animation: deedCardEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.flying-deed-card {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.65));
}

.flying-banknote {
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  width: 48px;
  height: 24px;
  border-radius: 4px;
  border: 1.5px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  will-change: transform, opacity;
}

.flying-banknote::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px dashed rgba(15, 23, 42, 0.25);
  border-radius: 2px;
}

.flying-cash-label {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #0f172a;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  will-change: transform, opacity;
}

.flying-trade-deed {
  position: fixed;
  z-index: 9997;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55));
}

@keyframes miniCardLand {
  0%   { transform: scale(1.35) translateZ(14px); box-shadow: 0 0 18px rgba(250, 204, 21, 0.9); }
  100% { transform: scale(1) translateZ(0); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.42); }
}

.mini-deed-card.just-landed {
  animation: miniCardLand 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-table-zone.zone-received {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45), 0 12px 26px rgba(16, 185, 129, 0.28);
}

/* ================= DEED MODAL SIDE-BY-SIDE LAYOUT ================= */
.deed-modal-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  max-width: 620px;
  width: 100%;
}

.deed-actions-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  width: 220px;
  flex-shrink: 0;
}

.deed-actions-col.hidden {
  display: none;
}

/* Custom Scrollbar for Dashboard */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
