:root {
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-card: rgba(30, 41, 59, 0.5);
  --danger: #f43f5e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ===================================================
   TOP NAVIGATION BAR
=================================================== */
#site-nav {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.nav-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.nav-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.btn-nav-action {
  background: var(--accent);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.btn-nav-action:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ===================================================
   ARTICLE & CONTENT LAYOUT
=================================================== */
.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-header {
  margin-bottom: 36px;
  text-align: left;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.article-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 14px;
  color: #fff;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-body {
  font-size: 1.05rem;
  color: #cbd5e1;
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 28px 0 12px;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.article-body li {
  margin-bottom: 10px;
}

.article-body strong {
  color: #fff;
}

/* Moves Code Block */
.moves-banner {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.moves-banner .moves-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
}

.moves-banner code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  color: #f8fafc;
}

/* Highlight & Strategy Cards */
.callout-card {
  background: var(--glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.callout-card.tip {
  border-left: 4px solid #10b981;
}

.callout-card.warning {
  border-left: 4px solid #f59e0b;
}

.callout-card.tactics {
  border-left: 4px solid var(--accent);
}

.callout-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Feature/Variation Grid */
.variation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.variation-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.variation-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
}

.variation-card h4 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
}

.variation-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* In-Article Ad Container */
.ad-article-slot {
  margin: 36px 0;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  text-align: center;
}

.ad-slot-label {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 10px;
}

/* Play Now CTA Box at bottom of articles */
.play-cta-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 32px;
  margin-top: 50px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.play-cta-box h3 {
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 10px;
}

.play-cta-box p {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 24px;
}

.btn-cta-play {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0f172a;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.35);
}

.btn-cta-play:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.5);
}

/* ===================================================
   DIRECTORY / HUB GRID PAGES
=================================================== */
.directory-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 40px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.directory-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.directory-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.directory-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.directory-card-tag {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.directory-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.directory-card-moves {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 12px;
  display: inline-block;
}

.directory-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.directory-card-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================
   FOOTER
=================================================== */
#site-footer {
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--glass-border);
  padding: 48px 24px 24px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.footer-brand-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
}

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

.footer-nav-col h5 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 12px;
}

.footer-nav-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.footer-nav-col a:hover {
  color: var(--accent);
}

.footer-bottom-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .content-wrapper {
    padding: 24px 16px 60px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-nav-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

/* ===================================================
   VISUAL CHESSBOARD DIAGRAMS & STUDY MODULES
=================================================== */
.diagram-wrap {
  margin: 32px auto;
  max-width: 380px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.diagram-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
}

.sq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 4.2vw, 1.95rem);
  line-height: 1;
  position: relative;
}

.sq.light {
  background-color: #dee3e6;
}

.sq.dark {
  background-color: #8ca2ad;
}

.sq .p-w {
  color: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 1px #000);
}

.sq .p-b {
  color: #1e1b18;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.4));
}

.sq.highlight-move {
  box-shadow: inset 0 0 0 3px #38bdf8;
}

.sq.highlight-target {
  background-color: rgba(244, 63, 94, 0.7) !important;
}

.diagram-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
  line-height: 1.4;
}

/* Strategy & Plans Table */
.strategy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--glass-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.strategy-table th, .strategy-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.strategy-table th {
  color: var(--accent);
  background: rgba(15, 23, 42, 0.85);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.strategy-table td {
  color: #cbd5e1;
  font-size: 0.95rem;
  vertical-align: top;
}

/* Master Game Study Box */
.game-study-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 28px 0;
}

.game-study-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.game-study-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.game-study-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
}

