/* =============================================================
   CỜ TỶ PHÚ PIXEL RPG — BẢN NÂNG CẤP GIAO DIỆN CAO CẤP V3
   ============================================================= */

:root {
  --ink: #0a1222;
  --gold: #f7d286;
  --gold-soft: #ffedb8;
  --gold-deep: #c98f3f;
  --cream: #f6f1de;
  --muted: #9dabc7;
  --glow: rgba(245, 199, 110, 0.25);
  --card: #151f39;
  --card-hi: #223156;
  --blue-neon: #4ea8de;
  --blue-glow: rgba(78, 168, 222, 0.4);
  --red-neon: #f26a8d;
  --red-glow: rgba(242, 106, 141, 0.4);
}

/* ================= 1. TRANG CHỦ FANTASY PIXEL RPG MENU PC ================= */
.home-page {
  padding: 0 !important;
  max-width: 100% !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.fantasy-home-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  background: url('./fantasy-v3/home-kingdom.png') center 40% / cover no-repeat;
  isolation: isolate;
  min-height: calc(100vh - 78px);
  overflow: visible;
  overflow-x: hidden;
}

.fantasy-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(10, 25, 48, 0.3) 0%, rgba(6, 14, 28, 0.82) 65%, #050b16 100%),
    linear-gradient(180deg, rgba(8, 18, 34, 0.7) 0%, rgba(10, 20, 38, 0.4) 40%, rgba(4, 9, 18, 0.95) 100%);
  pointer-events: none;
}

.fantasy-castle-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 300px;
  background: radial-gradient(circle, rgba(247, 210, 134, 0.16) 0%, rgba(138, 92, 194, 0.1) 45%, transparent 70%);
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
  animation: castleGlowPulse 6s ease-in-out infinite alternate;
}

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

/* Tiêu đề Game */
.home-title-area {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 12px;
}

.game-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gold);
  font-size: 20px;
  margin-bottom: 4px;
}

.crest-crown {
  font-size: 32px;
  line-height: 1;
  color: #ffea9f;
  filter: drop-shadow(0 0 16px #f7d286aa);
  animation: crownFloat 4s ease-in-out infinite alternate;
}

.crest-wings.flip {
  transform: scaleX(-1);
}

@keyframes crownFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.home-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(247, 210, 134, 0.4);
  margin-bottom: 6px;
}

.game-main-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 5.5vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 2px;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fff0cf 40%, #f7d286 70%, #d49a42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(247, 210, 134, 0.35));
}

.title-sub {
  display: block;
  font-size: clamp(11px, 1.8vw, 16px);
  letter-spacing: 6px;
  margin-top: 6px;
  font-weight: 600;
  background: linear-gradient(90deg, #d2e4ff, #ffe8be, #d2e4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-lead-desc {
  font-size: 13px;
  color: #cad8ee;
  margin-top: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
}

/* Menu PC RPG Trung Tâm */
.rpg-menu-container {
  position: relative;
  z-index: 2;
  width: min(520px, 94%);
  margin: 16px auto;
  background: linear-gradient(180deg, rgba(16, 28, 52, 0.88), rgba(9, 18, 34, 0.94));
  border: 1px solid rgba(247, 210, 134, 0.4);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(247, 210, 134, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.rpg-menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Nút Bắt Đầu Chơi nổi bật nhất */
.btn-play-primary {
  position: relative;
  overflow: hidden;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #1a2318;
  background: linear-gradient(180deg, #fff2c4 0%, #f7d286 45%, #e5b050 100%);
  border: 2px solid #fff5cf;
  border-radius: 12px;
  box-shadow:
    0 6px 0 #946927,
    0 10px 25px rgba(247, 210, 134, 0.45),
    inset 0 1px 0 #ffffff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.2s;
}

.btn-play-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow:
    0 8px 0 #946927,
    0 14px 35px rgba(247, 210, 134, 0.65),
    inset 0 1px 0 #ffffff;
}

.btn-play-primary:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #946927, 0 6px 15px rgba(247, 210, 134, 0.35);
}

.btn-play-primary .btn-sword {
  font-size: 22px;
  color: #5a4014;
}

.btn-play-primary .btn-sword.flip {
  transform: scaleX(-1);
}

.btn-play-primary .btn-shine {
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-25deg);
  animation: shineSweep 4.5s ease-in-out infinite;
}

@keyframes shineSweep {
  0%, 60% { left: -120%; }
  100% { left: 220%; }
}

/* Nút Tiếp tục */
.btn-secondary {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #f1f4fc;
  background: linear-gradient(180deg, #1f3154, #14223b);
  border: 1px solid rgba(247, 210, 134, 0.35);
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn-secondary:hover {
  background: linear-gradient(180deg, #273d69, #1a2c4e);
  border-color: var(--gold);
  color: var(--gold-soft);
  transform: translateY(-1px);
}

.btn-state-badge {
  background: #2b7a4b;
  color: #bbf7d0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Lưới 6 nút chức năng */
.rpg-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 4px;
}

.btn-compact {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #dbe4f6;
  background: rgba(26, 40, 68, 0.7);
  border: 1px solid rgba(157, 171, 199, 0.22);
  border-radius: 8px;
  padding: 0 8px;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-compact:hover {
  background: rgba(43, 64, 107, 0.85);
  border-color: rgba(247, 210, 134, 0.5);
  color: var(--gold);
  transform: translateY(-1px);
}

.btn-compact .btn-icon {
  font-size: 15px;
}

/* Footer trang chủ */
.fantasy-home-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(247, 210, 134, 0.2);
  margin-top: auto;
}

.footer-pills {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #b6c5df;
}

.footer-pills .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  margin-right: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-link-btn:hover {
  color: #fff0cf;
}

.footer-version {
  font-size: 11px;
  color: #7b8ea8;
}

/* ================= 2. POPUP CHỌN CHẾ ĐỘ CHƠI (FANTASY MODE SELECT MODAL) ================= */
.mode-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 7, 15, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: visible;
}

.mode-popup-panel {
  position: relative;
  width: min(840px, 96%);
  background: linear-gradient(180deg, #121c32 0%, #0d1628 100%);
  border: 1px solid rgba(247, 210, 134, 0.5);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(247, 210, 134, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--cream);
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 20px;
  color: #a0b1cb;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.mode-popup-header {
  text-align: center;
  margin-bottom: 24px;
}

.mode-popup-header h2 {
  font-size: 26px;
  color: #fff4d1;
  margin: 4px 0 6px;
}

.mode-popup-header p {
  font-size: 13px;
  color: var(--muted);
}

/* 3 thẻ lớn 1vs1, 2vs2, 3vs3 */
.mode-cards-major {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.mode-major-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, #182642 0%, #101c34 100%);
  border: 1px solid rgba(247, 210, 134, 0.28);
  border-radius: 14px;
  padding: 24px 16px 20px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mode-major-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(247, 210, 134, 0.22);
}

.mode-major-card.featured {
  border-color: rgba(247, 210, 134, 0.7);
  background: linear-gradient(180deg, #1d3154 0%, #13223e 100%);
  box-shadow: 0 0 20px rgba(247, 210, 134, 0.15);
}

.card-badge-popular {
  position: absolute;
  top: -10px;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-emblem {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.card-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff2c7;
  letter-spacing: 1px;
}

.card-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 11px;
  line-height: 1.5;
  color: #a8b9d6;
  margin-bottom: 14px;
  flex: 1;
}

.card-action-hint {
  font-size: 12px;
  font-weight: 700;
  color: #ffe69f;
  margin-top: auto;
}

/* Mục Tùy Chỉnh & Chế Độ Khác */
.mode-custom-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.custom-modes-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #c9d8ee;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.custom-modes-summary:hover {
  color: var(--gold);
  background: rgba(247, 210, 134, 0.08);
}

.custom-modes-content {
  padding: 16px 8px 4px;
}

.custom-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.custom-field-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #9eb0cc;
}

.custom-field-grid select {
  height: 38px;
  background: #111e35;
  border: 1px solid rgba(247, 210, 134, 0.3);
  border-radius: 7px;
  padding: 0 10px;
  color: #fff;
}

.custom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ================= 3. SẢNH CHỜ MỚI - PHONG CÁCH GAME ĐỐI KHÁNG ================= */
.setup-page {
  padding: 16px 20px !important;
  max-width: 1400px;
  margin: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fighting-lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(247, 210, 134, 0.25);
  margin-bottom: 16px;
  flex: none;
}

.lobby-back-btn {
  font-size: 13px;
  color: var(--gold);
  cursor: pointer;
}

.lobby-title-wrap {
  text-align: center;
}

.lobby-title-wrap h1 {
  font-size: 22px;
  color: #fff5d6;
  margin: 2px 0 0;
}

.lobby-quick-meta {
  display: flex;
  gap: 8px;
}

.meta-pill {
  background: rgba(247, 210, 134, 0.12);
  border: 1px solid rgba(247, 210, 134, 0.3);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Đấu trường 2 bên: Đội Lam (Trái) | VS PHÁT SÁNG | Đội Hồng (Phải) */
.fighting-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 0;
  overflow: visible;
  padding: 10px 0;
}

.team-bracket {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.team-bracket.team-blue {
  background: linear-gradient(135deg, rgba(13, 33, 62, 0.75), rgba(7, 18, 38, 0.85));
  border: 1px solid var(--blue-glow);
  box-shadow: 0 0 30px rgba(78, 168, 222, 0.12);
}

.team-bracket.team-red {
  background: linear-gradient(225deg, rgba(62, 18, 33, 0.75), rgba(38, 9, 18, 0.85));
  border: 1px solid var(--red-glow);
  box-shadow: 0 0 30px rgba(242, 106, 141, 0.12);
}

.team-header-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.team-blue .team-name { color: #80c4ff; font-size: 15px; }
.team-red .team-name { color: #ff8fb0; font-size: 15px; }
.team-sub { color: #8ca3c7; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }

/* Hàng thẻ nhân vật NGANG */
.horizontal-cards-row {
  display: flex;
  gap: 14px;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

/* Thẻ nhân vật HÌNH CHỮ NHẬT ĐỨNG */
.standing-hero-card {
  position: relative;
  width: clamp(120px, 16vw, 175px);
  height: clamp(260px, 46vh, 360px);
  border-radius: 14px;
  background: linear-gradient(180deg, #16243e 0%, #0d1628 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.team-blue .standing-hero-card.slot-occupied {
  border-color: #4ea8de;
  box-shadow: 0 0 18px rgba(78, 168, 222, 0.35);
}

.team-red .standing-hero-card.slot-occupied {
  border-color: #f26a8d;
  box-shadow: 0 0 18px rgba(242, 106, 141, 0.35);
}

.standing-hero-card.is-me {
  border-color: #ffd166 !important;
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.5) !important;
}

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 8px 12px;
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.seat-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-player { background: #2563eb; color: #eff6ff; }
.badge-ai { background: #d97706; color: #fffbeb; }

.slot-remove-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.slot-remove-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* Khu vực ảnh đứng toàn thân */
.card-portrait-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standing-hero-sprite {
  max-width: 90%;
  max-height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s;
}

.standing-hero-card:hover .standing-hero-sprite {
  transform: scale(1.06) translateY(-4px);
}

.portrait-pedestal {
  position: absolute;
  bottom: 6px;
  width: 70%;
  height: 14px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, transparent 70%);
  border-radius: 50%;
}

/* Thông tin dưới chân thẻ */
.card-info-bottom {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-archetype {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
}

.player-custom-name {
  font-size: 11px;
  color: #9cb2d4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-ready-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  margin-top: 4px;
}

.slot-ready-status.is-ready {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.slot-ready-status.not-ready {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.card-edit-btn {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gold);
  border-radius: 6px;
  padding: 3px 6px;
  margin-top: 2px;
  cursor: pointer;
}

/* Ô TRỐNG */
.standing-hero-card.slot-empty {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  background: rgba(10, 18, 32, 0.55);
}

.empty-inner {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.empty-silhouette {
  font-size: 48px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.12);
}

.empty-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #7b8ea8;
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 85%;
}

.empty-actions button {
  height: 36px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
}

/* Chữ VS Lớn Phát Sáng ở chính giữa */
.fighting-vs-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  flex: none;
}

.vs-glow-orb {
  position: absolute;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(247, 210, 134, 0.35) 0%, rgba(239, 68, 68, 0.2) 50%, transparent 70%);
  filter: blur(20px);
  animation: vsOrbPulse 2.5s ease-in-out infinite alternate;
}

@keyframes vsOrbPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

.vs-badge {
  position: relative;
  font-family: Georgia, serif;
  font-size: 48px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, #ffe69f 30%, #f59e0b 70%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(245, 158, 11, 0.8));
  animation: vsShake 5s ease-in-out infinite;
}

@keyframes vsShake {
  0%, 90%, 100% { transform: rotate(0deg); }
  92% { transform: rotate(-3deg); }
  94% { transform: rotate(3deg); }
  96% { transform: rotate(-2deg); }
  98% { transform: rotate(2deg); }
}

.vs-subtitle {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(247, 210, 134, 0.6);
}

/* Sảnh FFA */
.ffa-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.ffa-header-strip {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}

/* Footer sảnh */
.fighting-lobby-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(247, 210, 134, 0.25);
  margin-top: auto;
  gap: 16px;
}

.lobby-status-guide {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #b1c3df;
}

.guide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(247, 210, 134, 0.15);
  color: var(--gold);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.lobby-footer-actions {
  display: flex;
  gap: 12px;
}

.lobby-ready-toggle {
  height: 44px;
  padding: 0 18px;
  font-weight: 700;
  border-radius: 8px;
  background: #1e3a5f;
  color: #fff;
  border: 1px solid #4ea8de;
}

.lobby-start-btn {
  height: 48px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* ================= 5. CỬA HÀNG 3 DANH MỤC ================= */
.shop-hero-img {
  width: 64px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.shop-die-preview {
  font-size: 54px;
  line-height: 1;
}

.shop-bld-preview {
  width: 72px;
  height: 72px;
  border: 2px solid;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-bld-preview img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
}

.shop-item-desc {
  font-size: 11px;
  color: #8fa5c5;
  margin: 4px 0 8px;
  min-height: 32px;
}

.shop-item-price {
  font-weight: 700;
  color: var(--gold);
}

.owned-tag {
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
}

/* ================= 6. MODAL BẠN BÈ ================= */
.friends-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.my-friend-code-box {
  background: rgba(247, 210, 134, 0.08);
  border: 1px solid rgba(247, 210, 134, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
}

.code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.code-display strong {
  font-size: 20px;
  color: #ffe69f;
  letter-spacing: 2px;
}

.friends-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
}

.friends-status-banner .status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  margin-top: 4px;
  flex: none;
}

.friends-notice-card {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: #a8bcd9;
}

.notice-badge {
  color: var(--gold);
  font-weight: 700;
  font-size: 10px;
  display: block;
  margin-bottom: 2px;
}

.friends-action-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.friends-action-row button {
  flex: 1;
}

/* ================= 7. RESPONSIVE THIẾT KẾ CHO PC & MOBILE ================= */
@media (max-width: 900px) {
  .mode-cards-major {
    grid-template-columns: 1fr;
  }
  .fighting-stage {
    flex-direction: column;
    height: auto;
  }
  .team-bracket {
    width: 100%;
  }
  .fighting-vs-center {
    padding: 12px 0;
  }
}

@media (max-width: 600px) {
  .game-main-title {
    font-size: 32px;
  }
  .rpg-menu-container {
    padding: 16px 14px;
  }
  .btn-play-primary {
    height: 56px;
    font-size: 16px;
  }
  .rpg-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .standing-hero-card {
    width: 130px;
    height: 240px;
  }
}

/* ================= 8. HIỂN THỊ BẢN ĐỒ (ẨN/HIỆN TÊN & GIÁ ĐẤT) ================= */
.hide-tile-names .tile-name-line {
  display: none !important;
}
.hide-tile-names .label-bg {
  height: 16px !important;
  y: -6px !important;
}
.hide-tile-prices .tile-price-line {
  display: none !important;
}
.hide-tile-names.hide-tile-prices .tile-label {
  display: none !important;
}

/* ================= 9. XÚC XẮC VẬT LÝ TRỰC TIẾP TRUNG TÂM BÀN CỜ ================= */
#physics-dice-arena {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
}

#dice-banner {
  margin-top: 4px;
  background: rgba(12, 22, 36, 0.94);
  border: 1.5px solid var(--gold, #f7d286);
  border-radius: 6px;
  padding: 5px 16px;
  color: var(--gold-soft, #ffedb8);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

#dice-banner-double {
  background: #ff5252;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ================= 10. POPUP CHỌN CHẾ ĐỘ (ĐẤU ĐƠN & ĐẤU ĐỘI) ================= */
.mode-cards-dual {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.mode-dual-card {
  position: relative;
  background: linear-gradient(180deg, #18233c 0%, #10192d 100%);
  border: 2px solid rgba(247, 210, 134, 0.25);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mode-dual-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold, #f7d286);
  box-shadow: 0 12px 30px rgba(247, 210, 134, 0.2);
}

.mode-dual-card .card-emblem {
  font-size: 38px;
  margin-bottom: 12px;
}

.mode-dual-card .card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold, #f7d286);
  letter-spacing: 1px;
}

.mode-dual-card .card-subtitle {
  font-size: 13px;
  color: var(--muted, #9dabc7);
  margin-bottom: 10px;
}

.mode-dual-card .card-desc {
  font-size: 12px;
  color: #d8e2f0;
  line-height: 1.5;
  margin-bottom: 14px;
}

.mode-dual-card .card-perks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--gold-soft, #ffedb8);
  margin-bottom: 18px;
}

.mode-dual-card .card-action-hint {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  color: #8ee1bc;
}

.mode-dual-card .card-badge-popular {
  position: absolute;
  top: -10px;
  right: 14px;
  background: linear-gradient(90deg, #ff8b60, #f26a8d);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

/* ================= 11. SẢNH CHỌN TƯỚNG (FFA 6 VỊ TRÍ & ĐẤU ĐỘI 3VS3) ================= */
.slots-container-ffa {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.standing-hero-card {
  width: 150px;
  min-height: 280px;
  background: linear-gradient(180deg, #16213a 0%, #0e1526 100%);
  border: 2px solid rgba(247, 210, 134, 0.2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.standing-hero-card.team-blue {
  border-color: rgba(78, 168, 222, 0.4);
}
.standing-hero-card.team-blue:hover {
  border-color: #4ea8de;
  box-shadow: 0 0 16px rgba(78, 168, 222, 0.35);
}

.standing-hero-card.team-red {
  border-color: rgba(242, 106, 141, 0.4);
}
.standing-hero-card.team-red:hover {
  border-color: #f26a8d;
  box-shadow: 0 0 16px rgba(242, 106, 141, 0.35);
}

.standing-hero-card.is-me {
  border-color: var(--gold, #f7d286);
  box-shadow: 0 0 18px rgba(247, 210, 134, 0.35);
}

.standing-hero-card .card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 10px;
}

.standing-hero-card .card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.seat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.seat-badge.badge-ai { background: rgba(142, 225, 188, 0.2); color: #8ee1bc; }
.seat-badge.badge-player { background: rgba(247, 210, 134, 0.25); color: #f7d286; }

.slot-remove-btn {
  background: transparent;
  border: none;
  color: #ff8b60;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.slot-remove-btn:hover { color: #ff5252; }

.card-portrait-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 130px;
}

.standing-hero-sprite {
  width: 72px;
  height: 92px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  z-index: 2;
}

.portrait-pedestal {
  width: 64px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(247, 210, 134, 0.3) 0%, rgba(0, 0, 0, 0.6) 80%);
  margin-top: -8px;
  z-index: 1;
}

.card-info-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-archetype {
  font-size: 12px;
  color: var(--gold-soft, #ffedb8);
}

.player-custom-name {
  font-size: 11px;
  color: #c9d5e8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-ready-status {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 2px;
}
.slot-ready-status.is-ready {
  background: rgba(142, 225, 188, 0.2);
  color: #8ee1bc;
  border: 1px solid rgba(142, 225, 188, 0.4);
}
.slot-ready-status.not-ready {
  background: rgba(255, 139, 96, 0.2);
  color: #ff8b60;
  border: 1px solid rgba(255, 139, 96, 0.4);
}

.card-edit-btn {
  font-size: 10px;
  background: rgba(247, 210, 134, 0.15);
  border: 1px solid rgba(247, 210, 134, 0.3);
  color: var(--gold-soft, #ffedb8);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 4px;
  cursor: pointer;
}

.empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  height: 100%;
}

.empty-silhouette {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.3);
}

.empty-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted, #9dabc7);
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.empty-actions button {
  font-size: 11px;
  padding: 6px 8px;
  width: 100%;
}

/* ================= 12. BẢNG CHI TIẾT TÀI SẢN (INSPECT PROPERTY MODAL) ================= */
.inspect-property-card {
  font-family: inherit;
  color: #e5edf8;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 580px;
}

.inspect-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(10, 18, 34, 0.65);
  border: 1px solid rgba(247, 210, 134, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
}

.inspect-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspect-meta-label {
  font-size: 10px;
  color: var(--muted, #9dabc7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inspect-meta-val {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.inspect-meta-val.status-danger {
  color: #ff8b60;
}
.inspect-meta-val.gold {
  color: #f7d286;
}

.inspect-price-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: linear-gradient(180deg, #17243e 0%, #0e172a 100%);
  border: 1px solid rgba(247, 210, 134, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}

.inspect-price-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-col-label {
  font-size: 10px;
  color: var(--muted, #9dabc7);
}

.price-col-value {
  font-size: 13px;
  font-weight: 800;
}
.price-col-value.gold { color: #f7d286; }
.price-col-value.teal { color: #8ee1bc; }
.price-col-value.amber { color: #f5cc6e; }
.price-col-value.muted { color: var(--muted, #9dabc7); }

.inspect-tables-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.inspect-table-box {
  background: rgba(13, 21, 38, 0.7);
  border: 1px solid rgba(247, 210, 134, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
}

.table-box-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold, #f7d286);
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
  border-bottom: 1px solid rgba(247, 210, 134, 0.15);
  padding-bottom: 4px;
}

.inspect-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.inspect-data-table th {
  font-size: 10px;
  color: var(--muted, #9dabc7);
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  text-align: left;
}

.inspect-data-table td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.current-rent-level {
  background: rgba(142, 225, 188, 0.16) !important;
  color: #8ee1bc !important;
  font-weight: 700;
}

.current-badge {
  font-size: 9px;
  background: #8ee1bc;
  color: #0c1624;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 800;
  margin-left: 6px;
}

.next-upgrade-level {
  background: rgba(245, 204, 110, 0.14) !important;
  color: #f5cc6e !important;
}

.next-badge {
  font-size: 9px;
  background: #f5cc6e;
  color: #0c1624;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 800;
  margin-left: 6px;
}

.table-box-note {
  font-size: 10px;
  color: var(--muted, #9dabc7);
  margin: 8px 0 0;
  line-height: 1.4;
}

/* ================= 13. KHUNG THÔNG TIN NGƯỜI CHƠI (HUD) CAO CẤP ================= */
.player-hud-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(19, 31, 56, 0.95) 0%, rgba(12, 20, 36, 0.95) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--owner-col, #f7d286);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-width: 170px;
  flex: 1 1 180px;
  max-width: 250px;
  color: #fff;
  font-family: inherit;
}

.player-hud-card:hover {
  background: rgba(28, 44, 76, 0.95);
}

.player-hud-card.is-active-turn {
  border-color: var(--gold, #f7d286);
  box-shadow: 0 0 14px rgba(247, 210, 134, 0.4);
  background: linear-gradient(135deg, rgba(29, 46, 80, 0.98) 0%, rgba(18, 29, 52, 0.98) 100%);
}

.player-hud-card.is-bankrupt {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.player-hud-portrait {
  position: relative;
  width: 44px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-hud-portrait .avatar {
  width: 42px;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hud-turn-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #f7d286;
  color: #0c1624;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  animation: turnPulse 1.2s infinite ease-in-out;
}

@keyframes turnPulse {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.85; transform: translateX(-50%) scale(1.08); }
}

.player-hud-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-hud-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.player-hud-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-hud-tag {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.player-hud-tag.tag-ai { background: rgba(142, 225, 188, 0.2); color: #8ee1bc; }
.player-hud-tag.tag-human { background: rgba(247, 210, 134, 0.25); color: #f7d286; }

.player-hud-team {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}
.player-hud-team.blue { background: rgba(78, 168, 222, 0.25); color: #4ea8de; }
.player-hud-team.red { background: rgba(242, 106, 141, 0.25); color: #f26a8d; }

.player-hud-cash {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.player-hud-cash .cash-amount {
  font-size: 13px;
  font-weight: 800;
  color: #ffe3a1;
}

.player-hud-cash .coin-icon {
  font-size: 11px;
}

.net-worth-badge {
  font-size: 10px;
  color: var(--muted, #9dabc7);
}

.player-hud-assets {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.asset-count-pill {
  font-size: 10px;
  color: #c9d5e8;
}

.status-chip {
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
}
.status-chip.jail { background: rgba(255, 139, 96, 0.25); color: #ff8b60; }
.status-chip.mortgage { background: rgba(245, 204, 110, 0.25); color: #f5cc6e; }
.status-chip.dead { background: rgba(255, 82, 82, 0.25); color: #ff5252; }

@media (max-width: 900px) {
  .mode-cards-dual {
    grid-template-columns: 1fr;
  }
  .inspect-tables-grid {
    grid-template-columns: 1fr;
  }
}

/* 3D Dice-Box Three.js Canvas Container */
#dice-box-3d-wrap {
  width: 240px;
  height: 120px;
  position: relative;
  overflow: hidden;
  pointer-events: none;
}
#dice-box-3d-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}


/* ================= UI OVERLAY: Tách riêng khỏi camera transform ================= */
.board-ui-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.board-ui-overlay button,
.board-ui-overlay [role="button"],
.board-ui-overlay input,
.board-ui-overlay select {
  pointer-events: auto;
}

/* Center HUD fixed position - not affected by camera */
.center-hud-fixed {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  pointer-events: none;
  z-index: 52;
}
.center-hud-fixed .hud-eyebrow {
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--gold-soft, #ffedb8);
}
.center-hud-fixed #turnLabel {
  font: 21px Georgia;
  color: #e7d6b4;
  text-shadow: 0 2px 5px #102323;
}

/* Physics dice arena - fixed in screen space */
.physics-dice-arena-fixed {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 55;
}

/* Roll button and hint - fixed at center bottom of dice */
.board-ui-overlay > .roll {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 53;
  font-size: 14px;
  min-width: 178px;
  padding: 12px 15px;
}
.board-ui-overlay > #hint {
  position: absolute;
  top: calc(60% + 48px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted, #8e9ca8);
  max-width: 230px;
  min-height: 16px;
  text-align: center;
  z-index: 53;
}

/* Hide old .center class when replaced by overlay */
.in-match .center {
  display: none !important;
}

/* ================= RENT POPUP ================= */
.rent-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6, 12, 22, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.rent-popup-panel {
  background: linear-gradient(170deg, #1a2e40 0%, #0d1b2a 100%);
  border: 2px solid var(--gold, #f7d286);
  border-radius: 14px;
  padding: 22px 28px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 30px rgba(247,210,134,0.15);
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rent-popup-header {
  margin-bottom: 14px;
}
.rent-popup-header .eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--gold, #f7d286);
  display: block;
  margin-bottom: 6px;
}
.rent-popup-header h3 {
  font-size: 20px;
  color: #fff;
  margin: 0;
}
.rent-popup-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
}
.rent-from, .rent-to {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rent-from img, .rent-to img {
  width: 48px;
  height: 58px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}
.rent-from span, .rent-to span {
  font-size: 12px;
  color: #c9d3dd;
  font-weight: 600;
}
.rent-arrow {
  font-size: 28px;
  color: var(--gold, #f7d286);
  text-shadow: 0 0 8px rgba(247,210,134,0.5);
}
.rent-popup-detail {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  font-size: 13px;
  color: #b8c5d0;
}
.rent-popup-detail span:first-child {
  font-weight: 700;
  color: #fff;
}
.rent-amount-display {
  background: rgba(247,210,134,0.08);
  border: 1px solid rgba(247,210,134,0.25);
  border-radius: 10px;
  padding: 12px 20px;
  margin: 12px 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.rent-amount-label {
  font-size: 12px;
  color: #8e9ca8;
}
.rent-amount-display strong {
  font-size: 28px;
  color: var(--gold, #f7d286);
  font-weight: 800;
}
.rent-amount-unit {
  font-size: 13px;
  color: var(--gold, #f7d286);
}
.rent-popup-footer {
  margin-top: 14px;
}
.rent-timer-bar, .event-timer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.rent-timer-bar i, .event-timer-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold, #f7d286), #ff9f43);
  border-radius: 2px;
  transition: width 0.3s linear;
  width: 100%;
}
.rent-popup-footer small, .event-popup-footer small {
  display: block;
  font-size: 11px;
  color: #8e9ca8;
  margin-bottom: 10px;
}
.rent-popup-footer .primary, .event-popup-footer .primary {
  min-width: 160px;
  padding: 10px 20px;
  font-size: 14px;
}

/* ================= EVENT POPUP ================= */
.event-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 910;
  background: rgba(6, 12, 22, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.event-popup-panel {
  background: linear-gradient(170deg, #1d2846 0%, #10162a 100%);
  border: 2px solid #a782bc;
  border-radius: 14px;
  padding: 24px 30px;
  min-width: 340px;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 30px rgba(167,130,188,0.2);
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.event-popup-header {
  margin-bottom: 12px;
}
.event-popup-header .event-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 6px;
  color: #a782bc;
}
.event-popup-header .eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #a782bc;
}
.event-popup-body h3 {
  font-size: 19px;
  color: #fff;
  margin: 0 0 8px;
}
.event-popup-body p {
  font-size: 13px;
  color: #b8c5d0;
  line-height: 1.6;
  margin: 0 0 10px;
}
.event-effect-badge {
  display: inline-block;
  background: rgba(167,130,188,0.12);
  border: 1px solid rgba(167,130,188,0.3);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #d4b8e8;
}
.event-popup-footer {
  margin-top: 16px;
}
.event-popup-footer .primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================= MONEY NOTIFICATIONS ================= */
.money-notif-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.money-notif {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  animation: moneyFloat 2.5s ease-out forwards;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  z-index: 61;
}
.money-notif.gain {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.money-notif.loss {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
@keyframes moneyFloat {
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: 1; transform: translateY(-8px); }
  75% { opacity: 1; transform: translateY(-28px); }
  100% { opacity: 0; transform: translateY(-40px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ================= RESPONSIVE: UI OVERLAY ================= */
@media (max-width: 900px) {
  .center-hud-fixed #turnLabel { font-size: 17px; }
  .board-ui-overlay > .roll { font-size: 12px; min-width: 150px; padding: 10px 12px; }
  .center-hud-fixed .hud-eyebrow { font-size: 7px; }
  .board-ui-overlay > #hint { font-size: 9px; max-width: 180px; }
  .rent-popup-panel, .event-popup-panel { min-width: 280px; padding: 18px 20px; }
  .rent-amount-display strong { font-size: 22px; }
  .money-notif { font-size: 13px; }
}
@media (max-width: 600px) {
  .center-hud-fixed { top: 33%; }
  .center-hud-fixed #turnLabel { font-size: 15px; }
  .board-ui-overlay > .roll { top: 56%; font-size: 11px; min-width: 130px; padding: 9px 10px; }
  .board-ui-overlay > #hint { top: calc(56% + 42px); font-size: 8px; max-width: 150px; }
  .rent-popup-panel, .event-popup-panel { min-width: 260px; max-width: 340px; padding: 16px; }
  .rent-from img, .rent-to img { width: 36px; height: 44px; }
  .rent-amount-display strong { font-size: 20px; }
}
