:root {
  /* Core palette */
  --primary-blue: #2d8cff;
  --primary-blue-dark: #1A7CF2;
  --primary-blue-light: #E6F0FF;
  --light-blue: #5AA5FF;

  --white: #FFFFFF;
  --light-gray: #F5F5F5;
  --medium-gray: #E0E0E0;
  --dark-gray: #757575;
  --black: #000000;

  /* Aliases to minimize refactors */
  --blue: var(--primary-blue);
  --bg: #F3F4F6;
  --muted: var(--dark-gray);
  --card: var(--white);
  --border: var(--medium-gray);
}

/* While auth gate is checking login, keep content hidden to avoid flicker */
html.auth-checking body {
  visibility: hidden;
}

/* Global auth modal (login/signup prompt) */
.cg-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cg-auth-modal.hidden {
  display: none;
}

.cg-auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.cg-auth-modal-dialog {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 24px 24px 20px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
  z-index: 1;
}

.cg-auth-modal-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.cg-auth-modal-text {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.cg-auth-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.cg-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.cg-auth-btn.primary {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.cg-auth-btn.secondary {
  background: transparent;
  color: var(--primary-blue);
  border-color: rgba(45, 140, 255, 0.4);
}

.cg-auth-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

body {
  background: radial-gradient(circle at top left, rgba(45, 140, 255, 0.09) 0, transparent 45%), var(--bg);
  color: var(--black);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.hero {
  background: radial-gradient(circle at top right, rgba(45, 140, 255, 0.12) 0, transparent 55%), var(--white);
  border-bottom: 1px solid rgba(224, 224, 224, 0.7);
  padding: 80px 0 60px;
}

.hero.hero-learn {
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.14) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-bottom: none;
  padding: 96px 0 72px;
}

.hero .headline {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  color: var(--black);
}

.hero .subtitle {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 26px;
  line-height: 1.7;
  max-width: 640px;
}

.hero.hero-learn .subtitle {
  max-width: 640px;
}

.cta-row .btn,
.btn,
.btn-blue,
.btn-green,
.btn-outline {
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 1rem;
  background: var(--primary-blue);
  color: var(--white);
  border: 1px solid var(--primary-blue);
  transition: background-color 0.2s ease;
}

.cta-row .btn:hover,
.btn:hover,
.btn-blue:hover,
.btn-green:hover,
.btn-outline:hover {
  background: var(--primary-blue-dark);
  border-color: var(--primary-blue-dark);
  color: var(--white);
}

/* Make outline-secondary buttons look visually distinct (used by Variation/Annotation toggles) */
.btn.btn-outline-secondary {
  background-color: #ffffff;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn.btn-outline-secondary:hover {
  background-color: rgba(13, 110, 253, 0.08);
  color: var(--primary-blue-dark);
  border-color: var(--primary-blue-dark);
}

.btn.disabled,
.btn:disabled,
.disabled {
  background: var(--medium-gray) !important;
  border-color: var(--medium-gray) !important;
  color: var(--black) !important;
  opacity: 1 !important;
}

.hero-board {
  aspect-ratio: 1/1;
  background: transparent;
  border-radius: 0;
  border: 0;
  overflow: hidden;
}

.hero-board iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Social page featured video */
.social-video-wrapper {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 18px 22px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.social-video-frame {
  border-radius: 14px;
  overflow: hidden;
}

.nav-card {
  border: 1px solid rgba(224, 224, 224, 0.9);
  border-radius: 18px;
  background: var(--card);
  height: 100%;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav-card:hover {
  border-color: rgba(45, 140, 255, 0.9);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
  transform: translateY(-3px);
}

.nav-card .nav-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  color: var(--white);
  font-size: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.nav-card .nav-card-icon { background: var(--primary-blue); }

.nav-card .nav-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--black);
}

.nav-card .nav-card-text {
  color: var(--muted);
  flex-grow: 1;
  line-height: 1.6;
}

.section-title {
  color: var(--black);
  margin-bottom: 20px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.01em;
}

main.container {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.features-section {
  padding: 40px 0 32px;
}

.home-overview {
  background: var(--white);
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.12);
  padding: 30px 26px;
  box-shadow: 0 16px 36px rgba(26, 124, 242, 0.12);
}

.home-overview .section-title {
  margin-bottom: 16px;
}

.home-overview ul li strong {
  color: var(--black);
}

.feature-icon {
  font-size: 2.25rem;
  margin-bottom: 12px;
  color: var(--primary-blue);
}

/* Homepage audience + FAQ sections */
.home-audience {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.10);
  padding: 26px 24px;
}

.home-audience .section-title {
  text-align: left;
  margin-bottom: 12px;
}

.home-audience h5 {
  font-weight: 700;
  margin-bottom: 6px;
}

.home-audience p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.home-faq {
  background: #f8fafc;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 26px 24px;
}

.home-faq .section-title {
  margin-bottom: 18px;
}

.home-faq h5 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 4px;
}

.home-faq p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 8px;
}

.hero-badge .badge {
  background: var(--primary-blue) !important;
  border-radius: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Minimal pill using core palette */
.pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

/* Minimal sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.site-header .navbar-brand {
  font-weight: 800;
  color: var(--black);
  letter-spacing: .2px;
}

.brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 8px;
  background: var(--primary-blue);
}

.site-header .nav-link {
  color: var(--black);
  font-weight: 600;
  opacity: .8;
}

.site-header .nav-link:hover {
  opacity: 1;
}

.site-header .btn-cta {
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
}

.navbar-toggler {
  border: 1px solid rgba(45, 140, 255, 0.35);
  border-radius: 14px;
  width: 46px;
  height: 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(45, 140, 255, 0.08);
  transition: all 0.2s ease;
}

.navbar-toggler:focus,
.navbar-toggler:hover {
  border-color: var(--primary-blue);
  background: rgba(45, 140, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.15);
  outline: none;
}

.navbar-toggler .toggler-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-blue);
  border-radius: 999px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.navbar-toggler .toggler-line + .toggler-line {
  margin-top: 0;
}

.navbar-toggler[aria-expanded="true"] .toggler-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .toggler-line:nth-child(2) {
  opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .toggler-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 56px 0 0;
  color: var(--dark-gray);
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.site-footer .footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 48px;
}

.footer-brand .logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--black);
}

.footer-description {
  color: var(--dark-gray);
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-social .social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--dark-gray);
  text-decoration: none;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
}

.footer-social .social-link:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 14px rgba(8, 47, 73, 0.08);
}

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

.footer-column h6,
.footer-newsletter h6 {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: .3px;
  color: var(--black);
  margin-bottom: 16px;
}

.footer-link {
  display: block;
  color: var(--dark-gray);
  text-decoration: none;
  margin: 6px 0;
  transition: color 0.2s ease;
}

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

.footer-newsletter .newsletter-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.newsletter-input {
  position: relative;
  flex: 1 1 auto;
}

.newsletter-input i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-gray);
  font-size: 1rem;
}

.newsletter-input .form-control {
  padding-left: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  height: 46px;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-input .form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.footer-newsletter .btn {
  border-radius: 999px;
  padding: 0 20px;
  height: 46px;
}

.form-note {
  color: rgba(15, 23, 42, 0.6);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 0;
  margin-top: 48px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.footer-bottom small {
  color: rgba(15, 23, 42, 0.65);
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-meta .separator {
  color: rgba(15, 23, 42, 0.25);
}

@media (max-width: 991.98px) {
  .site-footer .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-newsletter .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-newsletter .btn {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .footer-links {
    grid-template-columns: 1fr;
  }

  .footer-social {
    gap: 10px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-meta {
    gap: 8px;
  }
}

/* ==============================
   Learn Page (learn/index.html)
   ============================== */
.back-to-main {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}

.back-to-main:hover {
  color: var(--primary-blue-dark);
  text-decoration: none;
}


.learn-benefits {
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 48px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}

.learn-benefits .section-title {
  font-weight: 700;
  font-size: 1.5rem;
}

.section-subtitle {
  color: var(--muted);
  max-width: 520px;
  margin: 12px auto 0 auto;
}

.benefit-card {
  position: relative;
  background: radial-gradient(circle at top, rgba(45, 140, 255, 0.18) 0%, rgba(255, 255, 255, 1) 58%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px 28px 18px 18px;
  padding: 32px 26px 28px 26px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%;
  overflow: hidden;
}

.benefit-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 36px 36px 22px 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.benefit-card:hover {
  transform: translateY(-6px);
  border-color: rgba(26, 124, 242, 0.45);
  box-shadow: 0 18px 44px rgba(26, 124, 242, 0.22);
}

.benefit-card:hover::after {
  opacity: 1;
}

.benefit-card h5 {
  font-weight: 700;
  margin-bottom: 10px;
}

.benefit-card p {
  color: var(--muted);
  margin: 0;
}

.benefit-icon {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  margin: 0 auto 20px auto;
  font-size: 1.6rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
  box-shadow: 0 10px 20px rgba(26, 124, 242, 0.25);
}

.benefit-icon-badge {
  position: absolute;
  bottom: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary-blue);
  font-size: 0.85rem;
  box-shadow: 0 8px 18px rgba(45, 140, 255, 0.2);
}

.benefit-icon-lightbulb {
  background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
}

.benefit-icon-lightbulb .benefit-icon-badge {
  color: var(--primary-blue);
}

.benefit-icon-target {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
}

.benefit-icon-target .benefit-icon-badge {
  color: var(--primary-blue-dark);
}

.benefit-icon-strategy {
  background: var(--primary-blue);
}

.benefit-icon-strategy .benefit-icon-badge {
  color: var(--light-blue);
}

.learning-card.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.learning-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 28px;
  color: var(--white);
  margin: 0 auto 16px auto;
  flex-shrink: 0;
  background: var(--primary-blue);
}

.learning-card.card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-blue);
  box-shadow: 0 18px 40px rgba(8, 47, 73, 0.15);
}

.learn-grid a:hover .learning-icon {
  background: var(--primary-blue-dark);
}

.learning-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
}

.learning-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  .hero.hero-learn {
    padding: 72px 0 56px;
  }

  .learn-benefits {
    padding: 28px;
  }
}

.breadcrumb-nav {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  margin-bottom: 24px;
}

.nav-pills .nav-link {
  border-radius: 8px;
  padding: 8px 16px;
}

.nav-pills .nav-link.active {
  background: var(--primary-blue);
  color: var(--white);
}

.progress .progress-bar {
  background-color: var(--primary-blue);
}

/* ==============================
   Openings Page (learn/openings/index.html)
   ============================== */
.openings-header {
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.18) 0%, rgba(255, 255, 255, 0.9) 100%);
  color: var(--black);
  padding: 48px 32px;
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.25);
  text-align: center;
  margin-bottom: 40px;
  box-shadow: 0 18px 44px rgba(26, 124, 242, 0.12);
  position: relative;
  overflow: hidden;
}

.openings-header::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  top: -120px;
  right: -80px;
  filter: blur(0.5px);
}

.openings-header .headline {
  font-size: 2.5rem;
}

.repertoire-hero {
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.14) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.18);
  padding: 32px 28px 28px;
  box-shadow: 0 18px 44px rgba(26, 124, 242, 0.14);
}

.repertoire-hero .headline {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.repertoire-hero .subtitle {
  max-width: 640px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(45, 140, 255, 0.1);
  color: var(--primary-blue);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.open-games-hero {
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.14) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1px solid rgba(45, 140, 255, 0.2);
  border-radius: 24px;
  padding: 48px 32px;
  box-shadow: 0 16px 40px rgba(26, 124, 242, 0.12);
}

.open-games-overview .open-games-card {
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.14);
  box-shadow: 0 12px 32px rgba(26, 124, 242, 0.1);
}

.open-games-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.open-games-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.open-games-list i {
  color: var(--primary-blue);
}

.open-games-structure,
.openings-structure {
  position: relative;
}

.structure-group {
  background: var(--white);
  border: 1px solid rgba(45, 140, 255, 0.15);
  border-radius: 24px;
  padding: 28px 26px;
  box-shadow: 0 14px 32px rgba(26, 124, 242, 0.1);
}

.structure-header {
  margin-bottom: 20px;
}

.structure-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(45, 140, 255, 0.12);
  color: var(--primary-blue);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.structure-title {
  margin-top: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--black);
}

.structure-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.structure-links li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 600;
}

.structure-links li a:hover {
  text-decoration: underline;
}

.open-games-roadmap,
.openings-roadmap {
  background: var(--white);
  border-radius: 28px;
  border: 1px solid rgba(45, 140, 255, 0.18);
  padding: 40px 32px;
  box-shadow: 0 20px 48px rgba(26, 124, 242, 0.1);
}

.roadmap-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.roadmap-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 16px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
}

.step-content h4 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--black);
}

.step-content p {
  margin: 0;
  color: var(--muted);
}

.open-games-roadmap .section-title,
.openings-roadmap .section-title {
  font-size: 1.5rem;
}

.open-games-roadmap .section-subtitle,
.openings-roadmap .section-subtitle {
  margin-bottom: 24px;
}

.preview-card.btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 999px;
}

.open-games-families .section-header {
  margin-bottom: 32px;
}

.manager-overview .open-games-card {
  border: 1px solid rgba(45, 140, 255, 0.15);
}

.badge-coming {
  background: #ffe9a8;
  color: #946200;
  font-weight: 600;
}

.open-games-grid .opening-card {
  border-radius: 20px;
}

.open-games-grid .opening-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

/* Opening variation viewer pages */
.variation-card {
  border: 1px solid rgba(45, 140, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(26, 124, 242, 0.12);
}

.variation-card .card-move-list {
  max-height: 520px;
  overflow: auto;
}

.board-frame {
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.board-iframe {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border: 0;
  background: transparent;
}

.board-frame.board-frame-loading .board-iframe {
  visibility: hidden;
}

/* ==============================
   Puzzles Page (learn/puzzles)
   ============================== */
.puzzle-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.puzzle-card .card-body {
  padding: 18px 18px 20px;
}

.puzzle-theme-filter {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.puzzle-theme-label span {
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.puzzle-theme-select select {
  min-width: 140px;
  max-width: 190px;
}

.puzzle-difficulty-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.puzzle-difficulty-filter select {
  min-width: 120px;
  max-width: 160px;
}

@media (max-width: 575.98px) {
  .puzzle-theme-select select,
  .puzzle-difficulty-filter select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

.puzzle-meta .badge {
  border-radius: 6px;
  font-weight: 600;
}

.puzzle-meta .badge.bg-secondary {
  background: var(--primary-blue) !important;
}

.puzzle-meta .badge.bg-light {
  background: var(--primary-blue-light) !important;
  color: var(--primary-blue) !important;
}

.puzzle-check-row {
  margin-top: 2px;
}

#pzCheckIcon i {
  font-size: 1.3rem;
  vertical-align: -1px;
}

@media (min-width: 992px) {
  /* Align puzzle card and board tops on desktop */
  .puzzles-board-col {
    margin-top: 8px;
  }

  .puzzle-card {
    margin-top: 0;
  }
}

.puzzle-card #pzTitle {
  margin-top: 0;
}

.move-toolbar .btn {
  min-width: 32px;
  border-radius: 6px;
  border-color: rgba(45, 140, 255, 0.25);
  color: var(--primary-blue);
  background: rgba(45, 140, 255, 0.08);
  transition: all 0.2s ease;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.move-toolbar .btn:hover,
.move-toolbar .btn:focus {
  color: var(--white);
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.move-toolbar .mv-status {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.move-table {
  display: grid;
  grid-auto-rows: auto;
  row-gap: 6px;
}

.move-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  column-gap: 6px;
  align-items: center;
}

.move-num {
  text-align: right;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.move-chip {
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(45, 140, 255, 0.12);
  color: var(--primary-blue);
  background: rgba(45, 140, 255, 0.08);
  font-size: 0.85rem;
}

.move-chip.btn-primary {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: var(--white);
}

.openings-overview .card {
  border-radius: 24px;
  border: 1px solid rgba(45, 140, 255, 0.15);
  box-shadow: 0 12px 32px rgba(26, 124, 242, 0.1);
}

.openings-principles,
.openings-importance {
  border: 1px solid rgba(45, 140, 255, 0.15);
  background: var(--white);
  border-radius: 24px;
}

.openings-principles ul li,
.openings-importance p {
  color: var(--muted);
}

.openings-families {
  position: relative;
  margin-top: 3rem; /* clear, breathable gap below the roadmap section */
  padding: 32px 24px 28px; /* give the header and grid breathing room inside the glow */
}

.openings-families::before {
  content: "";
  position: absolute;
  /* start the soft glow a bit lower so it never visually touches the roadmap above */
  top: 12px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border-radius: 28px;
  background: rgba(45, 140, 255, 0.08);
  z-index: -1;
}

.openings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 12px; /* gentle space below the subtitle before cards start */
}

/* Tighter, centered header layout just for Explore the Opening Families */
.openings-families .section-header {
  margin-bottom: 1.75rem;
}

.openings-families .section-subtitle {
  max-width: 640px;
  margin-top: 8px;
}

.opening-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  height: 100%;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.opening-card .card-body { padding: 24px; }

.opening-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(26, 124, 242, 0.16);
}

.opening-card:hover .click-indicator {
  opacity: 1;
  transform: translateX(0);
}

.opening-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--white);
  margin-bottom: 16px;
  background: var(--primary-blue);
  box-shadow: 0 10px 20px rgba(26, 124, 242, 0.25);
}

.opening-icon-piece .piece-symbol {
  font-size: 26px;
  line-height: 1;
}

.opening-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--dark-gray);
  margin-bottom: 8px;
}

.opening-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
  line-height: 1.3;
}

.opening-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Generic ChessGyan modal shell (used on profile delete confirm, etc.) */
.cg-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
}

.cg-modal-backdrop.show {
  display: flex;
}

.cg-modal-shell {
  background: #ffffff;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.35);
  padding: 20px 22px 18px;
}

.click-indicator {
  position: absolute;
  bottom: 16px;
  right: 16px;
  color: var(--dark-gray);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.famous-game-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--white);
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.famous-game-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(26, 124, 242, 0.14);
}

.famous-game-card h3 {
  font-weight: 700;
}

.famous-game-card p {
  line-height: 1.5;
}
