/* ==========================================================================
   ArcadeVerse Design System & Global Styles
   Cyberpunk / Dark Glassmorphism Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette */
  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(19, 26, 42, 0.7);
  --bg-card-hover: rgba(27, 37, 60, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-glow: rgba(99, 102, 241, 0.4);

  /* Accents */
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Text colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Ludo Board Colors */
  --ludo-red: #ef4444;
  --ludo-green: #22c55e;
  --ludo-yellow: #eab308;
  --ludo-blue: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient glow orbs in background */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}

body::before {
  top: -100px;
  left: -50px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
}

body::after {
  bottom: -150px;
  right: -50px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--secondary), transparent 70%);
}

/* Top Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 14, 0.8);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px var(--primary));
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-pill {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--primary);
  border-radius: var(--radius-full);
  color: #a5b4fc;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.admin-nav-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* Announcement Bar */
.announcement-bar {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid var(--border-glass-glow);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e2e8f0;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-emerald);
  text-transform: uppercase;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  background: linear-gradient(135deg, rgba(19, 26, 42, 0.8), rgba(13, 18, 29, 0.9));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero-glow-accent {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

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

.featured-game-badge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-smooth);
}

.featured-game-badge-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.featured-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  display: block;
  animation: float-anim 3s ease-in-out infinite;
}

@keyframes float-anim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.featured-card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.featured-card-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Section Titles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.active-count-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid var(--border-glass-glow);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--card-accent, var(--primary));
  transform: translateY(-6px);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.6), 0 0 20px var(--card-glow, var(--primary-glow));
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.game-icon-bubble {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid var(--border-glass);
}

.game-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.badge-featured {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-category {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid var(--border-glass);
}

.game-card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #fff;
}

.game-card-subtitle {
  font-size: 0.85rem;
  color: var(--card-accent, var(--primary));
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.game-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

.game-meta-group {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Empty Games State */
.empty-games-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  background: var(--bg-card);
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}

.placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
  background: linear-gradient(135deg, #7174f7 0%, #5850ec 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

/* ==========================================================================
   Game Arena Modal / Full Screen Theater
   ========================================================================== */
.game-arena-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 11, 0.92);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.game-arena-overlay.active {
  opacity: 1;
  visibility: visible;
}

.arena-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-glass);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.back-to-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.back-to-hub-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-3px);
}

.arena-body {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Game Wrapper General */
.game-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 860px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.25rem;
}

.game-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.game-emoji-badge {
  font-size: 2.2rem;
}

.game-title-group h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.game-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.game-mode-toggle {
  display: flex;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   GAME 1: Tic Tac Toe Styles
   ========================================================================== */
.ttt-scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.score-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.score-card.active-turn {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.score-avatar {
  font-size: 1.5rem;
}

.score-info {
  display: flex;
  flex-direction: column;
}

.score-name {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.score-value {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.game-status-banner {
  text-align: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1.05rem;
}

.win-text {
  color: #34d399;
  font-weight: 700;
}

.tie-text {
  color: #fbbf24;
}

.ttt-board-container {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 12px;
}

.ttt-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ttt-cell:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: scale(1.03);
}

.ttt-cell.filled.x {
  color: #38bdf8;
  text-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.ttt-cell.filled.o {
  color: #f43f5e;
  text-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
}

.ttt-cell.winning-cell {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  animation: pulse-win 1s infinite alternate;
}

@keyframes pulse-win {
  from { transform: scale(1); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
  to { transform: scale(1.05); box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
}

.game-actions-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   GAME 2: Ludo Classic Styles
   ========================================================================== */
.ludo-wrapper {
  max-width: 980px;
}

.ludo-player-count-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ctrl-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.pill-group {
  display: flex;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem;
  border-radius: var(--radius-full);
}

.pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
}

.ludo-arena-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.ludo-side-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ludo-turn-card {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ludo-turn-card.color-red { border-color: var(--ludo-red); box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); }
.ludo-turn-card.color-green { border-color: var(--ludo-green); box-shadow: 0 0 15px rgba(34, 197, 94, 0.2); }
.ludo-turn-card.color-yellow { border-color: var(--ludo-yellow); box-shadow: 0 0 15px rgba(234, 179, 8, 0.2); }
.ludo-turn-card.color-blue { border-color: var(--ludo-blue); box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }

.turn-avatar {
  font-size: 1.6rem;
}

.turn-text {
  display: flex;
  flex-direction: column;
}

.turn-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

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

/* 3D Interactive Dice */
.ludo-dice-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.ludo-dice {
  width: 72px;
  height: 72px;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), inset 0 -4px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ludo-dice.dice-ready {
  animation: dice-wiggle 1.8s infinite;
}

@keyframes dice-wiggle {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(99, 102, 241, 0); }
}

.ludo-dice.rolling {
  animation: dice-roll 0.45s infinite linear;
}

@keyframes dice-roll {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.dice-face {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 8px;
}

.dice-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #0f172a;
  border-radius: 50%;
}

.dot-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dot-top-left { top: 12px; left: 12px; }
.dot-top-right { top: 12px; right: 12px; }
.dot-mid-left { top: 50%; left: 12px; transform: translateY(-50%); }
.dot-mid-right { top: 50%; right: 12px; transform: translateY(-50%); }
.dot-bottom-left { bottom: 12px; left: 12px; }
.dot-bottom-right { bottom: 12px; right: 12px; }

.dice-instructions {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
  min-height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ludo-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.player-pill.active-player-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pill-red .color-dot { background: var(--ludo-red); }
.pill-green .color-dot { background: var(--ludo-green); }
.pill-yellow .color-dot { background: var(--ludo-yellow); }
.pill-blue .color-dot { background: var(--ludo-blue); }

.player-label {
  flex-grow: 1;
  font-weight: 600;
}

.token-tally {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Ludo 15x15 Board */
.ludo-board-container {
  display: flex;
  justify-content: center;
}

.ludo-grid-15 {
  display: grid;
  grid-template-columns: repeat(15, 34px);
  grid-template-rows: repeat(15, 34px);
  background: #0f172a;
  border: 3px solid #334155;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  position: relative;
  user-select: none;
}

/* 4 Home Yards / Bases */
.base-box {
  border: 2px solid rgba(0, 0, 0, 0.3);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.base-inner {
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.base-inner h4 {
  font-size: 0.65rem;
  letter-spacing: 1px;
  opacity: 0.8;
}

.base-tokens {
  display: flex;
  gap: 12px;
}

.base-red {
  grid-column: 1 / 7;
  grid-row: 1 / 7;
  background: var(--ludo-red);
}

.base-green {
  grid-column: 10 / 16;
  grid-row: 1 / 7;
  background: var(--ludo-green);
}

.base-yellow {
  grid-column: 10 / 16;
  grid-row: 10 / 16;
  background: var(--ludo-yellow);
}

.base-blue {
  grid-column: 1 / 7;
  grid-row: 10 / 16;
  background: var(--ludo-blue);
}

/* Center Triangle Home */
.ludo-center-home {
  grid-column: 7 / 10;
  grid-row: 7 / 10;
  background: #1e293b;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tri {
  position: absolute;
  width: 0;
  height: 0;
}

.tri-red {
  top: 0; left: 0; bottom: 0;
  border-top: 51px solid transparent;
  border-bottom: 51px solid transparent;
  border-left: 51px solid var(--ludo-red);
}

.tri-green {
  top: 0; left: 0; right: 0;
  border-left: 51px solid transparent;
  border-right: 51px solid transparent;
  border-top: 51px solid var(--ludo-green);
}

.tri-yellow {
  top: 0; right: 0; bottom: 0;
  border-top: 51px solid transparent;
  border-bottom: 51px solid transparent;
  border-right: 51px solid var(--ludo-yellow);
}

.tri-blue {
  bottom: 0; left: 0; right: 0;
  border-left: 51px solid transparent;
  border-right: 51px solid transparent;
  border-bottom: 51px solid var(--ludo-blue);
}

.center-star {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.home-tokens-center {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 4px;
}

/* Track & Corridor Cells */
.ludo-cell {
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #0f172a;
}

.track-cell.star-cell {
  background: #1e293b;
}

.cell-star {
  color: #94a3b8;
  font-size: 0.9rem;
  pointer-events: none;
}

.start-red { background: rgba(239, 68, 68, 0.25); border-color: var(--ludo-red); }
.start-green { background: rgba(34, 197, 94, 0.25); border-color: var(--ludo-green); }
.start-yellow { background: rgba(234, 179, 8, 0.25); border-color: var(--ludo-yellow); }
.start-blue { background: rgba(59, 130, 246, 0.25); border-color: var(--ludo-blue); }

.home-col-red { background: var(--ludo-red); opacity: 0.85; }
.home-col-green { background: var(--ludo-green); opacity: 0.85; }
.home-col-yellow { background: var(--ludo-yellow); opacity: 0.85; }
.home-col-blue { background: var(--ludo-blue); opacity: 0.85; }

/* Pawns / Tokens */
.ludo-token {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  cursor: default;
  transition: transform 0.2s ease;
  z-index: 5;
}

.token-pawn {
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.token-red { background: radial-gradient(circle at 35% 35%, #fca5a5, var(--ludo-red)); color: #fff; }
.token-green { background: radial-gradient(circle at 35% 35%, #86efac, var(--ludo-green)); color: #fff; }
.token-yellow { background: radial-gradient(circle at 35% 35%, #fef08a, var(--ludo-yellow)); color: #000; }
.token-blue { background: radial-gradient(circle at 35% 35%, #93c5fd, var(--ludo-blue)); color: #fff; }

.token-selectable {
  cursor: pointer;
  animation: token-bounce 0.8s infinite alternate;
  box-shadow: 0 0 12px #fff, 0 0 20px var(--primary);
}

@keyframes token-bounce {
  from { transform: scale(1); }
  to { transform: scale(1.22); }
}

.token-slot-empty {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   GAME 3: Neon Snake Arcade Styles
   ========================================================================== */
.snake-wrapper {
  max-width: 650px;
}

.snake-stats-header {
  display: flex;
  gap: 1rem;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.stat-pill.high-score .stat-val {
  color: var(--accent-amber);
}

.snake-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.canvas-glow-box {
  position: relative;
  border-radius: var(--radius-md);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.25), 0 12px 36px rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(6, 182, 212, 0.4);
  overflow: hidden;
  background: #0b0f19;
}

#snake-canvas {
  display: block;
}

.snake-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.overlay-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 320px;
}

.overlay-icon {
  font-size: 3rem;
}

.overlay-modal h4 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
}

.gameover-title {
  color: var(--accent-rose);
}

.final-score-text {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.new-record-badge {
  color: var(--accent-amber);
  font-weight: 800;
  font-size: 0.9rem;
  animation: pulse-ring 1.5s infinite;
}

.snake-controls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.snake-actions-bar {
  display: flex;
  gap: 1rem;
}

/* Touch D-Pad */
.touch-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.dpad-middle-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dpad-center {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.dpad-btn {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.dpad-btn:active, .dpad-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(0.94);
}

/* Footer */
.portal-footer {
  border-top: 1px solid var(--border-glass);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 4rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--primary);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
  .ludo-arena-layout {
    grid-template-columns: 1fr;
  }
  .ludo-board-container {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 1rem;
  }
  .ludo-grid-15 {
    transform-origin: top center;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .game-wrapper {
    padding: 1.25rem;
  }
  .ttt-grid {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
  }
  .ludo-grid-15 {
    grid-template-columns: repeat(15, 22px);
    grid-template-rows: repeat(15, 22px);
  }
  .ludo-token {
    width: 18px;
    height: 18px;
  }
  .token-pawn {
    font-size: 0.8rem;
  }
  #snake-canvas {
    width: 320px;
    height: 320px;
  }
}
