/* NovaChess Royal Arena — Noir Navy (#111020), Royal Plum (#24182E), Champagne Gold (#D9A441), Warm Ivory (#F5F0E9) */
:root {
  --ra-navy: #111020;
  --ra-plum: #24182E;
  --ra-gold: #D9A441;
  --ra-gold-soft: rgba(217, 164, 65, 0.16);
  --ra-ivory: #F5F0E9;
  --ra-ivory-dim: rgba(245, 240, 233, 0.72);
  --ra-border: rgba(217, 164, 65, 0.24);
  --ra-green: #22c55e;
  --ra-amber: #f59e0b;
  --ra-red: #ef4444;
  --ra-blue: #38bdf8;
}

.royal-modal-card {
  width: min(1160px, 96vw) !important;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(155deg, rgba(17, 16, 32, 0.98) 0%, rgba(36, 24, 46, 0.97) 100%) !important;
  border: 1px solid var(--ra-border) !important;
  color: var(--ra-ivory);
  font-family: 'DM Sans', system-ui, sans-serif;
  padding: 0 !important;
  border-radius: 18px !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.royal-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 24px 18px;
  background: linear-gradient(110deg, rgba(17, 16, 32, 0.92) 20%, rgba(36, 24, 46, 0.84) 70%, rgba(17, 16, 32, 0.92) 100%);
  border-bottom: 1px solid var(--ra-border);
}

.royal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/royal-hall.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  pointer-events: none;
}

.royal-hero.salon-bg::before {
  background-image: url('../img/royal-salon.jpg');
  opacity: 0.26;
}

.royal-hero > * {
  position: relative;
  z-index: 1;
}

.royal-title {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 800;
  color: var(--ra-ivory);
  letter-spacing: -0.02em;
  margin: 4px 0;
}

.royal-subtitle {
  font-size: 0.8rem;
  color: var(--ra-ivory-dim);
}

.royal-body {
  padding: 18px 22px 24px;
}

.royal-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.royal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.royal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.royal-card {
  background: rgba(17, 16, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.royal-card-gold {
  border-color: var(--ra-border);
  background: linear-gradient(160deg, rgba(36, 24, 46, 0.78), rgba(17, 16, 32, 0.88));
}

.royal-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
}

.royal-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ra-ivory-dim);
}

.royal-kpi-val {
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ra-gold);
  margin-top: 2px;
}

.royal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ra-ivory);
}

.royal-badge.live { background: rgba(34, 197, 94, 0.16); color: #86efac; border-color: rgba(34, 197, 94, 0.4); }
.royal-badge.paused { background: rgba(245, 158, 11, 0.18); color: #fde68a; border-color: rgba(245, 158, 11, 0.45); }
.royal-badge.calling { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.45); }
.royal-badge.gold { background: var(--ra-gold-soft); color: var(--ra-gold); border-color: var(--ra-border); }
.royal-badge.danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

.royal-pause-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(36, 24, 46, 0.85));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}

/* Table Map Card */
.royal-table-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(217, 164, 65, 0.22);
  background: rgba(17, 16, 32, 0.86);
  padding: 12px;
  transition: transform 0.16s ease, border-color 0.16s ease;
  cursor: pointer;
}

.royal-table-card:hover {
  transform: translateY(-2px);
  border-color: var(--ra-gold);
}

.royal-table-card.selected {
  border-color: var(--ra-gold);
  box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.28);
}

/* Mini Live Chessboard Preview (8x8 CSS Grid for Public Spectators) */
.royal-mini-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(217, 164, 65, 0.3);
  user-select: none;
}

.royal-mini-sq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.85rem, 1.5vw, 1.35rem);
  line-height: 1;
}

.royal-mini-sq.light { background: #e8dcc8; color: #161522; }
.royal-mini-sq.dark { background: #5a425b; color: #f8f5ef; }
.royal-mini-sq.last { box-shadow: inset 0 0 0 2px var(--ra-gold); }
.royal-mini-piece-w { color: #fff8eb; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); }
.royal-mini-piece-b { color: #14121f; text-shadow: 0 0 1px rgba(255, 255, 255, 0.4); }

/* Heart Reaction Animation Layer */
.royal-heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.royal-heart-btn:hover {
  transform: scale(1.06);
  background: rgba(239, 68, 68, 0.28);
}

.royal-heart-float-zone {
  position: relative;
  height: 0;
  overflow: visible;
  pointer-events: none;
}

.royal-heart-floater {
  position: absolute;
  bottom: 0;
  inset-inline-end: 16px;
  font-size: 1.25rem;
  animation: royalFloatUp 1.35s ease-out forwards;
}

@keyframes royalFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  100% { opacity: 0; transform: translateY(-58px) scale(1.35); }
}

.royal-section-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.royal-tab-btn {
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ra-ivory-dim);
  cursor: pointer;
}

.royal-tab-btn.active {
  background: var(--ra-gold-soft);
  border-color: var(--ra-gold);
  color: var(--ra-gold);
}

.royal-danger-zone {
  margin-top: 16px;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 820px) {
  .royal-grid-4, .royal-grid-3, .royal-grid-2 {
    grid-template-columns: 1fr;
  }
  .royal-hero {
    padding: 16px;
  }
  .royal-body {
    padding: 14px;
  }
}
