/* ==========================================================================
   Huỳnh Nguyễn Thành Đạt - Game Cờ Tỷ Phú (Monopoly Vietnam Edition)
   Tác giả: Huỳnh Nguyễn Thành Đạt
   Giao diện bàn cờ hiện đại, hiệu ứng xúc xắc 3D, thẻ bài cơ hội và bảng điều khiển
   ========================================================================== */

.game-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

/* ================= The Board Container ================= */
.monopoly-board-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* 9x9 CSS Grid Board for 32 perimeter tiles */
.monopoly-board {
  display: grid;
  grid-template-columns: 1.4fr repeat(7, 1fr) 1.4fr;
  grid-template-rows: 1.4fr repeat(7, 1fr) 1.4fr;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 760px;
  margin: 0 auto;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 4px;
  position: relative;
}

/* Tile Styles */
.board-tile {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 4px 4px;
  position: relative;
  font-size: 0.7rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.board-tile:hover {
  border-color: rgba(99, 102, 241, 0.7);
  transform: translateY(-2px) scale(1.03);
  z-index: 15;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(99, 102, 241, 0.4);
}

.board-tile.step-highlight {
  border-color: #818cf8 !important;
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.95), inset 0 0 12px rgba(99, 102, 241, 0.5) !important;
  transform: scale(1.06) translateY(-2px) !important;
  z-index: 25 !important;
  transition: all 0.12s ease !important;
}

/* Hiệu ứng chọn ô bay du lịch trực tiếp trên bàn cờ */
.board-tile.tile-flight-selectable {
  cursor: pointer !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.85), inset 0 0 10px rgba(56, 189, 248, 0.45) !important;
  animation: pulseFlightTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}

.board-tile.tile-flight-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(56, 189, 248, 1), inset 0 0 14px rgba(56, 189, 248, 0.65) !important;
  border-color: #7dd3fc !important;
  z-index: 30 !important;
}

.board-tile.tile-flight-selectable::after {
  content: "✈️";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #38bdf8);
  animation: bounceFlightIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulseFlightTile {
  0% {
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6), inset 0 0 6px rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
  }
  100% {
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.95), inset 0 0 14px rgba(56, 189, 248, 0.6);
    border-color: #bae6fd;
  }
}

@keyframes bounceFlightIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

/* Hiệu ứng chọn ô Monopoly trực tiếp trên bàn cờ */
.board-tile.tile-monopoly-selectable {
  cursor: pointer !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.85), inset 0 0 10px rgba(245, 158, 11, 0.45) !important;
  animation: pulseMonopolyTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}

.board-tile.tile-monopoly-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(245, 158, 11, 1), inset 0 0 14px rgba(245, 158, 11, 0.65) !important;
  border-color: #fde047 !important;
  z-index: 30 !important;
}

.board-tile.tile-monopoly-selectable::after {
  content: "💎";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #f59e0b);
  animation: bounceMonopolyIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes pulseMonopolyTile {
  0% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6), inset 0 0 6px rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
  }
  100% {
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.95), inset 0 0 14px rgba(245, 158, 11, 0.6);
    border-color: #fef08a;
  }
}

@keyframes bounceMonopolyIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

/* Hiệu ứng chọn ô Động Đất trực tiếp trên bàn cờ */
.board-tile.tile-earthquake-selectable {
  cursor: pointer !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.85), inset 0 0 10px rgba(239, 68, 68, 0.45) !important;
  animation: pulseEarthquakeTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}
.board-tile.tile-earthquake-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(239, 68, 68, 1), inset 0 0 14px rgba(239, 68, 68, 0.65) !important;
  border-color: #fca5a5 !important;
  z-index: 30 !important;
}
.board-tile.tile-earthquake-selectable::after {
  content: "🌋";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #ef4444);
  animation: bounceEarthquakeIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}
@keyframes pulseEarthquakeTile {
  0% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6), inset 0 0 6px rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
  }
  100% {
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.95), inset 0 0 14px rgba(239, 68, 68, 0.6);
    border-color: #fecaca;
  }
}
@keyframes bounceEarthquakeIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

/* Hiệu ứng chọn ô Cháy Nhà trực tiếp trên bàn cờ */
.board-tile.tile-fire-selectable {
  cursor: pointer !important;
  border-color: #f97316 !important;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.85), inset 0 0 10px rgba(249, 115, 22, 0.45) !important;
  animation: pulseFireTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}
.board-tile.tile-fire-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(249, 115, 22, 1), inset 0 0 14px rgba(249, 115, 22, 0.65) !important;
  border-color: #fdba74 !important;
  z-index: 30 !important;
}
.board-tile.tile-fire-selectable::after {
  content: "🔥";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #f97316);
  animation: bounceFireIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}
@keyframes pulseFireTile {
  0% {
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.6), inset 0 0 6px rgba(249, 115, 22, 0.3);
    border-color: #f97316;
  }
  100% {
    box-shadow: 0 0 22px rgba(249, 115, 22, 0.95), inset 0 0 14px rgba(249, 115, 22, 0.6);
    border-color: #ffedd5;
  }
}
@keyframes bounceFireIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

/* Hiệu ứng chọn ô Bán Nhà (Quy Hoạch Cưỡng Chế) trực tiếp trên bàn cờ */
.board-tile.tile-forcesale-selectable {
  cursor: pointer !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.85), inset 0 0 10px rgba(6, 182, 212, 0.45) !important;
  animation: pulseForcesaleTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}
.board-tile.tile-forcesale-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(6, 182, 212, 1), inset 0 0 14px rgba(6, 182, 212, 0.65) !important;
  border-color: #67e8f9 !important;
  z-index: 30 !important;
}
.board-tile.tile-forcesale-selectable::after {
  content: "🏛️";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #06b6d4);
  animation: bounceForcesaleIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}
@keyframes pulseForcesaleTile {
  0% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.6), inset 0 0 6px rgba(6, 182, 212, 0.3);
    border-color: #06b6d4;
  }
  100% {
    box-shadow: 0 0 22px rgba(6, 182, 212, 0.95), inset 0 0 14px rgba(6, 182, 212, 0.6);
    border-color: #cffafe;
  }
}
@keyframes bounceForcesaleIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

/* Hiệu ứng chọn ô Khiên Bảo Vệ trực tiếp trên bàn cờ */
.board-tile.tile-shield-selectable {
  cursor: pointer !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.85), inset 0 0 10px rgba(16, 185, 129, 0.45) !important;
  animation: pulseShieldTile 1.3s infinite alternate ease-in-out !important;
  z-index: 20 !important;
}
.board-tile.tile-shield-selectable:hover {
  transform: translateY(-4px) scale(1.06) !important;
  box-shadow: 0 0 26px rgba(16, 185, 129, 1), inset 0 0 14px rgba(16, 185, 129, 0.65) !important;
  border-color: #6ee7b7 !important;
  z-index: 30 !important;
}
.board-tile.tile-shield-selectable::after {
  content: "🛡️";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.85rem;
  z-index: 22;
  filter: drop-shadow(0 0 4px #10b981);
  animation: bounceShieldIcon 1.2s infinite ease-in-out;
  pointer-events: none;
}
@keyframes pulseShieldTile {
  0% {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6), inset 0 0 6px rgba(16, 185, 129, 0.3);
    border-color: #10b981;
  }
  100% {
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.95), inset 0 0 14px rgba(16, 185, 129, 0.6);
    border-color: #d1fae5;
  }
}
@keyframes bounceShieldIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.15); }
}

.board-tile.corner-tile {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.3));
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  font-weight: 800;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.2);
}

.tile-color-bar {
  height: 9px;
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  margin-bottom: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.tile-color-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent);
  border-radius: 4px 4px 0 0;
}

/* Các nhóm màu vùng miền phong cách Cyberpunk & Glassmorphism */
.tile-group-purple .tile-color-bar {
  background: linear-gradient(90deg, #9333ea, #c084fc) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6) !important;
}

.tile-group-pink .tile-color-bar {
  background: linear-gradient(90deg, #db2777, #f472b6) !important;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6) !important;
}

.tile-group-orange .tile-color-bar {
  background: linear-gradient(90deg, #ea580c, #fb923c) !important;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.6) !important;
}

.tile-group-red .tile-color-bar {
  background: linear-gradient(90deg, #dc2626, #f87171) !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6) !important;
}

.tile-group-yellow .tile-color-bar {
  background: linear-gradient(90deg, #ca8a04, #fde047) !important;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.6) !important;
}

.tile-group-blue .tile-color-bar {
  background: linear-gradient(90deg, #2563eb, #38bdf8) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6) !important;
}

.tile-type-station .tile-color-bar {
  background: linear-gradient(90deg, #0d9488, #2dd4bf) !important;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.6) !important;
}

.tile-type-utility .tile-color-bar {
  background: linear-gradient(90deg, #0284c7, #38bdf8) !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6) !important;
}

/* Dedicated flying smooth 3D character token pawn */
.flying-player-token {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  z-index: 9999;
  pointer-events: none;
  transition: left 0.28s cubic-bezier(0.22, 1, 0.36, 1), top 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: left, top;
}

.flying-player-token .pawn-body {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.75), 0 0 18px var(--pawn-glow, rgba(99, 102, 241, 0.95)), inset 0 2px 5px rgba(255, 255, 255, 0.5);
  border: 2.5px solid #ffffff;
  position: relative;
  will-change: transform;
}

.flying-player-token .pawn-name-tag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  letter-spacing: 0.2px;
  z-index: 4;
}

.flying-player-token .pawn-drop-shadow {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 7px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.28s ease;
  z-index: -1;
}

.flying-player-token .pawn-body.hopping {
  animation: pawnHopArc 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

.flying-player-token .pawn-body.hopping .pawn-drop-shadow {
  animation: pawnShadowPulse 0.28s ease-in-out;
}

@keyframes pawnHopArc {
  0% {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transform: translateY(0) scale(1) rotate(0deg);
  }
  45% {
    filter: drop-shadow(0 18px 24px var(--pawn-glow, rgba(99, 102, 241, 0.95))) brightness(1.25);
    transform: translateY(-18px) scale(1.22) rotate(-6deg);
  }
  85% {
    transform: translateY(-2px) scale(1.05) rotate(2deg);
  }
  100% {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes pawnShadowPulse {
  0% { transform: translateX(-50%) scale(1); opacity: 0.75; }
  45% { transform: translateX(-50%) scale(0.45); opacity: 0.2; filter: blur(2px); }
  100% { transform: translateX(-50%) scale(1); opacity: 0.75; }
}

.board-tile.tile-landed-pulse {
  animation: tileLandedPulse 0.6s ease-out;
  z-index: 20 !important;
}

@keyframes tileLandedPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.8), inset 0 0 0 2px rgba(255, 255, 255, 0.9);
  }
  50% {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 0 25px 4px rgba(99, 102, 241, 0.9), inset 0 0 15px rgba(255, 255, 255, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .flying-player-token {
    width: 32px;
    height: 32px;
  }
  .flying-player-token .pawn-body {
    font-size: 1.05rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 12px var(--pawn-glow, rgba(99, 102, 241, 0.95));
  }
  .flying-player-token .pawn-name-tag {
    font-size: 0.6rem;
    top: -20px;
    padding: 1px 5px;
  }
}

.step-highlight {
  animation: tileStepGlow 0.32s ease-out !important;
  z-index: 10 !important;
}

@keyframes tileStepGlow {
  0% {
    box-shadow: inset 0 0 0 2.5px #38bdf8, 0 0 24px rgba(56, 189, 248, 0.85);
    background: rgba(56, 189, 248, 0.22) !important;
  }
  100% {
    box-shadow: none;
  }
}

.tile-name {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  font-size: 0.68rem;
  text-align: center;
  word-break: break-word;
}

.tile-price {
  font-size: 0.62rem;
  font-weight: 700;
  color: #10b981;
  text-align: center;
  margin-top: auto;
  line-height: 1.1;
  transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.2s ease;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.tile-price .rent-prefix {
  font-size: 0.52rem;
  font-weight: 600;
  opacity: 0.82;
  margin-right: 1px;
}

.tile-price .rent-val {
  font-weight: 800;
}

/* Khi giá thuê tăng (có nhà, trọn bộ màu x1.5 hoặc thẻ Monopoly x2) */
.tile-price.rent-boosted {
  color: #f59e0b;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* Khi ô có Khách Sạn (cấp tối đa) */
.tile-price.rent-hotel {
  color: #ef4444;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

/* Hiệu ứng xung nhịp khi giá thuê thay đổi */
@keyframes rentPriceUpdate {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.rent-price-animated {
  animation: rentPriceUpdate 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-houses {
  display: flex;
  gap: 3px;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  min-height: 18px;
  margin: 1px 0;
}

.mini-house {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: houseSpawn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mini-house:hover {
  transform: scale(1.25) translateY(-2px);
}

.mini-hotel {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7), 0 2px 4px rgba(0,0,0,0.5);
  border: 1px solid #fef08a;
  animation: hotelGlow 2s infinite alternate, houseSpawn 0.4s ease-out;
  letter-spacing: 0.3px;
}

.mini-hotel .hotel-ico {
  font-size: 0.75rem;
}

@keyframes houseSpawn {
  0% { transform: scale(0.3) translateY(8px); opacity: 0; }
  70% { transform: scale(1.2) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes hotelGlow {
  0% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
  100% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.9), 0 0 22px rgba(245, 158, 11, 0.5); }
}

/* Đổi mới hiển thị sở hữu: VIỀN SÁNG ĐẬM RÕ RÀNG & HUY HIỆU CHỦ ĐẤT SANG TRỌNG */
.board-tile.tile-owned {
  border: 2.5px solid var(--tile-owner-color, #3b82f6) !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45), inset 0 0 14px rgba(99, 102, 241, 0.15) !important;
  position: relative;
}

.tile-owner-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: var(--tile-owner-color, #3b82f6);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.7), 0 0 6px var(--tile-owner-color, #3b82f6);
  z-index: 6;
  border: 1.5px solid #ffffff;
  max-width: 78px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  letter-spacing: 0.2px;
}

.tile-owner-badge .owner-badge-icon {
  font-size: 0.68rem;
  line-height: 1;
}

.tile-owner-badge .owner-badge-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58px;
}

@keyframes badgePop {
  0% { transform: scale(0.2) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Tokens inside tile - Thiết kế 3D Figurine sang xịn */
.tile-tokens-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  z-index: 8;
  pointer-events: none;
}

.player-token {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.6);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: auto;
  cursor: pointer;
}

.player-token.active-turn-token {
  box-shadow: 0 0 0 2px #f59e0b, 0 4px 14px rgba(245, 158, 11, 0.8), inset 0 2px 4px rgba(255,255,255,0.8);
  animation: activeTokenFloat 1.2s infinite ease-in-out alternate;
  z-index: 10;
}

.player-token.active-turn-token::after {
  content: '▼';
  position: absolute;
  top: -12px;
  font-size: 0.55rem;
  color: #f59e0b;
  animation: turnArrowBounce 0.8s infinite ease-in-out alternate;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}

@keyframes turnArrowBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

@keyframes activeTokenFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-4px) scale(1.08); }
}

.player-token.hopping {
  animation: pieceHop3D 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 12;
}

@keyframes pieceHop3D {
  0% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-16px) scale(1.15, 1.25) rotate(-6deg); }
  70% { transform: translateY(-3px) scale(0.95, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* ================= Center Area ================= */
.board-center-area {
  grid-column: 2 / 9;
  grid-row: 2 / 9;
  background: radial-gradient(circle at center, rgba(17, 24, 39, 0.95), rgba(11, 15, 25, 0.98));
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  position: relative;
  text-align: center;
}

.game-logo-banner {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Dice Container & 3D Effect */
.dice-arena {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0;
  perspective: 600px;
}

.dice-cube {
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #1e293b;
  font-weight: 800;
  transition: transform 0.2s ease;
  user-select: none;
  transform-style: preserve-3d;
}

.dice-cube.rolling,
.dice-cube.rolling-3d {
  animation: diceRoll3D 1.1s cubic-bezier(0.2, 0.8, 0.25, 1) infinite;
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.7), 0 0 24px rgba(245, 158, 11, 0.6);
}

@keyframes diceRoll3D {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.95) translateY(0);
  }
  20% {
    transform: rotateX(120deg) rotateY(160deg) rotateZ(30deg) scale(1.18) translateY(-20px);
  }
  45% {
    transform: rotateX(240deg) rotateY(280deg) rotateZ(120deg) scale(0.96) translateY(2px);
  }
  70% {
    transform: rotateX(400deg) rotateY(420deg) rotateZ(240deg) scale(1.15) translateY(-14px);
  }
  88% {
    transform: rotateX(580deg) rotateY(600deg) rotateZ(320deg) scale(1.04) translateY(-3px);
  }
  100% {
    transform: rotateX(720deg) rotateY(720deg) rotateZ(360deg) scale(1) translateY(0);
  }
}

/* Action Controls Panel */
.center-action-controls {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.turn-announcement {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: inline-block;
  margin: 0 auto;
}

.action-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ================= Right Sidebar: Players & Leaderboard ================= */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.player-status-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  position: relative;
}

.player-status-card.active-turn {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.04);
}

.player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-info-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-token-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.player-name-text {
  font-size: 0.95rem;
  font-weight: 700;
}

.player-money-box {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin: 0.4rem 0 0.55rem;
}

.player-money-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-money-lbl {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.player-money-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 0.3px;
}

.player-wealth-row,
.player-wealth-lbl,
.player-wealth-val {
  display: none !important;
}

/* Floating Money Difference Badge Animation */
.floating-money-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 800;
  pointer-events: none;
  z-index: 50;
  animation: floatFadeUp 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.floating-money-badge.float-plus {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.floating-money-badge.float-minus {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

@keyframes floatFadeUp {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.85);
  }
  20% {
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
  }
  70% {
    opacity: 1;
    transform: translateY(-16px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(0.9);
  }
}

.player-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  padding-top: 0.4rem;
}

/* Game Log Box */
.game-log-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  height: 180px;
  overflow-y: auto;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.log-entry {
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  line-height: 1.35;
}

.log-entry.log-highlight {
  color: #f59e0b;
  font-weight: 600;
}

.log-entry.log-success {
  color: #34d399;
}

.log-entry.log-danger {
  color: #f87171;
}

/* ========================================================
   CHANCE & CHEST 3D FLIP CARD MODAL (FULL VIEWPORT)
   ======================================================== */
.chance-card-modal-backdrop,
.card-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100010;
  padding: 1rem;
}

.chance-card-modal-backdrop.active,
.card-popup-overlay.active {
  display: flex !important;
  animation: popInCardModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popInCardModal {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.chance-modal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 420px;
  width: 100%;
}

.chance-card-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 440px;
  border-radius: 28px;
  filter: blur(45px);
  opacity: 0.65;
  pointer-events: none;
  transition: all 0.5s ease;
  z-index: 0;
}

.theme-chance .chance-card-halo {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.65) 0%, rgba(217, 119, 6, 0.3) 50%, transparent 75%);
}

.theme-chest .chance-card-halo {
  background: radial-gradient(circle, rgba(6, 182, 212, 0.65) 0%, rgba(2, 132, 199, 0.3) 50%, transparent 75%);
}

.chance-modal-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.35rem;
  z-index: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.theme-chance .chance-modal-header-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: 1.5px solid #fbbf24;
}

.theme-chest .chance-modal-header-tag {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
  border: 1.5px solid #38bdf8;
}

.chance-player-badge {
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  text-align: center;
  z-index: 1;
}

/* 3D Scene & Flipping Card */
.chance-card-scene {
  width: 310px;
  height: 430px;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  cursor: pointer;
  user-select: none;
  z-index: 1;
  margin: 0.5rem 0 1rem;
}

.chance-3d-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.4);
}

.chance-3d-card.flipped {
  transform: rotateY(180deg);
}

.chance-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;
}

/* Card Back (Mặt Lưng) */
.chance-card-back {
  background: linear-gradient(145deg, #0f172a, #1e293b, #0f172a);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.card-back-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.card-back-border {
  position: absolute;
  inset: 12px;
  border-radius: 16px;
  border: 2px dashed rgba(245, 158, 11, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.4s ease;
}

.theme-chest .card-back-border {
  border-color: rgba(6, 182, 212, 0.6);
}

.card-back-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.card-back-emblem {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  animation: emblemPulse 2s infinite ease-in-out;
}

@keyframes emblemPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 8px 20px rgba(245, 158, 11, 0.8)); }
}

.theme-chest .card-back-emblem {
  animation-name: emblemPulseCyan;
}

@keyframes emblemPulseCyan {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 10px rgba(6, 182, 212, 0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 8px 20px rgba(6, 182, 212, 0.8)); }
}

.card-back-brand {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
}

.card-back-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.card-back-prompt {
  display: inline-block;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.5px;
  animation: promptGlow 1.8s infinite alternate ease-in-out;
}

.theme-chest .card-back-prompt {
  color: #38bdf8;
}

@keyframes promptGlow {
  from { transform: scale(0.97); opacity: 0.85; }
  to { transform: scale(1.03); opacity: 1; }
}

/* Card Front (Mặt Ngửa) */
.chance-card-front {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, #131b2e 0%, #0b1120 100%);
  border: 2.5px solid #f59e0b;
  box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.2);
}

.theme-chest .chance-card-front {
  border-color: #06b6d4;
  box-shadow: inset 0 0 30px rgba(6, 182, 212, 0.2);
}

.card-front-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.card-type-badge {
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.theme-chance .card-type-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.theme-chest .card-type-badge {
  background: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.card-number {
  color: #64748b;
  font-family: monospace;
}

.card-front-icon-wrap {
  position: relative;
  margin: 0.6rem 0 0.35rem;
}

.card-front-icon {
  font-size: 3.6rem;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
  animation: cardIconBob 2.2s infinite ease-in-out;
}

@keyframes cardIconBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.card-front-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0.2rem 0 0.4rem;
  color: #ffffff;
  line-height: 1.3;
}

.theme-chance .card-front-title {
  color: #fef08a;
}

.theme-chest .card-front-title {
  color: #a5f3fc;
}

.card-front-divider {
  width: 48px;
  height: 3px;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

.theme-chance .card-front-divider {
  background: #f59e0b;
}

.theme-chest .card-front-divider {
  background: #06b6d4;
}

.card-front-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

.card-front-impact {
  margin-top: 0.75rem;
  width: 100%;
}

.impact-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.impact-badge.impact-positive {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.impact-badge.impact-negative {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.impact-badge.impact-special {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.5);
}

/* Modal Footer & Buttons */
.chance-modal-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  z-index: 1;
}

.chance-confirm-btn {
  min-width: 220px;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.45);
  transition: all 0.25s ease;
}

.chance-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.6);
}

.chance-auto-countdown {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Real-time Chance Card Synchronize Badges & Effects */
.chance-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.chance-sync-badge.sync-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.chance-viewer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #38bdf8;
  font-weight: 700;
  padding: 3px 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  margin-top: 4px;
}

.chance-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  display: inline-block;
  animation: chancePulseDot 1.4s infinite ease-in-out;
}

.chance-pulse-dot.pulse-sky {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

@keyframes chancePulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.35; }
}

.chance-confirm-btn.btn-viewer-mode {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.45);
}

.chance-confirm-btn.btn-viewer-mode:hover {
  box-shadow: 0 14px 30px rgba(2, 132, 199, 0.6);
}

/* Legacy fallback wrapper */
.chance-card-box {
  display: none;
}

/* Sound Toggle Button */
.btn-sound-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.btn-sound-toggle:hover {
  background: var(--accent-primary);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* ================= Collapsible Guide & Chance Directory ================= */
.game-collapsible-guide {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.game-collapsible-guide:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.guide-toggle-header {
  padding: 1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.04) 100%);
  border-bottom: 1px solid transparent;
  transition: background var(--transition-fast);
}

.guide-toggle-header:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
}

.game-collapsible-guide.open .guide-toggle-header {
  border-bottom: 1px solid var(--border-glass);
}

.guide-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.guide-badge-icon {
  font-size: 1.5rem;
  background: rgba(99, 102, 241, 0.15);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.guide-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.guide-chevron {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-collapsible-guide.open .guide-chevron {
  transform: rotate(180deg);
}

.guide-expandable-body {
  padding: 1.25rem 1.4rem;
  animation: fadeIn 0.3s ease;
}

.guide-subtabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.guide-subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.guide-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.guide-subtab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Guide Cards Grid */
.guide-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.guide-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.guide-info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.guide-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.guide-card-body {
  flex: 1;
}

.guide-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.guide-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.tile-spec-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-secondary);
  border-radius: 12px;
  font-weight: 600;
}

/* Chance Cards Directory Grid */
.chance-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.chance-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.chance-item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #f59e0b;
}

.chance-item-card.chance-type-bonus::before {
  background: #10b981;
}

.chance-item-card.chance-type-penalty::before {
  background: #ef4444;
}

.chance-item-card.chance-type-special::before {
  background: #8b5cf6;
}

.chance-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(245, 158, 11, 0.5);
}

.chance-item-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chance-item-icon {
  font-size: 1.4rem;
}

.chance-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.chance-item-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.chance-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Rules Prose */
.rules-prose {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.rules-prose h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.1rem 0 0.4rem;
}

.rules-prose h5:first-child {
  margin-top: 0;
}

.rules-prose ul, .rules-prose ol {
  padding-left: 1.25rem;
  margin-bottom: 0.8rem;
}

.rules-prose li {
  margin-bottom: 0.35rem;
}

/* ================= Setup Modal: Bot Chips ================= */
.setup-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.setup-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.setup-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.bot-chips-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.85rem 0 1.25rem;
}

.bot-chip-btn {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.bot-chip-btn:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.05);
}

.bot-chip-btn.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.bot-chip-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.bot-chip-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.bot-chip-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Online Users List */
.online-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.online-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  transition: all var(--transition-fast);
}

.online-user-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.online-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.online-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #10b981;
}

.online-user-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.online-user-status {
  font-size: 0.72rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.online-user-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* 3D Dice Roll Animation uses diceRoll3D defined in base */


/* Token step hop */
.player-token.hopping {
  animation: tokenHop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 50;
}

@keyframes tokenHop {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  40% {
    transform: translateY(-20px) scale(1.35) rotate(-4deg);
    filter: drop-shadow(0 12px 16px rgba(99, 102, 241, 0.8));
  }
  75% {
    transform: translateY(-3px) scale(1.1) rotate(2deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

/* ================= Property Deed Card & Deed Table System ================= */
.modal-backdrop.deed-modal-backdrop,
#propertyDeedModal {
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  align-items: center;
  justify-content: center;
}

#propertyDeedModal.active {
  display: flex !important;
}

.property-deed-dialog {
  max-width: 480px;
  width: 100%;
  max-height: min(92vh, 720px);
  margin: auto;
  padding: 0;
  border-radius: var(--radius-lg, 18px);
  overflow: hidden;
  border: 2px solid var(--border-glass);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

.property-deed-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: inherit;
  width: 100%;
  overflow: hidden;
  background: var(--bg-surface);
}

.deed-header {
  flex-shrink: 0;
  padding: 1.15rem 1.25rem 0.95rem;
  text-align: center;
  color: #fff;
  background: var(--accent-primary);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.deed-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.92;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.deed-title {
  margin: 0.25rem 0 0.15rem;
  font-size: 1.45rem;
  color: #fff;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  word-break: break-word;
}

.deed-subtitle {
  font-size: 0.8rem;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.deed-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1;
  transition: all 0.2s ease;
}

.deed-close-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.08);
}

.deed-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.2rem;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.deed-body::-webkit-scrollbar {
  width: 5px;
}
.deed-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
.deed-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 3px;
}

.deed-status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.deed-status-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.deed-status-val {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.deed-house-highlight {
  color: #10b981;
}

.deed-multiplier-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.15));
  border: 1px solid #f59e0b;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  gap: 0.5rem;
}

.deed-multiplier-label {
  font-weight: 700;
  color: #fbbf24;
  font-size: 0.84rem;
}

.deed-multiplier-text {
  font-weight: 800;
  color: #f59e0b;
  font-size: 0.92rem;
  text-align: right;
}

.deed-table-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
  margin-top: 0.15rem;
}

.deed-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.deed-table-wrapper::-webkit-scrollbar {
  height: 4px;
}
.deed-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 2px;
}

.deed-table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.deed-table thead tr {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 2px solid var(--border-glass);
  color: var(--text-muted);
  text-align: left;
}

.deed-table th {
  padding: 0.5rem 0.4rem;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.deed-table th.col-invested { text-align: right; color: #06b6d4; }
.deed-table th.col-rent { text-align: right; color: #10b981; }
.deed-table th.col-buyout { text-align: right; color: #f59e0b; }

.deed-table td {
  padding: 0.5rem 0.4rem;
  white-space: nowrap;
}

.deed-col-level {
  font-weight: 600;
  white-space: nowrap;
}

.deed-col-invested {
  text-align: right;
  color: #06b6d4;
  font-weight: 700;
  white-space: nowrap;
}

.deed-col-rent {
  text-align: right;
  color: #10b981;
  font-weight: 700;
  white-space: nowrap;
}

.deed-col-buyout {
  text-align: right;
  color: #f59e0b;
  font-weight: 700;
  white-space: nowrap;
}

.current-level-mark {
  font-weight: 800;
  color: #34d399;
}

.rent-multi-badge {
  font-size: 0.72rem;
  color: #f59e0b;
  margin-left: 2px;
}

.deed-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background var(--transition-fast);
}

.deed-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.deed-table tr.current-level {
  background: rgba(16, 185, 129, 0.12);
  font-weight: 700;
  border-left: 3px solid #10b981;
}

.deed-table tr.current-level td:first-child {
  padding-left: 0.5rem;
  color: #34d399;
}

.deed-build-cost-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  background: var(--bg-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px dashed var(--border-glass);
}

.deed-build-cost-box strong {
  color: #34d399;
  font-weight: 800;
}

.deed-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.35rem;
  margin-top: auto;
}

.deed-close-btn-bottom {
  width: 100%;
  padding: 0.65rem 1rem;
  font-weight: 700;
}

/* ================= Target Tile Selection Grid ================= */
.target-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.target-tile-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.target-tile-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  background: rgba(99, 102, 241, 0.08);
}

.target-tile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.target-tile-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.target-tile-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ================= Tile Monopoly Badge on Board ================= */
.tile-monopoly-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  z-index: 8;
  animation: pulseGold 2s infinite ease-in-out;
  letter-spacing: 0.5px;
}

@keyframes pulseGold {
  0% { transform: scale(1); box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
  50% { transform: scale(1.1); box-shadow: 0 0 12px rgba(245, 158, 11, 0.9); }
  100% { transform: scale(1); box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
}

/* Buyout Action Button */
.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: none;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .bot-chips-group {
    grid-template-columns: 1fr;
  }
}

/* ================= Monopoly Color Set & Buyout & Surrender ================= */
.board-tile.monopoly-set-glow {
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), inset 0 0 8px rgba(251, 191, 36, 0.45) !important;
  border: 1.5px solid #f59e0b !important;
  animation: goldSetPulse 2.5s infinite ease-in-out;
}

@keyframes goldSetPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6), inset 0 0 6px rgba(251, 191, 36, 0.3) !important;
  }
  50% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 1), inset 0 0 12px rgba(251, 191, 36, 0.7) !important;
  }
}

.color-set-badge {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  letter-spacing: 0.2px;
  animation: popBadge 0.3s ease;
}

@keyframes popBadge {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.btn-surrender {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  font-weight: 600 !important;
  transition: all var(--transition-fast);
}

.btn-surrender:hover {
  background: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ================================================================
   TRUNG TÂM ÂM NHẠC & ÂM THANH HỢP NHẤT (MONOPOLY MUSIC & AUDIO)
   ================================================================ */

/* Action Bar Button */
.btn-music-center {
  background: linear-gradient(135deg, #8b5cf6, #ec4899) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35) !important;
  font-weight: 700 !important;
  transition: all var(--transition-fast) !important;
}

.btn-music-center:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.45) !important;
}

/* Center Board Audio Group */
.center-audio-controls-group {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.btn-sound-music-toggle {
  background: rgba(168, 85, 247, 0.2) !important;
  border-color: rgba(168, 85, 247, 0.45) !important;
}

.btn-sound-music-toggle:hover {
  background: rgba(168, 85, 247, 0.4) !important;
  transform: scale(1.1);
}

/* Modal: Dual Volume Controls */
.volume-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .volume-panel-grid {
    grid-template-columns: 1fr;
  }
}

.volume-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.volume-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.volume-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.volume-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.volume-icon-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  transform: scale(1.08);
}

.volume-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.volume-slider-wrapper {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Modal: Main Music Player Showcase (Hero) */
.music-hero-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.65), rgba(15, 23, 42, 0.75));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.music-hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.15), transparent 70%);
  pointer-events: none;
}

.music-hero-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

@media (max-width: 540px) {
  .music-hero-content {
    flex-direction: column;
    text-align: center;
  }
}

/* 3D Vinyl Record Graphic */
.vinyl-record-wrap {
  flex-shrink: 0;
}

.vinyl-record {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: radial-gradient(circle, #0f172a 20%, #1e1b4b 55%, #090d16 100%);
  border: 4px solid #111827;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-record.spinning {
  animation: spinVinyl 4s linear infinite;
}

.vinyl-grooves {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.vinyl-grooves::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vinyl-center-label {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  border: 3px solid #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

@keyframes spinVinyl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.music-hero-details {
  flex: 1;
  min-width: 0;
}

.music-now-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ec4899;
  background: rgba(236, 72, 153, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.music-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-hero-artist {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* Scrub Progress Bar */
.music-progress-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}

.music-time-text {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-muted);
  min-width: 38px;
}

.music-seek-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.music-seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ec4899;
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

.music-seek-bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Playback Control Buttons */
.music-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 540px) {
  .music-controls-row {
    justify-content: center;
  }
}

.player-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.player-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.5);
  transform: scale(1.08);
}

.player-btn.active {
  background: rgba(168, 85, 247, 0.35);
  border-color: #a855f7;
  color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.player-btn-main {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: none;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.45);
  transition: all 0.2s;
}

.player-btn-main:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.6);
}

.player-btn-main.playing {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5);
}

.player-stop-btn {
  color: #f87171 !important;
}

.player-stop-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

.player-btn-toggle {
  width: auto;
  border-radius: 9999px;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: auto;
}

@media (max-width: 540px) {
  .player-btn-toggle {
    margin-left: 0;
  }
}

.player-btn-toggle.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

/* Modal: Playlist Items */
.playlist-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateX(3px);
}

.playlist-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
  border-color: #a855f7;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2);
}

.playlist-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.playlist-index {
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  font-family: monospace;
}

.playlist-equalizer {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 14px;
}

.playlist-item.active .playlist-index {
  display: none;
}

.playlist-item.active .playlist-equalizer {
  display: flex;
}

.eq-bar {
  width: 3px;
  background: #ec4899;
  border-radius: 1px;
  animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.eq-bar:nth-child(2) { animation-delay: 0.2s; height: 100%; }
.eq-bar:nth-child(3) { animation-delay: 0.4s; height: 60%; }

@keyframes eqBounce {
  0% { height: 25%; }
  100% { height: 100%; }
}

.playlist-info {
  min-width: 0;
}

.playlist-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item.active .playlist-title {
  color: #c084fc;
}

.playlist-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.playlist-duration {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.playlist-admin-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-track-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-track-action:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

.btn-track-delete:hover {
  background: #ef4444 !important;
  color: #fff !important;
}

/* ================================================================
   EMBEDDED SIDEBAR MUSIC WIDGET (DƯỚI NHẬT KÝ & LUẬT CHƠI)
   ================================================================ */

.sidebar-music-card {
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 10px rgba(168, 85, 247, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-music-card:hover {
  border-color: rgba(236, 72, 153, 0.45) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 15px rgba(236, 72, 153, 0.15);
}

@keyframes cardPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); border-color: #ec4899; }
  50% { box-shadow: 0 0 25px 5px rgba(236, 72, 153, 0.6); border-color: #a855f7; transform: translateY(-2px); }
  100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); border-color: var(--border-glass); transform: translateY(0); }
}

.sidebar-music-card.highlight-glow {
  animation: cardPulseGlow 1.8s ease-in-out;
}

.sidebar-music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.6rem;
}

.sidebar-music-icon {
  font-size: 1.35rem;
  display: inline-block;
  transition: transform 0.2s;
}

.sidebar-music-icon.spinning {
  animation: spinVinyl 3.5s linear infinite;
}

.sidebar-music-expand-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.sidebar-music-expand-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
  transform: scale(1.1);
}

/* Sidebar Now Playing Details */
.sidebar-music-player {
  background: rgba(30, 41, 59, 0.55);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-glass);
}

.sidebar-track-meta {
  margin-bottom: 0.45rem;
}

.sidebar-track-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.sidebar-track-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.6rem;
}

.sidebar-time-txt {
  font-size: 0.68rem;
  font-family: monospace;
  color: var(--text-muted);
  min-width: 32px;
}

.sidebar-seek-bar {
  flex: 1;
  height: 4px;
}

.sidebar-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.side-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.side-ctrl-btn:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #a855f7;
  transform: scale(1.1);
}

.side-ctrl-btn.active {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}

.side-play-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: none;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: 0 3px 10px rgba(236, 72, 153, 0.4);
}

.side-play-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.6);
}

.side-play-btn.playing {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.5);
}

.side-stop-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.side-stop-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Sidebar Dual Volume Sliders */
.sidebar-volume-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.4);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-vol-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-vol-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.side-vol-mute-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.sidebar-vol-label {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.sidebar-vol-pct {
  font-size: 0.72rem;
  font-weight: 800;
  color: #c084fc;
  font-family: monospace;
}

.side-vol-slider {
  width: 100%;
  height: 4px;
}

/* Sidebar Playlist */
.sidebar-playlist-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.5rem;
}

.sidebar-playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem 0;
  user-select: none;
}

.sidebar-playlist-header:hover {
  color: var(--accent-primary);
}

.sidebar-playlist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.4rem;
  padding-right: 2px;
}

.sidebar-playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.15s ease;
}

.sidebar-playlist-item:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
}

.sidebar-playlist-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.15));
  border-color: #a855f7;
  color: #c084fc;
  font-weight: 700;
}

/* ================================================================
   RESPONSIVE CHO ĐIỆN THOẠI & TABLET (MOBILE & TABLET RESPONSIVENESS)
   ================================================================ */

/* Tablet (Screens <= 992px) */
@media (max-width: 992px) {
  .game-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .game-sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    align-items: start;
  }

  .sidebar-music-card {
    grid-column: 1 / -1;
  }
}

/* Tablet & Phablet (Screens <= 768px) */
@media (max-width: 768px) {
  .monopoly-board-wrapper {
    padding: 8px !important;
    overflow: hidden !important;
    border-radius: var(--radius-md) !important;
  }

  .monopoly-board {
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    min-height: unset !important;
    aspect-ratio: 1 / 1 !important;
    gap: 2.5px !important;
    padding: 3px !important;
  }

  .dice-cube {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.7rem !important;
  }

  .tile-price .rent-prefix {
    display: none !important;
  }
}

/* Mobile Devices (Screens <= 640px) */
/* Mobile Devices (Screens <= 640px) */
@media (max-width: 640px) {
  .game-container {
    padding-left: 4px !important;
    padding-right: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Header tinh gọn trên điện thoại để tiết kiệm diện tích */
  .game-header-bar {
    margin-bottom: 0.65rem !important;
    gap: 0.4rem !important;
  }

  .game-header-info {
    width: 100%;
    text-align: center;
  }

  .game-hero-badge {
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
    margin-bottom: 0.2rem !important;
    display: inline-block !important;
  }

  .game-title {
    font-size: 1.35rem !important;
    margin: 0.1rem 0 0.25rem !important;
    line-height: 1.2 !important;
  }

  .game-subtitle {
    display: none !important; /* Ẩn phụ đề dài trên điện thoại để bàn cờ vào trọn tầm nhìn */
  }

  .game-header-actions {
    width: 100%;
    justify-content: center !important;
    gap: 0.35rem !important;
  }

  .btn-game-action {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.74rem !important;
    border-radius: 6px !important;
    min-height: 30px !important;
  }

  /* KHUNG BAO BÀN CỜ VỪA VẶN MÀN HÌNH ĐIỆN THOẠI */
  .monopoly-board-wrapper {
    padding: 4px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    margin: 0 auto !important;
    max-width: min(100%, 400px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* BÀN CỜ VỪA KHÍT 100% CHIỀU RỘNG MÀN HÌNH ĐIỆN THOẠI - KHÔNG CUỘN NGANG - KHÔNG BỊ TRÀN */
  .monopoly-board {
    width: 100% !important;
    max-width: min(100%, 385px, calc(100vh - 250px)) !important;
    min-width: unset !important;
    min-height: unset !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 auto !important;
    gap: 1.5px !important;
    padding: 2px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  /* Từng ô bàn cờ trên điện thoại */
  .board-tile {
    padding: 2px 1px !important;
    border-radius: 3px !important;
    font-size: 0.52rem !important;
    overflow: hidden !important;
  }

  .board-tile:hover {
    transform: none !important; /* Tắt phóng to khi hover/tap trên điện thoại để không che ô cạnh bên */
  }

  .tile-color-bar {
    height: 3.5px !important;
    margin-bottom: 1px !important;
    border-radius: 1px !important;
  }

  .tile-name {
    font-size: clamp(0.36rem, 1.6vw, 0.48rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.2px !important;
    max-height: 2.2em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .tile-price {
    font-size: clamp(0.34rem, 1.3vw, 0.44rem) !important;
    line-height: 1 !important;
    margin-top: auto !important;
  }

  .board-tile.corner-tile {
    font-size: 0.75rem !important;
    gap: 1px !important;
  }

  .board-tile.corner-tile div:first-child {
    font-size: 1rem !important;
    line-height: 1 !important;
  }

  /* Huy hiệu chủ đất & Nhà trên điện thoại */
  .tile-owner-badge {
    font-size: 0.4rem !important;
    padding: 0 2px !important;
    max-width: 88% !important;
    top: 1px !important;
    right: 1px !important;
    border-radius: 2px !important;
  }

  .tile-owner-badge .owner-badge-name {
    max-width: 20px !important;
  }

  .color-set-badge {
    font-size: 0.4rem !important;
    padding: 0 2px !important;
    top: 5px !important;
  }

  .tile-houses {
    gap: 1px !important;
    min-height: 12px !important;
  }

  .house-model-3d {
    width: 5px !important;
    height: 5px !important;
    font-size: 4px !important;
  }

  .hotel-model-3d {
    font-size: 6px !important;
    padding: 0 2px !important;
  }

  /* Quân cờ người chơi trên điện thoại */
  .tile-tokens-container {
    bottom: 1px !important;
    gap: 1px !important;
  }

  .player-token {
    width: 15px !important;
    height: 15px !important;
    font-size: 0.5rem !important;
    border-width: 1px !important;
  }

  .player-token.active-turn-token::after {
    top: -8px !important;
    font-size: 0.42rem !important;
  }

  /* Vùng trung tâm bàn cờ trên điện thoại */
  .board-center-area {
    padding: 0.35rem 0.25rem !important;
    border-radius: 6px !important;
    justify-content: space-evenly !important;
  }

  .game-logo-banner {
    font-size: clamp(0.75rem, 2.8vw, 0.95rem) !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 1px !important;
    line-height: 1 !important;
  }

  .game-logo-banner div {
    display: none !important; /* Ẩn Vietnam Edition phụ trên điện thoại để tiết kiệm chiều cao */
  }

  .dice-arena {
    gap: 6px !important;
    margin: 2px 0 !important;
  }

  .dice-cube {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.25rem !important;
    border-radius: 6px !important;
  }

  .turn-announcement {
    font-size: 0.68rem !important;
    padding: 1px 6px !important;
    margin-bottom: 3px !important;
    line-height: 1.2 !important;
  }

  .action-buttons-row {
    gap: 3px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .action-buttons-row .btn {
    padding: 4px 7px !important;
    font-size: 0.72rem !important;
    min-height: 28px !important;
    border-radius: 6px !important;
  }

  .center-audio-controls-group {
    top: 2px !important;
    right: 2px !important;
    gap: 2px !important;
  }

  .btn-sound-toggle {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.65rem !important;
  }

  /* Cột thông tin phụ bên dưới bàn cờ */
  .game-sidebar {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    width: 100% !important;
    max-width: min(100%, 400px) !important;
    margin: 0 auto !important;
  }

  /* Thẻ thông tin người chơi hiển thị dạng 2 cột ngang nhỏ gọn */
  .players-card {
    padding: 0.75rem !important;
  }

  .players-card .players-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .player-card-item {
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }

  .player-card-name {
    font-size: 0.78rem !important;
  }

  .player-card-money {
    font-size: 0.74rem !important;
  }

  .game-log-card {
    padding: 0.75rem !important;
  }

  .game-log-box {
    max-height: 120px !important;
    font-size: 0.74rem !important;
  }

  .sidebar-music-card {
    padding: 0.75rem !important;
  }

  .sidebar-controls-row {
    gap: 6px;
  }

  .side-ctrl-btn {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .side-play-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  /* Modal responsive on mobile */
  #musicCenterModal .modal-dialog {
    max-width: 96vw !important;
    width: 96vw !important;
    padding: 0.5rem !important;
  }

  #musicCenterModal .volume-panel-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  #musicCenterModal .music-hero-card {
    padding: 0.85rem !important;
  }

  #musicCenterModal .vinyl-record {
    width: 75px !important;
    height: 75px !important;
  }

  #musicCenterModal .vinyl-center-label {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }

  #musicCenterModal .music-hero-title {
    font-size: 0.95rem !important;
  }
}

/* Small / Compact Phones (Screens <= 400px e.g. iPhone SE, Galaxy Fold outer) */
@media (max-width: 400px) {
  .game-container {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }

  .monopoly-board-wrapper {
    padding: 2px !important;
    max-width: 100% !important;
  }

  .monopoly-board {
    max-width: min(100%, 335px, calc(100vh - 230px)) !important;
    gap: 1px !important;
    padding: 1px !important;
  }

  .tile-color-bar {
    height: 2.5px !important;
  }

  .tile-name {
    font-size: 0.35rem !important;
    line-height: 1 !important;
  }

  .tile-price {
    font-size: 0.32rem !important;
  }

  .board-tile.corner-tile div:first-child {
    font-size: 0.9rem !important;
  }

  .player-token {
    width: 13px !important;
    height: 13px !important;
    font-size: 0.42rem !important;
  }

  .dice-cube {
    width: 28px !important;
    height: 28px !important;
    font-size: 1.1rem !important;
    border-radius: 5px !important;
  }

  .action-buttons-row .btn {
    padding: 3px 5px !important;
    font-size: 0.68rem !important;
    min-height: 25px !important;
  }

  .turn-announcement {
    font-size: 0.64rem !important;
  }

  .sidebar-music-header h4 {
    font-size: 0.84rem !important;
  }

  .sidebar-vol-header {
    font-size: 0.7rem !important;
  }

  .sidebar-playlist-list {
    max-height: 140px;
  }

  .sidebar-playlist-item {
    font-size: 0.72rem !important;
    padding: 4px 5px !important;
  }
}

/* ================= Shield Badge & Debt Modal Styles ================= */
.shield-badge {
  position: absolute;
  bottom: 12px;
  right: 4px;
  background: rgba(14, 165, 233, 0.9);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.4);
}

.debt-asset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.debt-asset-card:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.05);
}

.debt-asset-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.debt-asset-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.debt-asset-meta {
  min-width: 0;
}

.debt-asset-meta h5 {
  margin: 0 0 2px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debt-asset-meta small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.debt-asset-action {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.debt-sale-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: #10b981;
}

/* ================= Landing Tile Action Modal (#tileActionModal) ================= */
.modal-backdrop.tile-action-backdrop,
#tileActionModal {
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  align-items: center;
  justify-content: center;
}

#tileActionModal.active {
  display: flex !important;
}

.tile-action-card {
  width: min(520px, 94vw);
  max-height: min(92vh, 680px);
  padding: 1.5rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 40px var(--tile-action-accent, rgba(99, 102, 241, 0.3));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
}

.tile-action-card::-webkit-scrollbar {
  width: 5px;
}
.tile-action-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 3px;
}

@keyframes modalPopIn {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.tile-action-header {
  text-align: center;
  position: relative;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.tile-action-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 3px 12px;
  border-radius: 20px;
  background: var(--tile-action-accent, #6366f1);
  color: #ffffff;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.tile-action-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  letter-spacing: -0.5px;
}

.tile-action-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
}

.tile-action-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tile-action-owner-tag strong {
  color: var(--owner-color, #38bdf8);
}

.tile-action-level-tag strong {
  color: #34d399;
}

.tile-action-prices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  flex-shrink: 0;
}

.price-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.price-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.price-stat-card.buy-stat {
  border-top: 3px solid #06b6d4;
  background: rgba(6, 182, 212, 0.07);
}

.price-stat-card.rent-stat {
  border-top: 3px solid #10b981;
  background: rgba(16, 185, 129, 0.07);
}

.price-stat-card.sale-stat {
  border-top: 3px solid #06b6d4;
  background: rgba(6, 182, 212, 0.07);
}

.price-stat-card.buyout-stat {
  border-top: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.07);
}

.price-stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.35rem;
}

.price-stat-value {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
}

.price-stat-value.text-emerald { color: #34d399; }
.price-stat-value.text-cyan { color: #38bdf8; }
.price-stat-value.text-amber { color: #fbbf24; }

.price-stat-sub {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.25rem;
}

.tile-action-buttons-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.tile-action-btn-primary {
  flex: 1.6;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile-action-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.tile-action-btn-primary.btn-buyout {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.tile-action-btn-primary.btn-upgrade {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.tile-action-btn-secondary {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #cbd5e1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.tile-action-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.tile-action-auto-note {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  text-align: center;
  font-style: italic;
  flex-shrink: 0;
}

/* ================= Responsive Card Styles for Mobile (< 520px) ================= */
@media (max-width: 520px) {
  .modal-backdrop.deed-modal-backdrop,
  #propertyDeedModal,
  .modal-backdrop.tile-action-backdrop,
  #tileActionModal {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .property-deed-dialog {
    max-width: 100%;
    width: 100%;
    max-height: 94vh;
    margin: auto 0;
    border-radius: 16px;
  }

  .deed-header {
    padding: 0.85rem 1rem 0.75rem;
  }

  .deed-badge {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
  }

  .deed-title {
    font-size: 1.25rem;
    margin: 0.2rem 0 0.1rem;
  }

  .deed-subtitle {
    font-size: 0.74rem;
  }

  .deed-close-btn {
    width: 30px;
    height: 30px;
    font-size: 1.15rem;
    top: 8px;
    right: 10px;
  }

  .deed-body {
    padding: 0.85rem;
    gap: 0.7rem;
  }

  .deed-status-box {
    padding: 0.55rem 0.75rem;
  }

  .deed-status-label {
    font-size: 0.7rem;
  }

  .deed-status-val {
    font-size: 0.86rem;
  }

  .deed-multiplier-banner {
    padding: 0.5rem 0.7rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .deed-multiplier-label {
    font-size: 0.76rem;
  }

  .deed-multiplier-text {
    font-size: 0.82rem;
    text-align: left;
  }

  .deed-table-title {
    font-size: 0.8rem;
  }

  .deed-table {
    font-size: 0.76rem;
    min-width: 290px;
  }

  .deed-table th,
  .deed-table td {
    padding: 0.42rem 0.28rem;
  }

  .deed-build-cost-box {
    padding: 0.5rem 0.75rem;
    font-size: 0.76rem;
  }

  .deed-close-btn-bottom {
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
  }

  /* Tile Action Card Mobile */
  .tile-action-card {
    width: 100%;
    max-height: 94vh;
    padding: 1rem 0.85rem;
    gap: 0.65rem;
    border-radius: 16px;
    margin: auto 0;
  }

  .tile-action-header {
    padding-bottom: 0.5rem;
  }

  .tile-action-badge {
    font-size: 0.64rem;
    padding: 2px 9px;
    margin-bottom: 0.3rem;
  }

  .tile-action-title {
    font-size: 1.25rem;
  }

  .tile-action-subtitle {
    font-size: 0.74rem;
  }

  .tile-action-status-box {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
  }

  .tile-action-prices-grid {
    gap: 0.4rem;
  }

  .price-stat-card {
    padding: 0.55rem 0.35rem;
    border-radius: 10px;
  }

  .price-stat-label {
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
  }

  .price-stat-value {
    font-size: clamp(0.78rem, 2.8vw, 0.95rem);
  }

  .price-stat-sub {
    font-size: 0.6rem;
    margin-top: 0.15rem;
  }

  .tile-action-buttons-row {
    gap: 0.5rem;
    margin-top: 0.15rem;
  }

  .tile-action-btn-primary {
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    border-radius: 12px;
  }

  .tile-action-btn-secondary {
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 12px;
  }

  .tile-action-auto-note {
    font-size: 0.68rem;
  }
}

/* ================= Landscape Mobile / Short Viewports (< 540px height) ================= */
@media (max-height: 540px) {
  .modal-backdrop.deed-modal-backdrop,
  #propertyDeedModal,
  .modal-backdrop.tile-action-backdrop,
  #tileActionModal {
    padding: 0.35rem;
    align-items: flex-start;
  }

  .property-deed-dialog {
    max-height: 96vh;
  }

  .deed-header {
    padding: 0.5rem 0.85rem;
  }

  .deed-title {
    font-size: 1.15rem;
    margin: 0;
  }

  .deed-subtitle {
    display: none;
  }

  .deed-body {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .tile-action-card {
    padding: 0.75rem 0.85rem;
    gap: 0.45rem;
    max-height: 96vh;
  }

  .tile-action-subtitle,
  .tile-action-auto-note {
    display: none;
  }
}

/* ================= Mini Hotel & Houses Styling ================= */
.mini-hotel-landmark {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, #d97706, #dc2626);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 5px;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), 0 2px 5px rgba(0, 0, 0, 0.6);
  border: 1.5px solid #fef08a;
  animation: hotelGlow 1.8s infinite alternate, houseSpawn 0.4s ease-out;
  letter-spacing: 0.3px;
  position: relative;
}

.mini-hotel-landmark .hotel-crown {
  font-size: 0.68rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.mini-hotel-landmark .hotel-star-badge {
  font-size: 0.58rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 3px;
  border-radius: 3px;
  color: #fef08a;
  font-weight: 800;
}

/* ================= Skip Action Button ================= */
.btn-game-skip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.btn-game-skip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
}

/* ==========================================================================
   Huỳnh Nguyễn Thành Đạt - Monopoly Vietnam Light Theme System
   Đảm bảo khả năng hiển thị tương phản cao, chữ sắc nét, thiết kế bàn cờ
   hiện đại, sang trọng và chuẩn mực khi ở chế độ Ban Ngày [data-theme="light"]
   ========================================================================== */

[data-theme="light"] .monopoly-board-wrapper {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .monopoly-board {
  background: #cbd5e1; /* Viền rãnh chia ô cờ 4px sắc nét chuẩn cờ tỷ phú */
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .board-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .board-tile:hover {
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .board-tile.corner-tile {
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  border: 1.5px solid #c7d2fe;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .board-tile.corner-tile .tile-name {
  color: #1e1b4b;
  font-weight: 800;
}

[data-theme="light"] .tile-name {
  color: #0f172a;
  font-weight: 700;
  text-shadow: none;
}

[data-theme="light"] .tile-price {
  color: #047857; /* Xanh ngọc đậm sắc sảo, nổi bật trên nền trắng */
  font-weight: 800;
  text-shadow: none;
}

[data-theme="light"] .tile-price .rent-prefix {
  color: #475569;
  font-weight: 700;
}

[data-theme="light"] .tile-price.rent-boosted {
  color: #b45309; /* Hổ phách đậm tương phản cao */
  font-weight: 800;
  text-shadow: 0 0 1px rgba(180, 83, 9, 0.2);
}

[data-theme="light"] .tile-price.rent-hotel {
  color: #b91c1c; /* Đỏ ruby quyền lực */
  font-weight: 900;
  text-shadow: 0 0 1px rgba(185, 28, 28, 0.25);
}

[data-theme="light"] .board-center-area {
  background: radial-gradient(circle at center, #ffffff 35%, #f8fafc 100%);
  border: 1.5px dashed #cbd5e1;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .game-logo-banner {
  background: linear-gradient(135deg, #b45309, #dc2626, #4338ca);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .game-logo-banner div {
  color: #64748b !important;
}

[data-theme="light"] .turn-announcement {
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  color: #3730a3;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .dice-cube {
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08), inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .btn-sound-toggle {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-sound-toggle:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

[data-theme="light"] .btn-game-skip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

[data-theme="light"] .btn-game-skip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .player-status-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .player-status-card.active-turn {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.18);
}

[data-theme="light"] .player-money-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .player-money-lbl {
  color: #64748b;
}

[data-theme="light"] .player-money-val {
  color: #047857;
}

[data-theme="light"] .game-log-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

[data-theme="light"] .log-entry {
  border-bottom: 1px dashed #e2e8f0;
}

[data-theme="light"] .log-entry.log-highlight {
  color: #b45309;
  font-weight: 700;
}

[data-theme="light"] .log-entry.log-success {
  color: #047857;
  font-weight: 700;
}

[data-theme="light"] .log-entry.log-danger {
  color: #b91c1c;
  font-weight: 700;
}

[data-theme="light"] .sidebar-music-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .tile-action-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12), 0 0 30px rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .tile-action-header {
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .tile-action-title {
  color: #0f172a;
}

[data-theme="light"] .tile-action-subtitle {
  color: #64748b;
}

[data-theme="light"] .tile-action-status-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .tile-action-owner-tag {
  color: #334155;
}

[data-theme="light"] .tile-action-level-tag {
  color: #334155;
}

[data-theme="light"] .price-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .price-stat-card.buy-stat {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-top: 3px solid #0d9488;
}

[data-theme="light"] .price-stat-card.rent-stat {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-top: 3px solid #059669;
}

[data-theme="light"] .price-stat-card.buyout-stat {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-top: 3px solid #d97706;
}

[data-theme="light"] .price-stat-label {
  color: #475569;
}

[data-theme="light"] .price-stat-value.text-emerald { color: #047857; }
[data-theme="light"] .price-stat-value.text-cyan { color: #0284c7; }
[data-theme="light"] .price-stat-value.text-amber { color: #b45309; }

[data-theme="light"] .price-stat-sub {
  color: #64748b;
}

[data-theme="light"] .tile-action-btn-secondary {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .tile-action-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .tile-action-auto-note {
  color: #64748b;
}

[data-theme="light"] .debt-asset-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .debt-asset-card:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

[data-theme="light"] .debt-asset-icon {
  background: #f1f5f9;
}

[data-theme="light"] .debt-sale-price {
  color: #047857;
}

[data-theme="light"] .target-tile-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .target-tile-card:hover {
  background: #eef2ff;
  border-color: #6366f1;
}

[data-theme="light"] .target-tile-name {
  color: #0f172a;
}

[data-theme="light"] .target-tile-meta {
  color: #64748b;
}

[data-theme="light"] .property-deed-dialog {
  border-color: #cbd5e1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  background: #ffffff;
}

[data-theme="light"] .property-deed-card {
  background: #ffffff;
}

[data-theme="light"] .property-deed-card .deed-body {
  background: #ffffff !important;
}

[data-theme="light"] .deed-status-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] #deedOwnerName {
  color: #0f172a !important;
}

[data-theme="light"] .deed-status-val {
  color: #0f172a;
}

[data-theme="light"] .deed-multiplier-banner {
  background: linear-gradient(90deg, #fef3c7, #ffedd5) !important;
  border-color: #f59e0b !important;
}

[data-theme="light"] .deed-multiplier-label {
  color: #b45309 !important;
}

[data-theme="light"] .deed-multiplier-text {
  color: #c2410c !important;
}

[data-theme="light"] .deed-table-title {
  color: #0f172a !important;
}

[data-theme="light"] .deed-table-wrapper {
  border-color: #e2e8f0;
  background: #ffffff;
}

[data-theme="light"] .deed-table thead tr {
  background: #f8fafc !important;
  border-bottom: 2px solid #e2e8f0 !important;
  color: #64748b !important;
}

[data-theme="light"] .deed-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

[data-theme="light"] .deed-table tbody tr:hover {
  background: #f8fafc;
}

[data-theme="light"] .deed-table tbody tr.current-level {
  background: #f0fdf4 !important;
}

[data-theme="light"] .deed-col-invested {
  color: #0284c7 !important;
}

[data-theme="light"] .deed-col-rent {
  color: #059669 !important;
}

[data-theme="light"] .deed-col-buyout {
  color: #d97706 !important;
}

[data-theme="light"] #deedBuildCostRow {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .mini-house {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* ========================================================
   IN-GAME REALTIME CHAT WIDGET (COLLAPSIBLE / MINIMIZABLE)
   ======================================================== */
.game-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10050;
  font-family: inherit;
}

/* Nút Thu Nhỏ / Bật Mở Chat */
.game-chat-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  user-select: none;
}

.game-chat-toggle-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.65), 0 4px 10px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.game-chat-toggle-btn:active {
  transform: translateY(0) scale(0.98);
}

.chat-toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.chat-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Khung Chat Mở Rộng */
.game-chat-panel {
  width: 350px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(85vh - 40px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatPanelSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatPanelSlideUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Chat Header */
.game-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: #ffffff;
}

.chat-header-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.chat-room-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
  margin-left: 2px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-chat-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.btn-chat-action:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transform: scale(1.05);
}

/* Danh Sách Tin Nhắn */
.game-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.game-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.game-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.chat-welcome-msg {
  text-align: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  margin-bottom: 4px;
}

.chat-welcome-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

/* Bong bóng chat từng người */
.chat-msg-item {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: chatMsgAppear 0.22s ease-out;
}

@keyframes chatMsgAppear {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.chat-msg-item.msg-self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.chat-msg-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-msg-item.msg-self .chat-msg-body {
  align-items: flex-end;
}

.chat-msg-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.chat-msg-sender {
  font-weight: 800;
  color: #818cf8;
}

.chat-msg-time {
  color: var(--text-muted, #64748b);
  font-size: 0.68rem;
}

.chat-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.chat-msg-item.msg-self .chat-msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  border-bottom-right-radius: 2px;
}

.chat-msg-item:not(.msg-self) .chat-msg-bubble {
  border-bottom-left-radius: 2px;
}

/* System Message inside chat */
.chat-msg-system {
  align-self: center;
  text-align: center;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 4px 0;
  max-width: 95%;
  line-height: 1.35;
}

/* Quick Emoji Bar */
.game-chat-quick-reactions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  flex-shrink: 0;
}

.game-chat-quick-reactions::-webkit-scrollbar {
  display: none;
}

.btn-quick-emoji {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  color: #ffffff;
}

.btn-quick-emoji:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.15) translateY(-2px);
}

.btn-quick-emoji:active {
  transform: scale(0.95);
}

/* Form Nhập Chat */
.game-chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.game-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.game-chat-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.game-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.btn-send-chat {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-send-chat:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.6);
}

.btn-send-chat:active {
  transform: scale(0.92);
}

/* Light Mode Styles for Chat */
[data-theme="light"] .game-chat-panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: #cbd5e1;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15), 0 0 0 1px #e2e8f0;
}

[data-theme="light"] .game-chat-header {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .chat-header-title {
  color: #0f172a;
}

[data-theme="light"] .btn-chat-action {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .chat-welcome-msg {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .chat-msg-bubble {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .chat-msg-item.msg-self .chat-msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
}

[data-theme="light"] .game-chat-quick-reactions {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .btn-quick-emoji {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .game-chat-form {
  background: #ffffff;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .game-chat-input {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .game-chat-input::placeholder {
  color: #94a3b8;
}

/* Responsive adjustment for Mobile */
@media (max-width: 640px) {
  .game-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .game-chat-panel {
    width: calc(100vw - 32px);
    height: 400px;
  }
}

/* Ẩn các button hỗ trợ / floating social trên giao diện game giải trí cờ tỷ phú */
.portal-floating-social {
  display: none !important;
}

/* ================= Player Level, Stats, History & Achievements UI ================= */
.game-user-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.game-user-level-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
}

/* Player Stats Modal Grid */
.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-metric-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-metric-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Level Progress Bar */
.level-progress-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.level-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.level-progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Match History List */
.history-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: background 0.15s ease;
}

.history-card-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.history-badge-win {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.history-badge-loss {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  position: relative;
  transition: all 0.2s ease;
}

.achievement-card.ach-unlocked {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}

.achievement-card.ach-locked {
  opacity: 0.55;
  filter: grayscale(80%);
}

.achievement-card.ach-unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.ach-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ach-locked .ach-icon-circle {
  background: rgba(255, 255, 255, 0.05);
}

.ach-info-box {
  min-width: 0;
  flex: 1;
}

.ach-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ach-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.ach-badge-tag {
  font-size: 0.65rem;
  color: #fbbf24;
  font-weight: 700;
  margin-top: 3px;
  display: inline-block;
}

/* ================= Persistent Modal Shake Warning Animation ================= */
@keyframes modalShakeAnim {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-9px); }
  30%, 60%, 90% { transform: translateX(9px); }
}

.modal-shake-anim {
  animation: modalShakeAnim 0.4s ease-in-out !important;
}

/* ================= Synchronized Dice Roll Landing & Roller Badge ================= */
.dice-cube.dice-landed {
  animation: diceLandBounce 0.42s cubic-bezier(0.22, 1.35, 0.36, 1) both;
}

.dice-cube.dice-double-flash {
  animation: diceDoubleFlash 0.65s ease-out both;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.9), 0 0 42px rgba(99, 102, 241, 0.65), inset 0 0 10px rgba(251, 191, 36, 0.55);
  border: 2px solid #fbbf24;
}

@keyframes diceLandBounce {
  0% { transform: scale(1.22) translateY(-10px) rotateZ(-6deg); }
  55% { transform: scale(0.92) translateY(3px) rotateZ(2deg); }
  100% { transform: scale(1) translateY(0) rotateZ(0deg); }
}

@keyframes diceDoubleFlash {
  0% { transform: scale(1.25) translateY(-10px); }
  45% { transform: scale(0.94) translateY(2px); }
  75% { transform: scale(1.1) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}

.dice-roller-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.25rem 0.78rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  margin: -0.35rem auto 0.45rem;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.22s ease;
}

.dice-roller-status.is-rolling {
  border-color: rgba(251, 191, 36, 0.7);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
}

.dice-roller-status.is-double {
  border-color: rgba(251, 191, 36, 0.9);
  color: #fef08a;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(99, 102, 241, 0.28));
}

[data-theme="light"] .dice-roller-status {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .dice-roller-status.is-rolling {
  background: #fffbeb;
  color: #b45309;
  border-color: #f59e0b;
}

[data-theme="light"] .dice-roller-status.is-double {
  background: linear-gradient(135deg, #fef3c7, #e0e7ff);
  color: #92400e;
  border-color: #f59e0b;
}

/* ================= 4-Player Online Waiting Room Lobby ================= */
.lobby-modal-panel {
  width: min(560px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.45rem;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.65), 0 0 32px rgba(99, 102, 241, 0.25);
  border-radius: 18px;
  text-align: left;
  animation: popIn 0.28s ease;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.lobby-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.lobby-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
  animation: pulse 1.6s infinite ease-in-out;
}

.lobby-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #fbbf24;
  font-weight: 800;
}

.lobby-title {
  margin: 0.1rem 0 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-seat-counter {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.lobby-seat-counter.is-ready {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.lobby-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg-primary);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  margin-bottom: 1rem;
}

.lobby-code-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.lobby-code-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lobby-code-value {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #38bdf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lobby-code-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lobby-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.lobby-status-hint {
  font-size: 0.74rem;
  color: #fbbf24;
  font-weight: 700;
}

.lobby-status-hint.is-ready {
  color: #10b981;
}

.lobby-seats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.lobby-seat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-glass);
  min-width: 0;
  transition: all 0.2s ease;
}

.lobby-seat-card.is-occupied {
  border-color: var(--seat-color, var(--accent-primary));
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.25));
}

.lobby-seat-card.is-empty {
  border-style: dashed;
  opacity: 0.72;
}

.lobby-seat-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--seat-color, #64748b);
  background: rgba(148, 163, 184, 0.12);
}

.lobby-seat-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.lobby-seat-token-chip {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--seat-color, #6366f1);
  color: #fff;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f172a;
}

.lobby-seat-info {
  min-width: 0;
  flex: 1;
}

.lobby-seat-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-seat-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 2px;
}

.lobby-host-crown {
  color: #fbbf24;
  font-weight: 700;
}

.lobby-kick-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.lobby-kick-btn:hover {
  background: rgba(239, 68, 68, 0.32);
  color: #fff;
}

.lobby-invite-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 1rem;
}

.lobby-invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 0.55rem;
}

.lobby-invite-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 155px;
  overflow-y: auto;
  padding-right: 2px;
}

.lobby-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
}

.lobby-invite-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.lobby-invite-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #10b981;
  flex-shrink: 0;
}

.lobby-invite-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-invite-empty {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.65rem 0.25rem;
}

.lobby-invite-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.lobby-invite-badge.is-pending {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.lobby-invite-badge.is-joined {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.lobby-guest-notice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  color: #fde68a;
  margin-bottom: 1rem;
  line-height: 1.45;
}

.lobby-pulse-icon {
  display: inline-block;
  font-size: 1.1rem;
  animation: pulse 1.5s infinite ease-in-out;
}

.lobby-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.lobby-start-btn {
  flex: 1;
  min-width: 190px;
  justify-content: center;
  font-weight: 800;
}

.lobby-start-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

[data-theme="light"] .lobby-modal-panel {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .lobby-seat-card.is-occupied {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), #f8fafc);
}

[data-theme="light"] .lobby-seat-counter {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}

[data-theme="light"] .lobby-seat-counter.is-ready {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

[data-theme="light"] .lobby-guest-notice {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}

@media (max-width: 640px) {
  .dice-roller-status {
    font-size: 0.62rem !important;
    padding: 1px 6px !important;
    margin: 0 auto 2px !important;
  }

  .lobby-modal-panel {
    padding: 1rem;
    width: 96vw;
  }

  .lobby-seats-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .lobby-code-value {
    font-size: 1.05rem;
    letter-spacing: 2px;
  }

  .lobby-footer {
    flex-direction: column;
  }

  .lobby-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

#waitingInviteModal.active,
#roomCancelledModal.active {
  display: flex !important;
}

.room-cancelled-panel {
  width: min(440px, 94vw);
  padding: 1.85rem 1.5rem;
  text-align: center;
  border: 2px solid rgba(239, 68, 68, 0.55);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.7), 0 0 32px rgba(239, 68, 68, 0.25);
  border-radius: 18px;
  animation: popIn 0.28s ease;
}

.room-cancelled-icon {
  font-size: 3.1rem;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.room-cancelled-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  margin-bottom: 0.55rem;
}

.room-cancelled-title {
  margin: 0 0 0.55rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: #f87171;
}

.room-cancelled-desc {
  margin: 0 0 1.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.room-cancelled-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

[data-theme="light"] .room-cancelled-panel {
  background: #ffffff;
  border-color: #fca5a5;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .room-cancelled-title {
  color: #dc2626;
}

[data-theme="light"] .room-cancelled-badge {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}




