/* Modern Premium Glassmorphic Design System for Chess Trainer */
:root {
  /* Default Theme: Slate */
  --bg-app: radial-gradient(circle at top left, #121826, #090b11);
  --bg-glass: rgba(18, 24, 38, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --glow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent-secondary: #60a5fa;
  --danger-color: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --success-color: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);

  /* Chessboard Colors (Slate Default) */
  --board-light: #eceff1;
  --board-dark: #37474f;
  --board-highlight: rgba(245, 158, 11, 0.6); /* Amber highlight for moves */
  --board-selected: rgba(59, 130, 246, 0.6); /* Blue highlight for selected */
  --board-dot: rgba(16, 185, 129, 0.5);      /* Green dot for legal moves */
  --board-capture: rgba(239, 68, 68, 0.4);   /* Red ring for legal captures */
}

/* Theme: Slate (Default) */
body.board-slate {
  --board-light: #eceff1;
  --board-dark: #37474f;
  --board-highlight: rgba(245, 158, 11, 0.6);
  --board-selected: rgba(59, 130, 246, 0.6);
  --board-dot: rgba(16, 185, 129, 0.5);
  --board-capture: rgba(239, 68, 68, 0.4);
}

/* Theme: Forest Green */
body.board-forest {
  --board-light: #eeeed2;
  --board-dark: #769656;
}

/* Theme: Classic Walnut */
body.board-wood {
  --board-light: #f0d9b5;
  --board-dark: #b58863;
}

/* Theme: Cyber Neon */
body.board-neon {
  --border-glass: rgba(139, 92, 246, 0.15);
  --board-light: #2d1b4e;
  --board-dark: #0f051d;
  --board-border-neon: 2px solid #8b5cf6;
  --board-highlight: rgba(236, 72, 153, 0.6); /* Pink neon for moves */
  --board-selected: rgba(6, 182, 212, 0.6);   /* Cyan neon for selected */
  --board-dot: rgba(6, 182, 212, 0.6);
  --board-capture: rgba(236, 72, 153, 0.5);
}

/* Theme: Ice Blue */
body.board-ice {
  --board-light: #e0f2fe;
  --board-dark: #0284c7;
}

/* Theme: Warm Leather */
body.board-leather {
  --board-light: #e6b89c;
  --board-dark: #7d3c13;
}

/* Theme: Granite Stone */
body.board-granite {
  --board-light: #e5e7eb;
  --board-dark: #1f2937;
}

/* Theme: Midnight Minimal */
body.board-midnight {
  --board-light: #3f3f46;
  --board-dark: #18181b;
}

/* Theme: Cherry Blossom */
body.board-rose {
  --board-light: #ffd1dc;
  --board-dark: #9f1d35;
}

/* Theme: Sand & Sea */
body.board-beach {
  --board-light: #f5e6c8;
  --board-dark: #008080;
}

/* Theme: Stained Oak Wood */
body.board-oak {
  --board-light: #d7b889;
  --board-dark: #5c4033;
}

/* Theme: Volcanic Obsidian */
body.board-obsidian {
  --board-light: #323232;
  --board-dark: #121212;
}

/* Theme: Carrara Marble */
body.board-marble {
  --board-light: #f8fafc;
  --board-dark: #cbd5e1;
}

/* General Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--glow-glass);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Layout */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* Sidebar styling */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none; /* Hide scrollbar for clean premium look */
}
.sidebar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 20px;
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  filter: blur(25px);
  border-radius: 50%;
  z-index: -1;
  transform: translate(-50%, -50%);
  animation: pulse-glow 3s infinite alternate;
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-color);
}

.brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.brand h1 span {
  color: var(--accent-color);
  font-weight: 500;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.theme-picker-container label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 10px;
}

.theme-chips {
  display: flex;
  gap: 10px;
}

.theme-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.theme-chip:hover {
  transform: scale(1.15);
}

.theme-chip.active {
  border-color: #fff;
  box-shadow: 0 0 8px #fff;
}

.theme-chip.slate { background: linear-gradient(135deg, #e2e8f0, #475569); }
.theme-chip.forest { background: linear-gradient(135deg, #eeeed2, #769656); }
.theme-chip.wood { background: linear-gradient(135deg, #f0d9b5, #b58863); }
.theme-chip.neon { background: linear-gradient(135deg, #2d1b4e, #8b5cf6); }

/* Main Area Layout */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0; /* Prevents grid cell from stretching vertically */
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.top-bar h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success-color);
  animation: pulse 1.5s infinite;
}

.pulse-dot.error {
  background: var(--danger-color);
  box-shadow: 0 0 8px var(--danger-color);
}

.pulse-dot.thinking {
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

/* Workspace Grid split */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: 16px;
  flex-grow: 1;
  min-height: 0; /* Prevents vertical stretching past parent container */
  overflow: hidden;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-grid.resizing-transition {
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.workspace-grid.board-large {
  grid-template-columns: minmax(440px, 640px) 1fr;
}

/* App View Wrapper Grid system */
.app-view-layout-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  flex-grow: 1;
  min-height: 0;
  width: 100%;
}

.app-view-layout-wrapper.with-ads {
  grid-template-columns: 1fr; /* Single column by default for smaller viewports */
}

.app-view-content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  min-height: 0;
  width: 100%;
}

.app-active-views {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
}

#instructive-games-view {
  overflow: visible;
  height: auto;
  min-height: 100%;
  padding-bottom: 30px;
}


/* Ad System Styling */
.ad-skyscraper {
  display: none !important; /* Hidden on viewports < 1400px to prevent layout squeezing */
  flex-direction: column;
  gap: 12px;
  width: 180px; /* Reduced from 300px to avoid taking up half the screen space */
  padding: 12px;
  border-radius: 16px;
  box-sizing: border-box;
  align-items: center;
  justify-content: flex-start;
  min-height: 500px;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* On viewports >= 768px, display skyscraper ad side-by-side on the right */
@media (min-width: 768px) {
  .app-view-layout-wrapper.with-ads {
    grid-template-columns: 1fr 180px; /* Allocated 180px for the ad column */
    gap: 20px;
  }
  .ad-skyscraper:not(.hidden) {
    display: flex !important;
  }
  .ad-leaderboard {
    display: none !important;
  }
}

.ad-leaderboard {
  display: none !important; /* Hidden by default on viewports with height < 900px to prevent vertical board clipping */
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  border-radius: 12px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ad-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  opacity: 0.6;
  font-weight: 700;
  margin-bottom: 4px;
}

.ad-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.01);
  padding: 12px;
  box-sizing: border-box;
  color: var(--text-secondary);
  font-size: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.ad-content:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--accent-color);
}

.ad-skyscraper-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
  justify-content: flex-start;
  align-items: stretch;
}

.ad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ad-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ad-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ad-card:hover::before {
  opacity: 1;
}

.ad-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: 'Space Grotesk', sans-serif;
}

.ad-desc {
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.ad-cta {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-color);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.ad-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

/* Board Column Layout */
.board-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: auto;
  position: sticky;
  top: 16px;
  align-self: start;
  z-index: 10;
}

.board-wrapper {
  position: relative;
  display: flex;
  padding: 16px;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  min-height: 0;
  min-width: 0;
}

/* Evaluation Bar CSS */
.eval-bar-container {
  position: relative;
  width: 14px;
  height: auto;
  align-self: stretch;
  background: #1e1e1e;
  border-radius: 8px;
  margin-right: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.eval-bar-fill {
  width: 100%;
  background: #ffffff;
  transition: height 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.eval-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  color: #fff;
  mix-blend-mode: difference;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* The Grid Board */
.chessboard {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  max-width: min(440px, calc(100vh - 340px));
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
}

.workspace-grid.resizing-transition .chessboard {
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chessboard.enlarged {
  max-width: min(600px, calc(100vh - 260px));
}

body.board-neon .chessboard {
  border: var(--board-border-neon);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Board Square Styles */
.square {
  position: relative;
  aspect-ratio: 1/1;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.square.light {
  background-color: var(--board-light);
  transition: background-color 0.2s ease, background-image 0.2s ease;
}

.square.dark {
  background-color: var(--board-dark);
  transition: background-color 0.2s ease, background-image 0.2s ease;
}

/* --- COPYRIGHT-FREE PREMIUM BOARD TEXTURING --- */

/* 1. Classic Tournament Green (Textured Vinyl Weave) */
body.board-forest .square.light {
  background-color: #eeeed2;
  background-image: linear-gradient(rgba(0,0,0,0.01) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.01) 1px, transparent 1px);
  background-size: 3px 3px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.02);
}
body.board-forest .square.dark {
  background-color: #769656;
  background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 3px 3px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.06);
}

/* 2. Classic Wood Board Texture (Maple / Walnut) */
body.board-wood .square.light {
  background-color: #f0d9b5;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.01) 0px, rgba(0,0,0,0.01) 1px, transparent 1px, transparent 8px),
                    linear-gradient(90deg, rgba(255,255,255,0.03), rgba(0,0,0,0.03));
  box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
}
body.board-wood .square.dark {
  background-color: #b58863;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 2px, transparent 2px, transparent 12px),
                    linear-gradient(90deg, rgba(255,255,255,0.03), rgba(0,0,0,0.06));
  box-shadow: inset 0 0 8px rgba(0,0,0,0.12);
}

/* 3. Granite Stone Board Texture (Volcanic speckled stone) */
body.board-granite .square.light {
  background-color: #e5e7eb;
  background-image: radial-gradient(circle at 30% 40%, rgba(0,0,0,0.04) 1px, transparent 2px),
                    radial-gradient(circle at 80% 80%, rgba(0,0,0,0.03) 1px, transparent 2px);
  background-size: 5px 5px, 7px 7px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}
body.board-granite .square.dark {
  background-color: #1f2937;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.05) 1px, transparent 2px),
                    radial-gradient(circle at 70% 60%, rgba(0,0,0,0.08) 1.5px, transparent 2px);
  background-size: 8px 8px, 10px 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

/* 4. Luxury Tan & Cognac Leather Board Texture */
body.board-leather .square.light {
  background-color: #e6b89c;
  background-image: radial-gradient(rgba(0,0,0,0.05) 15%, transparent 16%);
  background-size: 3px 3px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.08);
}
body.board-leather .square.dark {
  background-color: #7d3c13;
  background-image: radial-gradient(rgba(0,0,0,0.15) 15%, transparent 16%);
  background-size: 4px 4px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
}

/* 5. Cyber Neon Grid Outlines */
body.board-neon .square.light {
  background-color: #2d1b4e;
  background-image: linear-gradient(rgba(139, 92, 246, 0.12) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(139, 92, 246, 0.12) 1px, transparent 1px);
  background-size: 100% 100%;
}
body.board-neon .square.dark {
  background-color: #0f051d;
  background-image: linear-gradient(rgba(139, 92, 246, 0.22) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(139, 92, 246, 0.22) 1px, transparent 1px);
  background-size: 100% 100%;
}

/* 6. Sand & Sea Wave Ripple Board Texture */
body.board-beach .square.light {
  background-color: #f5e6c8;
  background-image: radial-gradient(circle at 100% 150%, #f5e6c8 24%, #ecdcb9 25%, #ecdcb9 28%, #f5e6c8 29%);
  background-size: 16px 16px;
}
body.board-beach .square.dark {
  background-color: #008080;
  background-image: radial-gradient(circle at 0% 150%, #008080 24%, #006666 25%, #006666 28%, #008080 29%);
  background-size: 16px 16px;
}

/* 7. Cherry Blossom Floral Texture */
body.board-rose .square.light {
  background-color: #ffd1dc;
  background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.4) 1px, transparent 2px);
  background-size: 12px 12px;
}
body.board-rose .square.dark {
  background-color: #9f1d35;
  background-image: radial-gradient(circle at 30% 70%, rgba(0,0,0,0.15) 1px, transparent 2px);
  background-size: 14px 14px;
}

/* 8. Glacial Frosted Ice Texture */
body.board-ice .square.light {
  background-color: #e0f2fe;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 25%, transparent 25%),
                    linear-gradient(225deg, rgba(255,255,255,0.4) 25%, transparent 25%);
  background-size: 16px 16px;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.6);
}
body.board-ice .square.dark {
  background-color: #0284c7;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.08) 25%, transparent 25%),
                    linear-gradient(225deg, rgba(255,255,255,0.08) 25%, transparent 25%);
  background-size: 18px 18px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
}

/* 9. High-Tech Carbon Fiber Matte Texture */
body.board-midnight .square.light {
  background-color: #3f3f46;
  background-image: linear-gradient(45deg, #27272a 25%, transparent 25%, transparent 75%, #27272a 75%, #27272a),
                    linear-gradient(45deg, #27272a 25%, #3f3f46 25%, #3f3f46 75%, #27272a 75%, #27272a);
  background-size: 8px 8px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.3);
}
body.board-midnight .square.dark {
  background-color: #18181b;
  background-image: linear-gradient(45deg, #09090b 25%, transparent 25%, transparent 75%, #09090b 75%, #09090b),
                    linear-gradient(45deg, #09090b 25%, #18181b 25%, #18181b 75%, #09090b 75%, #09090b);
  background-size: 6px 6px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.6);
}

/* 10. Stained Oak Wood Board Texture */
body.board-oak .square.light {
  background-color: #d7b889;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1.5px, transparent 1.5px, transparent 6px),
                    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.05));
  box-shadow: inset 0 0 8px rgba(0,0,0,0.08);
}
body.board-oak .square.dark {
  background-color: #5c4033;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0px, rgba(0,0,0,0.06) 2px, transparent 2px, transparent 10px),
                    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.12));
  box-shadow: inset 0 0 14px rgba(0,0,0,0.35);
}

/* 11. Volcanic Obsidian Board Texture (Glass fractures) */
body.board-obsidian .square.light {
  background-color: #323232;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.04) 25%, transparent 25%),
                    linear-gradient(225deg, rgba(0,0,0,0.2) 25%, transparent 25%),
                    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.03) 1px, transparent 3px);
  background-size: 24px 24px, 20px 20px, 100% 100%;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}
body.board-obsidian .square.dark {
  background-color: #121212;
  background-image: linear-gradient(135deg, rgba(255,255,255,0.02) 25%, transparent 25%),
                    linear-gradient(225deg, rgba(255,255,255,0.01) 25%, transparent 25%),
                    radial-gradient(circle at 80% 90%, rgba(255,255,255,0.04) 1.5px, transparent 4px);
  background-size: 30px 30px, 24px 24px, 100% 100%;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.8);
}

/* 12. Carrara Marble Board Texture (Polished gray veins) */
body.board-marble .square.light {
  background-color: #f8fafc;
  background-image: linear-gradient(60deg, transparent 46%, rgba(148,163,184,0.08) 47%, rgba(148,163,184,0.12) 50%, transparent 53%),
                    linear-gradient(-30deg, transparent 48%, rgba(148,163,184,0.06) 49%, rgba(148,163,184,0.09) 51%, transparent 52%);
  background-size: 100% 100%;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.03);
}
body.board-marble .square.dark {
  background-color: #cbd5e1;
  background-image: linear-gradient(60deg, transparent 45%, rgba(71,85,105,0.12) 46%, rgba(71,85,105,0.18) 50%, transparent 54%),
                    linear-gradient(-30deg, transparent 47%, rgba(71,85,105,0.1) 48%, rgba(71,85,105,0.15) 51%, transparent 53%);
  background-size: 100% 100%;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.08);
}

/* Highlight Squares */
.square.last-move {
  background-color: var(--board-highlight);
}

.square.selected {
  background-color: var(--board-selected);
}

.square.better-square {
  background-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: inset 0 0 0 3px rgba(16, 185, 129, 0.75);
}

.square.good-alternative-square {
  background-color: rgba(59, 130, 246, 0.2) !important;
  box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Coordinates labels inside squares */
.coord-label {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0.65;
}

.coord-label.file {
  bottom: 2px;
  right: 4px;
}

.coord-label.rank {
  top: 2px;
  left: 4px;
}

.square.light .coord-label {
  color: var(--board-dark);
}

.square.dark .coord-label {
  color: var(--board-light);
}

/* Pieces inside squares */
.piece {
  width: 90%;
  height: 90%;
  object-fit: contain;
  cursor: grab;
  z-index: 10;
  transition: transform 0.1s ease;
}

.piece:active {
  cursor: grabbing;
  transform: scale(1.1);
}

/* Legals Dots */
.possible-dot {
  width: 25%;
  height: 25%;
  background: var(--board-dot);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

.possible-capture {
  width: 80%;
  height: 80%;
  border: 4px solid var(--board-capture);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

/* King check alert */
.square.check {
  animation: check-pulse 0.8s infinite alternate;
}

/* Controls Bar Under Board */
.board-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 8px;
}

.fen-box {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
  font-size: 13px;
}

.fen-box span {
  color: var(--text-secondary);
  font-weight: 600;
}

.fen-box input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
}

/* Right Panel System */
.panels-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel.grow {
  flex-grow: 1;
}

.panel.collapsed .panel-content {
  display: none !important;
}
.panel.collapsed {
  flex-grow: 0 !important;
  flex: none !important;
  min-height: 0 !important;
  max-height: fit-content !important;
  height: auto !important;
}

.hidden {
  display: none !important;
}

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

.panel-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 10px;
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

/* Engine Stats Grid */
.engine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-item .label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.stat-item .val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Engine principal variation lines */
.engine-lines {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  height: 90px;
  overflow-y: auto;
}

.engine-lines label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.pv-line {
  font-family: monospace;
  color: var(--accent-secondary);
}

.pv-line.empty {
  color: var(--text-secondary);
  font-style: italic;
}

/* Tab Headers */
.tab-header {
  padding: 0 16px;
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  outline: none;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-secondary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

.tab-content-container {
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
}

.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Move history panel elements */
.game-meta-display {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.moves-scroll-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.moves-grid {
  display: grid;
  grid-template-columns: 1fr;
  font-family: monospace;
  font-size: 13px;
}

.move-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  align-items: center;
  break-inside: avoid;
  padding: 2px 0;
}

.move-num {
  color: var(--text-secondary);
  padding: 4px;
}

.move-cell {
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.move-cell:hover {
  background: rgba(255, 255, 255, 0.05);
}

.move-cell.active-move {
  background: var(--accent-glow);
  color: var(--accent-secondary);
  font-weight: 700;
}

/* PGN Import panel elements */
.pgn-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pgn-dropzone:hover, .pgn-dropzone.dragover {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
}

.pgn-dropzone:hover .upload-icon {
  color: var(--accent-color);
}

.pgn-text-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.pgn-text-area label {
  font-size: 12px;
  color: var(--text-secondary);
}

.pgn-text-area textarea {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  font-family: monospace;
  font-size: 12px;
  resize: none;
  outline: none;
}

.pgn-text-area textarea:focus {
  border-color: var(--accent-color);
}

/* Puzzles mode layout */
.puzzle-selector-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px;
}

.puzzle-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.puzzle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.puzzle-btn.solved {
  border-color: var(--success-color);
  color: var(--success-color);
}

.puzzle-btn.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.trainer-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instruction-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px;
}

.trainer-score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.score-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.score-card .label {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
}

.score-card .val {
  font-size: 13px;
  font-weight: 700;
}

.puzzle-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-msg {
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.feedback-msg.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.feedback-msg.incorrect {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.feedback-msg.correct-so-far {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-secondary);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Engine Toggle Switch styling */
.switch-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.switch-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border: 1px solid rgba(255,255,255,0.05);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(14px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Core Buttons Styles */
button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active {
  transform: scale(0.97);
}

.primary-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.primary-btn:hover {
  background: var(--accent-secondary);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

/* Animations */
@keyframes pulse-glow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes check-pulse {
  0% { box-shadow: inset 0 0 15px var(--danger-color); background-color: rgba(239, 68, 68, 0.3); }
  100% { box-shadow: inset 0 0 30px var(--danger-color); background-color: rgba(239, 68, 68, 0.6); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Scaling */
@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
    height: auto !important;
    overflow-y: auto !important;
  }
  .sidebar {
    height: auto !important;
  }
  .main-content {
    height: auto !important;
    overflow: visible !important;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
    height: auto !important;
    overflow: visible !important;
  }
  .board-column {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    overflow: visible !important;
  }
  .board-wrapper {
    height: auto !important;
    min-height: auto !important;
  }
  .chessboard {
    max-width: min(500px, 90vw) !important;
    margin: 0 auto;
  }
  .panels-column {
    height: auto !important;
    overflow: visible !important;
  }
  body {
    overflow-y: auto !important;
  }
}

/* Player Profile Workspace View */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) 1.8fr;
  gap: 16px;
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
}

.profile-card-col, .profile-details-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playstyle-body {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-grow: 1;
}

.playstyle-tag {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: white;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--accent-glow);
  letter-spacing: 0.5px;
  display: inline-block;
}

.playstyle-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
}

/* Metrics & Breakdown */
.metrics-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-progress-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-info span:first-child {
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
  transition: width 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Strengths & Weaknesses styling */
.sw-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}

.sw-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw-bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.sw-bullet-list li {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.sw-bullet-list li.empty-list {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  background: transparent;
  border: none;
}

/* Training plan list */
.training-plan-body {
  padding: 20px;
  overflow-y: auto;
}

.plan-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--accent-glow);
  color: var(--accent-secondary);
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 600;
  border: 1px solid var(--border-glass);
}

.training-schedule {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.training-step {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.training-step:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.04);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.step-content h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.step-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Baseline progress metrics */
.baseline-tracker {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.baseline-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.baseline-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.baseline-progress-fill {
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.5s ease;
}

.baseline-prompt {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Analyzed games list */
.analyzed-games-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.analyzed-games-section label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 2px;
}

.game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 12px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.game-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.game-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-item-names {
  font-weight: 600;
  color: var(--text-primary);
}

.game-item-result {
  font-size: 11px;
  color: var(--text-secondary);
}

.game-item-score {
  background: var(--accent-glow);
  color: var(--accent-secondary);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Colors utility */
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }

/* Responsive tweaks */
@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  #puzzle-duel-arena, #puzzle-duel-reviewer {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
}

/* Ambiguity Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88); /* Premium semi-transparent dark slate */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  width: 90%;
  max-width: 480px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.1);
  border-radius: 20px;
  animation: modal-enter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game-preview-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-secondary);
}

.modal-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-choice-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.2s ease;
  outline: none;
}

.modal-choice-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-color-dot.white {
  background: #ffffff;
}

.player-color-dot.black {
  background: #111111;
}

.player-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.modal-footer button {
  width: 100%;
}

/* Metrics Container Side-by-Side */
.metrics-container-side {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 20px;
  align-items: center;
}

@media (max-width: 768px) {
  .metrics-container-side {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
}

.metric-sparkline-container {
  width: 140px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 3px 6px;
  overflow: visible;
}

.sparkline-placeholder {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Blunder Analytics Card Styles */
.blunders-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.blunder-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.blunder-stat-card .label {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.blunder-stat-card .val {
  font-size: 16px;
  font-weight: 700;
}

.blunder-phases {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blunder-phases h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

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

.phase-bar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.phase-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.phase-count-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Multi-Line Graph Legend */
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 12px;
}

.legend-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.legend-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.legend-btn.active {
  color: var(--text-primary);
}

.legend-btn.muted {
  opacity: 0.45;
  text-decoration: line-through;
  background: rgba(0, 0, 0, 0.2);
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Interactive Sparkline Tooltip & Dot Styles */
.graph-tooltip {
  position: absolute;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  transition: opacity 0.1s ease, transform 0.1s ease;
  white-space: nowrap;
}
.graph-tooltip.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(5px);
}
.metric-sparkline-container svg circle {
  transition: r 0.15s ease, stroke-width 0.15s ease;
}
.metric-sparkline-container svg circle:hover {
  stroke-dasharray: none;
}

/* Highlighted moves styling in history list */
.move-cell.highlight-matching {
  border: 1.5px dashed var(--accent-color) !important;
  border-radius: 4px;
  font-weight: 700;
}
.move-cell.highlight-matching.category-Blunder {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: var(--danger-color) !important;
  color: #fca5a5 !important;
}
.move-cell.highlight-matching.category-Opening {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: var(--success-color) !important;
  color: #6ee7b7 !important;
}
.move-cell.highlight-matching.category-Tactics {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}
.move-cell.highlight-matching.category-Strategy {
  background: rgba(217, 70, 239, 0.18) !important;
  border-color: #d946ef !important;
  color: #f5d0fe !important;
}
.move-cell.highlight-matching.category-Center {
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: #fbbf24 !important;
  color: #fef3c7 !important;
}
.move-cell.highlight-matching.category-Endgame {
  background: rgba(249, 115, 22, 0.18) !important;
  border-color: #f97316 !important;
  color: #ffedd5 !important;
}

/* Profile Analyzed Games Item Layout */
.profile-games-list .game-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}
.profile-games-list .game-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-color);
  transform: translateX(2px);
}
.profile-games-list .game-item-names {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}
.profile-games-list .game-item-result {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}
.profile-games-list .game-item-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Auth0 User Profile Block */
.user-profile-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.user-avatar-placeholder .avatar-icon {
  width: 18px;
  height: 18px;
}

.user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.user-text .username {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-text .user-status {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  box-shadow: none;
}
.time-filter-btn {
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.time-filter-btn:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.time-filter-btn.active,
.source-filter-btn.active,
.library-source-filter-btn.active,
.library-time-filter-btn.active {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: var(--accent-color) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.12) !important;
}

/* Piece Style Selector Chips */
.piece-chip.active {
  border-color: #fff !important;
  box-shadow: 0 0 8px #fff !important;
}

/* --- PIECE SET GLOW EFFECTS --- */
body.board-neon .piece {
  filter: drop-shadow(0 0 5px var(--accent-color)) !important;
}

/* Player Avatar Sizing & Selectors */
.profile-avatar-wrapper:hover .avatar-edit-overlay {
  opacity: 1 !important;
}

.avatar-option-item {
  border-radius: 12px;
  border: 2px solid transparent;
  padding: 8px;
  transition: all 0.2s ease-in-out;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-option-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.avatar-option-item.active {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.avatar-option-item.active img {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.avatar-option-item.active span {
  color: var(--accent-color) !important;
}

/* Premove Highlight Elements */
.square.premove-selected {
  box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.8) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

.square.premove-highlight {
  background: rgba(245, 158, 11, 0.25) !important;
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.5) !important;
}

.premove-possible-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.7) !important;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.premove-possible-capture {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.7) !important;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* --- DYNAMIC CHESTER PIECE THEMES (CSS FILTERS) --- */

/* 1. Classic (Default) */
body.pieces-classic .piece {
  /* No filter overrides */
}

/* 2. Alpha (High-Contrast Minimalist Gray & Steel) */
body.pieces-alpha .piece {
  filter: saturate(0) brightness(0.95) drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* 3. California (Neon Purple & Lavender) */
body.pieces-california .piece {
  filter: sepia(1) hue-rotate(240deg) saturate(2.5) brightness(0.8) contrast(1.1) drop-shadow(0 2px 5px rgba(168, 85, 247, 0.5));
}

/* 4. Dubrovny (Maple & Walnut Wood tones) */
body.pieces-dubrovny .piece {
  filter: sepia(0.8) saturate(1.2) hue-rotate(5deg) brightness(0.85) contrast(1.05) drop-shadow(0 2px 4px rgba(62, 39, 35, 0.2));
}

/* 5. Merida (Slate Navy & Royal Blue) */
body.pieces-merida .piece {
  filter: sepia(1) hue-rotate(185deg) saturate(1.8) brightness(0.8) contrast(1.1) drop-shadow(0 2px 4px rgba(30, 58, 138, 0.2));
}

/* 6. Maestro (Gold & Bronze Outlines) */
body.pieces-maestro .piece {
  filter: sepia(1) hue-rotate(15deg) saturate(2.5) brightness(0.9) contrast(1.05) drop-shadow(0 2px 4px rgba(202, 138, 4, 0.35));
}

/* 7. Tatiana (Warm Sepia Newspaper Serif) */
body.pieces-tatiana .piece {
  filter: sepia(0.4) saturate(0.8) contrast(0.95) brightness(0.95);
}

/* 8. Gothic (Crimson Red & Iron) */
body.pieces-gothic .piece {
  filter: sepia(1) hue-rotate(310deg) saturate(2.2) brightness(0.7) contrast(1.15) drop-shadow(0 2px 4px rgba(220, 38, 38, 0.35));
}

/* 9. Pirat (Vibrant Fuchsia & Hot Pink) */
body.pieces-pirat .piece {
  filter: sepia(1) hue-rotate(280deg) saturate(3) brightness(0.85) contrast(1.1) drop-shadow(0 2px 4px rgba(219, 39, 119, 0.35));
}

/* 10. Plants (Flora Emerald Green) */
body.pieces-plants .piece {
  filter: sepia(1) hue-rotate(85deg) saturate(2) brightness(0.75) contrast(1.15) drop-shadow(0 2px 4px rgba(16, 185, 129, 0.35));
}

/* Force Sandbox Setup Modal Content to take full expanded width on Desktop */
#sandbox-setup-modal-content {
  max-width: 1160px !important;
  width: 94vw !important;
}

/* Fix option contrast in Bot Chatter select dropdown */
#sandbox-chatter-level option {
  background-color: #1f2937 !important;
  color: #f9fafb !important;
}

/* Custom Settings Page Aesthetic Chip Styles */
.theme-chip {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  background: none !important;
  overflow: hidden;
  padding: 0 !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-chip:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.theme-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 12px var(--accent-glow) !important;
  transform: scale(1.05);
}

.piece-chip {
  width: 100%;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.25) !important;
  padding: 12px 16px !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.piece-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.piece-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 4px 20px var(--accent-glow) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}

/* --- APP ACCENT COLOR THEMES & SELECTION --- */
.color-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.color-chip:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.color-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 12px var(--accent-glow) !important;
  transform: scale(1.05);
}

/* App Accent Color overrides on body class */
body.color-blue {
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent-secondary: #60a5fa;
}
body.color-green {
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.4);
  --accent-secondary: #34d399;
}
body.color-amber {
  --accent-color: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --accent-secondary: #fbbf24;
}
body.color-purple {
  --accent-color: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.5);
  --accent-secondary: #a78bfa;
}
.avatar-option-item.active img {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.avatar-option-item.active span {
  color: var(--accent-color) !important;
}

/* Premove Highlight Elements */
.square.premove-selected {
  box-shadow: inset 0 0 0 3px rgba(245, 158, 11, 0.8) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

.square.premove-highlight {
  background: rgba(245, 158, 11, 0.25) !important;
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.5) !important;
}

.premove-possible-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.7) !important;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.premove-possible-capture {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.7) !important;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* --- DYNAMIC CHESTER PIECE THEMES (CSS FILTERS) --- */

/* 1. Classic (Default) */
body.pieces-classic .piece {
  /* No filter overrides */
}

/* 2. Alpha (High-Contrast Minimalist Gray & Steel) */
body.pieces-alpha .piece {
  filter: saturate(0) brightness(0.95) drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* 3. California (Neon Purple & Lavender) */
body.pieces-california .piece {
  filter: sepia(1) hue-rotate(240deg) saturate(2.5) brightness(0.8) contrast(1.1) drop-shadow(0 2px 5px rgba(168, 85, 247, 0.5));
}

/* 4. Dubrovny (Maple & Walnut Wood tones) */
body.pieces-dubrovny .piece {
  filter: sepia(0.8) saturate(1.2) hue-rotate(5deg) brightness(0.85) contrast(1.05) drop-shadow(0 2px 4px rgba(62, 39, 35, 0.2));
}

/* 5. Merida (Slate Navy & Royal Blue) */
body.pieces-merida .piece {
  filter: sepia(1) hue-rotate(185deg) saturate(1.8) brightness(0.8) contrast(1.1) drop-shadow(0 2px 4px rgba(30, 58, 138, 0.2));
}

/* 6. Maestro (Gold & Bronze Outlines) */
body.pieces-maestro .piece {
  filter: sepia(1) hue-rotate(15deg) saturate(2.5) brightness(0.9) contrast(1.05) drop-shadow(0 2px 4px rgba(202, 138, 4, 0.35));
}

/* 7. Tatiana (Warm Sepia Newspaper Serif) */
body.pieces-tatiana .piece {
  filter: sepia(0.4) saturate(0.8) contrast(0.95) brightness(0.95);
}

/* 8. Gothic (Crimson Red & Iron) */
body.pieces-gothic .piece {
  filter: sepia(1) hue-rotate(310deg) saturate(2.2) brightness(0.7) contrast(1.15) drop-shadow(0 2px 4px rgba(220, 38, 38, 0.35));
}

/* 9. Pirat (Vibrant Fuchsia & Hot Pink) */
body.pieces-pirat .piece {
  filter: sepia(1) hue-rotate(280deg) saturate(3) brightness(0.85) contrast(1.1) drop-shadow(0 2px 4px rgba(219, 39, 119, 0.35));
}

/* 10. Plants (Flora Emerald Green) */
body.pieces-plants .piece {
  filter: sepia(1) hue-rotate(85deg) saturate(2) brightness(0.75) contrast(1.15) drop-shadow(0 2px 4px rgba(16, 185, 129, 0.35));
}

/* Force Sandbox Setup Modal Content to take full expanded width on Desktop */
#sandbox-setup-modal-content {
  max-width: 1160px !important;
  width: 94vw !important;
}

/* Fix option contrast in Bot Chatter select dropdown */
#sandbox-chatter-level option {
  background-color: #1f2937 !important;
  color: #f9fafb !important;
}

/* Custom Settings Page Aesthetic Chip Styles */
.theme-chip {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  background: none !important;
  overflow: hidden;
  padding: 0 !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-chip:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.theme-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 12px var(--accent-glow) !important;
  transform: scale(1.05);
}

.piece-chip {
  width: 100%;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(0, 0, 0, 0.25) !important;
  padding: 12px 16px !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.piece-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.piece-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 4px 20px var(--accent-glow) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}

/* --- APP ACCENT COLOR THEMES & SELECTION --- */
.color-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.color-chip:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.color-chip.active {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 12px var(--accent-glow) !important;
  transform: scale(1.05);
}

/* App Accent Color overrides on body class */
body.color-blue {
  --accent-color: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --accent-secondary: #60a5fa;
}
body.color-green {
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.4);
  --accent-secondary: #34d399;
}
body.color-amber {
  --accent-color: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.4);
  --accent-secondary: #fbbf24;
}
body.color-purple {
  --accent-color: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.5);
  --accent-secondary: #a78bfa;
}
body.color-pink {
  --accent-color: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.4);
  --accent-secondary: #f472b6;
}
body.color-cyan {
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --accent-secondary: #22d3ee;
}
body.color-red {
  --accent-color: #ef4444;
  --accent-glow: rgba(239, 68, 68, 0.4);
  --accent-secondary: #f87171;
}
body.color-orange {
  --accent-color: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.4);
  --accent-secondary: #fbbf24;
}
body.color-pink {
  --accent-color: #ec4899;
  --accent-glow: rgba(236, 72, 153, 0.4);
  --accent-secondary: #f472b6;
}
body.color-cyan {
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --accent-secondary: #22d3ee;
}
body.color-red {
  --accent-color: #ef4444;
  --accent-glow: rgba(239, 68, 68, 0.4);
  --accent-secondary: #f87171;
}
body.color-orange {
  --accent-color: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.4);
  --accent-secondary: #fbbf24;
}

/* Ensure all select options are readable and high-contrast across all OS/browser defaults */
select option {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

/* Scale board when flanking player cards are visible to prevent vertical overflows */
.board-column:has(#player-card-top:not(.hidden)) .chessboard {
  max-width: min(440px, calc(100vh - 340px)) !important;
}
.board-column:has(#player-card-top:not(.hidden)) .chessboard.enlarged {
  max-width: min(600px, calc(100vh - 260px)) !important;
}

/* Premove Sequence Number Badge */
.premove-number-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f59e0b; /* Amber */
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-family: 'Space Grotesk', sans-serif;
  z-index: 5;
}

/* AI Suggestion Number Badge */
.suggestion-number-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #3b82f6; /* Blue for alternatives */
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-family: 'Space Grotesk', sans-serif;
  z-index: 6;
}

.suggestion-number-badge.best-suggestion {
  background: #10b981; /* Green for the best recommendation */
}

.metric-sparkline-container {
  width: 140px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 3px 6px;
  overflow: visible;
  transition: all 0.2s ease;
  position: relative;
}

.metric-sparkline-container.has-data {
  cursor: pointer;
}

.metric-sparkline-container.has-data:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--accent-color) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.metric-sparkline-container:hover .enlarge-sparkline-btn {
  opacity: 1 !important;
  color: #fff !important;
}

.enlarge-sparkline-btn:hover {
  background: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  transform: scale(1.1);
}

.sparkline-placeholder {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Practice Mode Select Cards in Review Modal */
.practice-mode-card:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Toast Notification System */
.toast-message {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  max-width: 380px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-message.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 3px solid #10b981;
}

.toast-error {
  border-left: 3px solid var(--danger-color);
}

.toast-warning {
  border-left: 3px solid #f59e0b;
}

.toast-info {
  border-left: 3px solid var(--accent-color);
}

.practice-mode-card:has(input:checked) {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* Semi-transparent premove ghost piece style */
.piece.premove-ghost {
  opacity: 0.55;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4)) grayscale(10%);
  pointer-events: auto;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.piece.premove-ghost:hover {
  opacity: 0.8;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6)) grayscale(0%);
}

/* Clickable and Zoomable Sparklines */
.metric-sparkline-container {
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.metric-sparkline-container:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

/* Enlarged graph axis and hover styling */
.enlarged-graph-axis-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-dasharray: 4, 4;
}
.enlarged-graph-axis-text {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: var(--text-secondary);
}
.enlarged-graph-point {
  transition: r 0.2s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.2s ease;
}
.enlarged-graph-point:hover {
  stroke-width: 2.5px !important;
}

/* Minimized Top Bar header styles for AI Analysis */
.top-bar.minimized {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 8px 24px 0 24px !important;
  margin-bottom: -24px !important;
  pointer-events: none;
}
.top-bar.minimized .header-right {
  position: absolute;
  top: 12px;
  right: 24px;
  z-index: 10002;
  pointer-events: auto;
}
.top-bar.minimized .switch-container {
  display: inline-flex !important;
}

/* Left Active Game Tab Yellow Highlight */
.nav-item.left-game-tab {
  background: rgba(234, 179, 8, 0.15) !important;
  border: 1px solid #eab308 !important;
  color: #eab308 !important;
  animation: left-tab-pulse 2s infinite ease-in-out;
}
.nav-item.left-game-tab i {
  color: #eab308 !important;
}

@keyframes left-tab-pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(234, 179, 8, 0.2);
  }
  50% {
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
  }
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Premium Reviewer and Duel feedback buttons */
.reviewer-feedback-btn {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 18px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  outline: none;
}

.reviewer-feedback-btn i {
  transition: transform 0.2s ease;
}

/* Hover effects with glowing border and subtle raise */
.reviewer-feedback-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1), inset 0 0 8px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.reviewer-feedback-btn:hover i {
  transform: scale(1.1);
}

.reviewer-feedback-btn:active {
  transform: translateY(1px);
}

/* Specific glows for different button types */
#btn-reviewer-like-puzzle:hover, #btn-like-puzzle:hover {
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25), inset 0 0 8px rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

#btn-reviewer-report-puzzle:hover, #btn-report-puzzle:hover {
  border-color: rgba(245, 158, 11, 0.5) !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25), inset 0 0 8px rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
}

#btn-reviewer-share-puzzle:hover, #btn-share-puzzle:hover {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25), inset 0 0 8px rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
}

/* Premium Responsive Layout for Puzzle Duel and Reviewer Views */
#puzzle-duel-view {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 1200px) {
  #puzzle-duel-view {
    max-width: 1240px;
  }
  #puzzle-duel-arena, #puzzle-duel-reviewer {
    grid-template-columns: 320px 1fr !important;
    gap: 24px !important;
  }
}

@media (min-width: 1600px) {
  #puzzle-duel-view {
    max-width: 1440px;
  }
}

/* Panel heights in Puzzle views to scale with viewport height */
#puzzle-duel-reviewer .panel,
#puzzle-duel-arena .panel {
  max-height: calc(100vh - 120px) !important;
  height: auto !important;
}

/* Board Sizing adjustments based on screen size and toggle status */
#puzzle-board-wrapper {
  max-width: 480px !important;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#puzzle-board-wrapper.enlarged {
  max-width: 580px !important;
}

#puzzle-reviewer-board-wrapper {
  max-width: 440px !important;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (min-width: 1200px) {
  #puzzle-board-wrapper {
    max-width: 560px !important;
  }
  #puzzle-board-wrapper.enlarged {
    max-width: 700px !important;
  }
  #puzzle-reviewer-board-wrapper {
    max-width: 520px !important;
  }
}

@media (min-width: 1600px) {
  #puzzle-board-wrapper {
    max-width: 640px !important;
  }
  #puzzle-board-wrapper.enlarged {
    max-width: 800px !important;
  }
  #puzzle-reviewer-board-wrapper {
    max-width: 600px !important;
  }
}

/* Premium Responsive Scaling for AI Analysis Screen Chessboard & Grid Columns */
@media (min-width: 1200px) {
  .workspace-grid.board-large {
    grid-template-columns: minmax(500px, 760px) 1fr !important;
  }
  /* Default board sizing overrides */
  .chessboard {
    max-width: min(540px, calc(100vh - 300px)) !important;
  }
  /* Enlarged board sizing overrides */
  .chessboard.enlarged {
    max-width: min(720px, calc(100vh - 220px)) !important;
  }
  /* Overrides for board with flanking player cards */
  .board-column:has(#player-card-top:not(.hidden)) .chessboard {
    max-width: min(540px, calc(100vh - 300px)) !important;
  }
  .board-column:has(#player-card-top:not(.hidden)) .chessboard.enlarged {
    max-width: min(720px, calc(100vh - 220px)) !important;
  }
}

@media (min-width: 1600px) {
  .workspace-grid.board-large {
    grid-template-columns: minmax(600px, 900px) 1fr !important;
  }
  /* Default board sizing overrides */
  .chessboard {
    max-width: min(640px, calc(100vh - 260px)) !important;
  }
  /* Enlarged board sizing overrides */
  .chessboard.enlarged {
    max-width: min(840px, calc(100vh - 180px)) !important;
  }
  /* Overrides for board with flanking player cards */
  .board-column:has(#player-card-top:not(.hidden)) .chessboard {
    max-width: min(640px, calc(100vh - 260px)) !important;
  }
  .board-column:has(#player-card-top:not(.hidden)) .chessboard.enlarged {
    max-width: min(840px, calc(100vh - 180px)) !important;
  }
}

/* Sidebar manual collapse transition */
.app-container {
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed {
  grid-template-columns: 80px 1fr;
}

/* Sidebar toggle button styling */
.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  transition: all 0.2s ease;
  z-index: 10;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
  padding: 20px 8px;
  align-items: center;
  overflow-x: hidden;
}

.sidebar.collapsed .brand {
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.sidebar.collapsed .brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar.collapsed .brand-icon {
  margin: 0 auto;
}

.sidebar.collapsed .brand h1 {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-btn {
  margin: 0 auto;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.sidebar.collapsed .nav-item span {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  display: none;
}

.brand h1 {
  white-space: nowrap;
}

.nav-item span {
  white-space: nowrap;
}

/* Stack profile columns vertically on screen < 1150px */
@media (max-width: 1150px) {
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Premium styles for larger avatar on player profile page */
.profile-avatar-wrapper {
  position: relative;
  width: 192px;
  height: 192px;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.15);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.profile-avatar-wrapper:hover {
  transform: scale(1.04);
  border-color: var(--accent-color);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow);
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-wrapper:hover img {
  transform: scale(1.08);
}

.avatar-edit-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 44px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-avatar-wrapper:hover .avatar-edit-overlay {
  opacity: 1;
}

/* Instructive Games Full Screen Responsive Styles */
@media (max-width: 768px) {
  .instructive-main-layout {
    grid-template-columns: 1fr !important;
    overflow-y: auto;
    height: auto !important;
  }
  #instructive-board-wrapper {
    max-width: 100vw !important;
  }
}



/* Instructive Board explicit override to prevent .chessboard !important max-width capping */
#instructive-board {
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box !important;
}

/* Custom Instructive Review View Styles for Viewport Height constraints */
#instructive-review-view:not(.hidden) {
  height: 100% !important;
  max-height: calc(100vh - 80px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#instructive-review-view > .instructive-main-layout {
  flex: 1 1 0% !important;
  min-height: 0 !important;
}

.instructive-commentary-panel {
  flex: 1 1 180px !important;
  min-height: 180px !important;
}

/* Height-based media query for smaller screens / low-height viewports */
@media (max-height: 768px) {
  #instructive-review-view:not(.hidden) {
    gap: 8px !important;
  }
  #instructive-review-view > .instructive-main-layout {
    gap: 12px !important;
  }
}

/* Landing Page & Login Gateway Styles */
#landing-bg-video {
  position: fixed;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  z-index: -100;
  object-fit: cover;
  transition: opacity 1s ease;
}

#landing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  z-index: -90;
  transition: all 0.8s ease;
}

.landing-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.landing-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  width: 100%;
  box-sizing: border-box;
}

.landing-logo {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-color), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.landing-beta-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-secondary);
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px 40px 24px;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

.landing-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  background: rgba(59, 130, 246, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.landing-title {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 0 32px 0;
  font-weight: 400;
}

.landing-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.landing-btn {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.landing-btn-primary {
  background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.landing-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
}

.landing-btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.landing-btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.landing-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.3s ease;
  margin-top: auto;
  padding-bottom: 24px;
}

.landing-scroll-indicator:hover {
  color: #fff;
}

.landing-scroll-indicator i {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

.landing-features-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  box-sizing: border-box;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.feature-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  margin-bottom: 20px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px 0;
}

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

.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 48px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 18, 0.4);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-secondary);
}

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

.social-link-item {
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.social-link-item:hover {
  color: var(--accent-color);
  filter: drop-shadow(0 0 4px var(--accent-color));
}

.share-btn-wrapper {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Floating Login Modal Center Override */
#auth-simulation-modal.floating-card {
  background: rgba(10, 10, 18, 0.4) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#auth-simulation-modal.floating-card.visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#auth-simulation-modal .modal-content {
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#auth-simulation-modal.floating-card.visible .modal-content {
  transform: translateY(0);
}

/* Watch Trailer Popup Styles */
#trailer-video-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#trailer-video-modal.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.trailer-player-container {
  position: relative;
  width: 90%;
  max-width: 960px;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#trailer-video-modal.visible .trailer-player-container {
  transform: scale(1);
}

#trailer-video-modal video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trailer-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.trailer-close-btn:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.9);
  transform: rotate(90deg);
}

@media (max-width: 768px) {
  .landing-title {
    font-size: 32px;
  }
  .landing-subtitle {
    font-size: 15px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .landing-header {
    padding: 16px 24px;
  }
  .landing-footer {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    text-align: center;
  }
}

