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

:root {
  --bg: #080a0f;
  --bg2: #0d1017;
  --surface: #111520;
  --accent: #00e5ff;
  --accent2: #ff3c6e;
  --accent3: #a259ff;
  --text: #e8eaf2;
  --muted: #5a6078;
  --border: rgba(0, 229, 255, 0.12);
  --font-display: "Bebas Neue", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "Space Mono", monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;
}

/* Custom-cursor opt-out (game settings -> site-wide via localStorage,
   cursor.js adds this class on load). Individual interactive elements set
   their own cursor:none throughout the site's CSS to keep the illusion
   consistent while the custom cursor is active - overriding just body
   wouldn't reach those, so this deliberately overrides everything at once
   rather than hunting down every such rule across every stylesheet. */
body.cursor-native,
body.cursor-native * {
  cursor: auto !important;
}

/* ─── CURSOR ─── */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
}

/* ─── NOISE + SCANLINE ─── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9000;
  opacity: 0.4;
}

.scanline {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.025) 2px,
    rgba(0, 0, 0, 0.025) 4px
  );
  pointer-events: none;
  z-index: 8999;
}

/* ─── BACKGROUND DECORATORS ─── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 0%,
      rgba(0, 229, 255, 0.06) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 80% 80%,
      rgba(162, 89, 255, 0.05) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 40% at 20% 70%,
      rgba(255, 60, 110, 0.04) 0%,
      transparent 60%
    );
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(
    ellipse 70% 80% at 50% 40%,
    black 20%,
    transparent 90%
  );
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent2);
}

/* Hidden by default (desktop) - only shown below the responsive breakpoint,
   see the @media block further down. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: none;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Animates into an X when the menu is open. */
nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

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

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-donate {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
  cursor: none;
}

.nav-donate svg {
  width: 0.8em;
  height: 0.8em;
  flex-shrink: 0;
}

/* Reusable inline heart icon - scales with whatever font-size its parent
   (h1, button, etc.) already has. Deliberately modest (well under the size
   of the text next to it) - this is a small accent on a button/heading,
   not the dominant visual. */
.heart-icon svg {
  width: 0.5em;
  height: 0.5em;
  vertical-align: -0.02em;
}

.nav-donate:hover {
  background: var(--accent2);
  color: #000;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--muted);
  border-radius: 50%;
  transition:
    background 0.4s,
    box-shadow 0.4s;
}

.nav-status.is-live {
  color: #22ff88;
}

.nav-status.is-live .status-dot {
  background: #22ff88;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 255, 136, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 255, 136, 0);
  }
}

/* ─── LANGUAGE TOGGLE (pill switch with a sliding thumb) ─── */
/* The whole pill is a single link to the other locale - clicking anywhere
   on it (not just one specific label) flips the language, like a real
   toggle switch rather than two separate destination links. */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: border-color 0.2s;
}

.lang-switch:hover {
  border-color: var(--accent);
}

.lang-switch-thumb {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: calc(50% - 0.2rem);
  height: calc(100% - 0.4rem);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 0.25s ease;
  z-index: 0;
}

.lang-switch-thumb.is-en {
  transform: translateX(100%);
}

.lang-option {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.3rem 0.55rem;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  cursor: none;
}

.lang-option.active {
  color: #000;
}

.lang-switch-standalone {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
}

/* ─── NAV: MOBILE COLLAPSE ───
   Below this width the full nav (logo + 4 links + login/donate/status/lang)
   doesn't fit on one line and was overflowing/wrapping badly. Collapses
   into a hamburger toggle; .nav-links/.nav-right get flex-basis:100% so
   they drop onto their own row when shown, but contribute nothing to
   layout while `display:none`, so the collapsed bar stays a clean single
   row of just the logo + toggle button. */
@media (max-width: 880px) {
  nav {
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links,
  .nav-right {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    margin-top: 1.2rem;
  }

  nav.nav-open .nav-links,
  nav.nav-open .nav-right {
    display: flex;
  }

  .nav-right {
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
  }
}

/* ─── SITE FOOTER (shared across all main content pages) ─── */
footer {
  padding: 2.5rem 3rem;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-logo:hover {
  color: var(--accent);
}

.footer-links,
.footer-social {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a,
.footer-social a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-social a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-domain {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.footer-domain span {
  color: var(--accent);
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-legal span {
  color: var(--border);
}

/* ─── AD SLOT ─── */
.ad-slot {
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(0, 229, 255, 0.08);
  padding: 0.5rem;
  text-align: center;
  overflow: hidden;
}

.ad-slot ins {
  display: block;
}

/* ─── NAV LOGIN BUTTON ─── */
.nav-login-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.35rem 0.75rem;
  transition: background 0.2s, color 0.2s;
}

.nav-login-btn:hover {
  background: var(--accent);
  color: #000;
}

.nav-logout-form {
  display: inline-flex;
}

.nav-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: none;
  padding: 0;
  transition: border-color 0.2s, color 0.2s;
}

.nav-logout-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.nav-logout-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ─── FLASH MESSAGES ─── */
.flash-banner {
  max-width: 900px;
  margin: 6.5rem auto 0;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.flash-success {
  color: #00e5a0;
  background: rgba(0, 229, 160, 0.06);
  border: 1px solid rgba(0, 229, 160, 0.25);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
