:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #12161f;
  --bg-card: rgba(22, 28, 40, 0.75);
  --bg-card-hover: rgba(28, 36, 52, 0.85);
  --border-color: rgba(212, 175, 55, 0.2);
  --border-glow: rgba(212, 175, 55, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --gold-primary: #d4af37;
  --gold-light: #fbbf24;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d4af37 50%, #fef08a 100%);
  --crimson-primary: #e11d48;
  --crimson-glow: rgba(225, 29, 72, 0.35);
  --blue-accent: #38bdf8;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px -5px rgba(212, 175, 55, 0.25);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(225, 29, 72, 0.08) 0%, transparent 45%),
    linear-gradient(to bottom, #0a0c10, #0f131a);
}

/* Background grid */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Header & Nav */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 0;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #881337 0%, #e11d48 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 15px rgba(225, 29, 72, 0.5);
}

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

.logo-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px var(--crimson-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(225, 29, 72, 0.5);
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #b49126 100%);
  color: #0a0c10;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.3);
  font-weight: 700;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, #fbbf24 0%, #d4af37 100%);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* Hero Section */
.hero-section {
  padding: 80px 0 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
}

.hero-title .highlight {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item h3 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-item p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Hero Visual / Chess Showcase Card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #10b981;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.board-preview-box {
  width: 100%;
  aspect-ratio: 830 / 920;
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  position: relative;
  background-image: url('assets/board/wood_grain.png');
  background-size: cover;
  background-position: center;
  border: 3px solid #8d5b28;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.showcase-board-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.river-text {
  fill: #5a3d1e;
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif, var(--font-sans);
  font-size: 34px;
  font-weight: 700;
  opacity: 0.7;
  letter-spacing: 14px;
  user-select: none;
}

.board-lines path {
  stroke: #5a3d1e;
  stroke-width: 2.2;
  fill: none;
}

.board-markers {
  stroke: #5a3d1e;
  stroke-width: 1.8;
  fill: none;
  opacity: 0.75;
}

.board-piece {
  cursor: pointer;
}

.board-piece image {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.board-piece:hover image {
  transform: scale(1.08);
}

.ai-evaluation-bar {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-eval-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.ai-meter {
  height: 8px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.ai-meter-fill {
  height: 100%;
  width: 62%;
  background: linear-gradient(90deg, #e11d48, #d4af37);
  border-radius: 999px;
}

/* Features Section */
.section {
  padding: 100px 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 60px;
}

.section-tag {
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.25;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--gold-light);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 700;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* AI Engine Showcase */
.ai-showcase {
  background: linear-gradient(180deg, rgba(18, 22, 31, 0.8) 0%, rgba(10, 12, 16, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  margin: 40px 0;
  box-shadow: var(--shadow-card);
}

.ai-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.tech-spec-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.tech-spec-item {
  display: flex;
  gap: 16px;
}

.tech-spec-item span.icon {
  font-size: 22px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.tech-spec-item strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tech-spec-item p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Code / Tactical Review Preview Box */
.terminal-box {
  background: #090b0e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.terminal-header {
  background: #141820;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.terminal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
}

.terminal-highlight {
  color: var(--gold-light);
}

.terminal-comment {
  color: #38bdf8;
}

/* Game Variants Section */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.mode-card:hover {
  border-color: var(--gold-primary);
  transform: translateY(-4px);
}

.mode-piece {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.mode-piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mode-card h4 {
  font-size: 18px;
  margin-bottom: 8px;
}

.mode-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* CTA Bottom Section */
.cta-banner {
  background: radial-gradient(circle at center, rgba(225, 29, 72, 0.25) 0%, rgba(10, 12, 16, 0.9) 70%),
              linear-gradient(135deg, #181d28 0%, #10131a 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.cta-banner h2 {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-banner p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* Footer */
footer.site-footer {
  background: #07080b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 60px 0 32px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h5 {
  font-size: 14px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Legal / Privacy Page Specific */
.legal-container {
  max-width: 860px;
  margin: 40px auto 80px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.legal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.legal-header h1 {
  font-size: 34px;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.legal-body section {
  margin-bottom: 32px;
}

.legal-body h2 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.legal-body p, .legal-body li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-body ul {
  padding-left: 20px;
  margin: 12px 0;
}

.legal-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-light);
}

/* Responsive */
@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-tag {
    margin: 0 auto;
  }
  .hero-buttons {
    justify-content: center;
  }
  .hero-title {
    font-size: 40px;
  }
  .ai-showcase-grid {
    grid-template-columns: 1fr;
  }
  .modes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 32px;
  }
  .modes-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
