/* ═══════════════════════════════════════════════════
   ألعاب وائل — Wael's Games
   Premium Interactive Design System v2
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

/* ─── CSS Variables ─── */
:root {
  --bg-body: #06060e;
  --bg-surface: #0d0d1a;
  --bg-card: rgba(18, 18, 40, 0.85);
  --bg-card-solid: #12122a;
  --bg-glass: rgba(18, 18, 40, 0.6);
  --bg-input: rgba(255, 255, 255, 0.04);
  --text-primary: #eef0ff;
  --text-secondary: #8b8fa8;
  --text-muted: #555770;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-active: rgba(99, 102, 241, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 50px rgba(0, 0, 0, 0.6);
  --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.2);
  --shadow-glow-pink: 0 0 40px rgba(236, 72, 153, 0.2);
  --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.2);

  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-yellow: #fbbf24;
  --accent-orange: #f97316;
  --accent-red: #ef4444;

  --gradient-hero: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --gradient-pink: linear-gradient(135deg, #db2777, #ec4899);
  --gradient-blue: linear-gradient(135deg, #2563eb, #3b82f6);
  --gradient-green: linear-gradient(135deg, #059669, #10b981);
  --gradient-amber: linear-gradient(135deg, #d97706, #fbbf24);
  --gradient-danger: linear-gradient(135deg, #dc2626, #ef4444);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  --sidebar-width: 260px;
}

/* ─── Light Mode ─── */
[data-theme="light"] {
  --bg-body: #f4f4fb;
  --bg-surface: #eeeef8;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-input: rgba(0, 0, 0, 0.03);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5f7a;
  --text-muted: #9ca0b8;
  --border-color: rgba(0, 0, 0, 0.07);
  --border-active: rgba(99, 102, 241, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 50px rgba(0, 0, 0, 0.12);
  --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.12);
  --shadow-glow-pink: 0 0 40px rgba(236, 72, 153, 0.12);
  --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.12);
}

/* ─── Color Themes ─── */
[data-color="ocean"] {
  --accent-purple: #0ea5e9;
  --accent-pink: #06b6d4;
  --gradient-hero: linear-gradient(135deg, #0284c7 0%, #06b6d4 50%, #22d3ee 100%);
  --gradient-purple: linear-gradient(135deg, #0284c7, #0ea5e9);
  --gradient-pink: linear-gradient(135deg, #0891b2, #06b6d4);
  --shadow-glow-purple: 0 0 40px rgba(14, 165, 233, 0.2);
  --shadow-glow-pink: 0 0 40px rgba(6, 182, 212, 0.2);
  --border-active: rgba(14, 165, 233, 0.4)
}

[data-color="emerald"] {
  --accent-purple: #10b981;
  --accent-pink: #34d399;
  --gradient-hero: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --gradient-purple: linear-gradient(135deg, #059669, #10b981);
  --gradient-pink: linear-gradient(135deg, #0d9488, #14b8a6);
  --shadow-glow-purple: 0 0 40px rgba(16, 185, 129, 0.2);
  --shadow-glow-pink: 0 0 40px rgba(52, 211, 153, 0.2);
  --border-active: rgba(16, 185, 129, 0.4)
}

[data-color="sunset"] {
  --accent-purple: #f97316;
  --accent-pink: #ef4444;
  --gradient-hero: linear-gradient(135deg, #ea580c 0%, #ef4444 50%, #f97316 100%);
  --gradient-purple: linear-gradient(135deg, #ea580c, #f97316);
  --gradient-pink: linear-gradient(135deg, #dc2626, #ef4444);
  --shadow-glow-purple: 0 0 40px rgba(249, 115, 22, 0.2);
  --shadow-glow-pink: 0 0 40px rgba(239, 68, 68, 0.2);
  --border-active: rgba(249, 115, 22, 0.4)
}

[data-color="rose"] {
  --accent-purple: #ec4899;
  --accent-pink: #f472b6;
  --gradient-hero: linear-gradient(135deg, #db2777 0%, #ec4899 50%, #f472b6 100%);
  --gradient-purple: linear-gradient(135deg, #db2777, #ec4899);
  --gradient-pink: linear-gradient(135deg, #be185d, #ec4899);
  --shadow-glow-purple: 0 0 40px rgba(236, 72, 153, 0.2);
  --shadow-glow-pink: 0 0 40px rgba(244, 114, 182, 0.2);
  --border-active: rgba(236, 72, 153, 0.4)
}

/* Theme picker bar */
.theme-picker {
  position: relative;
  display: inline-block
}

.theme-picker-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  color: var(--text-primary)
}

.theme-picker-btn:hover {
  border-color: var(--accent-purple)
}

.theme-picker-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  min-width: 180px
}

.theme-picker-dropdown.open {
  display: block
}

.theme-picker-dropdown h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center
}

.theme-color-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap
}

.theme-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative
}

.theme-color-swatch:hover {
  transform: scale(1.15)
}

.theme-color-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 10px currentColor
}

.theme-color-swatch.active::after {
  content: '✓';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff
}

/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  transition: background .3s, color .3s;
  overflow-x: hidden;
  line-height: 1.6
}

a {
  text-decoration: none;
  color: inherit
}

img {
  max-width: 100%;
  height: auto;
  display: block
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none
}

input,
select,
textarea {
  font-family: inherit;
  outline: none
}

::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 10px
}

/* ═════════════════════════════════════
   ANIMATED BACKGROUND
   ═════════════════════════════════════ */
.bg-mesh {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none
}

.bg-mesh::before {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  top: -200px;
  right: -200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  animation: meshDrift 25s infinite ease-in-out
}

.bg-mesh::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  bottom: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
  animation: meshDrift 25s infinite ease-in-out reverse
}

[data-theme="light"] .bg-mesh::before {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%)
}

[data-theme="light"] .bg-mesh::after {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, transparent 70%)
}

@keyframes meshDrift {

  0%,
  100% {
    transform: translate(0, 0) scale(1)
  }

  33% {
    transform: translate(40px, -30px) scale(1.1)
  }

  66% {
    transform: translate(-30px, 20px) scale(0.9)
  }
}

/* Grid pattern overlay */
.bg-grid {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 60px 60px
}

[data-theme="light"] .bg-grid {
  background-image: linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px)
}

/* ═════════════════════════════════════
   HEADER / NAVBAR
   ═════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: var(--bg-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color)
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 900
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4)
}

.logo-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px
}

.header-center a {
  padding: 7px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast)
}

.header-center a:hover,
.header-center a.active {
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.1)
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

/* ─── Teams Bar in Header ─── */
.teams-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color)
}

.teams-bar .team-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
  transition: transform var(--transition-fast)
}

.teams-bar .team-chip:hover {
  transform: scale(1.05)
}

.teams-bar .team-chip .chip-score {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  margin-right: 4px
}

.teams-bar .edit-teams-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  font-size: 0.85rem;
  transition: all var(--transition-fast)
}

.teams-bar .edit-teams-btn:hover {
  background: var(--accent-purple);
  color: #fff;
  transform: rotate(90deg)
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 1.15rem;
  transition: all var(--transition-fast)
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple)
}

/* ═════════════════════════════════════
   TEAMS MODAL
   ═════════════════════════════════════ */
.zoom-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
}

.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all
}

.modal-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg)
}

.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0)
}

.modal-box h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px
}

.modal-box .close-modal {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast)
}

.modal-box .close-modal:hover {
  background: var(--accent-red);
  color: #fff
}

.team-entry-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  animation: popIn .3s ease-out both
}

.team-entry-card .te-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px
}

.team-entry-card .te-color {
  width: 14px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0
}

.team-entry-card .te-header input {
  flex: 1
}

.team-entry-card .te-del {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  flex-shrink: 0
}

.team-entry-card .te-del:hover {
  background: var(--accent-red);
  color: #fff
}

.player-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px
}

.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  font-size: 0.8rem;
  font-weight: 600
}

.player-chip .pc-x {
  cursor: pointer;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  font-size: 0.65rem;
  transition: all var(--transition-fast)
}

.player-chip .pc-x:hover {
  background: var(--accent-red);
  color: #fff
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ═════════════════════════════════════
   HERO — Main Page
   ═════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 70px 24px 30px;
  position: relative
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
  animation: fadeSlideIn .6s ease-out
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  animation: fadeSlideIn .6s ease-out .1s both
}

.hero h1 .gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  animation: fadeSlideIn .6s ease-out .2s both
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ═════════════════════════════════════
   GAME CARDS — Main Page (Bento Grid)
   ═════════════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 16px 40px 60px;
  max-width: 1100px;
  margin: 0 auto
}

.game-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  border: 1px solid var(--border-color);
  background: var(--bg-card)
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg)
}

.game-card .card-glow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none
}

.game-card:hover .card-glow {
  opacity: 1
}

.game-card:nth-child(1) .card-glow {
  background: radial-gradient(circle at 30% 70%, rgba(139, 92, 246, 0.15), transparent 60%)
}

.game-card:nth-child(2) .card-glow {
  background: radial-gradient(circle at 50% 60%, rgba(236, 72, 153, 0.15), transparent 60%)
}

.game-card:nth-child(3) .card-glow {
  background: radial-gradient(circle at 70% 50%, rgba(251, 191, 36, 0.15), transparent 60%)
}

.game-card .card-emoji {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform var(--transition-spring)
}

.game-card:hover .card-emoji {
  transform: scale(1.15) rotate(-5deg)
}

.game-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  position: relative;
  z-index: 1
}

.game-card .card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  line-height: 1.5
}

.game-card .card-arrow {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color)
}

.game-card:hover .card-arrow {
  background: var(--accent-purple);
  color: #fff;
  transform: translateX(-4px)
}

/* Custom sections cards */
.custom-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 0 40px 50px;
  max-width: 1100px;
  margin: 0 auto
}

.custom-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-normal)
}

.custom-section-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md)
}

.custom-section-card .cs-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0
}

.custom-section-card h4 {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px
}

.custom-section-card p {
  font-size: 0.78rem;
  color: var(--text-muted)
}

/* ═════════════════════════════════════
   ADMIN LAYOUT — Sidebar
   ═════════════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 64px)
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform .3s
}

.admin-sidebar .sidebar-title {
  padding: 0 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px
}

.admin-sidebar .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: right
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: var(--bg-input)
}

.sidebar-item.active {
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.1)
}

.sidebar-item.active::before {
  content: '';
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent-purple);
  margin-left: auto
}

.sidebar-item .si-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-input);
  transition: all var(--transition-fast);
  flex-shrink: 0
}

.sidebar-item.active .si-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple)
}

.admin-main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 900px
}

.admin-main h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px
}

.admin-main .page-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 28px
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  font-size: 1.2rem
}

/* ═════════════════════════════════════
   FORM ELEMENTS
   ═════════════════════════════════════ */
.form-group {
  margin-bottom: 18px
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary)
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: all var(--transition-fast)
}

.form-control:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12)
}

.form-control::placeholder {
  color: var(--text-muted)
}

textarea.form-control {
  resize: vertical;
  min-height: 80px
}

select.form-control {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 32px;
  cursor: pointer
}

select.form-control option {
  background: #1a1a2e;
  color: #eef0ff;
  padding: 10px 14px;
  font-size: 0.92rem
}

select.form-control option:checked {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff
}

select.form-control option:hover {
  background: rgba(59, 130, 246, 0.3)
}

[data-theme="light"] select.form-control option {
  background: #ffffff;
  color: #1a1a2e
}

[data-theme="light"] select.form-control option:checked {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff
}

.form-inline {
  display: flex;
  gap: 10px;
  align-items: flex-end
}

.form-inline .form-group {
  flex: 1;
  margin-bottom: 0
}

/* ─── Toggle Switch ─── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  font-weight: 600;
  font-size: 0.92rem
}

.toggle-row:hover {
  border-color: var(--border-active)
}

.toggle-row input[type="checkbox"] {
  display: none
}

.toggle-slider {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  right: 3px;
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2)
}

.toggle-row input:checked+.toggle-slider {
  background: var(--gradient-green)
}

.toggle-row input:checked+.toggle-slider::after {
  transform: translateX(-20px)
}

[data-theme="light"] .toggle-slider {
  background: rgba(0, 0, 0, 0.12)
}

/* ═════════════════════════════════════
   BUTTONS
   ═════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap
}

.btn-primary {
  background: var(--gradient-purple);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35)
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.45)
}

.btn-success {
  background: var(--gradient-green);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3)
}

.btn-success:hover {
  transform: translateY(-2px)
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3)
}

.btn-danger:hover {
  transform: translateY(-2px)
}

.btn-warning {
  background: var(--gradient-amber);
  color: #1a1a2e;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3)
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color)
}

.btn-ghost:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple)
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 10px
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius-lg)
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem
}

/* ═════════════════════════════════════
   ITEM LIST (Admin rows)
   ═════════════════════════════════════ */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px
}

.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast)
}

.item-row:hover {
  border-color: var(--border-active)
}

.item-row .ir-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0
}

.item-row .ir-info {
  flex: 1;
  min-width: 0
}

.item-row .ir-info h4 {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.item-row .ir-info p {
  font-size: 0.78rem;
  color: var(--text-muted)
}

.item-row .ir-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem
}

.empty-state .es-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.4
}

/* ═════════════════════════════════════
   UPLOAD AREA
   ═════════════════════════════════════ */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-input)
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.04)
}

.upload-area .ua-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.6
}

.upload-area p {
  color: var(--text-muted);
  font-size: 0.85rem
}

.image-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  justify-content: center
}

.img-thumb {
  position: relative;
  width: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-color)
}

.img-thumb img {
  width: 100%;
  height: 100px;
  object-fit: cover
}

.img-thumb .rm-img {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: transform var(--transition-fast)
}

.img-thumb .rm-img:hover {
  transform: scale(1.2)
}

.plus-sep {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-yellow)
}

/* Symbol config */
.symbol-cfg {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 10px 0
}

.symbol-cfg h5 {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-secondary)
}

.sym-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

/* ═════════════════════════════════════
   SCOREBOARD — in game pages
   ═════════════════════════════════════ */
.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
  padding: 0 16px
}

.score-pill {
  text-align: center;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  min-width: 120px;
  transition: all var(--transition-normal)
}

.score-pill.active-turn {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow-purple);
  transform: scale(1.06)
}

.score-pill .sp-name {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 2px
}

.score-pill .sp-score {
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

/* ═════════════════════════════════════
   GAME CONTAINER
   ═════════════════════════════════════ */
.game-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px
}

/* ═════════════════════════════════════
   GAME 1 — Picture Puzzle
   ═════════════════════════════════════ */
.puzzle-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0
}

.puzzle-img-wrap {
  position: relative;
  max-width: 240px;
  overflow: visible
}

.puzzle-img-wrap img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  object-fit: cover
}

.puzzle-sym {
  position: absolute;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--accent-pink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  z-index: 2;
  animation: symPulse 2s infinite
}

.puzzle-sym.pos-top-start {
  top: -18px;
  right: 8px
}

.puzzle-sym.pos-top-center {
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  animation: symPulseC 2s infinite
}

.puzzle-sym.pos-top-end {
  top: -18px;
  left: 8px
}

.puzzle-sym.pos-bottom-start {
  bottom: -18px;
  right: 8px
}

.puzzle-sym.pos-bottom-center {
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  animation: symPulseC 2s infinite
}

.puzzle-sym.pos-bottom-end {
  bottom: -18px;
  left: 8px
}

@keyframes symPulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.15)
  }
}

@keyframes symPulseC {

  0%,
  100% {
    transform: translateX(-50%) scale(1)
  }

  50% {
    transform: translateX(-50%) scale(1.15)
  }
}

.puzzle-plus {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-yellow);
  text-shadow: 0 2px 12px rgba(251, 191, 36, 0.4)
}

.answer-reveal {
  text-align: center;
  margin: 20px 0
}

.answer-box {
  display: inline-block;
  padding: 14px 36px;
  border-radius: var(--radius-lg);
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
  opacity: 0;
  transform: scale(0.8);
  transition: all .4s cubic-bezier(0.34, 1.56, 0.64, 1)
}

.answer-box.show {
  opacity: 1;
  transform: scale(1)
}

/* ═════════════════════════════════════
   GAME 2 — Q&A
   ═════════════════════════════════════ */
.question-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin: 20px 0
}

.question-panel .qp-num {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px
}

.question-panel .qp-text {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 28px;
  line-height: 1.8
}

.opts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto
}

.opt-btn {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all var(--transition-fast)
}

.opt-btn:hover {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.06)
}

.opt-btn.correct {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green)
}

.opt-btn.wrong {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red)
}

/* ═════════════════════════════════════
   GAME 3 — Jeopardy
   ═════════════════════════════════════ */

/* Category selection screen */
#catScreen {
  max-width: 100% !important;
  width: 100%;
}

.cat-select-screen {
  text-align: center;
  padding: 20px 0;
  width: 100%;
}

.cat-select-screen h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px
}

.cat-select-screen p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px
}

.cat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 0 20px;
  width: 75vw;
  /* As requested: 75% of browser */
  max-width: none;
  margin: 0 auto;
}

/* Section divider inside grid */
.cat-grid .game-section-divider {
  flex: 0 0 100%;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0 10px;
  padding: 15px 0;
}

.cat-grid .game-section-divider .gsd-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.8), transparent);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  transform: translateY(-50%);
  z-index: 1;
}

.cat-grid .game-section-divider .gsd-label {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px 30px;
  border-radius: 30px;
  border: 2px solid var(--accent-purple);
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
  letter-spacing: 0.5px;
}

/* Category card — like reference image with image + name + info */
.cat-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: #fcc419;
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s;
  flex: 0 0 calc(25% - 18px);
  min-width: 200px;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 10px;
  text-align: center;
  border: 4px solid #e8a317
}

.cat-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2)
}

.cat-card .cat-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0
}

.cat-card .cat-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 25%, transparent 50%);
  z-index: 1
}

.cat-card .cat-info-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(236, 72, 153, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  z-index: 3;
  cursor: pointer;
  transition: transform .2s;
  border: 2px solid #fff
}

.cat-card .cat-info-btn:hover {
  transform: scale(1.15)
}

.cat-card .cat-name {
  position: relative;
  z-index: 2;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 0.7);
  line-height: 1.3;
  padding: 0 4px;
  width: 100%;
}

.cat-card.no-img {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%)
}

.cat-card.no-img .cat-name {
  font-size: 1.1rem
}

/* Category info tooltip */
.cat-tooltip {
  position: absolute;
  top: 40px;
  right: 4px;
  background: var(--bg-card-solid);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  z-index: 10;
  box-shadow: var(--shadow-md);
  max-width: 200px;
  text-align: right;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all .2s
}

.cat-card:hover .cat-tooltip.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0)
}

/* Jeopardy board (after selecting categories) */
.jp-game-container {
  max-width: 90%;
  margin: 0 auto;
  padding: 16px 20px 70px
}

.jeopardy-board {
  display: grid;
  gap: 3px;
  margin: 0;
  direction: ltr;
  height: 78vh;
  grid-auto-rows: 1fr
}

.jp-header {
  text-align: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6, #a855f7);
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.25);
  position: relative
}

.jp-header.has-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat
}

.jp-header.has-img::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to top, rgba(10, 5, 30, 0.85) 0%, rgba(10, 5, 30, 0.2) 60%, transparent 100%);
  z-index: 1
}

.jp-header .jph-name {
  font-weight: 900;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 2;
  padding: 5px 10px;
  background: rgba(109, 40, 217, 0.75);
  border-radius: 6px 6px 0 0;
  width: 100%;
  text-align: center
}

.jp-cell {
  padding: 4px 4px;
  text-align: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: #1a1a2e;
  background: linear-gradient(to bottom, #fff9c4, #fff59d);
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center
}

.jp-cell:hover {
  transform: scale(1.06);
  background: linear-gradient(to bottom, #ffe082, #ffca28);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3)
}

.jp-cell.used {
  opacity: 0.15;
  pointer-events: none;
  background: #e0e0e0
}

[data-theme="dark"] .jp-cell {
  background: var(--bg-card);
  color: var(--accent-yellow);
  border-color: var(--border-color)
}

[data-theme="dark"] .jp-cell:hover {
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.15)
}

[data-theme="dark"] .jp-cell.used {
  background: var(--bg-surface)
}

/* Score panel — fixed footer bar */
.jp-bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(15, 15, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap
}

[data-theme="light"] .jp-bottom-panel {
  background: rgba(255, 255, 255, 0.92)
}

.jp-team-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-color);
  transition: all .3s;
  min-width: 0
}

.jp-team-block.active-turn {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.08);
  animation: teamGlow 1.5s ease-in-out infinite alternate
}

@keyframes teamGlow {
  from {
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.2)
  }

  to {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5), 0 0 40px rgba(139, 92, 246, 0.15)
  }
}

.jp-team-block .jtb-name {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap
}

.active-turn .jtb-name {
  animation: nameGlow 1.5s ease-in-out infinite alternate
}

@keyframes nameGlow {
  from {
    text-shadow: 0 0 4px rgba(139, 92, 246, 0.3)
  }

  to {
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.8), 0 0 24px rgba(139, 92, 246, 0.3)
  }
}

.jp-team-block .jtb-score {
  font-size: 1.1rem;
  font-weight: 900;
  min-width: 30px;
  text-align: center
}

.jp-team-block .jtb-btns {
  display: flex;
  gap: 3px
}

.jp-team-block .jtb-btns button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast)
}

.jp-score-add {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3)
}

.jp-score-add:hover {
  background: var(--accent-green);
  color: #fff
}

.jp-score-sub {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2)
}

.jp-score-sub:hover {
  background: var(--accent-red);
  color: #fff
}

.jp-turn-label {
  display: none
}

.jp-turn-active {
  display: inline-block;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap
}

.jp-turn-switch {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: center
}

.jp-turn-switch:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple)
}

.jp-end-game {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent-red);
  cursor: pointer;
  transition: all var(--transition-fast);
  align-self: center
}

.jp-end-game:hover {
  background: var(--accent-red);
  color: #fff
}

/* Jeopardy question modal */
.jp-modal {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px)
}

.jp-modal .modal-box {
  max-width: 1000px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 32px;
  min-height: 70vh;
  justify-content: center
}

.jp-modal .jpm-cat {
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-purple);
  margin-bottom: 12px;
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  letter-spacing: 1px
}

.jp-modal .jpm-points {
  display: inline-block;
  padding: 10px 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1a1a2e;
  font-weight: 900;
  font-size: 1.3rem;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3)
}

.jp-modal .jpm-question {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  line-height: 2;
  margin-bottom: 24px;
  max-width: 650px
}

.jp-modal .jpm-media {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid var(--border-color);
  max-width: 500px;
  width: 100%
}

[data-theme="light"] .jp-modal .jpm-media {
  background: rgba(0, 0, 0, 0.04)
}

.jp-modal .jpm-media img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto
}

.jp-modal .jpm-media video {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto
}

.jp-modal .jpm-media audio {
  width: 100%;
  margin: 8px 0
}

/* ═════════════════════════════════════
   TEAM SELECTOR (scoring)
   ═════════════════════════════════════ */
.team-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0
}

.team-selector .ts-btn {
  padding: 9px 22px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition-fast)
}

.team-selector .ts-btn:hover {
  border-color: var(--accent-purple);
  transform: translateY(-2px)
}

.action-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0
}

/* ═════════════════════════════════════
   GAME OVER
   ═════════════════════════════════════ */
.game-over-screen {
  text-align: center;
  padding: 60px 24px;
  animation: fadeSlideIn .5s ease-out
}

.game-over-screen .trophy {
  font-size: 5rem;
  animation: trophyBounce 1.5s infinite
}

.game-over-screen h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 16px 0 8px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.game-over-screen .winner {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px
}

@keyframes trophyBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0)
  }

  25% {
    transform: translateY(-20px) rotate(-5deg)
  }

  75% {
    transform: translateY(-10px) rotate(5deg)
  }
}

/* ═════════════════════════════════════
   TOAST NOTIFICATIONS
   ═════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  z-index: 9999;
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg)
}

.toast.show {
  transform: translateX(-50%) translateY(0)
}

.toast.success {
  background: var(--gradient-green)
}

.toast.error {
  background: var(--gradient-danger)
}

.toast.info {
  background: var(--gradient-blue)
}

/* ═════════════════════════════════════
   UTILITIES
   ═════════════════════════════════════ */
.text-center {
  text-align: center
}

.mt-1 {
  margin-top: 8px
}

.mt-2 {
  margin-top: 16px
}

.mt-3 {
  margin-top: 24px
}

.mb-2 {
  margin-bottom: 16px
}

.mb-3 {
  margin-bottom: 24px
}

.hidden {
  display: none !important
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  position: relative
}

/* Dev credit — fixed at far left of footer */
.dev-credit {
  position: fixed;
  bottom: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 999;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.35);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s;
  opacity: 0.75
}

.dev-credit:hover {
  transform: scale(1.15);
  opacity: 1;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5)
}

.dev-credit span {
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  font-family: 'Cairo', sans-serif
}

/* ═════════════════════════════════════
   ADMIN TABS (category filter bar)
   ═════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none
}

.admin-tabs::-webkit-scrollbar {
  display: none
}

.admin-tab {
  padding: 7px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.82rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0
}

.admin-tab:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple)
}

.admin-tab.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--accent-purple);
  color: var(--accent-purple)
}

.tab-edit {
  margin-right: 4px;
  font-size: 0.7rem;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity .2s
}

.admin-tab:hover .tab-edit {
  opacity: 1
}

/* ═════════════════════════════════════
   DRAG & DROP — VISUAL CATEGORY ROWS
   ═════════════════════════════════════ */
.drag-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: grab;
  transition: all .2s ease;
  user-select: none;
  direction: rtl
}

.drag-cat-item:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.1)
}

.drag-cat-item.dragging {
  opacity: 0.4;
  border-style: dashed;
  transform: scale(0.98)
}

.drag-cat-item.drag-over-item {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  transform: translateY(2px)
}

.drag-handle {
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: grab;
  opacity: 0.35;
  letter-spacing: 2px;
  transition: opacity .2s;
  margin-right: auto
}

.drag-cat-item:hover .drag-handle {
  opacity: 0.7
}

/* Category thumbnail */
.dci-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-color)
}

.dci-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  font-size: 1.4rem
}

/* Category info */
.dci-info {
  flex: 1;
  min-width: 0;
  text-align: right
}

.dci-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px
}

.dci-info p {
  font-size: 0.78rem;
  color: var(--text-muted)
}

/* Action buttons */
.dci-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  direction: ltr
}

.dci-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.dci-del {
  background: var(--gradient-danger);
  color: #fff
}

.dci-del:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4)
}

.dci-add {
  background: var(--gradient-purple);
  color: #fff
}

.dci-add:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4)
}

.dci-edit {
  background: var(--bg-surface);
  color: var(--text-secondary)
}

.dci-edit:hover,
.dci-edit.active {
  background: var(--accent-purple);
  color: #fff
}

/* Inline edit form */
.cat-edit-form {
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-purple);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px;
  margin: -6px 0 8px;
  animation: fadeSlideIn .25s ease-out
}

.cef-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px
}

/* Section divider in admin */
.cat-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-purple)
}

.cat-section-divider::before,
.cat-section-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), transparent)
}

.cat-section-divider::after {
  background: linear-gradient(90deg, transparent, var(--accent-purple))
}

/* Question sub-rows */
.cat-questions-sub {
  margin-bottom: 8px
}

.cq-row {
  margin: 0 0 2px 24px;
  padding: 8px 12px !important;
  font-size: 0.85rem
}

.cq-row h4 {
  font-size: 0.82rem !important
}

/* ═════════════════════════════════════
   ADMIN CAT-CARD GRID (Game3 style)
   ═════════════════════════════════════ */
.admin-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 4px 0;
  justify-items: center;
  margin-bottom: 8px
}

.admin-cat-wrap {
  width: 100%;
  max-width: 260px
}

.admin-cat-card {
  position: relative;
  cursor: grab
}

.admin-cat-card.dragging {
  opacity: 0.4;
  border-style: dashed;
  transform: scale(0.95)
}

.admin-cat-card.drag-over-item {
  border-color: var(--accent-green) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25) !important
}

/* Badge showing question count */
.admin-cat-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 4;
  backdrop-filter: blur(4px)
}

/* Action buttons overlay (bottom of card) */
.admin-cat-actions {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: all .25s ease;
  z-index: 5
}

.admin-cat-card:hover .admin-cat-actions {
  opacity: 1;
  transform: translateX(-50%) translateY(0)
}

/* Drag handle on card */
.admin-cat-drag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.5);
  z-index: 4;
  cursor: grab;
  opacity: 0;
  transition: opacity .2s
}

.admin-cat-card:hover .admin-cat-drag {
  opacity: 1
}

/* Questions list below card */
.admin-cat-questions {
  margin-top: 4px;
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden
}

.acq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-input)
}

.acq-row:last-child {
  border-bottom: none
}

.acq-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.acq-info em {
  color: var(--text-muted);
  font-style: normal;
  margin-right: 6px
}

.acq-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0
}

/* Collapsible question groups */
.acq-group {
  border-bottom: 1px solid var(--border-color)
}

.acq-group:last-child {
  border-bottom: none
}

.acq-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-input);
  transition: all var(--transition-fast);
  user-select: none
}

.acq-group-header:hover {
  background: rgba(139, 92, 246, 0.08)
}

.acq-group-arrow {
  font-size: 0.7rem;
  color: var(--accent-purple);
  transition: transform var(--transition-fast);
  width: 14px;
  text-align: center
}

.acq-group-pts {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  padding: 2px 10px;
  border-radius: 8px
}

.acq-group-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600
}

.acq-group-body {
  animation: slideDown .2s ease-out
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0
  }

  to {
    opacity: 1;
    max-height: 2000px
  }
}

/* Inline edit form under card */
.admin-cat-wrap .cat-edit-form {
  border-radius: var(--radius-md);
  margin: 4px 0 0;
  border: 1.5px solid var(--accent-purple)
}


.cq-row h4 {
  font-size: 0.82rem !important
}


/* ═════════════════════════════════════
   GAME PAGE — Section Divider (stylish)
   ═════════════════════════════════════ */
.game-section-divider {
  text-align: center;
  margin: 30px 0 20px;
  position: relative
}

.game-section-divider .gsd-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-purple) 20%, var(--accent-pink) 50%, var(--accent-purple) 80%, transparent 100%);
  border-radius: 4px;
  opacity: 0.5
}

.game-section-divider .gsd-label {
  position: relative;
  display: inline-block;
  padding: 6px 24px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--accent-purple);
  color: var(--accent-purple);
  box-shadow: 0 2px 16px rgba(139, 92, 246, 0.2);
  z-index: 1
}


/* ═════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════ */
@media(max-width:900px) {
  .bento-grid {
    grid-template-columns: 1fr 1fr;
    padding: 16px 20px 40px
  }

  .admin-sidebar {
    position: fixed;
    top: 64px;
    right: 0;
    z-index: 99;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
    height: calc(100vh - 64px)
  }

  .admin-sidebar.open {
    transform: translateX(0)
  }

  .sidebar-toggle {
    display: flex
  }

  .admin-main {
    padding: 20px 16px
  }

  .teams-bar {
    display: none
  }

  .cat-grid {
    width: 95vw;
    padding: 0 15px;
  }

  .cat-card {
    flex: 0 0 calc(50% - 15px);
  }

  .cat-card {
    width: calc(50% - 15px);
  }

  .admin-cat-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .jp-game-container {
    max-width: 96%;
    padding: 10px 10px 60px
  }

  .jp-cell {
    font-size: 0.82rem;
    padding: 6px 2px
  }

  .jp-header .jph-img {
    height: 30px
  }

  .jp-header-highlight .jph-name {
    font-size: 0.78rem;
    padding: 6px 4px
  }

  .jp-bottom-panel {
    gap: 8px;
    padding: 8px 12px
  }

  .jp-team-block {
    padding: 5px 10px;
    gap: 6px
  }

  .jp-team-block .jtb-score {
    font-size: 0.95rem
  }
}

@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 14px
  }

  .cat-card {
    width: calc(50% - 15px);
  }

  .cat-icon {
    font-size: 2.5rem;
  }

  .game-card .card-emoji {
    font-size: 2.4rem;
  }
}

@media(max-width:600px) {
  .main-header {
    padding: 0 14px
  }

  .header-center {
    display: none
  }

  .hero h1 {
    font-size: 2rem
  }

  .puzzle-area {
    flex-direction: column
  }

  .puzzle-img-wrap {
    max-width: 85%
  }

  .opts-grid {
    grid-template-columns: 1fr
  }

  .question-panel {
    padding: 24px 16px
  }

  .score-pill {
    min-width: 90px;
    padding: 10px 16px
  }

  .score-pill .sp-score {
    font-size: 1.4rem
  }

  .custom-sections {
    grid-template-columns: 1fr;
    padding: 0 16px 40px
  }

  .cat-grid {
    grid-template-columns: 1fr;
    width: 95vw;
    padding: 0 10px;
  }

  .cat-card {
    flex: 0 0 calc(100% - 10px);
    max-width: none;
  }

  .jp-game-container {
    max-width: 100%;
    padding: 8px 6px 56px
  }

  .jeopardy-board {
    gap: 2px;
    overflow-x: auto
  }

  .jp-cell {
    font-size: 0.75rem;
    padding: 4px 2px;
    min-width: 36px
  }

  .jp-header .jph-img {
    height: 24px
  }

  .jp-header-highlight .jph-name {
    font-size: 0.65rem;
    padding: 4px 2px
  }

  .jp-bottom-panel {
    gap: 6px;
    padding: 6px 8px;
    flex-wrap: wrap
  }

  .jp-team-block {
    padding: 4px 8px;
    font-size: 0.75rem
  }

  .jp-team-block .jtb-name {
    font-size: 0.7rem
  }

  .jp-team-block .jtb-score {
    font-size: 0.85rem
  }

  .jp-modal .modal-box {
    padding: 24px 16px;
    min-height: 60vh
  }

  .jp-modal .jpm-question {
    font-size: 1.2rem
  }
}

/* ═════════════════════════════════════
   LOGO — Professional Animated
   ═════════════════════════════════════ */
.logo-glow {
  display: inline-block;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 3.2rem;
  font-weight: 900;
  position: relative;
  cursor: default;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3))
}

.logo-glow:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 35px rgba(139, 92, 246, 0.6)) drop-shadow(0 0 60px rgba(236, 72, 153, 0.3))
}

.logo-glow::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -20px;
  right: -20px;
  bottom: -4px;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: logoPulse 3s ease-in-out infinite alternate;
  z-index: -1
}

@keyframes logoPulse {
  from {
    opacity: 0.4;
    transform: scale(0.95)
  }

  to {
    opacity: 1;
    transform: scale(1.1)
  }
}

/* ═════════════════════════════════════
   FIXED FOOTER — Copyright
   ═════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(6, 6, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 8px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600
}

[data-theme="light"] .site-footer {
  background: rgba(244, 244, 251, 0.92)
}

.site-footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s
}

.site-footer a:hover {
  color: var(--accent-pink)
}

body:has(.site-footer) {
  padding-bottom: 40px
}

/* ═════════════════════════════════════
   BACKGROUND THEMES
   ═════════════════════════════════════ */
/* Stars */
[data-bg="stars"] .bg-mesh {
  background: none
}

[data-bg="stars"] .bg-grid {
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 60%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 20% 90%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 10%, rgba(255, 255, 255, 0.35) 0%, transparent 100%);
  animation: none
}

/* Aurora */
[data-bg="aurora"] .bg-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 80% 50% at 80% 20%, rgba(236, 72, 153, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(59, 130, 246, 0.1), transparent);
  animation: auroraShift 8s ease-in-out infinite alternate
}

@keyframes auroraShift {
  0% {
    opacity: 0.6
  }

  50% {
    opacity: 1
  }

  100% {
    opacity: 0.7
  }
}

[data-bg="aurora"] .bg-grid {
  background-image: none
}

/* Waves */
[data-bg="waves"] .bg-mesh {
  background: none
}

[data-bg="waves"] .bg-grid {
  background-image: none;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 60px,
      rgba(139, 92, 246, 0.03) 60px,
      rgba(139, 92, 246, 0.03) 61px);
  animation: none
}

[data-bg="waves"]::after {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 100%, rgba(139, 92, 246, 0.1), transparent 60%),
    radial-gradient(ellipse at 70% 0%, rgba(236, 72, 153, 0.08), transparent 60%);
  pointer-events: none
}

/* None (clean) */
[data-bg="none"] .bg-mesh,
[data-bg="none"] .bg-grid {
  background: none;
  animation: none
}

/* ═════════════════════════════════════
   ADMIN THEME PAGE
   ═════════════════════════════════════ */
.theme-page {
  padding: 24px
}

.theme-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px
}

.theme-section h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-primary)
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px
}

.theme-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-input)
}

.theme-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md)
}

.theme-card.active {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2)
}

.theme-card-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 3px solid rgba(255, 255, 255, 0.15)
}

.theme-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary)
}

.theme-preview-bg {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  position: relative
}

/* ═════════════════════════════════════
   SCRAMBLED LETTERS — Game 3 Type
   ═════════════════════════════════════ */
.scramble-letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 20px 10px;
  direction: ltr
}

.scramble-tile {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  background: var(--gradient-purple);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: scramblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  cursor: default;
  user-select: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast)
}

.scramble-tile:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2)
}

@keyframes scramblePop {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(15deg)
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0)
  }
}

/* ═════════════════════════════════════
   ZOOMED IMAGE — "من عيونه" Game 3 Type
   ═════════════════════════════════════ */
.zoom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0
}

.zoom-viewport {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--accent-purple);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.25);
  cursor: grab;
  position: relative;
  background: #111;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none
}

.zoom-viewport:active {
  cursor: grabbing
}

.zoom-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: transform-origin 0.05s ease-out;
  will-change: transform, transform-origin
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 8px 16px
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast)
}

.zoom-btn:hover {
  background: var(--gradient-purple);
  color: #fff;
  border-color: var(--accent-purple);
  transform: scale(1.1)
}

.zoom-label {
  font-size: 1.2rem
}

.zoom-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-purple);
  min-width: 45px;
  text-align: center
}

.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-purple) 0%, rgba(139, 92, 246, 0.2) 100%);
  outline: none;
  cursor: pointer
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-purple);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  transition: transform var(--transition-fast)
}

.zoom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2)
}

.zoom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-purple);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  cursor: pointer
}

.zoom-viewport {
  overflow: hidden;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  background: transparent;
  position: relative
}

.zoom-icon-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 1.6rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 2
}

.answer-box,
.answer-reveal {
  text-align: center
}

.zoom-lightbox {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.zoom-lightbox.show {
  display: flex
}

.zoom-lightbox-inner {
  width: 90vw;
  height: 60vh;
  border-radius: 14px;
  border: 3px solid var(--accent-purple);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.4)
}

/* ═════════════════════════════════════
   TEAM DISTRIBUTION
   ═════════════════════════════════════ */

.dist-arena {
  background: radial-gradient(circle at center, #1a1a3e 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  min-height: 750px;
  position: relative;
  overflow: hidden;
  perspective: 1200px;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

.dist-arena::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 60%);
  transform: translate(-50%, -50%);
  animation: pulseCore 4s infinite alternate;
  pointer-events: none;
}

@keyframes pulseCore {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

.dist-deck {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 220px;
  z-index: 50;
  animation: floatDeck 4s infinite ease-in-out;
}

.dist-card {
  width: 130px;
  height: 180px;
  background: linear-gradient(135deg, #111, #222);
  border: 2px solid var(--accent-purple);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.1);
  position: absolute;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backface-visibility: hidden;
}

.dist-card::after {
  content: '🪄';
  position: absolute;
  font-size: 4rem;
  opacity: 0.1;
  z-index: 0;
}

.dist-card span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes floatDeck {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

.dist-card.flying {
  z-index: 100;
}

.floating-col {
  position: absolute;
  width: 200px;
  background: rgba(18, 18, 40, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.2);
  transition: transform 0.3s;
  animation: floatCol 6s infinite ease-in-out alternate;
}

/* Stagger floating animation for columns */
.floating-col:nth-child(2n) {
  animation-delay: -2s;
}

.floating-col:nth-child(3n) {
  animation-delay: -4s;
}

@keyframes floatCol {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  100% {
    transform: translateY(-15px) rotate(1deg);
  }
}

.floating-col:hover {
  transform: scale(1.05) translateY(-5px);
  z-index: 20;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px var(--accent-purple);
  border-color: var(--accent-purple);
}

.glow-header {
  background: var(--gradient-hero) !important;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-weight: 900;
  margin-bottom: 15px;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dist-team-list {
  display: flex;
  flex-direction: column;
  gap: -10px;
  /* Overlap cards slightly */
}

.dist-static-card {
  width: 100%;
  padding: 12px 10px;
  background: #ffffff;
  color: #1a1a2e;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 45px;
  position: relative;
  background-image: linear-gradient(135deg, #fff 0%, #f0f0f5 100%);
  margin-bottom: 6px;
  transform-origin: top center;
  transition: transform 0.2s;
  overflow: hidden;
}

.dist-static-card:hover {
  transform: translateY(-5px) scale(1.02);
  z-index: 10;
}

.dist-static-card .card-suit {
  font-size: 1rem;
  opacity: 0.8;
  position: relative;
  z-index: 2;
}

.dist-static-card .card-suit.bottom {
  transform: rotate(180deg);
}

.dist-static-card span:nth-child(3) {
  font-size: 1.05rem;
  flex-grow: 1;
  position: relative;
  z-index: 2;
}

.card-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 2.5rem;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  width: 100%;
  text-align: center;
}

.dist-static-card.is-base {
  background: linear-gradient(135deg, #1e1e2f, #2a2a4a);
  color: #ffd700;
  border: 1px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.dist-static-card.is-base .card-watermark {
  color: rgba(255, 215, 0, 0.05);
}

.dist-static-card.is-base .card-suit {
  opacity: 1;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.magic-drop {
  animation: magicDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes magicDrop {
  0% {
    transform: scale(1.5) rotate(15deg);
    opacity: 0;
    filter: blur(5px);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: blur(0);
  }
}

/* ═════════════════════════════════════
   MOBILE RESPONSIVENESS
   ═════════════════════════════════════ */
@media (max-width: 768px) {
  .main-header {
    flex-wrap: wrap;
    height: auto;
    padding: 15px 10px;
    justify-content: center;
    gap: 12px;
  }

  .header-center {
    order: 3;
    width: 100%;
    display: flex;
    /* Force visibility */
    justify-content: center;
    margin-top: 5px;
  }

  .header-actions {
    justify-content: center;
    width: 100%;
    order: 2;
  }

  .logo {
    width: 100%;
    justify-content: center;
    order: 1;
  }
}

/* ═════════════════════════════════════
   HOME PAGE MODERN CENTERING & REDESIGN
   ═════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 80px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 15px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.bento-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.game-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  flex: 1 1 280px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(10px);
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  border-color: var(--accent-purple);
}

.game-card .card-emoji {
  font-size: 3.5rem;
  margin-bottom: 15px;
}

.game-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.game-card .card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card-arrow {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.game-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(-5px);
  color: var(--accent-purple);
}

/* Fireworks popup overlay */
.fireworks-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.fireworks-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.close-fireworks {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  transition: all var(--transition-fast);
  z-index: 10001;
}

.close-fireworks:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: scale(1.1) rotate(90deg);
}

.fireworks-msg {
  font-size: 4rem;
  font-weight: 900;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px var(--accent-purple), 0 0 80px var(--accent-pink);
  transform: scale(0.5);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fireworks-overlay.show .fireworks-msg {
  transform: scale(1);
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px var(--accent-purple);
  }

  100% {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(255, 255, 255, 1), 0 0 60px var(--accent-pink), 0 0 100px var(--accent-purple);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 40px 15px 20px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .fireworks-msg {
    font-size: 2.5rem;
  }
}