/* ==========================================================================
   Ludoground.com - Comprehensive Master Stylesheet (PHP & Static Arena)
   With Light/Dark Themes, Royal Gradients, 2D Fast Spin Rolling, and Responsive Grid
   ========================================================================== */

/* Google Material Symbols Font Import */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* Material Symbols Utility Setup */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded', sans-serif !important;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

/* Icon Sizing */
.icon-xs { font-size: 14px !important; }
.icon-sm { font-size: 17px !important; }
.icon-md { font-size: 22px !important; }
.icon-lg { font-size: 26px !important; }
.icon-xl { font-size: 32px !important; }

/* Vibrant Color System for Google Icons */
.icon-gold { color: #f59e0b !important; filter: drop-shadow(0 1px 3px rgba(245, 158, 11, 0.45)); }
.icon-emerald { color: #10b981 !important; filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.35)); }
.icon-crimson { color: #f43f5e !important; filter: drop-shadow(0 1px 2px rgba(244, 63, 94, 0.35)); }
.icon-sapphire { color: #3b82f6 !important; filter: drop-shadow(0 1px 2px rgba(59, 130, 246, 0.35)); }
.icon-amber { color: #f59e0b !important; }
.icon-purple { color: #a855f7 !important; }
.icon-white { color: #ffffff !important; }
.icon-dark { color: #0f172a !important; }
.icon-muted { color: var(--text-muted) !important; }

/* Dark Mode Variables (Default) */
:root, [data-theme="dark"] {
  --bg-body: #020617;
  --bg-header: rgba(15, 23, 42, 0.95);
  --bg-card: rgba(15, 23, 42, 0.95);
  --bg-card-sub: #090d16;
  --bg-player-card: #ffffff;
  --text-player-card: #0f172a;
  --bg-player-card-sub: #f8fafc;
  --border-color: #1e293b;
  --border-sub: #334155;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --ad-bg: #090d16;
  --board-bg: #ffffff;
  --board-border: #334155;
  --hero-mesh: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.15) 0%, transparent 40%),
               radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
               radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.12) 0%, transparent 50%),
               linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
}

/* Light Mode Variables - Crisp, High-Contrast & Vibrant */
[data-theme="light"] {
  --bg-body: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.96);
  --bg-card: #ffffff;
  --bg-card-sub: #f8fafc;
  --bg-player-card: #ffffff;
  --text-player-card: #0f172a;
  --bg-player-card-sub: #f1f5f9;
  --border-color: #e2e8f0;
  --border-sub: #cbd5e1;
  --text-color: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --ad-bg: #e2e8f0;
  --board-bg: #ffffff;
  --board-border: #94a3b8;
  --hero-mesh: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.1) 0%, transparent 40%),
               radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
               radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
               linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #eff6ff 100%);
}

/* Light Theme Component Specific Enhancements */
[data-theme="light"] .header-nav {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .brand-text h1 {
  color: #0f172a;
}

[data-theme="light"] .btn-header-icon {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}

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

[data-theme="light"] .hero-gradient-wrapper {
  background: var(--hero-mesh);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.08), inset 0 1px 2px rgba(255, 255, 255, 1);
}

[data-theme="light"] .hero-subtitle {
  color: #475569;
}

[data-theme="light"] .floating-hero-badge {
  background: rgba(255, 255, 255, 0.92);
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

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

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

[data-theme="light"] .active-turn-banner {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

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

[data-theme="light"] .player-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .player-card.active-turn {
  background: #ffffff;
  box-shadow: 0 0 0 2.5px var(--card-accent, #f43f5e), 0 0 16px var(--card-glow, rgba(244, 63, 94, 0.35)), 0 6px 20px rgba(15, 23, 42, 0.1);
}

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

[data-theme="light"] .card-home-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .token-summary-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

[data-theme="light"] .token-summary-box span.num-val {
  color: #0f172a;
}

[data-theme="light"] .center-dice-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .center-dice-player-name {
  color: #0f172a;
}

[data-theme="light"] .activity-feed-box {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .activity-item {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] .game-mode-card,
[data-theme="light"] .feature-highlight-card,
[data-theme="light"] .guide-card,
[data-theme="light"] .page-card,
[data-theme="light"] .static-page-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .mode-card-title,
[data-theme="light"] .feature-card-title {
  color: #0f172a;
}

[data-theme="light"] .mode-card-desc,
[data-theme="light"] .feature-card-desc {
  color: #475569;
}

[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .modal-dialog-box {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

[data-theme="light"] .modal-header-row h3 {
  color: #0f172a;
}

[data-theme="light"] .btn-close-modal {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .btn-close-modal:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

[data-theme="light"] .config-player-row,
[data-theme="light"] .player-config-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .config-name-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .btn-type-toggle {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-type-toggle.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

[data-theme="light"] .magic-promo-box {
  background: linear-gradient(135deg, #fffbeb, #ffffff);
  border-color: #fde68a;
}

[data-theme="light"] .magic-promo-title {
  color: #b45309;
}

[data-theme="light"] .magic-num-tile {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .magic-num-tile:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

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

[data-theme="light"] .home-center-icon,
[data-theme="light"] .center-home-trophy-badge {
  background: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Vivid Saturated Colors - Exact Match with React Ludo */
:root {
  --color-red: #f43f5e;
  --color-red-dark: #be123c;
  --color-red-light: #fff1f2;
  --color-red-glow: rgba(244, 63, 94, 0.45);

  --color-green: #10b981;
  --color-green-dark: #047857;
  --color-green-light: #ecfdf5;
  --color-green-glow: rgba(16, 185, 129, 0.45);

  --color-yellow: #f59e0b;
  --color-yellow-dark: #b45309;
  --color-yellow-light: #fffbeb;
  --color-yellow-glow: rgba(245, 158, 11, 0.45);

  --color-blue: #3b82f6;
  --color-blue-dark: #1d4ed8;
  --color-blue-light: #eff6ff;
  --color-blue-glow: rgba(59, 130, 246, 0.45);
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-body);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Header Navbar */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fbbf24, #f43f5e, #3b82f6);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
  animation: logoFloat 3s ease-in-out infinite alternate;
  flex-shrink: 0;
}

@keyframes logoFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-3px) rotate(4deg); }
}

.brand-logo-inner {
  width: 100%;
  height: 100%;
  background: var(--bg-card-sub);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-img-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--text-color);
  white-space: nowrap;
  margin: 0;
}

.brand-badge {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: #f59e0b;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-width: 0;
}

.btn-header-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-header-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.5);
}

.btn-header-primary:active {
  transform: scale(0.96);
}

.btn-header-label {
  display: inline-block;
  white-space: nowrap;
}

.btn-header-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0;
  box-sizing: border-box;
}

.btn-header-icon:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn-header-icon:active {
  transform: scale(0.92);
}

/* AdSense Banner Container */
.adsense-banner {
  max-width: 1320px;
  margin: 8px auto;
  padding: 0 16px;
  width: 100%;
}

.adsense-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--border-sub);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 11px;
}

/* ==========================================================================
   Home Landing Page (Best-in-class Modern Gradient Showcase)
   ========================================================================== */
.home-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

/* Spectacular Hero Section */
.hero-gradient-wrapper {
  position: relative;
  border-radius: 28px;
  background: var(--hero-mesh);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  padding: 44px 24px 40px;
  text-align: center;
  overflow: hidden;
}

.hero-gradient-wrapper::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.hero-title-gradient {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 40%, #f43f5e 80%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

[data-theme="light"] .hero-title-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #d97706 40%, #e11d48 80%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 15.5px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-hero-primary {
  background: linear-gradient(135deg, #f59e0b, #e11d48);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  padding: 15px 32px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 28px -4px rgba(244, 63, 94, 0.55);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.btn-hero-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 34px -4px rgba(244, 63, 94, 0.7);
}

.btn-hero-primary:active {
  transform: scale(0.96);
}

.btn-hero-secondary {
  background: var(--bg-card);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  font-size: 15px;
  font-weight: 800;
  padding: 14px 26px;
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-hero-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
  border-color: #f59e0b;
}

/* Home Interactive Match Configurator Card */
.config-launcher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.config-launcher-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f43f5e, #10b981, #f59e0b, #3b82f6);
}

.config-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.config-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-header-title h3 {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-color);
}

.config-pills-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.config-option-btn {
  background: var(--bg-card-sub);
  border: 1.5px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.config-option-btn:hover {
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.config-option-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(244, 63, 94, 0.18));
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.config-launcher-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.btn-launch-arena {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  padding: 12px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.18s;
  text-decoration: none;
}

.btn-launch-arena:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
}

/* Game Mode Cards (2P, 3P, 4P) */
.section-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title-box h3 {
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modes-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.royal-mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.royal-mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.card-mode-2p::before { background: linear-gradient(90deg, #f43f5e, #f59e0b); }
.card-mode-3p::before { background: linear-gradient(90deg, #f43f5e, #10b981, #f59e0b); }
.card-mode-4p::before { background: linear-gradient(90deg, #f43f5e, #10b981, #f59e0b, #3b82f6); }

.royal-mode-card:hover {
  transform: translateY(-6px);
  border-color: #f59e0b;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.35);
}

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

.mode-icon-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mode-tag-pill {
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: #f59e0b;
}

.mode-content h4 {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-color);
  margin-bottom: 6px;
}

.mode-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.mode-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 12.5px;
  font-weight: 800;
  color: #f59e0b;
}

/* Live Stats Counter Bar */
.live-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stat-item-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-number {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-color);
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Feature Highlights Grid */
.features-grid-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.feature-box-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.feature-box-card:hover {
  transform: translateY(-3px);
  border-color: #f59e0b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.feature-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.feature-box-card h4 {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-color);
}

.feature-box-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* "How to Play & Win" Step Cards */
.roadmap-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.roadmap-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.step-num-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.roadmap-step-card h4 {
  font-size: 14.5px;
  font-weight: 900;
  color: var(--text-color);
}

.roadmap-step-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Main 3-Column Game Stage Layout (Rock-Solid Desktop & Mobile Alignment)
   ========================================================================== */
.game-stage-grid,
.main-stage {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

/* Mobile & Tablet Ordering: Center Board Column is ALWAYS TOP */
.center-col {
  order: 1;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.side-col-left {
  order: 2;
}

.side-col-right {
  order: 3;
}

.side-col,
.sidebar-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-width: 0;
}

/* Tablet (640px - 1023px): 2-Column Side Decks for Player Cards */
@media (min-width: 640px) and (max-width: 1023px) {
  .game-stage-grid,
  .main-stage {
    padding: 16px 20px 40px;
    gap: 20px;
  }
  .side-col,
  .sidebar-col {
    max-width: 600px;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .side-col-header,
  .magic-promo-box,
  .activity-feed-box {
    grid-column: 1 / -1;
  }
}

/* Desktop (>= 1024px): Premier 3-Column Studio Alignment */
@media (min-width: 1024px) {
  .game-stage-grid,
  .main-stage {
    grid-template-columns: 290px minmax(460px, 500px) 290px;
    justify-content: center;
    gap: 24px;
    padding: 20px 24px 44px;
  }
  .center-col {
    order: 2;
    max-width: 100%;
  }
  .side-col-left {
    order: 1;
    max-width: 100%;
  }
  .side-col-right {
    order: 3;
    max-width: 100%;
  }
  .side-col,
  .sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
  }
}

.side-col-header,
.col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* Enhanced Player Cards with React-Style Blinking Dot and Counters */
.player-card {
  position: relative;
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--bg-player-card);
  color: var(--text-player-card);
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-card.active-turn {
  background: #ffffff;
  border-color: var(--card-accent, #f43f5e);
  box-shadow: 0 0 0 2.5px var(--card-accent, #f43f5e), 0 0 20px var(--card-glow, rgba(244, 63, 94, 0.5)), 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  animation: cardPulse 2s infinite ease-in-out;
}

.player-card.slot-inactive {
  opacity: 0.45;
  filter: grayscale(0.6);
  pointer-events: none;
}

@keyframes cardPulse {
  0%, 100% {
    transform: scale(1) translateY(-2px);
    box-shadow: 0 0 0 2.5px var(--card-accent, #f43f5e), 0 0 12px var(--card-glow, rgba(244, 63, 94, 0.35)), 0 4px 14px rgba(0, 0, 0, 0.12);
  }
  50% {
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 0 0 3.5px var(--card-accent, #f43f5e), 0 0 24px var(--card-glow, rgba(244, 63, 94, 0.65)), 0 10px 28px rgba(0, 0, 0, 0.22);
  }
}

.card-turn-badge {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: badgeBounce 0.3s ease-out;
}

/* React-style pinging active turn blinking point */
.turn-blinking-point {
  position: relative;
  display: inline-flex;
  width: 7px;
  height: 7px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.turn-blinking-point::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #ffffff;
  animation: pingDot 1.25s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.turn-blinking-point::after {
  content: '';
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}

@keyframes pingDot {
  0% { transform: scale(1); opacity: 0.9; }
  75%, 100% { transform: scale(2.5); opacity: 0; }
}

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

.card-rank-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 900;
  background: #f59e0b;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.card-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.card-user-info {
  flex: 1;
  min-width: 0;
}

.card-user-name {
  font-size: 13.5px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-user-meta {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.card-home-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  color: #1e293b;
  flex-shrink: 0;
}

/* 3-Stage Progress Counters (Base, Track, Home) */
.player-token-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.token-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 2px;
  color: #64748b;
}

.token-summary-box span.num-val {
  font-weight: 900;
  color: #0f172a;
}

.token-summary-box.home-box-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.token-summary-box.home-box-active span.num-val {
  color: #047857;
}

/* Card Magic Dice Button */
.player-card-magic-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.player-card-magic-btn.active-magic {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.player-card-magic-btn.active-magic:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.player-card-magic-btn.disabled-magic {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Magic Ad Promo Card */
.magic-promo-box {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(69, 26, 3, 0.4), var(--bg-card));
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
}

.magic-promo-title {
  color: #fcd34d;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Match Activity Feed */
.activity-feed-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.feed-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.feed-item {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.35;
  animation: feedSlide 0.25s ease-out;
}

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

.feed-time {
  font-size: 9.5px;
  color: var(--text-faint);
  font-family: monospace;
  flex-shrink: 0;
}

/* ==========================================================================
   Center Stage: Turn Banner, Ludo Board & Interactive Controls
   ========================================================================== */
.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.active-turn-banner {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.banner-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.banner-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
}

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

.badge-human {
  background: #022c22;
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

/* Board Outer Wrapper */
.board-outer-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Top & Bottom Dice Rows */
.dice-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
}

.corner-station {
  display: flex;
  align-items: center;
  gap: 8px;
}

.corner-station.reverse {
  flex-direction: row-reverse;
}

.station-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.station-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.station-name {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.station-action-msg {
  font-size: 9.5px;
  font-weight: 900;
  animation: pulseDot 1.2s infinite;
}

/* Ludo Dice Box */
.ludo-dice-box {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #e2e8f0 100%);
  border-radius: 13px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.25),
    0 2px 5px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.14);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 7px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  position: relative;
  user-select: none;
}

.ludo-dice-box:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32), inset 0 2px 4px rgba(255, 255, 255, 1);
}

.ludo-dice-box:active {
  transform: scale(0.92);
}

.ludo-dice-box.active-turn {
  outline: 3px solid #f59e0b;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.9), 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: diceActiveFloat 1.6s infinite ease-in-out;
}

@keyframes diceActiveFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.8), 0 8px 18px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: translateY(-4px) rotate(2deg) scale(1.05);
    box-shadow: 0 0 28px rgba(245, 158, 11, 1), 0 12px 26px rgba(0, 0, 0, 0.3);
  }
}

.ludo-dice-box.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  animation: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Fast 2D Spin & Bounce Rolling Dice Animation */
.ludo-dice-box.rolling {
  animation: diceSpinRoll 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards !important;
  cursor: wait;
  pointer-events: none;
}

@keyframes diceSpinRoll {
  0% {
    transform: rotate(0deg) scale(1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  }
  25% {
    transform: rotate(90deg) scale(1.15);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  }
  50% {
    transform: rotate(180deg) scale(0.95);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
  }
  75% {
    transform: rotate(270deg) scale(1.12);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  }
  90% {
    transform: rotate(360deg) scale(0.96);
  }
  100% {
    transform: rotate(360deg) scale(1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.9);
  }
}

/* Pip Dots */
.dice-pip {
  background: radial-gradient(circle at 35% 35%, #475569, #0f172a 85%);
  border-radius: 50%;
  width: 9px;
  height: 9px;
  align-self: center;
  justify-self: center;
  box-shadow: inset 0 1.5px 2px rgba(0, 0, 0, 0.7), 0 1px 1px rgba(255, 255, 255, 0.5);
}

.dice-pip.pip-center-red {
  width: 13px;
  height: 13px;
  background: radial-gradient(circle at 35% 35%, #ff4d6d, #be123c 85%);
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.4), 0 0 10px rgba(244, 63, 94, 0.8);
}

.btn-magic-action {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #0f172a;
  border: none;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(234, 179, 8, 0.4);
  transition: all 0.15s;
}

.btn-magic-action:disabled {
  background: #334155;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 15x15 Ludo Board Grid */
/* ==========================================================================
   15x15 Ludo Board Grid, Yards, Tracks & Goti Tokens
   ========================================================================== */
.ludo-15-grid {
  width: min(92vw, 480px);
  height: min(92vw, 480px);
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 18px;
  border: 4px solid var(--board-border, #1e293b);
  box-shadow: 0 14px 35px rgba(0,0,0,0.45), inset 0 2px 6px rgba(0,0,0,0.1);
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  overflow: hidden;
  position: relative;
  user-select: none;
}

[data-theme="dark"] .ludo-15-grid {
  background: #0f172a;
  border-color: #334155;
}

/* 4 Yards (6x6 each) */
.grid-yard {
  grid-column: span 6;
  grid-row: span 6;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  box-sizing: border-box;
}

.yard-bg-red { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.yard-bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.yard-bg-yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }
.yard-bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.yard-plate-box {
  width: 84%;
  height: 84%;
  background: #ffffff;
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
  place-items: center;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

[data-theme="dark"] .yard-plate-box {
  background: #1e293b;
}

.yard-spot-circle {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.18);
}

.spot-col-red, .yard-spot-red {
  background: rgba(244, 63, 94, 0.22);
  border: 2px dashed #f43f5e;
}
.spot-col-green, .yard-spot-green {
  background: rgba(16, 185, 129, 0.22);
  border: 2px dashed #10b981;
}
.spot-col-yellow, .yard-spot-yellow {
  background: rgba(245, 158, 11, 0.22);
  border: 2px dashed #f59e0b;
}
.spot-col-blue, .yard-spot-blue {
  background: rgba(59, 130, 246, 0.22);
  border: 2px dashed #3b82f6;
}

/* Center Home Triangle Hub (3x3 rows 7..9, cols 7..9) */
.center-home-hub,
.grid-center-home {
  grid-column: 7 / span 3;
  grid-row: 7 / span 3;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

[data-theme="dark"] .center-home-hub,
[data-theme="dark"] .grid-center-home {
  background: #1e293b;
}

.wedge-red, .home-tri-red {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  clip-path: polygon(0 0, 50% 50%, 0 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 6px;
  box-sizing: border-box;
}

.wedge-green, .home-tri-green {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #10b981, #34d399);
  clip-path: polygon(0 0, 100% 0, 50% 50%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  box-sizing: border-box;
}

.wedge-yellow, .home-tri-yellow {
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #f59e0b, #fbbf24);
  clip-path: polygon(100% 0, 100% 100%, 50% 50%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  box-sizing: border-box;
}

.wedge-blue, .home-tri-blue {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #3b82f6, #60a5fa);
  clip-path: polygon(0 100%, 100% 100%, 50% 50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  box-sizing: border-box;
}

.home-wedge-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  justify-content: center;
  max-width: 36px;
  max-height: 36px;
  position: relative;
  z-index: 8;
  pointer-events: none;
}

.home-finished-goti {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: finishedGotiPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 9;
}

.home-star-mini {
  font-size: 8px;
  color: #ffd700;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

@keyframes finishedGotiPop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.35); }
  100% { transform: scale(1); opacity: 1; }
}

.home-center-icon,
.center-home-trophy-badge {
  position: relative;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  font-size: 18px;
}

[data-theme="dark"] .home-center-icon,
[data-theme="dark"] .center-home-trophy-badge {
  background: #0f172a;
}

/* Track Cells */
.track-cell,
.ludo-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid #e2e8f0;
  background: #ffffff;
  box-sizing: border-box;
}

[data-theme="dark"] .track-cell,
[data-theme="dark"] .ludo-cell {
  background: #1e293b;
  border-color: #334155;
}

/* Color Path Highways */
.path-col-red, .path-red {
  background: #ffe4e6 !important;
  border-color: #fecdd3 !important;
}
[data-theme="dark"] .path-col-red, [data-theme="dark"] .path-red {
  background: rgba(244, 63, 94, 0.35) !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
}

.path-col-green, .path-green {
  background: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}
[data-theme="dark"] .path-col-green, [data-theme="dark"] .path-green {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

.path-col-yellow, .path-yellow {
  background: #fef3c7 !important;
  border-color: #fde68a !important;
}
[data-theme="dark"] .path-col-yellow, [data-theme="dark"] .path-yellow {
  background: rgba(245, 158, 11, 0.35) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
}

.path-col-blue, .path-blue {
  background: #dbeafe !important;
  border-color: #bfdbfe !important;
}
[data-theme="dark"] .path-col-blue, [data-theme="dark"] .path-blue {
  background: rgba(59, 130, 246, 0.35) !important;
  border-color: rgba(59, 130, 246, 0.5) !important;
}

/* 8 Safe Star Sanctuaries */
.star-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  pointer-events: none;
  font-size: 14px;
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0.85;
}

.star-indicator .svg-star,
.star-indicator .material-symbols-rounded {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.6));
}

/* Multi-Token Layout inside single track cell */
.token-slot-single {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 15;
}

.token-slot-multi {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 15;
}

.token-slot-multi .goti-piece,
.token-slot-multi .ludo-token {
  position: absolute;
  width: 60% !important;
  height: 60% !important;
}

.token-slot-multi .pos-2-0 { top: 2px; left: 2px; }
.token-slot-multi .pos-2-1 { bottom: 2px; right: 2px; }

.token-slot-multi .pos-3-0 { top: 1px; left: 1px; }
.token-slot-multi .pos-3-1 { top: 1px; right: 1px; }
.token-slot-multi .pos-3-2 { bottom: 1px; left: 50%; transform: translateX(-50%); }

.token-slot-multi .pos-4-0 { top: 1px; left: 1px; }
.token-slot-multi .pos-4-1 { top: 1px; right: 1px; }
.token-slot-multi .pos-4-2 { bottom: 1px; left: 1px; }
.token-slot-multi .pos-4-3 { bottom: 1px; right: 1px; }

/* Goti Pieces (Vivid, High-Gloss 3D Styling) */
.goti-piece,
.ludo-token {
  width: 82%;
  height: 82%;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  border: 2px solid #ffffff;
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.9),
    inset 0 -2px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.goti-crown {
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.goti-red, .token-red {
  background: radial-gradient(circle at 35% 35%, #ff4d6d 0%, #f43f5e 40%, #be123c 100%);
}

.goti-green, .token-green {
  background: radial-gradient(circle at 35% 35%, #34d399 0%, #10b981 40%, #047857 100%);
}

.goti-yellow, .token-yellow {
  background: radial-gradient(circle at 35% 35%, #fde047 0%, #f59e0b 40%, #b45309 100%);
  border-color: #ffffff;
}

.goti-blue, .token-blue {
  background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #3b82f6 40%, #1d4ed8 100%);
}

/* Movable goti token bounce animation with subtle, balanced highlight */
.movable-goti,
.ludo-token.token-movable {
  cursor: pointer;
  z-index: 35 !important;
  animation: gotiBounce 1.2s infinite ease-in-out;
  box-shadow: 
    0 0 0 2px #f59e0b,
    0 2px 6px rgba(245, 158, 11, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

@keyframes gotiBounce {
  0%, 100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
    box-shadow: 
      0 0 0 2px #f59e0b,
      0 2px 6px rgba(245, 158, 11, 0.4),
      0 3px 6px rgba(0, 0, 0, 0.35),
      inset 0 1px 2px rgba(255, 255, 255, 0.8);
  }
  50% {
    transform: scale(1.12) translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 
      0 0 0 2.5px #fbbf24,
      0 3px 8px rgba(245, 158, 11, 0.5),
      0 4px 8px rgba(0, 0, 0, 0.35),
      inset 0 1px 2px rgba(255, 255, 255, 0.9);
  }
}

.goti-piece:hover,
.ludo-token:hover {
  transform: scale(1.18);
  z-index: 40;
}

/* ==========================================================================
   Central Interactive Dice Controller Panel & Rolling Bar
   ========================================================================== */
.center-dice-panel {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  margin-top: 4px;
}

.center-dice-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.center-dice-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.center-dice-box {
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18), inset 0 2px 4px rgba(255,255,255,1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.center-dice-box:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 22px rgba(0,0,0,0.25);
}

.center-dice-box.active-turn {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 8px 20px rgba(245, 158, 11, 0.35);
  animation: diceActivePulse 1.5s infinite ease-in-out;
}

@keyframes diceActivePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 6px 16px rgba(245, 158, 11, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.7), 0 10px 24px rgba(245, 158, 11, 0.5); }
}

.center-dice-box.rolling {
  animation: diceSpinRoll 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) forwards !important;
  pointer-events: none;
  cursor: wait;
}

.center-dice-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.center-dice-player-name {
  font-size: 13.5px;
  font-weight: 900;
  color: var(--text-color);
  line-height: 1.2;
}

.center-dice-status-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.center-dice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-big-roll {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-big-roll:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.6);
  filter: brightness(1.08);
}

.btn-big-roll:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-big-roll:disabled {
  background: var(--border-color);
  color: var(--text-faint);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-center-magic {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-center-magic:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
  filter: brightness(1.1);
}

.btn-center-magic:disabled {
  background: var(--border-color);
  color: var(--text-faint);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

/* ==========================================================================
   Modals (Setup, Magic Number, Victory, Guide, Legal)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

.hidden-modal {
  display: none !important;
}

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

.modal-dialog-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header-row h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-close-modal:hover {
  color: var(--text-color);
  border-color: #f43f5e;
}

/* Magic Modal Number Grid */
.magic-numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0;
}

.magic-num-tile {
  background: var(--bg-card-sub);
  border: 2px solid var(--border-sub);
  color: var(--text-color);
  border-radius: 16px;
  padding: 16px;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.magic-num-tile:hover {
  border-color: #f59e0b;
  transform: translateY(-3px);
  background: var(--border-color);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.btn-action-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.15s ease;
}

.btn-action-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Player Config List in Modal */
.player-config-item,
.config-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.player-config-item:hover {
  border-color: #cbd5e1;
}

[data-theme="dark"] .player-config-item:hover {
  border-color: #475569;
}

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

.config-color-badge,
.config-player-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

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

.config-name-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.config-name-input:focus {
  border-color: #f59e0b;
}

.config-base-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* Segmented Human vs Bot Buttons */
.config-type-btn-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
  flex-shrink: 0;
}

.btn-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-type-toggle .material-symbols-rounded {
  font-size: 15px;
}

.btn-type-toggle:hover:not(.active-human):not(.active-bot) {
  background: var(--border-color);
  color: var(--text-color);
}

.btn-type-toggle.active-human {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-type-toggle.active-bot {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.config-type-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Static Content Pages Layout (About, Contact, Privacy, Terms)
   ========================================================================== */
.page-container,
.static-page-wrapper {
  max-width: 920px;
  margin: 32px auto 64px;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.page-card,
.static-page-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.page-header,
.static-header {
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 26px;
  margin-bottom: 32px;
}

.page-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.12);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.18);
}

.page-header h2,
.static-header h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-color);
  letter-spacing: -0.5px;
  margin: 0;
}

.page-meta {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 600;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.policy-section,
.static-section {
  line-height: 1.75;
}

.policy-section h3,
.static-section h3 {
  font-size: 18px;
  font-weight: 800;
  color: #f59e0b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-section p,
.static-section p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-color);
  margin-bottom: 12px;
}

.policy-bullet-list {
  margin-left: 24px;
  margin-bottom: 16px;
  color: var(--text-color);
  font-size: 14.5px;
  line-height: 1.8;
}

.policy-bullet-list li {
  margin-bottom: 6px;
}

/* Feature Grid in About Page */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.feature-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-sub);
  border-radius: 16px;
  padding: 20px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
}

.feature-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.feature-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Contact Grid in Contact Page */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 12px 0 20px;
}

.contact-info-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-sub);
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-details h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 4px;
}

.contact-details p {
  font-size: 14.5px;
  margin-bottom: 4px;
}

.contact-details p a {
  color: #f59e0b;
  font-weight: 700;
  text-decoration: none;
}

.contact-details p a:hover {
  text-decoration: underline;
}

.contact-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* FAQ list */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

.faq-item {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-sub);
  border-radius: 14px;
  padding: 16px 18px;
}

.faq-item h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Call to action at bottom of pages */
.page-cta-wrapper {
  margin-top: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
}

@media (max-width: 640px) {
  .page-container,
  .static-page-wrapper {
    margin: 16px auto 40px;
    padding: 0 12px;
  }

  .page-card,
  .static-page-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .page-header h2,
  .static-header h2 {
    font-size: 22px;
  }

  .policy-section h3,
  .static-section h3 {
    font-size: 16px;
  }

  .feature-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  width: 100%;
  background: var(--bg-header);
  border-top: 1px solid var(--border-color);
  padding: 28px 16px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

@media (min-width: 768px) {
  .footer-top-row {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}

.footer-link-btn:hover {
  color: #f59e0b;
  background: var(--border-color);
}

.footer-copy {
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

/* ==========================================================================
   Master Cross-Device Responsiveness (Mobile, Phablet, Tablet, Laptop, 4K)
   ========================================================================== */

/* Universal Touch & Mobile Ergonomics */
button,
a,
.ludo-dice-box,
.center-dice-box,
.goti-piece,
.ludo-token,
.magic-num-tile,
.btn-type-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 1. Ultra-Small Devices (Phones <= 380px, e.g. iPhone SE, Galaxy Z Flip cover) */
@media (max-width: 380px) {
  .header-container {
    padding: 5px 6px;
    gap: 3px;
  }
  
  .brand-wrapper {
    gap: 5px;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-logo-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 7px;
  }

  .brand-img-logo {
    width: 20px;
    height: 20px;
  }

  .brand-logo-icon .material-symbols-rounded {
    font-size: 14px !important;
  }
  
  .brand-text h1 {
    font-size: 11.5px;
    letter-spacing: -0.3px;
  }
  
  .brand-badge {
    display: none !important;
  }
  
  .header-controls {
    gap: 2.5px;
    flex-shrink: 0;
  }
  
  .btn-header-primary {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 7px;
    justify-content: center;
  }

  .btn-header-primary .material-symbols-rounded {
    font-size: 15px !important;
  }

  .btn-header-primary .btn-header-label {
    display: none !important;
  }
  
  .btn-header-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 7px;
    padding: 0;
  }

  .btn-header-icon .material-symbols-rounded {
    font-size: 15px !important;
  }
  
  .game-stage-grid {
    padding: 8px 6px 24px;
    gap: 10px;
  }
  
  .active-turn-banner {
    padding: 6px 10px;
  }
  
  #banner-turn-text {
    font-size: 12px !important;
  }
  
  .ludo-15-grid {
    width: calc(100vw - 12px);
    height: calc(100vw - 12px);
    max-width: 345px;
    max-height: 345px;
    border-width: 2.5px;
    border-radius: 14px;
  }
  
  .grid-yard {
    padding: 4px;
  }
  
  .yard-spot-circle {
    width: 22px;
    height: 22px;
  }
  
  .ludo-dice-box {
    width: 38px;
    height: 38px;
    padding: 4px;
    border-radius: 9px;
  }
  
  .dice-pip {
    width: 6.5px;
    height: 6.5px;
  }
  
  .dice-pip.pip-center-red {
    width: 9.5px;
    height: 9.5px;
  }
  
  .station-name {
    font-size: 9px;
  }
  
  .station-action-msg {
    font-size: 8px;
  }
  
  .btn-magic-action {
    padding: 2px 4px;
    font-size: 8.5px;
  }
  
  .center-dice-panel {
    padding: 8px 10px;
  }
  
  .center-dice-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .center-dice-left {
    justify-content: center;
  }
  
  .center-dice-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 6px;
  }
  
  .btn-big-roll {
    padding: 9px 8px;
    font-size: 11.5px;
    justify-content: center;
  }
  
  .btn-center-magic {
    padding: 9px 6px;
    font-size: 10.5px;
    justify-content: center;
  }
  
  .player-card {
    padding: 10px 10px;
    border-radius: 14px;
  }
  
  .card-avatar {
    width: 32px;
    height: 32px;
  }
  
  .card-user-name {
    font-size: 12.5px;
  }
  
  .token-summary-box {
    padding: 3px 4px;
    font-size: 9.5px;
  }
  
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* 2. Standard Mobile Phones (381px - 540px, e.g. iPhone 12/13/14/15, Galaxy S21/S22/S23) */
@media (min-width: 381px) and (max-width: 540px) {
  .header-container {
    padding: 6px 10px;
    gap: 4px;
  }
  
  .brand-wrapper {
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-logo-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
  }

  .brand-img-logo {
    width: 24px;
    height: 24px;
  }

  .brand-logo-icon .material-symbols-rounded {
    font-size: 16px !important;
  }

  .brand-text h1 {
    font-size: 13.5px;
    letter-spacing: -0.3px;
  }
  
  .brand-badge {
    display: none !important;
  }

  .header-controls {
    gap: 3.5px;
    flex-shrink: 0;
  }

  .btn-header-primary {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    justify-content: center;
  }

  .btn-header-primary .material-symbols-rounded {
    font-size: 17px !important;
  }

  .btn-header-primary .btn-header-label {
    display: none !important;
  }

  .btn-header-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    padding: 0;
  }

  .btn-header-icon .material-symbols-rounded {
    font-size: 17px !important;
  }
  
  .game-stage-grid {
    padding: 10px 10px 28px;
    gap: 12px;
  }
  
  .ludo-15-grid {
    width: calc(100vw - 20px);
    height: calc(100vw - 20px);
    max-width: 420px;
    max-height: 420px;
    border-width: 3px;
  }
  
  .ludo-dice-box {
    width: 42px;
    height: 42px;
    padding: 5px;
  }
  
  .dice-pip {
    width: 7.5px;
    height: 7.5px;
  }
  
  .center-dice-panel {
    padding: 10px 12px;
  }
  
  .center-dice-main-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .center-dice-left {
    flex: 1;
    min-width: 150px;
  }
  
  .btn-big-roll {
    padding: 10px 14px;
    font-size: 12.5px;
  }
  
  .btn-center-magic {
    padding: 10px 10px;
    font-size: 11px;
  }
  
  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* 3. Phablets & Small Tablets (541px - 767px) */
@media (min-width: 541px) and (max-width: 767px) {
  .header-container {
    padding: 8px 12px;
    gap: 6px;
  }

  .brand-logo-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .brand-text h1 {
    font-size: 15px;
  }

  .brand-badge {
    display: none !important;
  }

  .header-controls {
    gap: 5px;
  }

  .btn-header-primary {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .btn-header-icon {
    width: 33px;
    height: 33px;
    min-width: 33px;
  }

  .ludo-15-grid {
    width: min(calc(100vw - 28px), 460px);
    height: min(calc(100vw - 28px), 460px);
  }
  
  .side-col {
    max-width: 500px;
  }
}

/* 4. Large Tablets & iPad Landscape / Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .header-container {
    padding: 10px 18px;
  }

  .brand-badge {
    display: inline-block;
  }

  .hero-gradient-wrapper {
    padding: 40px 24px;
  }
  
  .hero-cta-group {
    flex-direction: row;
    justify-content: center;
  }
  
  .live-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .game-modes-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .roadmap-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .ludo-15-grid {
    width: 460px;
    height: 460px;
  }
}

/* 5. Desktop Laptops & Displays (1024px - 1440px) */
@media (min-width: 1024px) {
  .header-container {
    padding: 10px 20px;
  }

  .live-stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .game-modes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .roadmap-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .ludo-15-grid {
    width: 480px;
    height: 480px;
  }
}

/* 6. Ultra-Wide & 4K Displays (>= 1441px) */
@media (min-width: 1441px) {
  .header-container {
    max-width: 1440px;
    padding: 12px 24px;
  }

  .game-stage-grid {
    max-width: 1360px;
    grid-template-columns: 310px 500px 310px;
    gap: 32px;
  }
  
  .ludo-15-grid {
    width: 500px;
    height: 500px;
  }
}

/* 7. Universal Modal Responsiveness */
.modal-overlay {
  padding: 12px;
}

.modal-dialog-box {
  max-width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .modal-dialog-box {
    padding: 18px 14px;
    border-radius: 18px;
  }
  
  .player-config-item {
    padding: 8px 10px;
    gap: 8px;
  }
  
  .config-name-input {
    font-size: 12px;
    padding: 5px 8px;
  }
  
  .btn-type-toggle {
    padding: 5px 7px;
    font-size: 10.5px;
  }
  
  .magic-numbers-grid {
    gap: 8px;
  }
  
  .magic-num-tile {
    font-size: 20px;
    padding: 10px 0;
  }
}

/* 8. Home Page Rich PNG Image Layouts & Animations */
.hero-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (min-width: 900px) {
  .hero-grid-layout {
    grid-template-columns: 1.1fr 0.9fr;
    text-align: left;
  }

  .hero-grid-layout .hero-content-col {
    text-align: left;
  }

  .hero-grid-layout .hero-subtitle {
    margin: 0 0 24px 0;
  }

  .hero-grid-layout .hero-cta-group {
    justify-content: flex-start;
  }
}

.hero-visual-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-artwork-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.12) 0%, rgba(30, 27, 75, 0.4) 70%, transparent 100%);
  padding: 12px;
}

.hero-art-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
  animation: heroArtFloat 4s ease-in-out infinite alternate;
  transition: transform 0.3s ease;
}

.hero-art-img:hover {
  transform: scale(1.02) rotate(1deg);
}

@keyframes heroArtFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

.floating-hero-badge {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  z-index: 3;
  animation: badgeFloat 3.5s ease-in-out infinite alternate;
}

.floating-badge-top {
  top: -10px;
  right: -8px;
  animation-delay: 0.5s;
}

.floating-badge-bottom {
  bottom: -10px;
  left: -8px;
  animation-delay: 1.2s;
}

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

.floating-badge-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.floating-badge-text {
  display: flex;
  flex-direction: column;
}

.floating-badge-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-color);
  line-height: 1.2;
}

.floating-badge-sub {
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
}

/* Mode Cards with PNG Avatars */
.mode-png-avatar {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.royal-mode-card:hover .mode-png-avatar {
  transform: scale(1.1) rotate(-4deg);
}

/* Feature Cards with PNG Illustrations */
.feature-png-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.25s ease;
}

.feature-box-card:hover .feature-png-icon {
  transform: scale(1.15) rotate(6deg);
}

/* ==========================================================================
   Victory & Exit / Leave Confirmation Modal UI Refinements
   ========================================================================== */
.victory-dialog-box {
  max-width: 420px;
  padding: 30px 24px;
  background: var(--bg-card);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.15);
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.victory-crown-avatar {
  font-size: 52px;
  line-height: 1;
  animation: victoryBounce 1.5s infinite ease-in-out;
  margin-bottom: 2px;
}

@keyframes victoryBounce {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.12) translateY(-6px); }
}

.victory-title-text {
  font-size: 21px;
  font-weight: 900;
  color: #f59e0b;
  line-height: 1.3;
  text-align: center;
}

.victory-subtitle-text {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  text-align: center;
}

.victory-actions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
  box-sizing: border-box;
}

.btn-action-secondary {
  background: var(--bg-card-sub);
  border: 1.5px solid var(--border-color);
  color: var(--text-color) !important;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 800;
  width: 100%;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none !important;
  transition: all 0.18s ease;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-action-secondary:hover {
  background: var(--border-color);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.btn-victory-playagain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 900;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}

.btn-victory-home {
  background: var(--bg-card-sub);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: var(--text-color) !important;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 800;
  min-height: 48px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none !important;
  box-sizing: border-box;
  border-radius: 14px;
  transition: all 0.18s ease;
}

.btn-victory-home:hover {
  border-color: #f59e0b;
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn-victory-home span {
  color: inherit;
}

/* Leave Match Modal */
.exit-dialog-box {
  max-width: 420px;
  padding: 28px 22px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-sizing: border-box;
}

.exit-warning-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.exit-modal-title {
  font-size: 21px;
  font-weight: 900;
  color: var(--text-color);
  margin: 0;
}

.exit-modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 10px 0;
}

.exit-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.btn-exit-cancel {
  flex: 1;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-exit-cancel:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-exit-confirm {
  flex: 1;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border: none;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-exit-confirm:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Board Locked Overlay State during Animation/Roll */
.board-movement-locked {
  pointer-events: none !important;
  user-select: none !important;
}

.board-movement-locked .movable-goti {
  animation: none !important;
  cursor: default !important;
}

@media (max-width: 480px) {
  .modal-dialog-box {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .exit-actions-row {
    flex-direction: column;
    gap: 10px;
  }
  .btn-exit-cancel,
  .btn-exit-confirm,
  .btn-victory-playagain,
  .btn-victory-home {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }
}


