:root {
  --bg-canvas: #080b12;
  --bg-sidebar: #0d121c;
  --bg-card: #101726;
  --bg-card-hover: #162033;
  --border-slate: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(158, 255, 51, 0.5);
  --lime: #9eff33;
  --lime-dim: rgba(158, 255, 51, 0.12);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.12);
  --amber: #fbbf24;
  --rose: #fb7185;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

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

html, body {
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: #04060a;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.08), transparent 36%),
    radial-gradient(circle at 82% 84%, rgba(158, 255, 51, 0.06), transparent 40%),
    linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
}

/* Custom Dark Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #080b12; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.5); }

/* Centered Tactical Frame */
.frame-wrapper {
  width: 100%;
  max-width: 1180px;
  margin: 1.5rem auto;
  flex: 1;
  display: flex;
  background: var(--bg-canvas);
  border: 1px solid var(--border-slate);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(34, 211, 238, 0.06);
  position: relative;
}

/* Left Rail Sidebar */
aside {
  width: 285px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-slate);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.2rem;
}

.brand-block {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-slate);
  margin-bottom: 1.35rem;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  line-height: 1.12;
  text-transform: uppercase;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.brand-title:hover {
  color: var(--lime);
  text-shadow: 0 0 14px rgba(158, 255, 51, 0.3);
}

.brand-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.69rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
  line-height: 1.4;
}

.coffee-btn {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border-radius: 7px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--amber);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.coffee-btn:hover {
  background: rgba(251, 191, 36, 0.18);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-bright);
  background: var(--lime-dim);
  color: var(--lime);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: rgba(158, 255, 51, 0.2);
}

.nav-drawer {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lime);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
  text-shadow: 0 0 12px rgba(158, 255, 51, 0.22);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.72rem 0.9rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
}

.nav-item:hover:not(.disabled) {
  color: var(--text-primary);
  background: rgba(34, 211, 238, 0.07);
  border-color: rgba(34, 211, 238, 0.32);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--lime);
  background: var(--lime-dim);
  border-color: var(--border-bright);
  box-shadow: 0 0 18px rgba(158, 255, 51, 0.1);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}

.nav-item.disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.58;
}

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.18rem 0.48rem;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.16);
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.live {
  background: var(--lime);
  color: #05070c;
  border-color: var(--lime);
  box-shadow: 0 0 10px rgba(158, 255, 51, 0.25);
}

/* Main HUD Canvas */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 90% 15%, rgba(34, 211, 238, 0.06), transparent 40%),
    linear-gradient(rgba(34, 211, 238, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
}

.topbar {
  padding: 0.95rem 2.25rem;
  border-bottom: 1px solid var(--border-slate);
  background: rgba(13, 18, 28, 0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumb span { color: var(--cyan); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--lime);
  font-weight: 600;
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.content-body {
  padding: 2.35rem 2.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  animation: fadeSlide 0.25s ease-out;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tactical Hero */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before {
  content: "\25A0";
  font-size: 0.7rem;
  text-shadow: 0 0 10px var(--cyan);
}

.hero-headline {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  line-height: 1.01;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.hero-headline .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--cyan);
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.18));
}

/* HUD Panel Box */
.hud-panel {
  position: relative;
  background: rgba(16, 23, 38, 0.78);
  border: 1px solid var(--border-slate);
  border-radius: 12px;
  padding: 1.5rem 1.7rem;
  max-width: 740px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.hud-panel::before,
.hud-panel::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--cyan);
  border-style: solid;
  pointer-events: none;
}
.hud-panel::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}
.hud-panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

.prose {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.99rem;
}
.prose p + p { margin-top: 1rem; }

.inline-link {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px dashed rgba(251, 191, 36, 0.65);
  font-weight: 600;
}
.inline-link:hover { color: #fde68a; border-bottom-color: #fde68a; }

.about-card {
  margin-top: 1.35rem;
  padding: 1.35rem 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-slate);
  border-left: 3px solid var(--lime);
  border-radius: 10px;
  max-width: 740px;
}
.about-card h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--lime);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.55rem;
}

/* Telemetry Strip */
.telemetry-strip {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  max-width: 740px;
}
.telemetry-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  background: rgba(13, 18, 28, 0.9);
  border: 1px solid var(--border-slate);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.telemetry-tag strong { color: var(--cyan); font-weight: 600; }

/* Footer */
footer {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-links {
  margin-top: 0.45rem;
}
.privacy-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.privacy-link:hover { color: var(--cyan); }

/* Modal Pop-up */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }

.modal-box {
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: #0d121c;
  border-radius: 14px;
  padding: 1.65rem;
  border: 1px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  animation: fadeSlide 0.18s ease-out;
}
.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-slate);
}
.modal-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.15rem;
  text-transform: uppercase;
  color: var(--cyan);
}
.modal-close {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border-slate);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.2); }

.modal-body {
  margin-top: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9rem;
}
.modal-body h4 {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1rem 0 0.35rem;
}
.modal-body p + p { margin-top: 0.65rem; }

/* Tablet & Mobile Responsive Polish */
@media (max-width: 860px) {
  .frame-wrapper {
    flex-direction: column;
    margin: 0.6rem;
    width: calc(100% - 1.2rem);
    border-radius: 12px;
  }

  aside {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-slate);
    padding: 1.1rem;
  }

  .brand-block {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .mobile-menu-btn { display: inline-flex; }

  .nav-drawer {
    display: none;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-slate);
  }
  .nav-drawer.open {
    display: flex;
    animation: fadeSlide 0.2s ease-out;
  }

  .topbar {
    padding: 0.85rem 1.15rem;
    font-size: 0.66rem;
  }

  .content-body {
    padding: 1.5rem 1.15rem;
  }

  .hero-headline {
    font-size: 1.95rem;
    margin-bottom: 1.2rem;
  }

  .hud-panel,
  .about-card {
    padding: 1.15rem;
  }
}

@media (max-width: 600px) {
  .jump-wrapper .jump-menu {
    left: 0;
    right: auto;
    width: min(276px, calc(100vw - 3.5rem));
  }

  .modal-box {
    padding: 1.25rem;
  }
}


/* ========== LIGHT THEME ========== */
[data-theme="light"] {
  --bg-canvas: #f7f8fb;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #eef2f7;
  --border-slate: rgba(15, 23, 42, 0.16);
  --text-primary: #0b1220;
  --text-secondary: #334155;
  --text-muted: #475569;
}
[data-theme="light"] body {
  background-color: #e8edf4;
  color: #0b1220;
  background-image: none;
}
[data-theme="light"] .frame-wrapper {
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .hero-headline,
[data-theme="light"] .brand-title,
[data-theme="light"] .arcade-game-title,
[data-theme="light"] .game-title {
  color: #0b1220;
}
[data-theme="light"] p,
[data-theme="light"] .nav-item,
[data-theme="light"] .breadcrumb,
[data-theme="light"] .module-card p,
[data-theme="light"] .hub-summary p,
[data-theme="light"] .q-text,
[data-theme="light"] .opt,
[data-theme="light"] .choice,
[data-theme="light"] .prompt {
  color: #1e293b;
}
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: #e2e8f0;
  color: #0b1220;
}
[data-theme="light"] .opt,
[data-theme="light"] .choice,
[data-theme="light"] .q-card,
[data-theme="light"] .prompt,
[data-theme="light"] .mem-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0b1220;
}
[data-theme="light"] .text-secondary,
[data-theme="light"] [style*="color:#94a3b8"],
[data-theme="light"] [style*="color: #94a3b8"] {
  color: #334155 !important;
}

/* Site toolbar */
.site-toolbar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10000;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.site-toolbar button {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-slate);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
@media (max-width: 680px) {
  .site-toolbar { top: auto; bottom: 12px; right: 12px; }
  .lang-list { bottom: calc(100% + 4px); top: auto; max-height: 50vh; }
  .frame-wrapper { margin: 0; border-radius: 0; }
}
