/* ==========================================================================
   Design Tokens & Base
   ========================================================================== */
:root {
  /* Colors - Blue & White Theme */
  --primary: #2563EB; /* Bright Blue */
  --primary-hover: #1D4ED8;
  --secondary: #EFF6FF; /* Very Light Blue */
  --accent: #3B82F6;
  --accent-hover: #2563EB;
  
  --bg-main: #f5f2eb; /* Warm parchment bg */
  --bg-2: #ebe8e0; /* Secondary warm bg */
  --bg-card: #fbf9f5; /* Cream card bg */
  
  --text-main: #18181b; /* Soft dark charcoal */
  --text-muted: #3f3f46; /* Muted charcoal */
  --text-dim: #71717a;
  --text-light: #FFFFFF;
  
  --border: #dfdbcf;
  --border-light: #ece9df;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout & Sizing */
  --container-width: 1200px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Chessboard Theme Variables */
  --board-light: #f0d9b5;
  --board-dark: #b58863;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  height: auto;
  min-height: 100vh;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.highlight {
  color: var(--primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.1);
}
.btn-secondary:hover {
  background-color: #DBEAFE;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.125rem;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  height: 80px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
}

.navbar > .container {
  max-width: 100% !important;
  margin: 0;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 80px;
}

/* Logo Far Left Extreme Corner */
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-main);
  padding: 8px 0;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 48px !important; /* Force a clear distance between logo and first nav link */
}
.nav-logo img {
  height: 34px;
  width: auto;
  object-fit: contain;
}
.nav-logo span {
  color: var(--primary);
}

/* Spaced-Out Navigation Links Left Aligned next to Logo */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px !important;
  list-style: none;
  margin: 0 !important;
  padding: 0;
  flex-shrink: 0;
}
.nav-links li {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
}
.nav-links li a {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.1px;
  line-height: 1.3;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
  white-space: nowrap;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--primary); /* blue highlight spec */
}

/* Active underline & blue highlight */
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.nav-links li a.active::after,
.nav-links li:hover > a::after {
  transform: scaleX(1);
}

.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted) !important;
  font-weight: 500;
  white-space: nowrap;
}
.dropdown-menu a:hover {
  background: var(--secondary);
  color: var(--primary) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px !important;
  flex-shrink: 0;
  margin-left: auto !important; /* Pushes the actions section to the extreme right */
}

/* Social links (Size: 20-22px, scale, glow, transition) */
.nav-socials {
  display: inline-flex;
  align-items: center;
  gap: 12px !important;
  margin-right: 16px !important;
}
.nav-social-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; /* spec */
  height: 22px; /* spec */
  transition: transform 0.3s ease, color 0.3s ease, filter 0.3s ease;
  position: relative;
}
.nav-social-link svg {
  width: 20px;
  height: 20px;
}
.nav-social-link:hover {
  color: var(--primary);
  transform: scale(1.15); /* slight scale spec */
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6)); /* blue glow spec */
}

/* Tooltip on Hover for Social Links */
.nav-social-link[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
}
.nav-social-link:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Theme Toggle button */
.theme-btn {
  margin-right: 24px; /* Theme Toggle -> Play Now spec */
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  padding: 6px;
  border-radius: 50%;
}
.theme-btn:hover {
  color: var(--primary);
  background: rgba(255,255,255,0.03);
}

/* CTA Play Now Button (Better radius, hover scale, gradient blue, shadow, ripple, lift) */
.nav-play-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 50px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-right: 10px;
  z-index: 1;
}
.nav-play-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-play-btn:hover::after {
  opacity: 1;
}
.nav-play-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}
.nav-play-btn:active {
  transform: translateY(0) scale(0.98);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: -5px 0 20px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 16px;
  transition: right 0.4s ease, visibility 0.4s ease;
  z-index: 2000;
  visibility: hidden;
}
.mobile-menu.open {
  right: 0;
  visibility: visible;
}
.mobile-menu a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 80px 0 100px;
  background: linear-gradient(to bottom, var(--bg-main) 0%, var(--bg-card) 100%);
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero-content {
  flex: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-main);
  border: 1px solid var(--primary);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #10B981; /* Green dot for 'live/free' */
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-content h1 {
  font-size: 4rem;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
}
.hero-stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-visual {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-board-preview {
  width: 440px;
  height: 440px;
  background: white;
  border: 8px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  transform: rotateX(15deg) rotateY(-15deg);
  transform-style: preserve-3d;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% { transform: rotateX(15deg) rotateY(-15deg) translateY(0px); }
  50% { transform: rotateX(15deg) rotateY(-15deg) translateY(-20px); }
  100% { transform: rotateX(15deg) rotateY(-15deg) translateY(0px); }
}

.hero-sq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  user-select: none;
}
.hero-sq.light { background-color: #F8FAFC; }
.hero-sq.dark { background-color: #DBEAFE; } /* Very light blue for dark squares */
.hero-sq .piece {
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

/* ==========================================================================
   Sections & General
   ========================================================================== */
.section {
  padding: 100px 0;
}
.section-sm {
  padding: 40px 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}
.section-label {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.875rem;
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ==========================================================================
   Features Grid
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.feature-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #DBEAFE;
}
.feature-icon {
  width: 56px;
  height: 56px;
  background: var(--secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
}
.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   Blog Section
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}

.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.blog-card-img {
  height: 200px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-card-img-placeholder {
  font-size: 4rem;
  opacity: 0.8;
}
.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
}
.blog-tag {
  background: var(--secondary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}
.blog-date {
  color: var(--text-dim);
}
.blog-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-main);
}
.blog-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex: 1;
}
.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.blog-read-time {
  color: var(--text-dim);
}
.read-more {
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   Openings Grid
   ========================================================================== */
.openings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.opening-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-align: center;
  color: inherit;
}
.opening-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: var(--secondary);
}
.opening-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: inline-block;
  background: var(--bg-main);
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.opening-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.opening-moves {
  margin-top: 16px;
  font-family: monospace;
  background: rgba(15, 23, 42, 0.05);
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Ads
   ========================================================================== */
.ad-unit {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ad-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #0F172A; /* Dark blue background for footer */
  color: #F8FAFC;
  padding: 80px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2.5fr 1.2fr 1.2fr 1.5fr 1.2fr;
  gap: 32px;
  margin-bottom: 64px;
}

.footer-brand .nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-main);
  padding: 8px 0;
  margin-right: auto !important;
  white-space: nowrap;
}
.footer-brand .nav-logo span {
  color: #60A5FA; /* Lighter blue for contrast */
}
.footer-brand p {
  color: #94A3B8;
  max-width: 300px;
}

.footer-col h4, .footer-col .footer-title {
  color: #FFFFFF;
  font-size: 1.1rem;
  margin-bottom: 24px;
  font-weight: 600;
}
.footer-col a {
  display: block;
  color: #94A3B8;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.footer-col a:hover {
  color: #60A5FA;
  padding-left: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }
  .hero-content p {
    margin: 0 auto 32px;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    justify-content: center;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1200px) {
  .nav-links, .nav-play-btn, #auth-container, .nav-socials, .premium-play-btn {
    display: none !important;
  }
  .navbar > .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hamburger {
    display: flex !important;
  }
  .hero-content h1 {
    font-size: 2.8rem;
  }
  .hero-board-preview {
    width: 320px;
    height: 320px;
  }
  .hero-sq {
    font-size: 1.6rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Theme System — Three Modes
   ========================================================================== */

/* ── Light Mode (default / [data-theme="light"]) ── */
:root,
[data-theme="light"] {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --secondary: #EFF6FF;
  --accent: #3B82F6;
  --bg-main: #f5f2eb;
  --bg-2: #ebe8e0;
  --bg-card: #fbf9f5;
  --text-main: #18181b;
  --text-muted: #3f3f46;
  --text-dim: #71717a;
  --text-light: #FFFFFF;
  --border: #dfdbcf;
  --border-light: #ece9df;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --board-light: #f0d9b5;
  --board-dark: #b58863;
}

/* ── Dark Green Mode — [data-theme="dark-green"] ── */
[data-theme="dark-green"] {
  --primary: #10b981;
  --primary-hover: #34d399;
  --secondary: #064e3b;
  --accent: #6ee7b7;
  --bg-main: #0a1a14;
  --bg-2: #112218;
  --bg-card: #132b1f;
  --text-main: #ecfdf5;
  --text-muted: #a7f3d0;
  --text-dim: #6ee7b7;
  --text-light: #FFFFFF;
  --border: #1a4731;
  --border-light: #112218;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --board-light: #e8f5e9;
  --board-dark: #388e3c;
}

[data-theme="dark-green"] .navbar {
  background: rgba(10, 26, 20, 0.97) !important;
  border-bottom: 1px solid #1a4731 !important;
}
[data-theme="dark-green"] .nav-logo,
[data-theme="dark-green"] .nav-links li a {
  color: #ecfdf5 !important;
}
[data-theme="dark-green"] .nav-links li a:hover,
[data-theme="dark-green"] .nav-links li a.active { color: #10b981 !important; }
[data-theme="dark-green"] .nav-play-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}
[data-theme="dark-green"] .footer {
  background: #051a0d !important;
  border-top: 1px solid #1a4731 !important;
}
[data-theme="dark-green"] .dropdown-menu {
  background: #132b1f !important;
  border-color: #1a4731 !important;
}
[data-theme="dark-green"] .btn-primary {
  background: #10b981;
  box-shadow: 0 4px 14px rgba(16,185,129,0.4);
}
[data-theme="dark-green"] .btn-primary:hover { background: #059669; }

/* ── Dark Blue Mode — [data-theme="dark-blue"] ── */
[data-theme="dark-blue"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --secondary: #1e293b;
  --accent: #818cf8;
  --bg-main: #0f172a;
  --bg-2: #1e293b;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-light: #FFFFFF;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --board-light: #b7c0d8;
  --board-dark: #4a6fa5;
}

[data-theme="dark-blue"] .navbar {
  background: rgba(15, 23, 42, 0.97) !important;
  border-bottom: 1px solid #334155 !important;
}
[data-theme="dark-blue"] .nav-logo,
[data-theme="dark-blue"] .nav-links li a {
  color: #f8fafc !important;
}
[data-theme="dark-blue"] .nav-links li a:hover,
[data-theme="dark-blue"] .nav-links li a.active { color: #3b82f6 !important; }
[data-theme="dark-blue"] .nav-play-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}
[data-theme="dark-blue"] .footer {
  background: #020617 !important;
  border-top: 1px solid #1e293b !important;
}
[data-theme="dark-blue"] .dropdown-menu {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* ── Theme Toggle Button ── */
.theme-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-right: 15px;
  width: 38px;
  height: 38px;
}
.theme-btn:hover {
  background: var(--bg-2);
  color: var(--primary);
}
.theme-btn .theme-icon { transition: color 0.2s; }
[data-theme="dark-green"] .theme-btn { color: #10b981; }
[data-theme="dark-blue"] .theme-btn { color: #60a5fa; }

/* Legacy icon classes (kept for compatibility) */
.theme-btn .sun-icon { display: block; }
.theme-btn .moon-icon { display: block; }
[data-theme="dark"] .theme-btn .sun-icon { display: block; color: #fbbf24; }
[data-theme="dark"] .theme-btn .moon-icon { display: none; }


/* Page Hero section styling */
.page-hero {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}
.page-hero .section-label {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
.page-hero h1 {
    font-size: 3rem;
    font-family: var(--font-display);
    color: var(--text-main);
    font-weight: 800;
    margin: 0 0 12px 0;
}
.page-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Floating Piece Keyframe Animations */
@keyframes float-piece-1 {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.05; }
  50% { transform: translateY(-25px) rotate(8deg); opacity: 0.12; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.05; }
}
@keyframes float-piece-2 {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.08; }
  50% { transform: translateY(-35px) rotate(-12deg); opacity: 0.15; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.08; }
}

.float-anim-1 {
  animation: float-piece-1 8s ease-in-out infinite;
}
.float-anim-2 {
  animation: float-piece-2 10s ease-in-out infinite;
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(30, 41, 59, 0.45) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
}

/* Gradient Borders with Hover Glow */
.gradient-border-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  z-index: 1;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.gradient-border-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  background: linear-gradient(135deg, var(--primary), var(--accent), transparent);
  border-radius: calc(var(--radius-lg) + 1px);
  z-index: -1;
  opacity: 0.15;
  transition: opacity var(--transition);
}
.gradient-border-card:hover::before {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.6));
}
.gradient-border-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(37, 99, 235, 0.12);
}

/* FAQ Search Bar */
.faq-search-box {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 30px auto;
  position: relative;
}
.faq-search-input {
  width: 100%;
  padding: 14px 20px;
  padding-right: 50px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1rem;
  transition: all var(--transition);
}
.faq-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

/* FAQ Categories Grid */
.faq-cats-flex {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.faq-cat-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.faq-cat-btn:hover, .faq-cat-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* FAQ Accordion */
.faq-accordion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .faq-accordion-grid {
    grid-template-columns: 1fr;
  }
}
.faq-accordion-item {
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.faq-accordion-item.active {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.08);
}
.faq-accordion-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
  font-size: 1.05rem;
}
.faq-accordion-header:hover {
  background: rgba(37, 99, 235, 0.04);
}
.faq-accordion-header .arrow {
  transition: transform var(--transition);
  font-size: 1.1rem;
  color: var(--primary);
}
.faq-accordion-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 24px;
  transition: all 0.3s cubic-bezier(0, 1, 0, 1);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}
.faq-accordion-item.active .faq-accordion-content {
  max-height: 800px;
  padding: 0 24px 20px 24px;
  transition: all 0.3s cubic-bezier(1, 0, 1, 0);
}
.faq-accordion-item.active .faq-accordion-header .arrow {
  transform: rotate(180deg);
}

/* ==========================================================================
   Float Chess Branding & Social Media premium integration
   ========================================================================== */
.social-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.social-brand-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  color: white !important;
}
.social-brand-btn.instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.social-brand-btn.youtube {
  background: #ff0000;
}
.social-brand-btn.twitter {
  background: #000000;
  border: 1px solid rgba(255,255,255,0.15);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Custom Chessboard.js overrides */
.white-1e1d7 {
  background-color: var(--board-light) !important;
  color: var(--board-dark) !important;
}
.black-3c85d {
  background-color: var(--board-dark) !important;
  color: var(--board-light) !important;
}
.notation-322f9 {
  font-family: var(--font-display), sans-serif !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  z-index: 10 !important;
  pointer-events: none !important;
  user-select: none;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.4);
}
.white-1e1d7 .notation-322f9 {
  color: var(--board-dark, #b58863) !important;
}
.black-3c85d .notation-322f9 {
  color: var(--board-light, #f0d9b5) !important;
}
.alpha-d2270 {
  bottom: 2px !important;
  right: 4px !important;
}
.numeric-fc462 {
  top: 2px !important;
  left: 4px !important;
}
html.hide-coordinates .notation-322f9 {
  display: none !important;
}

/* Responsive Lesson grids for How-to-Play and Endgames */
.lesson-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: center;
}
.lesson-grid-2col.reverse {
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 768px) {
  .lesson-grid-2col, .lesson-grid-2col.reverse {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .lesson-grid-2col > div {
    width: 100%;
  }
  /* Center image block on mobile for balanced design */
  .lesson-grid-2col img, .lesson-grid-2col .lesson-media-placeholder {
    max-width: 440px;
    margin: 0 auto;
  }
}

/* Viewport Play Layout rules to fit screen height perfectly */
@media (min-width: 1025px) {
  body.viewport-play {
    overflow: hidden !important;
  }
  body.viewport-play main.container {
    height: calc(100vh - 90px) !important;
    max-height: calc(100vh - 90px) !important;
    padding: 10px 20px 20px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  body.viewport-play .app-container {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 20px !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    overflow: hidden !important;
  }
  body.viewport-play .left-column,
  body.viewport-play .fs-left-column {
    flex: 0 1 auto !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: min(600px, 70vh) !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  /* Faint Chess Watermarks for Background styling */
  .chess-decor {
    position: absolute;
    font-size: 6rem;
    opacity: 0.04;
    color: var(--primary);
    pointer-events: none;
    z-index: 0;
    user-select: none;
  }
  .chess-decor.accent {
    color: var(--accent);
  }
  body.viewport-play .board-layout {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
    position: relative !important;
  }
  body.viewport-play .board-wrapper {
    height: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body.viewport-play #board {
    height: 100% !important;
    width: 100% !important;
  }
  body.viewport-play .right-column, body.viewport-play .fs-right-column {
    flex: 0 0 420px !important;
    width: 420px !important;
    max-width: 420px !important;
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    overflow-y: auto !important;
  }
  body.viewport-play .right-column::-webkit-scrollbar,
  body.viewport-play .fs-right-column::-webkit-scrollbar {
    width: 6px;
  }
  body.viewport-play .right-column::-webkit-scrollbar-thumb,
  body.viewport-play .fs-right-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  body.viewport-play .panel, body.viewport-play .card {
    padding: 16px !important;
    border-radius: 12px !important;
  }
}

/* Time Ratio Indicators inside Moves History */
.time-ratio-bar {
  width: 40px;
  height: 6px;
  background: #475569; /* Dark representing Black's time */
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.time-ratio-white {
  height: 100%;
  background: #f8fafc; /* Light representing White's time */
  transition: width 0.3s ease;
}

.move-row-styled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-display), sans-serif;
  font-size: 14px;
  color: var(--text-main);
  transition: background 0.15s ease;
}
.move-row-styled:hover {
  background: rgba(255, 255, 255, 0.02);
}
.move-row-styled .move-num {
  width: 28px;
  color: var(--text-muted);
  font-weight: 600;
}
.move-row-styled .move-span {
  flex: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  transition: all 0.2s;
}
.move-row-styled .move-span:hover {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-secondary);
}
.move-row-styled .move-span.active {
  background: var(--accent-secondary);
  color: white !important;
}
.move-row-styled .move-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
  margin-right: 4px;
  opacity: 0.85;
}

/* Page Render Speed Optimizations */
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

.ranking-container, .database-container, .openings-layout-container, .blog-grid, .neon-grid {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

/* Fullscreen Chessboard Collapsible States */
.navbar-collapsed .navbar {
  transform: translateY(-100%);
}
.navbar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar-collapsed main {
  padding-top: 15px !important;
}

/* Sidebar Collapsible */
.sidebar-collapsed .right-column {
  display: none !important;
}
.sidebar-collapsed .left-column,
.sidebar-collapsed .center-column {
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* Toggle Buttons styling */
.viewport-toggle-btn {
  position: fixed;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}
.viewport-toggle-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}
.navbar-collapsed-btn {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}
.sidebar-collapsed-btn {
  bottom: 20px;
  right: 20px;
}

/* Responsive Viewport Sizing for Chessboards */
.board-wrapper, .board-container-box {
  max-width: min(100%, 82vh) !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto !important;
}

/* GPU-Accelerated Animation Utilities */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* GPU Promotion for animated elements */
.navbar, .viewport-toggle-btn, .card, .nav-play-btn {
  will-change: transform;
  transform: translateZ(0);
}

/* Prevent Layout Shift for images */
img {
  max-width: 100%;
  height: auto;
}
img[loading="lazy"] {
  aspect-ratio: attr(width) / attr(height);
}

/* Smooth transitions globally */
a, button, .card, .panel {
  transition: all 0.2s ease;
}

/* Accessibility - Large Text Mode */
.accessibility-large-text {
  font-size: 1.15rem !important;
}
.accessibility-large-text .nav-links a,
.accessibility-large-text .card p {
  font-size: 1.1rem !important;
}

/* Accessibility - High Contrast Mode */
.accessibility-high-contrast {
  --text-main: #000 !important;
  --text-muted: #333 !important;
  --border: #555 !important;
}
[data-theme="dark"] .accessibility-high-contrast {
  --text-main: #fff !important;
  --text-muted: #ddd !important;
  --border: #aaa !important;
}

/* Accessibility Utility Classes */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}



/* ==========================================================================
   Dynamic Theme-Driven Chessboard Square Styling
   ========================================================================== */
.white-1e1d7, .square-55d63.white-1e1d7 {
  background-color: var(--board-light) !important;
  color: var(--board-dark) !important;
}

.black-3c85d, .square-55d63.black-3c85d {
  background-color: var(--board-dark) !important;
  color: var(--board-light) !important;
}

/* 1. Light Theme (Sun ☀️) - Warm Classical & Brown Board */
[data-theme="light"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #eff6ff;
  --accent: #3b82f6;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-2: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --board-light: #f0d9b5;
  --board-dark: #b58863;
}

/* 2. Dark Green Theme (Moon 🌙) - Deep Emerald & Green Board */
[data-theme="dark-green"], [data-theme="dark"] {
  --primary: #10b981;
  --primary-hover: #059669;
  --secondary: #064e3b;
  --accent: #34d399;
  --bg-main: #022c22;
  --bg-card: #064e3b;
  --bg-2: #065f46;
  --text-main: #f0fdf4;
  --text-muted: #a7f3d0;
  --text-dim: #6ee7b7;
  --border: #047857;
  --border-light: #059669;
  --board-light: #eeeed2;
  --board-dark: #769656;
}

/* 3. Dark Blue Theme (Star ⭐) - Deep Navy & Blue Board */
[data-theme="dark-blue"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #1e293b;
  --accent: #60a5fa;
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-2: #334155;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --border: #334155;
  --border-light: #475569;
  --board-light: #dee3e6;
  --board-dark: #8ca2ad;
}

/* Real Master Wooden Felt Table Backdrop for Playing Areas */
.board-column, .board-area {
  position: relative;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%),
              radial-gradient(ellipse at center, #2e1a09 0%, #170d04 100%);
  border-radius: 16px;
  padding: 16px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.6), 0 20px 40px rgba(0,0,0,0.4);
}


/* ==========================================================================
   FLOAT CHESS 2.0 CUSTOM OVERRIDES (CAPTURED PIECES, HIGHLIGHTS, LAYOUT)
   ========================================================================== */

/* Captured pieces styling */
.captured-pieces {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-wrap: wrap !important;
  min-height: 24px !important;
  margin-top: 4px !important;
}
.captured-piece-icon {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  opacity: 0.85 !important;
  transition: transform 0.2s ease !important;
}
.captured-piece-icon:hover {
  transform: scale(1.2) !important;
  opacity: 1 !important;
}
.captured-count {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
  margin-left: -2px !important;
  margin-right: 4px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  display: inline-block !important;
}
.material-balance-indicator {
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  margin-left: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Correct/Incorrect Move highlights */
.highlight-green {
  background-color: #10b981 !important;
  color: #fff !important;
}
.highlight-red {
  background-color: #ef4444 !important;
  color: #fff !important;
}
.shake-animation {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both !important;
  transform: translate3d(0, 0, 0) !important;
  backface-visibility: hidden !important;
  perspective: 1000px !important;
}
@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
  40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* Larger chessboard layout */
.board-wrapper {
  max-width: 680px !important; /* Increase desktop board size */
  width: 100% !important;
  margin: 0 auto !important;
  position: relative !important;
}
.board-area {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}
@media (max-width: 768px) {
  .board-wrapper {
    max-width: 90vw !important; /* Better tablet layout */
  }
}
@media (max-width: 480px) {
  .board-wrapper {
    max-width: 95vw !important; /* Responsive mobile scaling */
  }
}

/* ==========================================================================
   Premium News & Legal Page Overhaul
   ========================================================================== */

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 10000;
}
.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.1s ease-out;
}

/* Premium Breadcrumbs */
.premium-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 24px 0 16px 0;
  flex-wrap: wrap;
}
.premium-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  font-weight: 500;
}
.premium-breadcrumbs a:hover {
  color: var(--primary);
}
.premium-breadcrumbs span.separator {
  color: var(--border);
}
.premium-breadcrumbs span.current {
  color: var(--text-main);
  font-weight: 600;
}

/* Article Hero Section */
.article-hero {
  margin-bottom: 30px;
}
.article-hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 12px;
}
.article-hero-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-hero-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.95rem;
}
.article-hero-author-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}
.article-hero-date {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.article-hero-reading-time {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-2);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Lightbox / Zoomable Image */
.zoomable-image-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.zoomable-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.zoomable-image-container:hover .zoomable-image {
  transform: scale(1.03);
}
.image-caption {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox-modal.show {
  display: flex;
  opacity: 1;
}
.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.lightbox-modal.show .lightbox-content {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.lightbox-close:hover {
  color: var(--primary);
}

/* Premium Article Content Width & Spacing */
.article-premium-grid {
  max-width: var(--container-width);
  margin: 0 auto 60px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 40px;
  position: relative;
}
.article-premium-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}
.article-body-content {
  color: var(--text-muted);
  line-height: 1.85;
  font-size: 1.075rem;
  margin-bottom: 40px;
}
.article-body-content p {
  margin-bottom: 24px;
}
.article-body-content h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--text-main);
  margin: 40px 0 16px 0;
  font-weight: 700;
}
.article-body-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-main);
  margin: 32px 0 12px 0;
  font-weight: 600;
}
.article-body-content ul, .article-body-content ol {
  margin-bottom: 24px;
  padding-left: 24px;
}
.article-body-content li {
  margin-bottom: 10px;
}
.article-body-content blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(37, 99, 235, 0.04);
  padding: 20px 24px;
  margin: 30px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-main);
}
.article-body-content blockquote p {
  margin: 0;
}

/* Callout notice boxes */
.callout-box {
  background: var(--bg-2);
  border-left: 4px solid var(--border);
  padding: 18px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 30px 0;
  font-size: 0.975rem;
  color: var(--text-muted);
}
.callout-box.info {
  background: rgba(37, 99, 235, 0.04);
  border-left-color: var(--primary);
}
.callout-box.warning {
  background: rgba(245, 158, 11, 0.04);
  border-left-color: #f59e0b;
}
.callout-box.success {
  background: rgba(16, 185, 129, 0.04);
  border-left-color: #10b981;
}

/* Floating Share Sidebar */
.sticky-share-container {
  position: absolute;
  left: -70px;
  top: 150px;
  height: calc(100% - 300px);
}
.sticky-share-bar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.share-btn-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.share-btn-premium svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
/* Tooltips */
.share-btn-premium[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 55px;
  background: #0f172a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  font-weight: 500;
}
.share-btn-premium:hover[data-tooltip]::before {
  opacity: 1;
  visibility: visible;
  left: 50px;
}
/* Share brand colors */
.share-btn-premium.twitter:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}
.share-btn-premium.facebook:hover {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}
.share-btn-premium.linkedin:hover {
  background: #0077b5;
  color: #ffffff;
  border-color: #0077b5;
}
.share-btn-premium.whatsapp:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}
.share-btn-premium.telegram:hover {
  background: #0088cc;
  color: #ffffff;
  border-color: #0088cc;
}
.share-btn-premium.email:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.share-btn-premium.copy:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* Sidebar Columns */
.article-sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}
.article-sidebar-box h4 {
  margin: 0 0 16px 0;
  color: var(--text-main);
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

/* Newsletter block */
.newsletter-card {
  text-align: center;
}
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}
.newsletter-input {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.newsletter-input:focus {
  border-color: var(--primary);
}

/* Next / Prev Navigation */
.article-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 40px 0;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}
.nav-link-card {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.nav-link-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  transform: translateY(-2px);
}
.nav-link-card .direction {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 4px;
}
.nav-link-card .nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Comments section placeholder */
.comments-section-placeholder {
  border-top: 1px solid var(--border);
  padding-top: 35px;
  margin-top: 40px;
}
.comments-section-placeholder h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-main);
  margin-bottom: 20px;
  font-weight: 700;
}
.comments-input-area {
  display: flex;
  gap: 15px;
  margin-bottom: 24px;
}
.comments-input-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.comments-textarea {
  flex: 1;
  height: 80px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-main);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
}
.comments-textarea:focus {
  border-color: var(--primary);
}

/* Legal Page Sticky Sidebar ScrollSpy Grid */
.legal-container {
  max-width: 1100px;
  margin: 0 auto 80px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
}
.legal-sidebar {
  position: relative;
}
.legal-sticky-box {
  position: sticky;
  top: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.legal-sticky-box h4 {
  margin: 0 0 16px 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
}
.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.legal-toc-item a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
}
.legal-toc-item a:hover, .legal-toc-item.active a {
  color: var(--primary);
  transform: translateX(4px);
}
.legal-toc-item.active a {
  font-weight: 700;
}
.legal-content {
  max-width: 780px;
  line-height: 1.85;
  font-size: 1.05rem;
  color: var(--text-muted);
}
.legal-content h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 40px 0 16px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  scroll-margin-top: 100px;
}
.legal-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 24px 0 12px 0;
}
.legal-content p {
  margin-bottom: 20px;
}
.legal-content ul, .legal-content ol {
  margin-bottom: 20px;
  padding-left: 20px;
}
.legal-content li {
  margin-bottom: 8px;
}

/* Read status card labels */
.read-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

/* Bookmark indicators */
.bookmark-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.bookmark-btn:hover, .bookmark-btn.active {
  color: #f59e0b;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .article-premium-grid {
    grid-template-columns: 1fr;
  }
  .sticky-share-container {
    position: static;
    height: auto;
    margin-top: 20px;
  }
  .sticky-share-bar {
    flex-direction: row;
    justify-content: center;
    position: static;
  }
  .share-btn-premium[data-tooltip]::before {
    display: none; /* Hide tooltips on mobile */
  }
  
  .legal-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .legal-sidebar {
    display: none; /* Hide sticky TOC on small screens to save space */
  }
}
