/* ==========================================
   StartChess - Premium Dark Matter Theme
   ========================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
  --bg: #08080C;
  --surface: #111118;
  --surface-2: #1A1A24;
  --surface-3: #22222E;
  --border: #2A2A38;
  --border-light: #3A3A4A;
  --text: #F5F5F7;
  --text-2: #B0B0C0;
  --text-3: #6B6B80;
  --gold: #F0C040;
  --gold-dark: #C49A2C;
  --gold-glow: rgba(240,192,64,0.25);
  --gold-strong: rgba(240,192,64,0.5);
  --green: #4ADE80;
  --green-glow: rgba(74,222,128,0.3);
  --red: #EF4444;
  --red-glow: rgba(239,68,68,0.3);
  --blue: #60A5FA;
  --purple: #A78BFA;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 30px var(--gold-glow);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: 0.85; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input { font-family: inherit; outline: none; }
::selection { background: var(--gold-strong); color: var(--bg); }

/* --- Typography --- */
h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 1.1rem; font-weight: 600; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.font-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.grid { display: grid; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--r-md); font-weight: 600;
  font-size: 0.95rem; transition: all 0.25s ease; position: relative; overflow: hidden;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0A0A0F; box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
}
.btn-gold::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 40px var(--gold-strong); }
.btn-gold:hover::before { left: 100%; }
.btn-gold:active { transform: translateY(0); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border-light);
  color: var(--text); backdrop-filter: blur(8px);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--gold); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: var(--r-lg); }
.btn-danger { background: var(--red); color: white; }
.btn-success { background: var(--green); color: #0A0A0F; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.card:hover { border-color: var(--border-light); }
.card-glow { box-shadow: var(--shadow-gold); border-color: var(--gold-dark); }
.card-glow:hover { box-shadow: 0 0 50px var(--gold-glow); }
.card-glass {
  background: rgba(17,17,24,0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
}

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.75rem; border-radius: 100px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-gold { background: var(--gold); color: #0A0A0F; }
.badge-green { background: rgba(74,222,128,0.15); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.badge-blue { background: rgba(96,165,250,0.15); color: var(--blue); border: 1px solid rgba(96,165,250,0.3); }

/* --- Input --- */
.input {
  padding: 0.75rem 1rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text); font-size: 0.95rem; width: 100%;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: var(--text-3); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2.5rem; max-width: 480px; width: 90%;
  animation: scaleIn 0.3s ease; position: relative;
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: none; border: none;
  color: var(--text-3); font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0.75rem 2rem; display: flex; align-items: center; justify-content: space-between;
  background: rgba(8,8,12,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  min-height: 56px;
}
.navbar-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem; font-weight: 800; color: var(--text);
  display: flex; align-items: center; cursor: pointer;
  letter-spacing: -0.04em; line-height: 1;
  flex-shrink: 0;
}
.navbar-logo .logo-start { color: var(--gold); }
.navbar-logo .logo-chess { color: var(--text); }
.navbar-links { 
  display: flex; align-items: center; gap: 0.5rem; 
  position: absolute; left: 50%; transform: translateX(-50%);
}
.navbar-links a, .navbar-links button {
  padding: 0.5rem 1.25rem; color: var(--text-2); font-size: 0.95rem;
  font-weight: 500; border-radius: var(--r-sm); transition: all 0.2s;
  background: none; border: none; white-space: nowrap;
}
.navbar-links a:hover, .navbar-links button:hover { color: var(--text); background: var(--surface-2); }
.navbar-user { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* ==========================================
   LANDING PAGE
   ========================================== */
.landing { padding-top: 5rem; }

/* New Hero Section */
.hero-new {
  padding: 8rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 85vh;
  display: flex;
  align-items: center;
}
.hero-new::before {
  content: ''; position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(240,192,64,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(96,165,250,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(240,192,64,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-new::after {
  content: ''; position: absolute; inset: 0;
  background: 
    radial-gradient(circle at 90% 10%, rgba(74,222,128,0.08) 0%, transparent 30%);
  pointer-events: none;
}
.hero-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 6rem;
  align-items: center;
  position: relative; z-index: 2;
}
.hero-content { text-align: left; }
.hero-badge-new {
  display: inline-block;
  background: rgba(240,192,64,0.15);
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero-new h1 { 
  font-size: 3.25rem; line-height: 1.15; margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--gold) 50%, var(--text) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { 
  font-size: 1.25rem; color: var(--text-2); margin-bottom: 2.25rem; 
  max-width: 500px; line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.hero-badges { display: flex; gap: 0.75rem; flex-wrap: nowrap; justify-content: center; }
.hero-badges .badge { font-size: 0.8rem; padding: 0.4rem 1rem; white-space: nowrap; }
.hero-board-new {
  display: flex; justify-content: center;
}
.hero-board-new .mini-board {
  width: 100%; max-width: 500px; aspect-ratio: 1/1;
  overflow: hidden;
  position: relative;
  /* Stationary board, no animation or borders as requested */
  border-radius: var(--r-xl);
}
.hero-board-new .board-container {
  border: none !important;
  box-shadow: 0 20px 80px rgba(0,0,0,0.4);
}
@keyframes floatBoard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Stats Bar */
.stats-bar {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem;
}
.stats-flex {
  max-width: 900px;
  margin: 0 auto;
  display: flex; justify-content: center; align-items: center; gap: 3rem;
}
.stat-item { text-align: center; }
.stat-item .stat-num {
  display: block; font-size: 2.5rem; font-weight: 700; color: var(--gold);
  font-family: var(--font-mono);
}
.stat-item .stat-label {
  font-size: 0.95rem; color: var(--text-3); margin-top: 0.25rem;
}
.stat-divider {
  width: 1px; height: 50px; background: var(--border);
}

/* Feature cards */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  max-width: 1100px; margin: 0 auto;
}
.features .feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.25rem 1.75rem;
  text-align: center;
  transition: all 0.3s ease;
}
.features .feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-dark);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}
.features .feature-icon {
  width: 64px; height: 64px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  border: 1px solid;
  background: var(--surface);
}
.features .feature-icon svg { opacity: 0.9; }
.features .feature-card h3 { margin-bottom: 0.75rem; font-size: 1.2rem; }
.features .feature-card p { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; }

/* Testimonials */
.testimonials { padding: 5rem 2rem; background: var(--surface); }
.testimonials-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem;
  max-width: 1000px; margin: 0 auto;
}
.testimonial-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  transition: all 0.3s ease;
  position: relative;
}
.testimonial-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 20px rgba(240,192,64,0.1);
}
.testimonial-stars {
  color: var(--gold); font-size: 1.1rem; letter-spacing: 0.15rem;
  margin-bottom: 0.75rem;
}
.testimonial-card p {
  font-size: 0.95rem; line-height: 1.65; color: var(--text-2);
  margin-bottom: 1rem; font-style: italic;
}
.testimonial-author {
  font-size: 0.85rem; color: var(--text-3); font-weight: 500;
}

/* Benefits Section */
.benefit-card {
  position: relative;
  overflow: hidden;
}
.benefit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.benefit-card:hover::before {
  opacity: 1;
}
.benefit-card:hover {
  transform: translateY(-12px);
  border-color: var(--gold) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px rgba(240,192,64,0.15) !important;
}

/* Final CTA Section */
.final-cta {
  position: relative;
  overflow: hidden;
}
.final-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(240,192,64,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* CTA New */
.cta-section-new {
  padding: 6rem 2rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
}
.cta-content-new {
  text-align: center; max-width: 600px; margin: 0 auto;
}
.cta-icon {
  font-size: 4rem; margin-bottom: 1.25rem;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.cta-content-new h2 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.cta-content-new p { color: var(--text-2); font-size: 1.15rem; margin-bottom: 2rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .hero-content { text-align: center; }
  .hero-content .hero-subtitle { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-badges { justify-content: center; }
  .features { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .stats-flex { flex-direction: column; gap: 1.5rem; }
  .stat-divider { width: 50px; height: 1px; }
}

/* --- Premium Overhaul Additions --- */

.shimmer-text {
  background: linear-gradient(90deg, #fff 0%, var(--gold) 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.glass-card {
  background: rgba(26, 26, 36, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(240, 192, 64, 0.1);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.legal-content {
  line-height: 1.8;
  color: var(--text-2);
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.legal-content h1, .legal-content h2, .legal-content h3 {
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content section {
  margin-bottom: 3rem;
}

.legal-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.pricing-monthly-badge {
  background: var(--gold-glow);
  color: var(--gold);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.psych-benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.psych-benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: var(--r-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.psych-benefit-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold-dark);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.scarcity-banner {
  background: linear-gradient(90deg, #8B0000 0%, #B22222 50%, #8B0000 100%);
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.price-breakdown {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 0.5rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem;
  margin-top: 4rem;
  background: var(--bg);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
}

.footer-brand h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-links h5 {
  font-size: 0.9rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-bottom {
  max-width: 1200px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-3);
  font-size: 0.85rem;
}
.hero {
  min-height: auto; padding: 3rem 1rem; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(240,192,64,0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite;
}
@keyframes heroGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.hero-content { text-align: center; max-width: 800px; z-index: 2; padding: 2rem 0; }

.hero-badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--gold-dark);
  color: var(--gold);
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.hero h1 { margin-bottom: 1.5rem; font-size: 3.5rem; line-height: 1.15; }
.hero h1 .gold-text {
  background: linear-gradient(135deg, var(--gold), #FFD700, var(--gold-dark));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { 
  font-size: 1.3rem; color: var(--text-2); margin-bottom: 3rem; 
  max-width: 600px; margin-inline: auto; line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 4rem; }

.hero-stats {
  display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap;
}
.hero-stat {
  text-align: center; padding: 0 1rem;
}
.hero-stat-num {
  display: block; font-size: 2.25rem; font-weight: 700; color: var(--gold);
  font-family: var(--font-mono);
}
.hero-stat-label {
  font-size: 0.9rem; color: var(--text-3); margin-top: 0.25rem;
}

.hero-board {
  margin-top: 2rem; display: flex; justify-content: center;
  padding-bottom: 4rem; position: relative;
}
.hero-board::before {
  content: ''; position: absolute; inset: -50px;
  background: radial-gradient(ellipse at center, rgba(240,192,64,0.15) 0%, transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
.hero-board .mini-board, .still-board {
  width: 100%; max-width: 520px; aspect-ratio: 1/1;
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: 0 20px 80px rgba(240,192,64,0.25), var(--shadow-lg), 0 0 60px rgba(240,192,64,0.2);
  border: 2px solid rgba(240,192,64,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.still-board {
  border: 3px solid rgba(240,192,64,0.4) !important;
  box-shadow: 0 30px 100px rgba(240,192,64,0.3), 0 0 80px rgba(240,192,64,0.15) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.still-board:hover {
  transform: scale(1.02);
  box-shadow: 0 40px 120px rgba(240,192,64,0.4), 0 0 100px rgba(240,192,64,0.2) !important;
}
#hero-board-container {
  width: 100%;
  height: 100%;
  max-width: 520px;
}

/* How It Works Section */
.how-it-works {
  padding: 6rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-header {
  text-align: center; margin-bottom: 4rem;
}
.section-header h2 { font-size: 2.5rem; margin-bottom: 0.75rem; }
.section-header p { color: var(--text-2); font-size: 1.15rem; }

.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem;
  max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}
.feature-card:hover { 
  transform: translateY(-12px) scale(1.02); 
  border-color: var(--gold); 
  box-shadow: 0 25px 50px rgba(0,0,0,0.4), 0 0 30px rgba(240,192,64,0.15);
}
.feature-step {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #000;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.feature-icon {
  width: 80px; height: 80px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.25rem; margin: 0 auto 1.75rem;
  background: var(--surface); border: 1px solid var(--border);
}
.feature-card h3 { margin-bottom: 1rem; font-size: 1.35rem; }
.feature-card p { color: var(--text-2); font-size: 1rem; line-height: 1.65; }

/* CTA Section */
.cta-section {
  padding: 8rem 2rem;
}
.cta-content {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--gold-dark);
  border-radius: var(--r-xl);
  padding: 5rem;
  text-align: center;
  max-width: 750px; margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.cta-content::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center bottom, rgba(240,192,64,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.cta-content h2 { font-size: 2.5rem; margin-bottom: 1rem; position: relative; }
.cta-content p { color: var(--text-2); font-size: 1.15rem; margin-bottom: 2.5rem; position: relative; }

/* Stats banner */
.stats-banner {
  padding: 4rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center;
}
.stat-item h3 { font-size: 2.5rem; color: var(--gold); font-weight: 800; font-family: var(--font-mono); }
.stat-item p { color: var(--text-3); font-size: 0.85rem; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ==========================================
   DASHBOARD
   ========================================== */
.dashboard { padding-top: 5rem; min-height: 100vh; }
.dash-header { margin-bottom: 2.5rem; text-align: center; }
.dash-header h2 { margin-bottom: 0.5rem; font-size: 2.5rem; }
.dash-header p { color: var(--text-2); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }

.dash-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 2rem;
}

.dash-badges {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  margin-bottom: 2.5rem;
}

.dash-badges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dash-badges-header h3 {
  font-size: 1rem;
  color: var(--text);
}

.badge-count {
  font-size: 0.8rem;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.badges-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.badges-scroll .badges-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
  min-width: max-content;
}

.badges-scroll .badge-item {
  flex-shrink: 0;
  padding: 0.75rem;
  min-width: 80px;
}
.dash-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  text-align: center; transition: all 0.3s ease;
}
.dash-stat:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.dash-stat-icon {
  font-size: 2rem; margin-bottom: 0.75rem;
}
.dash-stat-label { font-size: 0.85rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; font-weight: 600; }
.dash-stat-value { font-size: 2rem; font-weight: 700; font-family: var(--font-mono); }
.dash-stat-value.gold { color: var(--gold); }
.dash-stat-value.green { color: var(--green); }

.dash-actions {
  display: flex; gap: 1rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap;
}
.dash-actions .btn { min-width: 200px; }

.dash-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; margin-bottom: 2rem;
}
.dash-section h3 { margin-bottom: 1rem; font-size: 1.25rem; }

.dash-openings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem;
}
.dash-opening-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1rem; cursor: pointer;
  transition: all 0.2s ease; display: flex; align-items: center; gap: 1rem;
}
.dash-opening-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.dash-opening-progress-ring {
  width: 50px; height: 50px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--border) 0);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative;
}
.dash-opening-progress-ring::before {
  content: ''; position: absolute; width: 40px; height: 40px;
  background: var(--surface-2); border-radius: 50%;
}
.dash-opening-progress-ring span {
  position: relative; font-size: 0.7rem; font-weight: 700;
}

.dash-opening-info { flex: 1; min-width: 0; }
.dash-opening-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.dash-opening-meta { font-size: 0.75rem; color: var(--text-3); }

.dash-srs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.dash-srs-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1rem; cursor: pointer;
  transition: all 0.2s ease;
}
.dash-srs-card:hover { border-color: var(--blue); }
.dash-srs-opening { font-weight: 600; margin-bottom: 0.25rem; }
.dash-srs-line { font-size: 0.8rem; color: var(--text-3); margin-bottom: 0.5rem; }
.dash-srs-quality { display: flex; gap: 0.5rem; }

.dash-pro-promo {
  background: linear-gradient(135deg, rgba(240,192,64,0.1) 0%, var(--surface) 100%);
  border: 1px solid var(--gold); border-radius: var(--r-lg); padding: 2rem;
  text-align: center; margin-bottom: 2rem;
}
.dash-pro-content h3 { margin-bottom: 0.5rem; }
.dash-pro-content p { color: var(--text-2); margin-bottom: 1rem; }

/* Dashboard grid layout - simplified */
.dash-grid {
  display: grid; gap: 2rem; margin-bottom: 3rem;
}
.dash-main { display: flex; flex-direction: column; gap: 2rem; }
.dash-sidebar { display: none; }

/* Next Due card */
.next-due {
  background: var(--surface); border: 2px solid var(--gold-dark);
  border-radius: var(--r-xl); padding: 1.5rem;
  animation: pulseGoldBorder 3s ease-in-out infinite;
  cursor: pointer; transition: transform 0.2s;
}
.next-due:hover { transform: scale(1.02); }
.next-due-label { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.next-due-label .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1.5s infinite; }
.next-due h4 { margin-bottom: 0.25rem; }
.next-due p { color: var(--text-3); font-size: 0.85rem; }

/* Daily Goal Ring */
.goal-ring-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 1.5rem; text-align: center;
}
.goal-ring-label { font-size: 0.8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.goal-ring-svg { width: 140px; height: 140px; margin: 0 auto; transform: rotate(-90deg); }
.goal-ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.goal-ring-fg { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.goal-ring-text {
  text-align: center; margin-top: -90px; position: relative; z-index: 1;
}
.goal-ring-text .count { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); color: var(--gold); }
.goal-ring-text .label { font-size: 0.75rem; color: var(--text-3); }

/* Heatmap */
.heatmap-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 1.5rem;
}
.heatmap-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.heatmap-header h4 { font-size: 0.95rem; }
.heatmap-grid {
  display: grid; grid-template-columns: repeat(52, 1fr); gap: 3px;
}
.heatmap-cell {
  width: 100%; aspect-ratio: 1; border-radius: 2px;
  background: var(--surface-3); transition: background 0.2s;
}
.heatmap-cell.l1 { background: rgba(240,192,64,0.2); }
.heatmap-cell.l2 { background: rgba(240,192,64,0.4); }
.heatmap-cell.l3 { background: rgba(240,192,64,0.6); }
.heatmap-cell.l4 { background: var(--gold); }
.heatmap-legend { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.75rem; justify-content: flex-end; }
.heatmap-legend span { font-size: 0.7rem; color: var(--text-3); }
.heatmap-legend .cell { width: 12px; height: 12px; border-radius: 2px; }

/* Opening catalog */
.catalog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.catalog-filters { display: flex; gap: 0.5rem; }
.filter-btn {
  padding: 0.4rem 1rem; border-radius: 100px; font-size: 0.8rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.filter-btn.active, .filter-btn:hover { background: var(--gold); color: #0A0A0F; border-color: var(--gold); }

/* Search */
.catalog-search { max-width: 350px; }
.search-input-wrap {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 1rem; color: var(--text-3); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text); font-size: 0.9rem;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--text-3); }

.opening-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  align-items: flex-start; /* Prevent vertical stretching */
}
.opening-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 0;
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.opening-card:hover { border-color: var(--gold); transform: translateY(-6px) scale(1.01); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.opening-card.locked { opacity: 0.7; }
.lock-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
  z-index: 10; border-radius: 12px 12px 0 0;
}
.lock-overlay span { font-size: 2.5rem; opacity: 0.8; filter: grayscale(1); }
.static-board {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.static-board::before {
  content: '♟️';
  position: absolute;
  font-size: 3rem;
  opacity: 0.3;
  pointer-events: none;
}

.static-board img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.opening-card-content { padding: 1.25rem; }
.opening-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.opening-card-header h4 { font-size: 1.1rem; color: #fff; }
.opening-card-side { font-size: 0.75rem; color: var(--text-3); margin-top: 0.2rem; }
.opening-card p { font-size: 0.85rem; color: var(--text-2); margin: 0.5rem 0 0.75rem; line-height: 1.5; display: block; }
.opening-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); pt: 1rem; margin-top: auto; padding-top: 1rem; }
.opening-card-meta { font-size: 0.75rem; color: var(--text-3); font-weight: 500; }
.opening-card-progress {
  height: 6px; background: var(--surface-3); border-radius: 100px; flex: 1; margin: 0 1rem;
  overflow: hidden;
}
.opening-card-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); border-radius: 100px; transition: width 0.5s; }

/* ==========================================
   TRAINER
   ========================================== */
.trainer { padding-top: 5rem; min-height: 100vh; }
.trainer-layout {
  display: grid; grid-template-columns: auto 1fr; gap: 2.5rem;
  align-items: start; max-width: 1300px; margin: 0 auto;
}
.trainer-board-wrap {
  position: relative;
}
.board-container {
  position: relative;
  width: min(720px, 90vw);
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
}
.board {
  display: grid; grid-template-columns: repeat(8, 90px); grid-template-rows: repeat(8, 90px);
  user-select: none;
}
.square {
  width: 90px; height: 90px;
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer;
  transition: background 0.05s;
}
/* Chessboard.js overrides - Lichess Board */
.white-1e1d7 { background-color: #F0D9B5 !important; color: #B58863 !important; }
.black-3c85d { background-color: #B58863 !important; color: #F0D9B5 !important; }

/* Disable chessboard.js default move highlighting (highlight1/highlight2) */
.highlight1-32417, .highlight2-9c5d2 {
  box-shadow: none !important;
}
/* Board highlighting */
.square-55d63 { position: relative; }
.square-55d63 { cursor: pointer; }

/* Chessground wrapper */
.cg-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

.board-container {
  user-select: none; 
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  position: relative;
}
.board-container,
.board-container * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.board-container .piece {
  pointer-events: auto;
  -webkit-user-drag: none;
  user-select: none;
}

/* Selected piece highlight */
.square-55d63.selected-square {
  box-shadow: inset 0 0 0 4px #646E40;
}
.square-55d63.selected-piece {
  box-shadow: inset 0 0 0 4px #e6b800;
}

/* Last move highlight */
.square-55d63.last-move {
  background-color: rgba(255, 255, 0, 0.4) !important;
}

/* Check highlight */
.square-55d63.in-check {
  background: radial-gradient(ellipse at center, #ff0000 0%, #ff0000 25%, rgba(255, 0, 0, 0) 89%, rgba(255, 0, 0, 0) 100%) !important;
}

/* Hint blue highlight - for hints - highlights the piece */
.square-55d63.hint-blue {
  box-shadow: inset 0 0 0 4px rgba(96, 165, 250, 0.9), inset 0 0 12px rgba(96, 165, 250, 0.5);
}
.square-55d63.hint-blue .piece {
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.9));
}

/* Hovered square outline */
.square-55d63.hovered-square {
  outline: 2px solid rgba(0,0,0,0.15);
}

/* Right-clicked square highlight - solid color backgrounds above pieces */
.square-55d63.right-clicked,
.square-55d63.right-clicked-green,
.square-55d63.right-clicked-blue,
.square-55d63.right-clicked-yellow {
  position: relative;
}

.square-55d63.right-clicked::after,
.square-55d63.right-clicked-green::after,
.square-55d63.right-clicked-blue::after,
.square-55d63.right-clicked-yellow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1; /* Under pieces (z-index: 2) */
  transition: none;
}

.square-55d63.right-clicked::after {
  background-color: rgba(229, 57, 53, 0.5);
}

.square-55d63.right-clicked-green::after {
  background-color: rgba(67, 160, 71, 0.5);
}

.square-55d63.right-clicked-blue::after {
  background-color: rgba(30, 136, 229, 0.5);
}

.square-55d63.right-clicked-yellow::after {
  background-color: rgba(255, 214, 0, 0.5);
}

/* Legal move - dot in center */
.square-55d63.legal-move::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: rgba(100, 110, 64, 0.5);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

/* Capture move - ring */
.square-55d63.capture-move::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border: 4px solid rgba(100, 110, 64, 0.55);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

/* Hover effects */
.square-55d63.legal-move:hover::after,
.square-55d63.capture-move:hover::after {
  opacity: 0.8;
}

/* Legal dot element - forced highest priority */
.square-55d63 .legal-dot {
  position: absolute !important;
  width: 28% !important;
  height: 28% !important;
  background: rgba(20, 85, 30, 0.6) !important;
  border-radius: 50% !important;
  top: 36% !important;
  left: 36% !important;
  pointer-events: none !important;
  z-index: 1000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.square-55d63 .legal-dot.capture {
  width: 88% !important;
  height: 88% !important;
  background: transparent !important;
  border: 4px solid rgba(20, 85, 30, 0.7) !important;
  border-radius: 50% !important;
  top: 6% !important;
  left: 6% !important;
}

/* Square highlight colors */
.square-55d63.highlight-green { background-color: rgba(21, 120, 27, 0.5) !important; }
.square-55d63.highlight-red { 
  background-color: rgba(252, 105, 85, 0.95) !important;
}
.square-55d63.highlight-blue { background-color: rgba(0, 48, 136, 0.5) !important; }
.square-55d63.highlight-yellow { background-color: rgba(230, 143, 0, 0.5) !important; }

/* Legal move highlight */
.square-55d63.legal-move { background: rgba(20, 85, 30, 0.15) !important; }

/* Square highlight colors - override white/black backgrounds */
.square-55d63.highlight-green {
  background-color: rgba(21, 120, 27, 0.5) !important;
}

.square-55d63.highlight-red {
  background-color: rgba(252, 105, 85, 0.95) !important;
}

.square-55d63.highlight-blue {
  background-color: rgba(0, 48, 136, 0.5) !important;
}

.square-55d63.highlight-yellow {
  background-color: rgba(230, 143, 0, 0.5) !important;
}

/* Override chessboard.js base colors */
.white-1e1d7.highlight-green,
.white-1e1d7.highlight-blue,
.white-1e1d7.highlight-yellow {
  background-color: rgba(21, 120, 27, 0.5) !important;
}

.white-1e1d7.highlight-red {
  background-color: rgba(252, 105, 85, 0.95) !important;
}

.black-3c85d.highlight-green,
.black-3c85d.highlight-blue,
.black-3c85d.highlight-yellow {
  background-color: rgba(226, 93, 70, 0.95) !important;
}

.black-3c85d.highlight-red {
  background-color: rgba(226, 93, 70, 0.95) !important;
}

.square:hover { filter: brightness(1.15); }
.piece {
  font-size: 50px; line-height: 1; z-index: 2; pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  transition: transform 0.12s ease;
}

/* Ensure chessboard.js pieces are properly displayed */
.square-55d63 img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Piece placement animation */
.square-55d63 .piece-417db {
  transition: transform 0.15s ease;
}

.square-55d63:hover .piece-417db {
  transform: scale(1.05);
}

/* Dragged piece from chessboard.js - ensure it hovers above legal move dots */
img[style*="position: absolute"][src*="cburnett"] {
  z-index: 50 !important;
}
.piece-white { color: #FFFFFF; -webkit-text-stroke: 0.5px rgba(0,0,0,0.2); }
.piece-black { color: #1A1A2E; -webkit-text-stroke: 0.5px rgba(0,0,0,0.15); }

/* Board labels */
.board-labels-file, .board-labels-rank {
  position: absolute; display: flex; pointer-events: none;
}
.board-labels-file {
  bottom: -22px; left: 0; right: 0; justify-content: space-around;
}
.board-labels-rank {
  top: 0; bottom: 0; left: -22px; flex-direction: column; justify-content: space-around;
  align-items: center;
}
.board-label { font-size: 0.7rem; color: var(--text-3); font-weight: 600; width: 72px; text-align: center; }
.board-labels-rank .board-label { width: auto; height: 72px; display: flex; align-items: center; }

/* Trainer panel */
.trainer-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2rem; min-width: 420px;
}
.trainer-opening-name { font-size: 0.8rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.25rem; }
.trainer-line-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }
.line-dropdown { 
  color: var(--text); 
  background: var(--surface-2); 
  border: 1px solid var(--border-light); 
  border-radius: var(--r-md); 
  padding: 0.75rem 1rem; 
  min-width: 340px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23B0B0C0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.line-dropdown:hover {
  border-color: var(--gold);
}
.line-dropdown:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.line-dropdown option { 
  color: var(--text); 
  background: var(--surface-2); 
  padding: 0.5rem;
}
.trainer-progress { margin-bottom: 1.5rem; }
.trainer-progress-bar {
  height: 6px; background: var(--surface-3); border-radius: 100px; overflow: hidden;
}
.trainer-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); border-radius: 100px; transition: width 0.4s ease; }
.trainer-progress-label { font-size: 0.8rem; color: var(--text-3); margin-top: 0.5rem; font-family: var(--font-mono); }
.trainer-turn {
  padding: 1rem; background: var(--surface-2); border-radius: var(--r-md);
  margin-bottom: 1.5rem; font-size: 0.95rem;
}
.trainer-turn.your-turn { border-left: 3px solid var(--gold); }
.trainer-turn.opponent-turn { border-left: 3px solid var(--text-3); color: var(--text-3); }
.trainer-feedback {
  padding: 1rem; border-radius: var(--r-md); margin: 1rem 0;
  font-size: 0.95rem; font-weight: 500; text-align: center;
}
.trainer-feedback.correct { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
.trainer-feedback.incorrect { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.trainer-feedback.mastered { background: rgba(240,192,64,0.1); color: var(--gold); border: 1px solid rgba(240,192,64,0.3); }

/* Move history */
.move-history {
  margin-bottom: 1.5rem; max-height: 200px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.move-history-title { font-size: 0.8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.move-row { display: flex; gap: 0.5rem; padding: 0.25rem 0; font-family: var(--font-mono); font-size: 0.85rem; }
.move-num { color: var(--text-3); min-width: 2rem; }
.move-white, .move-black { padding: 0.1rem 0.4rem; border-radius: 4px; min-width: 4rem; }
.move-white { color: var(--text); }
.move-black { color: var(--text-2); }
.move-current { background: var(--gold-glow); color: var(--gold); }

/* SRS buttons */
.srs-buttons {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 1rem;
}
.srs-btn {
  padding: 0.75rem 0.5rem; border-radius: var(--r-md); font-size: 0.8rem;
  font-weight: 600; text-align: center; transition: all 0.2s; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
}
.srs-btn:hover { transform: translateY(-2px); }
.srs-btn.again { border-color: var(--red); color: var(--red); }
.srs-btn.again:hover { background: rgba(239,68,68,0.15); }
.srs-btn.hard { border-color: #F59E0B; color: #F59E0B; }
.srs-btn.hard:hover { background: rgba(245,158,11,0.15); }
.srs-btn.good { border-color: var(--green); color: var(--green); }
.srs-btn.good:hover { background: rgba(74,222,128,0.15); }
.srs-btn.easy { border-color: var(--blue); color: var(--blue); }
.srs-btn.easy:hover { background: rgba(96,165,250,0.15); }
.srs-btn-interval { display: block; font-size: 0.65rem; color: var(--text-3); margin-top: 0.2rem; font-weight: 400; }
.trainer-hint-btn { margin-top: 0.75rem; }
.trainer-restart-btn { 
  margin-top: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.trainer-restart-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Trainer arrow overlay for showing correct move */
.arrow-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; overflow: visible;
}

/* ==========================================
   PRICING
   ========================================== */
.pricing { padding-top: 6rem; min-height: 100vh; }
.pricing-header { text-align: center; margin-bottom: 4rem; }
.pricing-header h1 { margin-bottom: 1rem; font-size: 3rem; }
.pricing-header p { color: var(--text-2); font-size: 1.25rem; max-width: 600px; margin: 0 auto; line-height: 1.6; }
.pricing-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  max-width: 1000px; margin: 0 auto; align-items: start;
}
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 2rem 1.5rem; position: relative;
  transition: all 0.3s ease; display: flex; flex-direction: column;
}
.pricing-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.pricing-card.featured {
  border: 2px solid var(--gold); transform: scale(1.05);
  box-shadow: 0 0 60px rgba(240,192,64,0.2);
}
.pricing-card.featured:hover { transform: scale(1.08) translateY(-8px); }
.pricing-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0A0A0F; padding: 0.35rem 1.25rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}
.pricing-card-name { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.pricing-card-subtitle { font-size: 0.85rem; color: var(--text-3); margin-bottom: 1rem; }
.pricing-card-price { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.25rem; }
.pricing-card-price .currency { font-size: 1.25rem; vertical-align: top; margin-right: 2px; }
.pricing-card-price .period { font-size: 0.85rem; color: var(--text-3); font-weight: 400; }
.pricing-card-equiv { font-size: 0.8rem; color: var(--gold); margin-bottom: 1rem; font-weight: 500; }
.pricing-features { list-style: none; margin-bottom: 1.5rem; margin-top: auto; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.pricing-features li {
  font-size: 0.85rem; color: var(--text-2); display: flex; align-items: flex-start; gap: 0.5rem;
}
.pricing-features li .check { color: var(--green); font-weight: 700; }
.pricing-features li .cross { color: var(--text-3); }
.pricing-card .btn { width: 100%; margin-top: auto; }
.pricing-countdown {
  text-align: center; margin-top: 1rem; font-size: 0.8rem; color: var(--gold);
  font-family: var(--font-mono);
}
.pricing-countdown-timer { font-size: 1.1rem; font-weight: 700; }

.pricing-social-proof {
  text-align: center; margin-top: 4rem; padding: 2rem;
  background: var(--surface); border-radius: var(--r-xl); max-width: 800px; margin-left: auto; margin-right: auto;
}
.pricing-proof-stats {
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
}
.proof-stat { font-size: 1rem; color: var(--text-2); }
.proof-stat strong { color: var(--gold); font-size: 1.5rem; display: block; }

/* ==========================================
   AUTH WALL & PAYWALL
   ========================================== */
.auth-wall .modal { text-align: center; }
.auth-wall .xp-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem; background: var(--gold-glow); border: 1px solid var(--gold-dark);
  border-radius: 100px; color: var(--gold); font-weight: 700; font-size: 1.1rem;
  margin-bottom: 1.5rem; font-family: var(--font-mono);
}
.auth-wall h3 { margin-bottom: 0.75rem; }
.auth-wall p { color: var(--text-2); margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; }

.paywall .modal { text-align: center; max-width: 520px; }
.paywall-ring {
  width: 120px; height: 120px; margin: 0 auto 1.5rem;
}
.paywall h3 { margin-bottom: 0.75rem; }
.paywall p { color: var(--text-2); margin-bottom: 2rem; font-size: 0.95rem; }

/* ==========================================
   STREAK WARNING
   ========================================== */
.streak-banner {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 90;
  background: linear-gradient(90deg, rgba(239,68,68,0.1), rgba(239,68,68,0.05));
  border-bottom: 1px solid rgba(239,68,68,0.3);
  padding: 0.75rem 2rem; display: flex; align-items: center; justify-content: space-between;
  animation: slideDown 0.4s ease;
}
.streak-banner p { font-size: 0.9rem; color: var(--red); }
.streak-banner-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ==========================================
   SOCIAL PROOF TICKER
   ========================================== */
.ticker {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.5rem 2rem; z-index: 80;
  overflow: hidden; height: 40px;
}
.ticker-content {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-2);
  animation: fadeIn 0.5s ease;
  height: 100%;
}
.ticker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.ticker-content .emoji { font-size: 1rem; }

/* ==========================================
   DESKTOP GATE
   ========================================== */
.desktop-gate {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; text-align: center;
}
.desktop-gate h2 { margin-bottom: 1rem; }
.desktop-gate p { color: var(--text-2); }

/* ==========================================
   EFFECTS & ANIMATIONS
   ========================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes pulseGoldBorder {
  0%, 100% { border-color: var(--gold-dark); box-shadow: 0 0 15px rgba(240,192,64,0.1); }
  50% { border-color: var(--gold); box-shadow: 0 0 30px rgba(240,192,64,0.25); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 20px var(--gold-glow); }
  50% { box-shadow: 0 0 40px var(--gold-strong); }
}
@keyframes particleFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
@keyframes countPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.shake { animation: shake 0.5s ease; }
.fade-in { animation: fadeIn 0.4s ease; }

/* Green ripple effect */
.ripple-effect {
  position: absolute; border-radius: 50%;
  background: rgba(74, 222, 128, 0.4);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none; z-index: 20;
  width: 40px; height: 40px;
  transform-origin: center;
}

/* Gold particle */
.gold-particle {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  pointer-events: none; z-index: 2000;
  animation: particleFly 1s ease-out forwards;
}

/* Correct move arrow */
.correct-arrow {
  position: absolute; pointer-events: none; z-index: 15;
  opacity: 0.7;
}

/* Page transitions */
#app { animation: fadeIn 0.3s ease; min-height: 100vh; padding-bottom: 50px; }

/* ==========================================
   AUTH PAGES - Redesigned Centered Card
   ========================================== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 50%, var(--surface-2) 0%, var(--bg) 100%);
  padding: 2rem;
}
.auth-sidebar {
  display: none; /* Hide sidebar in new centralized design for better focus */
}

.auth-form-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.auth-form-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 3rem;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 40px rgba(240,192,64,0.1);
  position: relative;
  overflow: hidden;
  animation: modalSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-form-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.auth-form-header { text-align: center; margin-bottom: 2rem; }
.auth-form-header h3 { font-size: 1.8rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.auth-form-header p { color: var(--text-2); font-size: 0.95rem; }

/* Custom Inputs for Auth */
.auth-form .input {
  margin-bottom: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
}
.auth-form .input:focus {
  background: var(--surface-3);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(240,192,64,0.15);
}


/* Social Login */
.social-login-divider { margin: 1.5rem 0; text-align: center; position: relative; }
.social-login-divider span { background: var(--surface); padding: 0 1rem; color: var(--text-3); font-size: 0.85rem; position: relative; z-index: 1; }
.social-login-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); z-index: 0; }

.social-login-buttons { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.btn-social { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem; border-radius: var(--r-md); font-weight: 600; font-size: 0.9rem; transition: all 0.2s ease; cursor: pointer; }
.btn-social:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn-google { background: #fff; color: #333; border: 1px solid #ddd; }
.btn-google:hover { background: #f8f8f8; border-color: #ccc; }
.btn-apple { background: #000; color: #fff; border: 1px solid #333; }
.btn-apple:hover { background: #1a1a1a; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Progress ring for paywall */
.progress-ring { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.progress-ring-fg { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }

/* Chessboard.js overrides - Lichess Board */
.white-1e1d7 { background-color: #f0d9b5 !important; color: #b58863 !important; }
.black-3c85d { background-color: #b58863 !important; color: #f0d9b5 !important; }

/* ==========================================
   CHESSREPS-STYLE OPENING CARD UPDATES
   ========================================== */
.opening-card-progress-bar-wrap {
  margin-bottom: 0.75rem;
}
.opening-card-try-link {
  font-size: 0.85rem; font-weight: 600; color: var(--text-2);
  transition: color 0.2s;
}
.opening-card:hover .opening-card-try-link { color: var(--gold); }
.opening-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 1rem; margin-top: auto;
}
.opening-card-meta { font-size: 0.8rem; color: var(--text-3); font-weight: 500; }

/* ==========================================
   TRAINER LEARN HEADER (ChessReps style)
   ========================================== */
.trainer-learn-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.trainer-learn-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
}
.trainer-learn-icon { font-size: 1rem; }
.trainer-learn-mode { color: var(--text); font-weight: 600; }
.trainer-learn-sep { color: var(--border-light); }
.trainer-learn-opening { color: var(--text-2); }
.trainer-learn-linenum { font-size: 0.8rem; color: var(--text-3); font-family: var(--font-mono); }

/* King avatar guidance bubble */
.trainer-king-guidance {
  display: flex; gap: 0.75rem; align-items: flex-start;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.4s ease;
}
.king-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  box-shadow: 0 0 12px var(--gold-glow);
}
.king-bubble {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg);
  padding: 0.75rem 1rem;
  font-size: 0.88rem; color: var(--text-2); line-height: 1.5;
  position: relative;
  transition: all 0.3s ease;
}
.king-bubble::before {
  content: '';
  position: absolute; top: 0; left: -8px;
  border-right: 8px solid var(--border);
  border-top: 8px solid transparent;
  border-bottom: 0 solid transparent;
}
.king-bubble::after {
  content: '';
  position: absolute; top: 1px; left: -6px;
  border-right: 7px solid var(--surface-2);
  border-top: 7px solid transparent;
  border-bottom: 0 solid transparent;
}

/* ==========================================
   LICHESS ANALYSIS BUTTONS
   ========================================== */
.move-history-title {
  font-size: 0.8rem; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 0.75rem;
  display: flex; align-items: center; justify-content: space-between;
}
.lichess-analysis-full-btn {
  font-size: 0.72rem; color: var(--blue) !important;
  background: rgba(96,165,250,0.08);
  border: 1px solid rgba(96,165,250,0.2);
  padding: 0.2rem 0.6rem; border-radius: 100px;
  text-transform: none; letter-spacing: 0; font-weight: 600;
  transition: all 0.2s; text-decoration: none !important;
}
.lichess-analysis-full-btn:hover {
  background: rgba(96,165,250,0.15);
  border-color: rgba(96,165,250,0.4);
}
.move-analysis-btn {
  font-size: 0.7rem; color: var(--text-3) !important;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem; border-radius: 4px;
  text-decoration: none !important; font-weight: 600;
  transition: all 0.15s; line-height: 1.6;
  margin-left: 2px;
}
.move-analysis-btn:hover {
  color: var(--blue) !important;
  background: rgba(96,165,250,0.1);
  border-color: rgba(96,165,250,0.3);
}
.move-row {
  display: flex; gap: 0.35rem; align-items: center;
  padding: 0.25rem 0; font-family: var(--font-mono); font-size: 0.85rem;
}

/* ==========================================
   COMMUNITY POSTS SECTION
   ========================================== */
.community-section {
  margin-top: 2rem; margin-bottom: 3rem;
}
.community-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.community-section-header h3 { font-size: 1.1rem; }
.community-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
}
.community-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem;
  cursor: pointer; transition: all 0.25s ease;
}
.community-card:hover {
  border-color: rgba(96,165,250,0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.community-card-header {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.875rem;
}
.community-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.community-author-info { flex: 1; min-width: 0; }
.community-author-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 0.4rem;
}
.community-role-badge {
  font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.4rem;
  background: rgba(240,192,64,0.15); color: var(--gold);
  border: 1px solid rgba(240,192,64,0.3); border-radius: 4px;
  letter-spacing: 0.03em;
}
.community-meta {
  display: flex; align-items: center; gap: 0.4rem; margin-top: 0.15rem;
  font-size: 0.75rem;
}
.community-opening-tag {
  color: var(--blue); font-weight: 500;
}
.community-dot { color: var(--text-3); }
.community-time { color: var(--text-3); }
.community-hearts {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  margin-left: auto;
}
.community-heart-icon { font-size: 1rem; line-height: 1; }
.community-hearts span:last-child { font-size: 0.72rem; color: var(--text-3); font-family: var(--font-mono); }
.community-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.5rem; line-height: 1.35;
}
.community-body {
  font-size: 0.83rem; color: var(--text-3); line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.community-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}
.community-stats { display: flex; align-items: center; gap: 0.35rem; }
.community-stat { font-size: 0.77rem; color: var(--text-3); }
.community-stat-sep { color: var(--border-light); }
.community-try-link {
  font-size: 0.8rem; color: var(--text-3); font-weight: 600;
  transition: color 0.2s;
}
.community-card:hover .community-try-link { color: var(--blue); }

/* ==========================================
   NAVBAR COMMUNITY LINK
   ========================================== */
.navbar-community-link {
  display: flex !important; align-items: center; gap: 0.4rem;
  color: var(--text) !important;
  background: rgba(96,165,250,0.08) !important;
  border: 1px solid rgba(96,165,250,0.2) !important;
  border-radius: 100px !important;
  padding: 0.4rem 1rem !important;
  font-weight: 600 !important; font-size: 0.85rem !important;
  transition: all 0.2s !important;
}
.navbar-community-link:hover {
  background: rgba(96,165,250,0.15) !important;
  border-color: rgba(96,165,250,0.35) !important;
  color: var(--text) !important;
}
.navbar-community-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 6px var(--blue);
  animation: pulse 2s infinite;
}

/* Confetti animation */
@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(var(--rotation));
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(calc(var(--rotation) + var(--rotation-speed)));
    opacity: 0.8;
  }
}

@keyframes confettiSway {
  0%, 100% {
    margin-left: 0;
  }
  50% {
    margin-left: 30px;
  }
}

.confetti {
  position: fixed;
  z-index: 9999;
  border-radius: 2px;
}

/* Badge styles */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.badge-item:hover {
  transform: translateY(-5px);
  border-color: var(--gold-dark);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4), 0 0 15px var(--gold-glow);
}

.badge-item.locked {
  filter: grayscale(1) opacity(0.4);
  border-style: dashed;
}

.badge-item.locked .badge-title {
  color: var(--text-3);
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 8px rgba(240,192,64,0.3));
}

.badge-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}

/* XP Progress Bar */
.xp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.level-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.level-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

.level-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 700;
}

.xp-count {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-2);
}

.xp-bar-container {
  height: 12px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), #FFEB3B);
  border-radius: 100px;
  width: 0%;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 15px var(--gold-strong);
}

/* Psychological Pricing Styles */
.premium-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 4rem auto;
  align-items: stretch;
}

.premium-price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.premium-price-card:hover {
  transform: translateY(-12px);
  border-color: var(--border-light);
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.premium-price-card.featured {
  background: radial-gradient(circle at top right, #1A1A2E, var(--surface));
  border: 2px solid var(--gold);
  box-shadow: 0 0 40px rgba(240,192,64,0.15);
  transform: scale(1.05);
}

.premium-price-card.featured:hover {
  transform: scale(1.08) translateY(-12px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 50px rgba(240,192,64,0.2);
}

.premium-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000;
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 5px 15px rgba(240,192,64,0.3);
}

.premium-price-header {
  text-align: center;
  margin-bottom: 2rem;
}

.premium-plan-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.premium-plan-price {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.premium-plan-price span {
  font-size: 1.25rem;
  color: var(--text-3);
  font-weight: 400;
}

.premium-plan-desc {
  font-size: 0.9rem;
  color: var(--text-3);
}

.premium-features-list {
  list-style: none;
  margin-bottom: 3rem;
  flex: 1;
}

.premium-features-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-2);
  margin-bottom: 1rem;
}

.premium-features-list li svg {
  color: var(--gold);
  flex-shrink: 0;
}

.premium-social-proof {
  margin-top: 5rem;
  text-align: center;
}

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 3rem;
  opacity: 0.6;
  filter: grayscale(1);
  transition: all 0.3s;
}

.trust-badges:hover {
  opacity: 1;
  filter: grayscale(0);
}

/* Sound Toggle Switch */
.sound-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-2);
  padding: 0.4rem 0.8rem;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--surface-3);
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-2);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider { background-color: var(--gold); }
input:checked + .slider:before { transform: translateX(16px); background-color: #000; }

/* Dashboard Mini Cards Enhancement */
.dash-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-mini-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 700;
}

.dash-mini-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

/* --- New Trainer & Dashboard Enhancements --- */

.card-progress-container {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  margin-top: 0.75rem;
  overflow: hidden;
  position: relative;
}

.card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--gold-glow);
}

.hint-highlight {
  box-shadow: inset 0 0 0 4px var(--gold) !important;
  border-radius: var(--r-sm);
  transition: box-shadow 0.3s ease;
}

.hint-highlight-to {
  box-shadow: inset 0 0 0 4px var(--blue) !important;
  border-radius: var(--r-sm);
  transition: box-shadow 0.3s ease;
}

.trainer-feedback {
  padding: 1rem;
  border-radius: var(--r-md);
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
}

.trainer-feedback.correct {
  background: rgba(74,222,128,0.1);
  border: 1px solid var(--green);
  color: var(--green);
}

.trainer-feedback.incorrect {
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--red);
  color: var(--red);
}

/* Sorting Dropdown */
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F0C040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
/* ==========================================
   MASTERY STUDIO REDESIGN
   ========================================== */
.trainer-studio {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: radial-gradient(circle at 50% 50%, #0F0F15 0%, var(--bg) 100%);
  overflow: hidden;
}

/* Studio Header */
.studio-header {
  height: 70px;
  background: rgba(8, 8, 12, 0.6);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
}

.studio-header-left { display: flex; align-items: center; gap: 1.5rem; }
.header-divider { width: 1px; height: 30px; background: var(--border); }
.opening-breadcrumb { display: flex; flex-direction: column; }
.opening-name-small { font-size: 0.75rem; color: var(--text-3); text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.line-name-prominent { font-size: 1.15rem; font-weight: 700; color: var(--gold); }

.accuracy-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
}
.accuracy-badge .label { display: block; font-size: 0.65rem; color: var(--text-3); font-weight: 800; }
.accuracy-badge .value { font-size: 1.1rem; font-weight: 800; color: var(--green); font-family: var(--font-mono); }

/* Studio Layout Central */
.studio-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Evaluation Bar */
.eval-bar-wrap {
  width: 32px;
  height: 100%;
  background: #111;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-right: 1px solid var(--border);
}

.eval-bar {
  width: 100%;
  height: 100%;
  position: relative;
  background: #222;
}

.eval-fill {
  background: white;
  width: 100%;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  bottom: 0;
}

.eval-score {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-3);
  z-index: 2;
}

/* Board Area */
.board-column {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(0,0,0,0.2);
}

.board-wrapper {
  perspective: 1000px;
}

.board-container {
  width: 600px;
  max-width: 80vh;
  aspect-ratio: 1/1;
  border-radius: 8px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.8), 0 0 40px rgba(240,192,64,0.1);
  border: 4px solid var(--surface-3);
}

.turn-indicator {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  background: var(--surface-2);
  width: fit-content;
  margin-inline: auto;
  border: 1px solid var(--border);
}
.turn-indicator.your-turn { color: var(--green); border-color: var(--green-glow); box-shadow: 0 0 20px var(--green-glow); }
.turn-indicator.opponent-turn { color: var(--text-2); opacity: 0.6; }

/* Sidebar */
.studio-sidebar {
  width: 400px;
  background: rgba(13, 13, 18, 0.8);
  backdrop-filter: blur(30px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
}

.sidebar-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 1.25rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.progress-badge {
  background: var(--gold-glow);
  color: var(--gold);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
}

/* Move History */
.move-history-list {
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-right: 0.5rem;
}

.move-history-row {
  display: grid;
  grid-template-columns: 35px 1fr 1fr;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.01);
}
.move-num { color: var(--text-3); font-size: 0.8rem; font-family: var(--font-mono); }
.move-piece { font-weight: 700; color: var(--text-2); cursor: pointer; border-radius: 4px; padding: 2px 6px; }
.move-piece.current { background: var(--gold-glow); color: var(--gold); }
.move-piece:hover { color: var(--text); }

.history-placeholder {
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
  margin-top: 2rem;
  font-style: italic;
}

/* Guidance Bubble */
.king-bubble-glass {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
  position: relative;
}

/* Controls */
.sidebar-controls {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-row { display: flex; gap: 0.75rem; }
.control-row.secondary { flex-direction: column; gap: 0.5rem; }

.btn-glow:hover {
  box-shadow: 0 0 25px var(--gold-glow);
}

.trainer-feedback-minimal {
  font-size: 0.85rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  display: none;
}
.trainer-feedback-minimal.correct { color: var(--green); background: var(--green-glow); }
.trainer-feedback-minimal.incorrect { color: var(--red); background: var(--red-glow); animation: shake 0.4s ease; }

/* Theme Switcher */
.theme-switcher {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.theme-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface-3);
  transition: transform 0.2s, border-color 0.2s;
  background: #333;
}
.theme-dot.active { border-color: var(--gold); transform: scale(1.2); }
.theme-dot.gold { background: linear-gradient(135deg, #f0d9b5, #b58863); }
.theme-dot.midnight { background: linear-gradient(135deg, #2c3e50, #000); }
.theme-dot.wood { background: linear-gradient(135deg, #8b4513, #f5f5dc); }

/* Board Themes Classes */
.executive-theme .white-1e1d7 { background-color: #f0d9b5 !important; }
.executive-theme .black-3c85d { background-color: #b58863 !important; }

.midnight-theme .white-1e1d7 { background-color: #2c3e50 !important; }
.midnight-theme .black-3c85d { background-color: #000000 !important; }

.wood-theme .white-1e1d7 { background-color: #e6b38c !important; }
.wood-theme .black-3c85d { background-color: #7b4f3d !important; }

/* Completion Overlay */
.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-content {
  text-align: center;
  max-width: 500px;
  width: 90%;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.completion-stars { font-size: 3rem; margin-bottom: 1rem; }
.overlay-content h2 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--gold); }
.line-summary { color: var(--text-2); margin-bottom: 2.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-box {
  background: rgba(255,255,255,0.03);
  padding: 1.5rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-box .val { display: block; font-size: 1.75rem; font-weight: 800; color: var(--text); }
.stat-box .lab { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; font-weight: 700; margin-top: 0.5rem; }

/* ================================================
   MASTERY STUDIO — Premium 3-Panel Layout
   Inspired by ChessReps, elevated
   ================================================ */

.trainer-studio {
  display: flex;
  height: calc(100vh - 70px);
  background: #0d0d11;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* ---- LEFT PANEL: Line Navigator ---- */
.trainer-left-panel {
  width: 260px;
  flex-shrink: 0;
  background: #111116;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.back-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.back-icon-btn:hover { background: rgba(240,192,64,0.15); border-color: var(--gold); color: var(--gold); }

.left-panel-opening-info { flex: 1; min-width: 0; }
.left-panel-opening-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.left-panel-badges { display: flex; gap: 0.4rem; margin-top: 0.3rem; flex-wrap: wrap; }

.badge-tiny {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  text-transform: capitalize;
}
.side-badge { background: rgba(96,165,250,0.12); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.diff-badge { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }

.left-panel-progress {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.left-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.left-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffd700);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.left-progress-text { font-size: 0.7rem; color: var(--text-3); font-weight: 600; }

.line-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.line-list-scroll::-webkit-scrollbar { width: 3px; }
.line-list-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 100px; }

.line-list-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.line-list-item:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.line-list-item.active {
  background: rgba(240,192,64,0.08);
  border-left-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.line-list-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-3);
  transition: all 0.2s;
}
.line-list-num.mastered {
  background: rgba(34,197,94,0.15);
  border-color: #22c55e;
  color: #22c55e;
}
.line-list-item.active .line-list-num { border-color: var(--gold); color: var(--gold); }
.line-list-name { flex: 1; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- CENTER: Board Area ---- */
.trainer-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  gap: 0;
  min-width: 0;
}

.trainer-board-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 540px;
  margin-bottom: 0.75rem;
}

.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  transition: all 0.3s;
}
.turn-pill.opponent-turn {
  background: rgba(148,163,184,0.08);
  border-color: rgba(148,163,184,0.2);
  color: var(--text-3);
}

.topbar-actions { display: flex; gap: 0.5rem; }

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.topbar-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: var(--text-1); }

.trainer-board-main {
  width: 520px !important;
  height: 520px !important;
  min-width: 520px !important;
  border-radius: 6px !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06) !important;
  border: none !important;
  aspect-ratio: unset !important;
}

/* Chessboard.js inner board element sizing */
.trainer-board-main .board-b72b1 {
  width: 520px !important;
  height: 520px !important;
}

.trainer-board-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 540px;
  margin-top: 0.75rem;
}

.board-theme-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-row-label { font-size: 0.68rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.5px; margin-right: 0.25rem; }

.theme-sm {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.theme-sm:hover { transform: scale(1.2); }
.theme-sm.active { border-color: white; box-shadow: 0 0 0 1px rgba(255,255,255,0.3); }
.theme-sm.gold { background: linear-gradient(135deg, #f0c040, #b8860b); }
.theme-sm.midnight { background: linear-gradient(135deg, #2c3e50, #000); }
.theme-sm.wood { background: linear-gradient(135deg, #8b4513, #f5f5dc); }

.restart-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.restart-btn:hover { border-color: rgba(255,100,100,0.4); color: #fca5a5; }

/* ---- RIGHT PANEL ---- */
.trainer-right-panel {
  width: 280px;
  flex-shrink: 0;
  background: #111116;
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.trainer-right-panel::-webkit-scrollbar { width: 3px; }
.trainer-right-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 100px; }

.right-current-line {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(240,192,64,0.06) 0%, transparent 100%);
}
.rcl-label { font-size: 0.62rem; font-weight: 800; color: var(--gold); letter-spacing: 2px; opacity: 0.8; text-transform: uppercase; margin-bottom: 0.3rem; }
.rcl-name { font-size: 0.95rem; font-weight: 700; color: var(--text-1); line-height: 1.3; }

.right-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.right-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.rprogress-badge {
  background: rgba(240,192,64,0.15);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

.move-history-premium {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.move-history-premium::-webkit-scrollbar { width: 2px; }
.move-history-premium::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  color: var(--text-3);
  font-size: 0.78rem;
  text-align: center;
}
.history-empty p { margin: 0; opacity: 0.5; }

/* Override move-history-row for premium look */
.move-history-premium .move-history-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.move-history-premium .move-history-row:hover { background: rgba(255,255,255,0.04); }
.move-history-premium .move-num { font-size: 0.7rem; color: var(--text-3); font-weight: 600; }
.move-history-premium .move-piece {
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--text-2);
  cursor: default;
}
.move-history-premium .move-piece.current {
  background: rgba(240,192,64,0.15);
  color: var(--gold);
}

.coach-bubble {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.85rem;
}
.coach-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.coach-bubble p { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; margin: 0; font-style: italic; }

.right-hint-btn-wrap {
  padding: 1rem 1.25rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.hint-main-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 10px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.hint-main-btn:hover {
  background: rgba(240,192,64,0.2);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(240,192,64,0.15);
}

/* ---- COMPLETION OVERLAY ---- */
.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.completion-card {
  background: linear-gradient(135deg, #16161e 0%, #1e1e2a 100%);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 24px;
  padding: 3rem 3.5rem;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(240,192,64,0.1);
  animation: scaleIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.completion-emoji { font-size: 3.5rem; margin-bottom: 0.5rem; animation: bounceIn 0.6s ease; }
.completion-stars { font-size: 2rem; margin-bottom: 1rem; letter-spacing: 4px; }
.completion-title { font-size: 2rem; font-weight: 800; color: var(--gold); margin: 0 0 0.3rem; }
.completion-linename { color: var(--text-3); font-size: 0.9rem; margin-bottom: 2rem; }

.completion-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.cs-item { text-align: center; }
.cs-val { font-size: 1.6rem; font-weight: 800; color: var(--text-1); margin-bottom: 0.2rem; }
.cs-lab { font-size: 0.65rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; }
.cs-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.08); }

.completion-btns { display: flex; flex-direction: column; gap: 0.75rem; }

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }


.studio-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.board-header-internal {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
}

.opening-context-internal {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.opening-title-top {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 2px;
  opacity: 0.8;
}

.line-title-sub {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-1);
}

.line-selector-internal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dropdown-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 1px;
}

.line-dropdown-compact {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F0C040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  transition: all 0.2s;
  min-width: 200px;
}

.line-dropdown-compact:hover {
  border-color: var(--gold);
}

.board-column {
  flex-shrink: 0;
}

.studio-sidebar {
  width: 300px;
  height: auto;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(40px);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.sidebar-section {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.move-history-list {
  max-height: 180px;
  overflow-y: auto;
}

.sidebar-controls {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255,255,255,0.01);
}

.theme-switcher-studio {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ==========================================
   TRAINER PAGE — Premium Glowing Redesign
   ========================================== */

.trainer-page-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  height: calc(100vh - 56px);
  background: linear-gradient(145deg, #07070a 0%, #0d0d14 50%, #08080e 100%);
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  overflow: hidden;
}

.trainer-page-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(240,192,64,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(96,165,250,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* === LEFT PANEL === */
.trainer-left {
  background: rgba(12, 12, 18, 0.95);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.trainer-left-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.back-btn-glow {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, rgba(240,192,64,0.1) 0%, rgba(240,192,64,0.05) 100%);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.back-btn-glow:hover {
  background: linear-gradient(135deg, rgba(240,192,64,0.25) 0%, rgba(240,192,64,0.1) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(240,192,64,0.2);
  transform: scale(1.05);
}

.opening-info-badge {
  flex: 1;
  min-width: 0;
}

.opening-name-glow {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.badges-row-glow {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mini-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  text-transform: capitalize;
}

.mini-badge.badge-white { background: rgba(96,165,250,0.12); color: #60a5fa; border: 1px solid rgba(96,165,250,0.25); }
.mini-badge.badge-black { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.mini-badge.badge-difficulty { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }

.progress-section-glow {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.progress-label-glow {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.progress-pct-glow {
  color: var(--gold);
  font-weight: 800;
}

.progress-track-glow {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.progress-fill-glow {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffd700);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(240,192,64,0.4);
}

.progress-sub-glow {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 600;
}

.line-selector-glow {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.line-selector-header-glow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.current-line-num {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.7rem;
}

.line-list-glow {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem;
}

.line-list-glow::-webkit-scrollbar {
  width: 3px;
}

.line-list-glow::-webkit-scrollbar-track {
  background: transparent;
}

.line-list-glow::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
}

.line-list-glow .line-list-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-radius: 8px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
}

.line-list-glow .line-list-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-1);
}

.line-list-glow .line-list-item.active {
  background: linear-gradient(90deg, rgba(240,192,64,0.15) 0%, rgba(240,192,64,0.05) 100%);
  border-left-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.line-list-glow .line-list-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-3);
  transition: all 0.2s ease;
}

.line-list-glow .line-list-num.mastered {
  background: rgba(34,197,94,0.15);
  border-color: #22c55e;
  color: #22c55e;
}

.line-list-glow .line-list-item.active .line-list-num {
  border-color: var(--gold);
  color: var(--gold);
}
.line-list-glow .line-list-item.locked-line {
  opacity: 0.5;
  cursor: not-allowed;
}
.line-list-glow .line-list-item.locked-line:hover {
  opacity: 0.7;
}

.line-list-glow .line-list-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* === MAIN BOARD AREA === */
.trainer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.board-header-glow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  margin-bottom: 1rem;
}

.turn-indicator-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  transition: all 0.3s ease;
}

.turn-indicator-glow.opponent-turn {
  background: rgba(148,163,184,0.08);
  border-color: rgba(148,163,184,0.2);
  color: var(--text-3);
}

.turn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: turnPulse 1.5s infinite;
}

.turn-indicator-glow.opponent-turn .turn-dot {
  background: var(--text-3);
  animation: none;
}

@keyframes turnPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.board-actions-glow {
  display: flex;
  gap: 0.5rem;
}

.action-btn-glow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, rgba(240,192,64,0.15) 0%, rgba(240,192,64,0.05) 100%);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 10px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn-glow:hover {
  background: linear-gradient(135deg, rgba(240,192,64,0.25) 0%, rgba(240,192,64,0.1) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(240,192,64,0.2);
}

.action-btn-glow.secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-2);
}

.action-btn-glow.secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-1);
}

.board-wrapper-glow {
  position: relative;
}

.board-frame-glow {
  position: relative;
  padding: 8px;
  background: linear-gradient(135deg, rgba(240,192,64,0.2) 0%, rgba(240,192,64,0.05) 50%, rgba(96,165,250,0.1) 100%);
  border-radius: 12px;
  box-shadow: 
    0 25px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.06),
inset 0 0 30px rgba(240,192,64,0.05);
}

.board-container-glow {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
  position: relative;
  margin: 0 auto;
}

.board-reflection {
  position: absolute;
  bottom: -40px;
  left: 8px;
  right: 8px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
  border-radius: 0 0 10px 10px;
  filter: blur(8px);
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 768px) {
  .board-reflection { display: none; }
}

.board-footer-glow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 560px;
  margin-top: 1.25rem;
  padding: 0 0.5rem;
}

.theme-switcher-glow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.25rem;
}

.theme-dot-glow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-dot-glow:hover {
  transform: scale(1.2);
}

.theme-dot-glow.active {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.theme-dot-glow.gold { background: linear-gradient(135deg, #f0c040, #b8860b); }
.theme-dot-glow.midnight { background: linear-gradient(135deg, #2c3e50, #1a1a2e); }
.theme-dot-glow.wood { background: linear-gradient(135deg, #8b4513, #deb887); }

.restart-btn-glow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.restart-btn-glow:hover {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239,68,68,0.2);
}

.restart-btn-glow svg {
  stroke: #fca5a5;
}

.shortcuts-hint {
  font-size: 0.65rem;
  color: var(--text-3);
  opacity: 0.6;
}

.shortcuts-hint span {
  padding: 0.2rem 0.4rem;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* === RIGHT PANEL === */
.trainer-right {
  background: rgba(12, 12, 18, 0.95);
  border-left: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.trainer-right::-webkit-scrollbar {
  width: 3px;
}

.trainer-right::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
}

.current-line-card-glow {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(240,192,64,0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cl-label-glow {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  opacity: 0.9;
}

.cl-name-glow {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.cl-progress-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cl-progress-bar {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--gold);
  font-weight: 600;
}

.history-section-glow {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.section-header-glow {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.move-history-glow {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 120px;
}

.move-history-glow::-webkit-scrollbar {
  width: 2px;
}

.move-history-glow::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
}

.history-placeholder-glow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  color: var(--text-3);
  text-align: center;
}

.history-icon-glow {
  font-size: 1.5rem;
  opacity: 0.3;
}

.history-placeholder-glow p {
  font-size: 0.75rem;
  opacity: 0.5;
  margin: 0;
}

.move-history-glow .move-history-row {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.move-history-glow .move-history-row:hover {
  background: rgba(255,255,255,0.04);
}

.move-history-glow .move-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.move-history-glow .move-piece {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--text-2);
  cursor: default;
}

.move-history-glow .move-piece.current {
  background: rgba(240,192,64,0.15);
  color: var(--gold);
  font-weight: 700;
}

.coach-section-glow {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.coach-card-glow {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 0.85rem;
}

.coach-avatar-glow {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.coach-text-glow {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.hint-section-glow {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.hint-btn-glow {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, rgba(240,192,64,0.12) 0%, rgba(240,192,64,0.05) 100%);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 10px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hint-btn-glow:hover {
  background: linear-gradient(135deg, rgba(240,192,64,0.2) 0%, rgba(240,192,64,0.1) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 25px rgba(240,192,64,0.2);
}

.keyboard-hints-glow {
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.key-hint {
  font-size: 0.6rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.key-hint kbd {
  padding: 0.15rem 0.35rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
}

/* === COMPLETION CARD === */
.completion-card-glow {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(240,192,64,0.12) 0%, rgba(240,192,64,0.06) 100%);
  border: 1px solid rgba(240,192,64,0.25);
  border-radius: 12px;
  text-align: center;
}

.completion-header-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.completion-emoji-glow {
  font-size: 1.25rem;
}

.completion-title-text-glow {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.completion-stats-row-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.stat-item-glow {
  text-align: center;
  min-width: 50px;
}

.stat-value-glow {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 0.1rem;
}

.stat-value-glow.accent {
  color: var(--gold);
}

.stat-label-glow {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider-glow {
  width: 1px;
  height: 25px;
  background: rgba(255,255,255,0.1);
}

.completion-actions-glow {
  display: flex;
  gap: 0.5rem;
}

.completion-actions-glow .btn-gold-glow,
.completion-actions-glow .btn-ghost-glow {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  border-radius: 6px;
}

/* Make move pieces clickable */
.move-history-glow .move-piece.played {
  cursor: pointer;
  transition: all 0.15s ease;
}

.move-history-glow .move-piece.played:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-1);
}

.btn-gold-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  border: none;
  border-radius: 10px;
  color: #08080C;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-gold-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240,192,64,0.35);
}

.btn-gold-glow svg {
  transition: transform 0.2s ease;
}

.btn-gold-glow:hover svg {
  transform: translateX(4px);
}

.btn-ghost-glow {
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost-glow:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-1);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .trainer-page-wrapper {
    grid-template-columns: 240px 1fr 280px;
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .trainer-page-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    overflow-y: auto;
    padding-bottom: 4rem;
  }
  
  .trainer-left, .trainer-right {
    height: auto;
    max-height: 400px;
  }

  .trainer-main {
    padding: 1rem;
    order: -1; /* Board on top */
  }
  
  .trainer-left { order: 1; }
  .trainer-right { order: 2; }
}

@media (max-width: 768px) {
  .navbar-links {
    display: none; /* Hidden for mobile toggle */
  }
  
  .navbar-toggle {
    display: flex !important;
  }
  
  .opening-grid {
    grid-template-columns: 1fr;
  }
  
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dash-stats {
    grid-template-columns: 1fr;
  }
  
  .board-header-glow {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .board-actions-glow {
    width: 100%;
    justify-content: space-between;
  }
}

/* Board theme overrides */
.executive-theme .white-1e1d7 { background-color: #f0d9b5 !important; }
.executive-theme .black-3c85d { background-color: #b58863 !important; }

.midnight-theme .white-1e1d7 { background-color: #2c3e50 !important; }
.midnight-theme .black-3c85d { background-color: #0a0a12 !important; }

.wood-theme .white-1e1d7 { background-color: #e6b38c !important; }
.wood-theme .black-3c85d { background-color: #7b4f3d !important; }

.hidden {
  display: none !important;
}

/* ===== LEADERBOARD ===== */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}
.leaderboard-row:hover {
  background: var(--surface-2);
}
.leaderboard-row:last-child {
  border-bottom: none;
}
.leaderboard-rank {
  width: 32px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-2);
  text-align: center;
}
.top-1 .leaderboard-rank { color: #FFD700; font-size: 1.25rem; }
.top-2 .leaderboard-rank { color: #C0C0C0; font-size: 1.25rem; }
.top-3 .leaderboard-rank { color: #CD7F32; font-size: 1.25rem; }

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.leaderboard-avatar span {
  font-weight: 600;
  color: var(--gold);
  font-size: 1rem;
}

/* Mobile menu active state */
.navbar-links.mobile-active {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  gap: 1rem;
}

.navbar-links.mobile-active a {
  padding: 1rem;
  width: 100%;
  border-radius: 8px;
  background: var(--surface-2);
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-xp {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
}

.leaderboard-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-2);
}

@keyframes starPulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@media (min-width: 768px) {
  .shake {
    animation: shake 0.4s ease-in-out;
  }
}

@keyframes popIn {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  80% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes popOut {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* ==========================================
   CHESSGROUND-INSPIRED ENHANCED BOARD STYLES
   ========================================== */

/* SVG Overlay for arrows and circles */
.board-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

.board-svg-overlay line,
.board-svg-overlay polygon {
  pointer-events: none;
}

/* Circle drawing styles */
.board-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 85%;
  border: 4px solid;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 8px currentColor;
  animation: circlePulse 0.3s ease-out;
}

@keyframes circlePulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Circle mode cursor indicator */
.board-container.circle-mode {
  cursor: crosshair;
}

.board-container.circle-mode .square-55d63:hover {
  box-shadow: inset 0 0 0 3px rgba(100, 200, 255, 0.5);
}

/* Premove highlighting */
.square-55d63.premove-from {
  box-shadow: inset 0 0 0 4px rgba(170, 0, 255, 0.6) !important;
}

.square-55d63.premove-to {
  background: rgba(170, 0, 255, 0.2) !important;
}

.square-55d63.premove-dest::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  background: rgba(170, 0, 255, 0.35);
  border: 2px solid rgba(170, 0, 255, 0.5);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

/* Premove arrow style */
.premove-arrow line {
  stroke-dasharray: 4, 2;
  animation: dashFlow 1s linear infinite;
}

@keyframes dashFlow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 6; }
}

/* Enhanced hover effects */
.square-55d63.hover-square {
  box-shadow: inset 0 0 0 2px rgba(240, 192, 64, 0.4);
}

/* Enhanced legal move dots */
.square-55d63.legal-move::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background: rgba(100, 110, 64, 0.5);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  transition: transform 0.15s ease, background 0.15s ease;
}

.square-55d63.legal-move:hover::after {
  transform: translate(-50%, -50%) scale(1.2);
  background: rgba(100, 110, 64, 0.7);
}

/* Enhanced capture move rings */
.square-55d63.capture-move::after {
  content: '';
  position: absolute;
  width: 82px;
  height: 82px;
  border: 4px solid rgba(100, 110, 64, 0.55);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.square-55d63.capture-move:hover::after {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: rgba(100, 110, 64, 0.8);
}

/* Piece ghost during drag */
.piece-ghost {
  pointer-events: none;
  z-index: 1000;
  transition: none;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* Arrow styles */
.temp-arrow {
  opacity: 0.7;
  animation: fadeIn 0.15s ease;
}

.board-arrow {
  animation: arrowAppear 0.2s ease-out;
}

@keyframes arrowAppear {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* SVG arrow specific styles */
.board-svg-overlay .board-arrow line {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.board-svg-overlay .board-arrow polygon {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* ==========================================
   CHESSGROUND BOARD STYLES (Lichess Theme)
   ========================================== */
.cg-wrap {
  width: 100% !important;
  height: 100% !important;
}

.cg-wrap cg-board {
  --cg-main: #161512;
  --cg-alt: #262421;
}

.cg-wrap cg-board square.last-move {
  background: rgba(255, 214, 0, 0.45) !important;
}

.cg-wrap cg-board square.selected {
  background: rgba(30, 136, 229, 0.5) !important;
}

.cg-wrap cg-board square.check {
  background: radial-gradient(ellipse at center, rgba(229, 57, 53, 0.9) 0%, rgba(229, 57, 53, 0.4) 25%, transparent 89%) !important;
}

.cg-wrap piece.dragging {
  z-index: 100;
}

.cg-wrap piece.ghost {
  opacity: 0.4;
}

.cg-wrap coords {
  color: rgba(240, 192, 64, 0.6);
}

.cg-wrap coord {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
}

/* Move destination dots */
.cg-wrap .move-dest {
  background: rgba(30, 136, 229, 0.35);
}

.cg-wrap .capture-dest {
  background: rgba(229, 57, 53, 0.45);
}

/* Piece animations */
.cg-piece {
  transition: transform 0.15s ease-out;
}

/* Board container for chessground */
#cg-board {
  width: 100%;
  height: 100%;
}

.board-container.cg-board {
  border: none;
  box-shadow: none;
}

/* Power User Board Features */
.square-55d63.highlight-red {
  background-color: rgba(252, 105, 85, 0.95) !important;
}

.board-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Achievements Gallery */
.achievements-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.badge-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.badge-card.earned {
  border-color: var(--gold-dark);
  background: linear-gradient(135deg, rgba(240,192,64,0.05) 0%, var(--surface-2) 100%);
}

.badge-card.locked {
  opacity: 0.6;
  filter: grayscale(1);
}

.badge-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.badge-icon-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  background: var(--surface-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.badge-card.earned .badge-icon-wrapper {
  background: rgba(240,192,64,0.15);
  box-shadow: 0 0 20px rgba(240,192,64,0.2);
}

.badge-check {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--green);
  color: #111;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  border: 2px solid var(--surface-2);
}

.badge-info {
  flex: 1;
}

.badge-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.badge-card.earned .badge-title {
  color: var(--gold);
}

.badge-description {
  font-size: 0.85rem;
  color: var(--text-3);
  line-height: 1.4;
}

/* Badge Unlock Popup */
.badge-unlock-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: var(--r-xl);
  padding: 2rem;
  width: 320px;
  z-index: 10000;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  animation: slideInRight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.badge-unlock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(240,192,64,0.4));
}

.badge-unlock-title {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.badge-unlock-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.badge-unlock-desc {
  font-size: 0.9rem;
  color: var(--text-2);
}
