:root {
  --bg-dark: #080706;
  --panel-bg: rgba(22, 20, 18, 0.45);
  --panel-border: rgba(255, 255, 255, 0.05);
  --gold-accent: #e2b13c;
  --gold-hover: #ffd670;
  --text-main: #fdfbf7;
  --text-muted: #8a8883;
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  --font-sans: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Cinematic Effects */
.background-glow {
  position: absolute;
  top: 15%;
  left: 30%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(226, 177, 60, 0.05) 0%, transparent 70%);
  z-index: -2;
  pointer-events: none;
}

/* Floating Chess piece animations */
.decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.float-piece {
  position: absolute;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.012);
  animation: floatSlow 20s infinite linear;
  user-select: none;
}

.p1 { top: 12%; left: 8%; animation-duration: 22s; }
.p2 { top: 70%; left: 15%; animation-duration: 30s; font-size: 6rem; }
.p3 { top: 25%; right: 10%; animation-duration: 25s; }
.p4 { top: 75%; right: 20%; animation-duration: 35s; font-size: 7rem; }
.p5 { top: 45%; left: 45%; animation-duration: 28s; }

@keyframes floatSlow {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* Base Wrapper Container */
.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-shield {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #c59b27 0%, #e2b13c 100%);
  color: #080706;
  font-size: 1.4rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(226, 177, 60, 0.2);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(to right, #fff 40%, var(--gold-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav Links */
.nav-links {
  display: flex;
  gap: 32px;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.nav-item:hover {
  color: var(--gold-accent);
}

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

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  padding: 6px 12px;
  border-radius: 20px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #e74c3c;
  box-shadow: 0 0 8px #e74c3c;
  transition: all 0.3s;
}

.status-dot.connected {
  background-color: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.status-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Split Hero Section */
.hero-split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  padding: 56px 0;
  align-items: center;
  flex: 1;
}

.badge-new {
  display: inline-block;
  background: rgba(226, 177, 60, 0.1);
  border: 1px solid rgba(226, 177, 60, 0.2);
  color: var(--gold-accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
  color: var(--text-main);
}

.hero-title span {
  color: var(--gold-accent);
  font-style: italic;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 520px;
}

/* Stats and Mini-board stacked */
.hero-stats-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: rgba(226, 177, 60, 0.2);
  transform: translateY(-2px);
}

.stat-num {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

/* Chessboard Visualizer Mockup style */
.hero-board-preview {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(226, 177, 60, 0.2);
}

.mini-sq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 600;
}

.mini-sq.l { background: #ece9e0; color: #181715; }
.mini-sq.d { background: #7d8796; color: #181715; }

.mini-board-caption {
  font-size: 0.64rem;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-top: 12px;
  text-shadow: 0 0 8px rgba(226, 177, 60, 0.35);
}

/* Settings Console Deck */
.hero-console {
  display: flex;
  justify-content: flex-end;
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 30px;
  width: 100%;
  max-width: 440px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  transition: all 0.3s;
}

.card:hover {
  border-color: rgba(226, 177, 60, 0.15);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

/* Tabs style */
.tab-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: rgba(226, 177, 60, 0.08);
  color: var(--gold-accent);
  border: 1px solid rgba(226, 177, 60, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Form Settings Input groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.input-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.pill-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  flex: 1;
  min-width: 70px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.pill-btn.active {
  background: var(--text-main);
  color: #080706;
  border-color: var(--text-main);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.15);
}

/* Side preference Selector buttons */
.side-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.side-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
}

.side-icon {
  font-size: 1.6rem;
  color: #fff;
}

.side-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.side-btn.active {
  border-color: var(--gold-accent);
  background: rgba(226, 177, 60, 0.06);
  box-shadow: inset 0 0 10px rgba(226,177,60,0.1);
}

.side-btn.active .side-name {
  color: var(--gold-accent);
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #ffd670 0%, #e2b13c 100%);
  color: #080706;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(226, 177, 60, 0.25);
  margin-top: 10px;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(226, 177, 60, 0.35);
  transform: translateY(-1px);
}

/* Join Code section */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--panel-border);
}

.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }

.join-row {
  display: flex;
  gap: 8px;
}

.join-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
  transition: all 0.2s;
}

.join-row input:focus {
  border-color: var(--gold-accent);
  background: rgba(0,0,0,0.45);
}

.btn-secondary {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255,255,255,0.15);
}

#message {
  font-size: 0.76rem;
  text-align: center;
  margin-top: 12px;
}

/* Showcase Features grid styling */
.features-section {
  border-top: 1px solid var(--panel-border);
  padding: 64px 0;
}

.section-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 32px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.feat-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.feature-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Accordion Accordion details */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background-color 0.2s;
  user-select: none;
}

.faq-question:hover {
  background: rgba(255,255,255,0.02);
}

.faq-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 24px;
}

.faq-answer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-bottom: 20px;
}

.faq-item.active .faq-arrow {
  transform: rotate(180deg);
  color: var(--gold-accent);
}

.faq-item.active .faq-answer {
  max-height: 200px;
}

/* Glassmorphic FAQ Modal styles */
.faq-modal-box {
  background: linear-gradient(135deg, #161412 0%, #0c0b0a 100%);
  border: 1px solid rgba(226, 177, 60, 0.25);
  border-radius: 24px;
  padding: 36px 30px;
  max-width: 680px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.95), 0 0 30px rgba(226, 177, 60, 0.04);
  animation: banner-drop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 16px;
}

.faq-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-accent);
}

.faq-modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
  outline: none;
}

.faq-modal-close:hover {
  color: var(--gold-hover);
}

/* Modal Overlay base style */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes banner-drop {
  from { opacity: 0; transform: translateY(-30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Multi-column Corporate Footer */
.saas-footer {
  border-top: 1px solid var(--panel-border);
  padding: 64px 0 32px 0;
}

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-col p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 12px;
  max-width: 240px;
}

.footer-col h5 {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--panel-border);
  padding-top: 24px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Animations */
.animate-slide-up {
  opacity: 0;
  transform: translateY(16px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shake {
  animation: shakeKey 0.4s ease;
}

@keyframes shakeKey {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Responsive Grid styling */
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 0;
  }
  .hero-console {
    justify-content: center;
  }
  .card {
    max-width: 100%;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 580px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}