/* ==========================================================================
   NEXUS SPIELE — gemeinsames Designsystem
   --------------------------------------------------------------------------
   Diese Datei ist die einzige Quelle für Farben, Schrift, Radien, Abstände,
   Schatten und die gemeinsamen Bedienelemente (Launcher-Button, Karten).
   Launcher und alle drei Spiele laden sie unter /theme/nexus-theme.css.

   Die Spiele bringen eigene, gewachsene Oberflächen mit. Ihre CSS-Variablen
   werden am Ende der jeweiligen stylesheet-Datei auf diese Tokens gemappt
   ("Nexus-Theme-Brücke"), damit Gameplay und Layout unverändert bleiben und
   trotzdem überall dieselbe Gestaltung gilt.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Schrift ------------------------------------------------------------- */
  --nx-font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'Segoe UI Variable Display', 'Segoe UI', Inter, system-ui, sans-serif;
  --nx-font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;

  /* Flächen und Text ---------------------------------------------------- */
  --nx-bg: #08070e;
  --nx-bg-2: #0b0917;
  --nx-bg-3: #0f0b1d;
  --nx-surface: rgba(255, 255, 255, 0.055);
  --nx-surface-2: rgba(255, 255, 255, 0.095);
  --nx-surface-solid: #141020;
  --nx-surface-solid-2: #1a1428;
  --nx-surface-solid-3: #241b38;
  --nx-ink: #f5f2ff;
  --nx-ink-soft: #d3caea;
  --nx-muted: rgba(214, 207, 240, 0.64);
  --nx-faint: rgba(214, 207, 240, 0.42);
  --nx-line: rgba(255, 255, 255, 0.1);
  --nx-line-strong: rgba(185, 164, 255, 0.28);

  /* Akzent -------------------------------------------------------------- */
  --nx-accent: #8b5cf6;
  --nx-accent-2: #ff5cc8;
  --nx-accent-soft: #b9a4ff;
  --nx-accent-deep: #4c1d95;
  --nx-accent-ink: #120a20;
  --nx-glow: rgba(139, 92, 246, 0.4);
  --nx-glow-soft: rgba(139, 92, 246, 0.16);
  --nx-danger: #ff6b8a;
  --nx-good: #52e0b0;

  /* Form ---------------------------------------------------------------- */
  --nx-radius-xs: 10px;
  --nx-radius-sm: 14px;
  --nx-radius: 20px;
  --nx-radius-lg: 26px;
  --nx-radius-pill: 999px;

  /* Abstände ------------------------------------------------------------ */
  --nx-space-1: 4px;
  --nx-space-2: 8px;
  --nx-space-3: 12px;
  --nx-space-4: 16px;
  --nx-space-5: 24px;
  --nx-space-6: 32px;
  --nx-space-7: 48px;
  --nx-space-8: 64px;

  /* Tiefe und Bewegung -------------------------------------------------- */
  --nx-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --nx-shadow: 0 18px 46px -22px rgba(0, 0, 0, 0.9);
  --nx-shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.96);
  --nx-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --nx-dur: 220ms;
  --nx-topbar-h: 60px;
}

/* Helle Variante: gleiche Farbwelt, nur aufgehellte Flächen. Wird nur von
   "Mensch ärgere dich nicht" über seinen Design-Schalter genutzt. */
[data-theme='light'] {
  color-scheme: light;
  --nx-bg: #f5f2fc;
  --nx-bg-2: #ede8f9;
  --nx-bg-3: #e4dcf5;
  --nx-surface: rgba(255, 255, 255, 0.72);
  --nx-surface-2: rgba(255, 255, 255, 0.92);
  --nx-surface-solid: #ffffff;
  --nx-surface-solid-2: #f7f3ff;
  --nx-surface-solid-3: #efe9fb;
  --nx-ink: #191327;
  --nx-ink-soft: #3f3556;
  --nx-muted: rgba(45, 35, 70, 0.66);
  --nx-faint: rgba(45, 35, 70, 0.46);
  --nx-line: rgba(60, 40, 100, 0.14);
  --nx-line-strong: rgba(90, 60, 160, 0.3);
  --nx-accent-ink: #ffffff;
  --nx-glow: rgba(139, 92, 246, 0.24);
  --nx-glow-soft: rgba(139, 92, 246, 0.1);
  --nx-shadow-sm: 0 2px 10px rgba(45, 25, 80, 0.1);
  --nx-shadow: 0 18px 46px -24px rgba(45, 25, 80, 0.35);
  --nx-shadow-lg: 0 40px 90px -44px rgba(45, 25, 80, 0.45);
}

/* --------------------------------------------------------------------------
   Grundlagen
   -------------------------------------------------------------------------- */

.nx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Zurück zum Launcher — identisch in allen Spielen. */
.nx-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px 9px 12px;
  border-radius: var(--nx-radius-pill);
  border: 1px solid var(--nx-line);
  background: var(--nx-surface);
  color: var(--nx-ink-soft);
  font-family: var(--nx-font);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--nx-shadow-sm);
  transition:
    color var(--nx-dur) var(--nx-ease),
    border-color var(--nx-dur) var(--nx-ease),
    background var(--nx-dur) var(--nx-ease),
    transform var(--nx-dur) var(--nx-ease),
    box-shadow var(--nx-dur) var(--nx-ease);
}

.nx-back__arrow {
  font-size: 15px;
  line-height: 1;
  transform: translateY(-0.5px);
  transition: transform var(--nx-dur) var(--nx-ease);
}

.nx-back:hover {
  color: var(--nx-ink);
  border-color: var(--nx-line-strong);
  background: var(--nx-surface-2);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 30px -10px var(--nx-glow);
}

.nx-back:hover .nx-back__arrow {
  transform: translate(-2px, -0.5px);
}

.nx-back:focus-visible {
  outline: 2px solid var(--nx-accent-soft);
  outline-offset: 2px;
}

/* Kompakt auf schmalen Bildschirmen: nur das Pfeil-Symbol. */
@media (max-width: 620px) {
  .nx-back {
    padding: 9px 12px;
    gap: 0;
  }

  .nx-back__label {
    display: none;
  }
}

/* Gemeinsamer Primär-Button (Launcher-Karten und Hinweise). */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--nx-radius-pill);
  background: linear-gradient(180deg, var(--nx-accent-soft) 0%, var(--nx-accent) 48%, #6a2fda 100%);
  color: var(--nx-accent-ink);
  font-family: var(--nx-font);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 16px 40px -16px rgba(139, 92, 246, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 8px rgba(60, 20, 120, 0.38);
  transition:
    transform var(--nx-dur) var(--nx-ease),
    box-shadow var(--nx-dur) var(--nx-ease),
    filter var(--nx-dur) var(--nx-ease);
}

.nx-btn:hover {
  transform: translateY(-2px);
  filter: saturate(112%) brightness(1.04);
  box-shadow:
    0 22px 52px -18px rgba(139, 92, 246, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 8px rgba(60, 20, 120, 0.38);
}

.nx-btn:active {
  transform: translateY(0);
}

.nx-btn:focus-visible {
  outline: 2px solid var(--nx-accent-soft);
  outline-offset: 3px;
}

/* Gemeinsame Kartenfläche (Launcher, Hinweise). */
.nx-card {
  position: relative;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018) 46%, rgba(140, 92, 255, 0.06));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 26px 70px -38px rgba(0, 0, 0, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .nx-back,
  .nx-back__arrow,
  .nx-btn {
    transition: none;
  }
}
