/* =====================================================================
   WERDIGO – globales Stylesheet für alle Seiten
   ---------------------------------------------------------------------
   In JEDER Seite in den <head> einbinden:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@600;700;800&display=swap" rel="stylesheet">
     <link rel="stylesheet" href="style.css">

   INHALT
     1. Design-Tokens      Farben, Schriften, Abstände -> hier zentral ändern
     2. Reset & Basis
     3. Seiten-Layout      Hintergrund, Container, Seitenkopf, Titel
     4. Buttons            Holzschild mit Schnee (wie im Hauptmenü)
     5. Komponenten        Panel, Modal, Formulare, Tabs, Badges, Avatare, Toast,
                           Tabelle, XP-Balken, Zähler
     6. Ausweis-Karten     Characters-Seite und Spiel (inkl. Holo-Effekt)
     7. Seiten             Startseite, Log-in, Play, Warteraum, Profil, Rewards,
                           Credits, Characters, Spiel
     8. Hilfsklassen       .hidden, .row, .stack, .mt-4 ...
     9. Animationen
    10. Bildschirmgrößen   schmale Bildschirme, "weniger Bewegung"

   Reihenfolge ist wichtig: Spätere Regeln überschreiben frühere mit gleicher
   Spezifität. Deshalb stehen Hilfsklassen und Bildschirmgrößen am Ende.
   ===================================================================== */


/* =====================================================================
   1. DESIGN-TOKENS
   ===================================================================== */
:root {
  /* Umrisslinie – die dunkle Kontur um Buttons, Titel und Panels */
  --ink:            #1d2033;

  /* Schnee */
  --snow:           #f3f6fb;
  --snow-shade:     #cdd6e6;

  /* Standard-Button / Panels (Pflaume) */
  --plum:           #655064;
  --plum-light:     #7a6279;
  --plum-dark:      #4c3b4c;

  /* PLAY / Hauptaktion (Gold) */
  --gold:           #f2b544;
  --gold-light:     #f8c962;
  --gold-dark:      #d3952c;

  /* Gefahr (Konto löschen, Spiel verlassen) */
  --red:            #c24a3e;
  --red-light:      #d4604f;
  --red-dark:       #94322a;

  /* Erfolg */
  --green:          #6aa84f;

  /* Nachthimmel – Ersatz-Hintergrund, solange kein Bild da ist */
  --night:          #1a2552;
  --night-purple:   #3d3263;

  /* Text */
  --text-light:     #f6f0f5;   /* auf Pflaume / dunkel  */
  --text-dark:      #1d2240;   /* auf Gold / Schnee     */
  --text-soft:      #e3d1db;   /* Untertitel auf Pflaume */
  --text-muted:     #6b6f86;   /* Hinweise auf Schnee   */

  /* Team-Farben (Badges, Karten) */
  --team-reindeer:  #e0a33a;   /* Dorf    */
  --team-werdigo:   #8e3b5a;   /* Böse    */
  --team-neutral:   #6f9cc6;   /* Neutral */

  /* Schriften */
  --font-display:   "Lilita One", "Arial Black", sans-serif;  /* Titel, Buttons */
  --font-body:      "Nunito", "Segoe UI", Arial, sans-serif;   /* Fließtext      */
  --font-mono:      "Consolas", "Courier New", monospace;      /* Codes          */

  /* Größen
     --ui wächst mit der Fensterbreite mit, damit Buttons & Titel auf der
     Startseite immer im gleichen Verhältnis zum Hintergrundbild stehen. */
  --ui:             clamp(13px, 1.63vw, 30px);
  --outline:        3px;
  --radius:         12px;
  --radius-sm:      8px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --transition: 140ms ease;

  /* Schneehaube (Buttons, Panels und Modals) */
  --snow-cap: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 12' preserveAspectRatio='none'><path d='M0 0H100V5.5C96 6.4 92 5.6 88 6.2 80 7.2 72 5.8 64 6.3 56 6.8 48 5.6 40 6.1 37 6.3 35 6.5 33.5 8.6 32.5 10.4 30 10.4 29 8.6 27.8 6.6 25 6.1 20 6.4 12 6.9 6 5.9 0 6.6Z' fill='%23cdd6e6'/><path d='M0 0H100V4.2C96 5.1 92 4.3 88 4.9 80 5.9 72 4.5 64 5 56 5.5 48 4.3 40 4.8 37 5 35 5.2 33.6 7.1 32.6 8.6 30.2 8.6 29.2 7.1 28 5.3 25 4.8 20 5.1 12 5.6 6 4.6 0 5.3Z' fill='%23f3f6fb'/></svg>");
}


/* =====================================================================
   2. RESET & BASIS
   ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--night);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;          /* Lilita One hat nur eine Stärke */
  line-height: 1.1;
  letter-spacing: 0.02em;
}

p { margin: 0; }

a {
  color: var(--gold-light);
  text-decoration: none;
}
a:hover { color: var(--gold); }

ul, ol { margin: 0; padding: 0; list-style: none; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}


/* =====================================================================
   3. SEITEN-LAYOUT
   ===================================================================== */

/* Vollbild-Seite mit Hintergrund – für ALLE Seiten:
   <body class="screen">
     <div class="screen__bg" aria-hidden="true"></div>
     ...
   Standard ist der Verlauf (Nachthimmel -> Schnee).
   Nur die Startseite bekommt zusätzlich das Bild: class="screen__bg screen__bg--image" */
.screen {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.screen__bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  --bg-gradient: linear-gradient(180deg,
      var(--night) 0%,
      var(--night-purple) 45%,
      #6c6a96 62%,
      #c9d2e6 72%,
      var(--snow) 100%);
  background-color: var(--night);
  background-image: var(--bg-gradient);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Nur Startseite: Hintergrundbild über dem Verlauf (Verlauf bleibt Ersatz, falls das Bild fehlt) */
.screen__bg--image {
  background-image: url("assets/img/background.png?v=f5cddf9a1c"), var(--bg-gradient);
  background-size: cover, cover;
  background-position: center bottom, center;
}

/* Unterseiten: Hintergrund abdunkeln, damit Panels besser lesbar sind
   (im Spiel nachts noch dunkler, siehe "7.9 Spiel") */
.screen__bg--dim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 50, 0.45);
  transition: background 0.8s ease;
}

/* Inhaltsbereich der Unterseiten */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-5);
}
.container--narrow { max-width: 920px; }     /* Profil */
.container--auth   { max-width: 560px; }     /* Log-in */
.container--wide {                           /* Spiel: breiter, weniger Rand */
  max-width: 1640px;
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

/* Kopfbereich einer Unterseite: Zurück-Button + Titel
   <header class="page-header">
     <a class="btn btn--small" href="home.html">← Back</a>
     <h1 class="page-title">Profile</h1>
   </header>                                                            */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.page-header__end { margin-left: auto; }     /* Element ganz rechts, z.B. "5 / 8 unlocked" */

/* Weißer Titel mit dunkler Kontur – gleicher Stil wie "WERDIGO" */
.outlined-title,
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--snow);
  letter-spacing: 0.03em;
  -webkit-text-stroke: 0.09em var(--ink);
  paint-order: stroke fill;
  text-shadow:
    0 0.05em 0 var(--ink),
    0 0 0.35em rgba(255, 210, 140, 0.35);
}

.page-title {
  font-size: 48px;
  line-height: 1;
  text-transform: uppercase;
}

/* Zwei Spalten: schmal links, breit rechts (--reverse: breit links) */
.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: var(--space-6);
  align-items: start;
}
.layout-split--reverse { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }


/* =====================================================================
   4. BUTTONS  (Holzschild mit Schnee obendrauf)
   ---------------------------------------------------------------------
   <a class="btn" href="profile.html">Profile</a>
   <button class="btn btn--primary">Play</button>
   <button class="btn btn--danger">Delete account</button>
   <button class="btn btn--small">Back</button>

   Mit Untertitel / Icon:
   <a class="btn" href="...">
     <span class="btn__label"><svg class="btn__icon">...</svg>Shop</span>
     <span class="btn__sub">OnlyReindeer Shop</span>
   </a>

   Größe: über font-size steuern – alles andere wächst mit (em).
   ===================================================================== */
.btn {
  /* Farben – werden von den Varianten überschrieben */
  --btn-fill:   var(--plum);
  --btn-light:  var(--plum-light);
  --btn-dark:   var(--plum-dark);
  --btn-text:   var(--text-light);
  --btn-shadow: rgba(29, 32, 51, 0.45);

  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 7.5em;
  height: 3.3em;
  padding: 0.45em 1.1em 0.3em;
  border: var(--outline) solid var(--ink);
  border-radius: 0.6em;
  background: var(--btn-fill);
  color: var(--btn-text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: 0 0.09em 0 var(--btn-shadow);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  /* 3D-Kante unten + dunkle Holz-Unterseite + Schlagschatten */
  box-shadow:
    inset 0 -0.32em 0 var(--btn-dark),
    0 0.22em 0 var(--ink),
    0 0.45em 0.7em rgba(14, 18, 40, 0.35);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

/* Schneehaube oben */
.btn::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0.12em;
  right: 0.12em;
  height: 0.55em;
  border-radius: 0.45em 0.45em 0 0;
  background: var(--snow-cap) no-repeat center top / 100% 100%;
  pointer-events: none;
}

/* Feiner heller Innenrahmen mit zwei "Nieten" links und rechts */
.btn::after {
  content: "";
  position: absolute;
  top: 0.55em;
  right: 0.28em;
  bottom: 0.42em;
  left: 0.28em;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-top: none;
  border-radius: 0 0 0.4em 0.4em;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 0 1.6px, transparent 2.2px) left center / 6px 6px no-repeat,
    radial-gradient(circle, rgba(255, 255, 255, 0.4) 0 1.6px, transparent 2.2px) right center / 6px 6px no-repeat;
  background-origin: border-box;
  pointer-events: none;
}

.btn:hover,
.btn.is-active {
  transform: translateY(-3px);
  filter: brightness(1.08);
  color: var(--btn-text);
  box-shadow:
    inset 0 -0.32em 0 var(--btn-dark),
    0 calc(0.22em + 3px) 0 var(--ink),
    0 0.7em 1em rgba(14, 18, 40, 0.4);
}

.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 -0.22em 0 var(--btn-dark),
    0 0.08em 0 var(--ink),
    0 0.2em 0.4em rgba(14, 18, 40, 0.35);
}

/* Tastatur-Fokus: zusätzlicher goldener Rahmen */
.btn:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 4px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  filter: grayscale(0.7) brightness(0.8);
  pointer-events: none;
}

/* Beschriftung, Icon, Untertitel */
.btn__label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.btn__icon {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

.btn__sub {
  position: relative;
  z-index: 1;
  margin-top: 0.38em;
  font-family: var(--font-body);
  font-size: 0.56em;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  text-shadow: none;
  color: var(--text-soft);
}

/* ---------- Farben ---------- */

/* Gold – die eine Hauptaktion pro Seite (PLAY, Join, Save) */
.btn--primary {
  --btn-fill:   var(--gold);
  --btn-light:  var(--gold-light);
  --btn-dark:   var(--gold-dark);
  --btn-text:   var(--text-dark);
  --btn-shadow: rgba(255, 255, 255, 0.35);
}
.btn--primary::after { border-color: rgba(255, 255, 255, 0.28); }
.btn--primary .btn__sub { color: #5b4520; }

/* Rot – gefährliche Aktionen (Delete account, Leave) */
.btn--danger {
  --btn-fill:   var(--red);
  --btn-light:  var(--red-light);
  --btn-dark:   var(--red-dark);
}

/* ---------- Größen ---------- */
.btn--large {
  min-width: 10.5em;
  height: 4.2em;
  font-size: 28px;   /* wird im Hauptmenü überschrieben */
}
.btn--small {
  min-width: 0;
  height: 2.6em;
  padding: 0.4em 1em 0.25em;
  font-size: 17px;
}
.btn--block { width: 100%; }

/* Textlink, der wie ein Link aussieht, aber ein <button> ist */
.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--gold-light);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--gold); }


/* =====================================================================
   5. KOMPONENTEN
   ===================================================================== */

/* ---------- 5.1 Panel (Pflaume, wie die Buttons) ----------
   <section class="panel">
     <h2 class="panel__title">Your Rewards</h2>
     ...
   </section>                                                           */
.panel {
  position: relative;
  padding: var(--space-6);
  padding-top: calc(var(--space-6) + 6px);
  border: var(--outline) solid var(--ink);
  border-radius: 16px;
  background: var(--plum);
  color: var(--text-light);
  box-shadow:
    inset 0 -6px 0 var(--plum-dark),
    0 5px 0 var(--ink),
    0 12px 24px rgba(14, 18, 40, 0.35);
}

/* Schneehaube auf Panels und Modals */
.panel::before,
.modal::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 6px;
  right: 6px;
  height: 12px;
  border-radius: 12px 12px 0 0;
  background: var(--snow-cap) no-repeat center top / 100% 100%;
  pointer-events: none;
}

/* Helle Variante: Schnee-Karte mit dunkler Schrift */
.panel--snow {
  background: var(--snow);
  color: var(--text-dark);
  box-shadow:
    inset 0 -6px 0 var(--snow-shade),
    0 5px 0 var(--ink),
    0 12px 24px rgba(14, 18, 40, 0.3);
}
.panel--snow::before { display: none; }

.panel__title {
  margin-bottom: var(--space-5);
  font-size: 28px;
  text-transform: uppercase;
}

/* Kleine Überschrift über einem Abschnitt in einem Panel */
.section-label {
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- 5.2 Modal (natives <dialog>) ----------
   <dialog class="modal" id="x"> ... </dialog>
   JS: document.getElementById("x").showModal();                        */
.modal {
  width: min(460px, calc(100vw - 32px));
  padding: 36px 32px 28px;
  border: var(--outline) solid var(--ink);
  border-radius: 16px;
  background: var(--plum);
  color: var(--text-light);
  box-shadow:
    inset 0 -6px 0 var(--plum-dark),
    0 6px 0 var(--ink),
    0 20px 50px rgba(10, 12, 30, 0.6);
}
.modal--wide { width: min(640px, calc(100vw - 32px)); }   /* z.B. Datenschutz */

.modal::backdrop {
  background: rgba(14, 18, 40, 0.6);
  backdrop-filter: blur(3px);
}
.modal[open] { animation: pop-in 200ms ease both; }

.modal__title {
  margin-bottom: var(--space-3);
  font-size: 30px;
  text-align: center;
  text-transform: uppercase;
}
.modal__body {
  text-align: center;
  color: var(--text-soft);
}
.modal__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.modal .field { text-align: left; }
#reset-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
#reset-dialog .btn { white-space: normal; overflow-wrap: anywhere; }
#reset-dialog .row { flex-wrap: wrap; }
#guest-warning { max-height: calc(100dvh - 32px); overflow-y: auto; }
#guest-warning .modal__actions { flex-wrap: wrap; }
#guest-warning .btn {
  max-width: 100%;
  white-space: normal;
  height: auto;
  min-height: 2.6em;
  padding: 0.7em 1.1em 0.8em;
  line-height: 1.1;
}

/* Fenster/Formular mit mehreren Schritten (Passwort ändern, Log-in/Sign-up) */
.dialog-step[hidden] { display: none; }

/* ---------- 5.3 Formulare ----------
   <div class="field">
     <label class="field__label" for="name">Username</label>
     <input class="input" id="name" type="text">
     <p class="field__hint">3–32 characters</p>
   </div>                                                               */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-5);
}

.field__label {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field__hint  { font-size: 13px; opacity: 0.75; }
.field__error { font-size: 13px; font-weight: 800; color: #ffb4a8; }
.field__info  { font-size: 13px; font-weight: 800; color: #b7e39c; }
.field__error:empty,
.field__info:empty { display: none; }

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--snow);
  color: var(--text-dark);
  font-weight: 700;
  box-shadow: inset 0 3px 0 var(--snow-shade);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.input::placeholder { color: #9198ad; }

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: inset 0 3px 0 var(--snow-shade), 0 0 0 4px var(--gold);
}

.input.is-invalid { box-shadow: inset 0 3px 0 var(--snow-shade), 0 0 0 4px var(--red); }

/* Eingabe für den 6-stelligen Lobby-Code bzw. Passwort-Code */
.input--code {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.checkbox input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- 5.4 Tabs (Log in / Sign up, Players / Roles, Chat-Kanäle) ----------
   <div class="tabs" role="tablist">
     <button class="tabs__tab is-active" role="tab">Log in</button>
     <button class="tabs__tab" role="tab">Sign up</button>
   </div>
   .tabs--block = Tabs füllen die ganze Breite                           */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--plum-dark);
  box-shadow: 0 3px 0 var(--ink);
}
.tabs--block { display: flex; }
.tabs--block .tabs__tab { flex: 1; }

.tabs__tab {
  padding: 7px 18px 5px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}
.tabs__tab:hover { color: var(--text-light); }
.tabs__tab.is-active {
  background: var(--gold);
  color: var(--text-dark);
  box-shadow: inset 0 -3px 0 var(--gold-dark);
}

/* Chat-Kanäle im Spiel: Werdigo rot, Dead grau statt Gold */
.tabs__tab--werdigo.is-active {
  background: var(--team-werdigo);
  color: var(--text-light);
  box-shadow: inset 0 -3px 0 #6a2a42;
}
.tabs__tab--dead.is-active {
  background: var(--snow-shade);
  color: var(--text-dark);
  box-shadow: inset 0 -3px 0 #9aa3b8;
}

/* Punkt am Tab = neue Nachricht in diesem Kanal */
.tabs__tab.has-unread::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--red-light);
  vertical-align: 2px;
}

/* ---------- 5.5 Badges / Team-Kennzeichnung ----------
   <span class="badge badge--werdigo">Werdigo</span>                    */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 2px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--plum-light);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--ink);
}
.badge--reindeer { background: var(--team-reindeer); color: var(--text-dark); }
.badge--werdigo  { background: var(--team-werdigo); }
.badge--neutral  { background: var(--team-neutral); color: var(--text-dark); }
.badge--gold     { background: var(--gold); color: var(--text-dark); }
.badge--success  { background: var(--green); }

/* ---------- 5.6 Avatare ----------
   Profilbild:            <img class="avatar" src="...">
   Platzhalter-Buchstabe: <span class="avatar avatar--letter">P</span>
                          (in JS: createLetterAvatar(name, index) aus js/ui.js)    */
.avatar {
  width: 56px;
  height: 56px;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--snow);
  object-fit: cover;
  box-shadow: 0 3px 0 var(--ink);
}
.avatar--large { width: 112px; height: 112px; }

.avatar--letter {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-dark);
}
.avatar--large.avatar--letter { font-size: 48px; }
.avatar--small { width: 34px; height: 34px; font-size: 16px; flex-shrink: 0; }   /* Spielerliste im Warteraum */
.avatar--profile { position: relative; border-radius: 0; overflow: hidden; flex-shrink: 0; }
.avatar--profile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--snow);
}

/* Auswahlraster für Profilbilder (profile.html) */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-3);
}
.avatar-grid button {
  padding: 0;
  aspect-ratio: 1;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--snow);
  overflow: hidden;
  transition: transform var(--transition);
}
.avatar-grid button:hover { transform: translateY(-3px); }
.avatar-grid button.is-selected { box-shadow: 0 0 0 4px var(--gold); }

/* Profilbilder sind quadratische Illustrationen -> eckig und vollständig sichtbar */
.profile-current .avatar,
.avatar-grid button,
.avatar-grid .avatar { border-radius: 0; }
.profile-current .avatar,
.avatar-grid .avatar { object-fit: contain; }
.avatar-grid .avatar {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  box-shadow: none;
}

/* ---------- 5.7 Toast-Meldung (unten mittig, js/ui.js showToast) ----------
   <div class="toast is-visible">Code copied!</div>                     */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  padding: 10px 22px;
  border: var(--outline) solid var(--ink);
  border-radius: 999px;
  background: var(--snow);
  color: var(--text-dark);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--ink);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast--error { background: var(--red); color: var(--text-light); }

/* ---------- 5.8 Tabelle (Lobby-Liste) ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: 10px 14px;
  border-bottom: var(--outline) solid var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
}
.table td {
  padding: 12px 14px;
  border-bottom: 2px solid rgba(29, 32, 51, 0.35);
}
.table tbody tr:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------- 5.9 XP-Balken ----------
   <div class="xp-bar"><div class="xp-bar__fill" style="width: 62%"></div></div>
   <div class="xp-bar__label"><span>Level 7</span><span>1240 / 1500 XP</span></div> */
.xp-bar {
  height: 20px;
  border: var(--outline) solid var(--ink);
  border-radius: 999px;
  background: var(--plum-dark);
  overflow: hidden;
  box-shadow: 0 3px 0 var(--ink);
}
.xp-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-light) 0 45%, var(--gold) 45% 100%);
  transition: width 600ms ease;
}
.xp-bar__label {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.04em;
}

/* ---------- 5.10 Zähler  [-] 2 [+]  (Rollen im Warteraum) ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--snow);
  overflow: hidden;
}
.stepper button {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--plum-light);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 18px;
}
.stepper button:hover { background: var(--plum); }
.stepper output {
  min-width: 34px;
  font-family: var(--font-display);
  font-size: 18px;
  text-align: center;
  color: var(--text-dark);
}


/* =====================================================================
   6. AUSWEIS-KARTEN  (Characters-Seite und Spiel, gebaut von js/cards.js)
   ---------------------------------------------------------------------
   Aufbau einer Karte (von hinten nach vorne):
     1. Karte          Hintergrundfarbe je nach Seltenheit
     2. __shine        Regenbogen-Glanz ("Holo")
     3. Inhalt         Kopfzeile, Passfoto, Text
     4. __glare        heller Lichtfleck an der Maus

   Klassen:
     Team (Farbe des Passfotos):   .id-card--reindeer / --werdigo / --neutral / --unknown
     Seltenheit (Hintergrund):     .id-card--normal  grau/weiß
                                   .id-card--good    hellblau
                                   .id-card--evil    rot
                                   .id-card--special glänzt immer (Holo)
     Größe / Verhalten:            .id-card--compact klein (Spiel)
                                   .id-card--flat    keine Neigung, kein Holo (Spieler-Karten)
                                   .id-card--win     Gewinner-Karte im Sieg-Fenster
     Zustand:                      .is-locked, .is-dead, .is-self, .is-selectable,
                                   .is-selected, .is-captured

   Neigung + Glanz: js/card-tilt.js setzt beim Bewegen der Maus 4 Variablen:
     --rx, --ry   wie weit die Karte gekippt wird (in Grad)
     --mx, --my   wo die Maus auf der Karte ist (in %)
   Alles andere macht CSS.

   WIE DER HOLO-EFFEKT FUNKTIONIERT (vereinfacht nach dem Holofoil-Shader von
   cyanilux.com/tutorials/holofoil-card-shader-breakdown):

     Shader (Unity)                       ->  Unsere CSS-Version
     -----------------------------------------------------------------------
     View Direction (Blickwinkel)         ->  Mausposition --mx / --my
     Regenbogen-Textur, wiederholt        ->  linear-gradient / repeating-linear-gradient
     UVs mit View Direction verschieben   ->  background-position: var(--mx) var(--my)
     Rotate-Node (Streifen schräg)        ->  Winkel 115deg im Verlauf
     Mask (wo darf Folie sein?)           ->  Ebenen + z-index + mix-blend-mode
     Distortion-Textur (Wellen)           ->  weggelassen (zu aufwendig für CSS)
     Bloom / Emission (Leuchten)          ->  __glare, ein weißer Lichtfleck

   Kurz: Der Regenbogen ist viel GRÖSSER als die Karte (300 %). Die Karte ist
   wie ein Fenster, durch das man nur einen Ausschnitt sieht. Bewegt sich die
   Maus, verschiebt sich der Ausschnitt -> die Farben "wandern" über die Karte,
   genau wie bei einer echten Holo-Karte, die man im Licht kippt.
   ===================================================================== */

.id-card {
  /* Startwerte: Karte gerade, Maus in der Mitte.
     card-tilt.js überschreibt diese 4 Werte direkt am Element (style="..."),
     alle Ebenen darin (__shine, __glare, Foto) lesen sie per var(...) mit. */
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;

  /* Farben – werden unten von Team und Seltenheit überschrieben */
  --team: var(--team-reindeer);
  --card-bg: #f1f3f7;
  --card-pattern: rgba(29, 32, 51, 0.04);
  --card-header: #6b6f86;
  --card-accent: #9a9cab;

  position: relative;           /* Bezugspunkt für die absolut liegenden Glanz-Ebenen */
  display: flex;
  flex-direction: column;
  border: var(--outline) solid var(--ink);
  border-radius: 16px;
  overflow: hidden;             /* schneidet den 300 % großen Regenbogen an den runden Ecken ab
                                   = das "Fenster", durch das man nur einen Ausschnitt sieht */
  color: var(--text-dark);
  background:
    repeating-linear-gradient(135deg, var(--card-pattern) 0 2px, transparent 2px 9px),  /* feines Ausweis-Muster */
    var(--card-bg);
  box-shadow:
    0 5px 0 var(--ink),
    0 12px 24px rgba(14, 18, 40, 0.3);

  /* DIE NEIGUNG:
     perspective = 3D-Tiefe (wie weit die "Kamera" weg ist; kleiner = stärkerer 3D-Effekt)
     rotateX     = nach oben/unten kippen
     rotateY     = nach links/rechts kippen
     Die Neigung selbst ist NICHT der Holo-Effekt – sie sorgt nur dafür, dass es
     sich so anfühlt, als würde man die Karte im Licht drehen.                 */
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));

  /* Maus weg: Karte gleitet langsam (0.5 s) zurück */
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}

/* Maus drauf: Karte folgt schnell (0.1 s), wird etwas größer, Schatten stärker */
.id-card:hover {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) scale(1.04);
  transition: transform 0.1s ease-out, box-shadow 0.3s ease;
  box-shadow:
    0 5px 0 var(--ink),
    0 22px 40px rgba(14, 18, 40, 0.45);
  z-index: 2;                   /* liegt über den Nachbarkarten */
}

/* ---------- Team -> Farbe des Passfotos ---------- */
.id-card--reindeer { --team: var(--team-reindeer); }
.id-card--werdigo  { --team: var(--team-werdigo); }
.id-card--neutral  { --team: var(--team-neutral); }
.id-card--unknown  { --team: #a9b0c3; }          /* Rolle unbekannt -> grau */

/* ---------- Seltenheit -> Hintergrund + Kopfzeile ---------- */
.id-card--normal {
  --card-bg: #f1f3f7;
  --card-header: #6b6f86;
  --card-accent: #b8bccb;
}
.id-card--good {
  --card-bg: #d9eefc;
  --card-pattern: rgba(40, 110, 170, 0.08);
  --card-header: #3b6e99;
  --card-accent: #7fbde8;
}
.id-card--evil {
  --card-bg: #f4c4bf;
  --card-pattern: rgba(140, 30, 40, 0.08);
  --card-header: #8e2f3a;
  --card-accent: #d4604f;
}
.id-card--special {
  --card-bg: #fbf7ff;
  --card-pattern: rgba(120, 80, 180, 0.06);
  --card-header: linear-gradient(90deg, #7b4fc9, #d1478f, #e79a2d);
  --card-accent: #f2b544;
  /* farbiger Schein unter der Karte */
  box-shadow:
    0 5px 0 var(--ink),
    0 12px 28px rgba(123, 79, 201, 0.45);
}

/* ---------- Inhalt ---------- */

/* Inhalt liegt ÜBER dem Glanz (z-index 1), damit der Text lesbar bleibt.
   Das ist unsere einfache "Mask" aus dem Shader: Der Regenbogen (z-index 0)
   ist nur dort zu sehen, wo kein Inhalt darüber liegt – also auf dem
   Kartenhintergrund, nicht auf Schrift und Foto.                            */
.id-card__header,
.id-card__body,
.id-card__footer {
  position: relative;
  z-index: 1;
}

/* Kopfzeile: "Werdigo · Identity Card"  …  "No. 004" */
.id-card__header {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px 7px;
  border-bottom: 5px solid var(--card-accent);
  background: var(--card-header);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.id-card__number { opacity: 0.8; }

.id-card__body {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 18px 14px;
  flex: 1;
}

/* Passfoto links */
.id-card__photo {
  position: relative;
  display: grid;
  place-items: end center;
  aspect-ratio: 3 / 4;
  align-self: start;
  min-width: 0;
  width: 100%;
  border: var(--outline) solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.45), transparent 60%),
    var(--team);
  color: rgba(29, 32, 51, 0.6);
}
.id-card__photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.id-card__silhouette { width: 92%; }

/* Schloss (gesperrt) und Kreuz (tot) liegen über dem Foto – nur bei .is-locked / .is-dead sichtbar */
.id-card__lock,
.id-card__dead {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(29, 32, 51, 0.35);
}
.id-card__lock { color: var(--snow); }
.id-card__dead { color: var(--red-light); }
.id-card__lock svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 3px 0 var(--ink));
}
.id-card__dead svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 3px 0 var(--ink));
}

/* Text rechts */
.id-card__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.id-card__name {
  margin: 2px 0 8px;
  font-size: 30px;
  line-height: 1;
}
.id-card__desc {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.45;
  color: #3b3f57;
}

/* Fußzeile: links Status, rechts Seltenheit */
.id-card__footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 18px;
  border-top: 2px dashed rgba(29, 32, 51, 0.25);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.id-card__status { color: var(--green); }
.id-card__rarity { color: var(--text-muted); }
.id-card--good .id-card__rarity { color: #3b6e99; }
.id-card--evil .id-card__rarity { color: #8e2f3a; }
.id-card--special .id-card__rarity {
  background: linear-gradient(90deg, #7b4fc9, #d1478f, #e79a2d);  /* Text in Regenbogenfarben */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- DER HOLO-GLANZ ----------
   Ein Regenbogen-Verlauf, der viel größer ist als die Karte (300 %).
   Je nachdem, wo die Maus ist (--mx / --my), sieht man einen anderen
   Ausschnitt davon -> beim Bewegen "wandern" die Farben über die Karte.

   Zwei Ebenen liegen dafür über der ganzen Karte:
     __shine  = die Holo-Folie (Regenbogen)       -> unter dem Text
     __glare  = die Lichtspiegelung (weißer Fleck) -> über dem Text          */
.id-card__shine,
.id-card__glare {
  position: absolute;
  inset: 0;                     /* deckt die ganze Karte ab (top/right/bottom/left = 0) */
  pointer-events: none;         /* Maus "geht durch" (Klicks + mousemove kommen bei der Karte an) */
}

/* Die Holo-Folie – entspricht im Shader "Regenbogen-Textur, mit View Direction verschoben" */
.id-card__shine {
  z-index: 0;                   /* unter dem Text (siehe "Mask" bei Inhalt) */

  /* Die "Regenbogen-Textur": ein schräger Farbverlauf.
     115deg = Richtung der Streifen (im Shader: Rotate-Node).
     Am Anfang und Ende "transparent" -> der Regenbogen ist nur ein breites
     Band in der Mitte, kein ganzer Farbteppich. */
  background: linear-gradient(115deg,
    transparent 20%,
    #ff8fb1 32%,                /* rosa  */
    #ffd36e 40%,                /* gelb  */
    #93f5b0 48%,                /* grün  */
    #84cfff 56%,                /* blau  */
    #c9a2ff 64%,                /* lila  */
    transparent 78%);

  /* Der Trick: Verlauf 3x so groß wie die Karte. Die Karte zeigt nur 1/3 davon. */
  background-size: 300% 300%;

  /* Welches Drittel man sieht, bestimmt die Maus:
       --mx = 0 %   -> linker Teil des Verlaufs
       --mx = 100 % -> rechter Teil des Verlaufs
     Im Shader: UV + View Direction. Hier: Ausschnitt + Mausposition. */
  background-position: var(--mx) var(--my);

  /* Wie die Farben auf die Karte "gedruckt" werden:
     multiply = wie farbige Folie: färbt den Hintergrund ein, ohne ihn zu übermalen. */
  mix-blend-mode: multiply;

  opacity: 0;                   /* normale Karten: Folie unsichtbar … */
  transition: opacity 0.3s ease;/* … und weich ein-/ausblenden */
}
.id-card:hover .id-card__shine {
  opacity: 0.4;                 /* … nur mit Maus drauf sichtbar (40 %, damit es dezent bleibt) */
}

/* Lichtfleck: ein weißer Kreis genau an der Mausposition.
   Gibt es im Shader-Tutorial nicht direkt – ersetzt das "Leuchten" (Bloom/Emission),
   damit es aussieht, als würde Licht auf der glänzenden Karte spiegeln. */
.id-card__glare {
  z-index: 3;                   /* über dem Text, wie eine Spiegelung auf Glas */
  background: radial-gradient(
    circle at var(--mx) var(--my),   /* Kreismitte = Mausposition */
    rgba(255, 255, 255, 0.7),        /* innen: 70 % weiß */
    transparent 50%);                /* läuft bis zur halben Kartengröße aus */
  mix-blend-mode: overlay;      /* hellt nur auf, Text bleibt trotzdem lesbar */
  opacity: 0;
  transition: opacity 0.3s ease;
}
.id-card:hover .id-card__glare { opacity: 1; }

/* ---------- Spezialkarten: glänzen IMMER, mit Maus noch stärker ----------
   Gleiches Prinzip wie oben, aber mit zwei Unterschieden:
     1. repeating-linear-gradient: Der Regenbogen wiederholt sich (wie die
        "wiederholte Regenbogen-Textur" im Shader) -> überall Farbe statt nur ein Band.
     2. Glitzerpunkte obendrauf (eigene Ergänzung, nicht aus dem Tutorial).
   Mehrere Hintergründe in einer Zeile: der ERSTE liegt oben, der LETZTE unten.
   Schreibweise je Ebene: Bild  Position / Größe                               */
.id-card--special .id-card__shine {
  background:
    /* Glitzerpunkte: zwei Raster aus kleinen weißen Punkten.
       Ein 1px-Punkt pro Kachel; Kachelgrößen 23px und 31px, um 11px versetzt
       -> die Raster überlappen unregelmäßig und wirken wie zufälliger Glitzer.
       Sie bewegen sich NICHT mit der Maus (feste Position 0 0 bzw. 11px 11px). */
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 2px) 0 0 / 23px 23px,
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 2px) 11px 11px / 31px 31px,
    /* Regenbogen-Streifen, die sich alle 35 % wiederholen (rosa am Ende = rosa am Anfang,
       damit es keine harte Kante gibt). Wieder 300 % groß und von der Maus verschoben. */
    repeating-linear-gradient(115deg,
      #ff8fb1 0%, #ffd36e 7%, #93f5b0 14%, #84cfff 21%, #c9a2ff 28%, #ff8fb1 35%)
    var(--mx) var(--my) / 300% 300%;
  opacity: 0.55;                /* ohne Maus schon sichtbar … */
}
.id-card--special:hover .id-card__shine { opacity: 0.85; }   /* … mit Maus kräftiger */

/* Spezialkarten: auch das Passfoto glänzt leicht.
   Das Foto liegt ÜBER der Folie (Mask), deshalb bekommt es eine eigene, kleine
   Glanz-Ebene (::after = unsichtbares Extra-Element im Foto). */
.id-card--special .id-card__photo::after {
  content: "";                  /* ohne content wird ::after nicht angezeigt */
  position: absolute;
  inset: 0;                     /* füllt das ganze Foto */
  pointer-events: none;
  /* Schmaleres Band nur aus rosa + blau, 260 % groß, wieder von der Maus verschoben */
  background: linear-gradient(115deg,
    transparent 25%, rgba(255, 140, 180, 0.5) 40%, rgba(130, 200, 255, 0.5) 55%, transparent 70%)
    var(--mx) var(--my) / 260% 260%;
  mix-blend-mode: soft-light;   /* sehr sanft, damit das Bild erkennbar bleibt */
}

/* ---------- Gesperrte Karte: grau, Schloss, kein Glanz ----------
   Folie (__shine) und Foto-Glanz werden komplett ausgeblendet ("Mask" = 0).
   Neigung und Lichtfleck (__glare) bleiben, damit sich die Karte trotzdem anfassbar anfühlt. */
.id-card.is-locked {
  --card-bg: #d5d9e2;
  --card-pattern: rgba(29, 32, 51, 0.05);
  --card-header: #6e7083;
  --card-accent: #9a9cab;
}
.id-card.is-locked .id-card__shine,
.id-card.is-locked .id-card__photo::after { display: none; }
.id-card.is-locked .id-card__photo { background: #9a9cab; }
.id-card.is-locked .id-card__silhouette,
.id-card.is-locked .id-card__photo img { opacity: 0.4; filter: grayscale(1); }
.id-card.is-locked .id-card__lock { display: grid; }
.id-card.is-locked .id-card__info {
  opacity: 0.55;
  filter: grayscale(1);
}
.id-card.is-locked .id-card__status { color: #4a4d60; }
.id-card.is-locked .id-card__status::before { content: "🔒 "; }

/* ---------- Kleine Karte fürs Spiel (.id-card--compact) ----------
   4 nebeneinander und 4 untereinander passen auf einen Full-HD-Bildschirm.
   Das Passfoto ist quadratisch (Rollen-Icons: 500 x 500 px). */
.id-card--compact { border-radius: 12px; }
.id-card--compact .id-card__header {
  padding: 4px 10px 3px;
  border-bottom-width: 3px;
  font-size: 11px;
}
.id-card--compact .id-card__body {
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px 8px;
}
.id-card--compact .id-card__photo {
  aspect-ratio: 1 / 1;
  border-width: 2px;
  border-radius: 8px;
}
.id-card--compact .id-card__label { font-size: 9px; }
.id-card--compact .id-card__name {
  margin: 1px 0 5px;
  font-size: 19px;
  white-space: nowrap;           /* lange Namen werden mit … gekürzt */
  overflow: hidden;
  text-overflow: ellipsis;
}
.id-card--compact .id-card__team {
  padding: 2px 8px 1px;
  font-size: 11px;
  box-shadow: 0 1px 0 var(--ink);
}
.id-card--compact .id-card__desc { margin-top: 6px; font-size: 12px; line-height: 1.35; }
.id-card--compact .id-card__desc:empty { display: none; }
.id-card--compact .id-card__footer {
  padding: 3px 10px 4px;
  font-size: 11px;
}
.id-card--compact .id-card__dead svg { width: 40px; height: 40px; }

/* Rollen-Karten haben eine Beschreibung -> Foto oben ausrichten statt mittig */
.id-card--compact:not(.id-card--flat) .id-card__body { align-items: start; }

/* ---------- Spieler-Karten (.id-card--flat): keine Neigung, kein Holo ----------
   Beim Drüberfahren nur etwas größer. */
.id-card.id-card--flat {
  transform: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.id-card.id-card--flat:hover { transform: scale(1.07); }
.id-card--flat .id-card__shine,
.id-card--flat .id-card__glare,
.id-card--flat .id-card__photo::after { display: none; }

/* Die eigene Karte: goldener Schein */
.id-card.is-self {
  box-shadow:
    0 5px 0 var(--ink),
    0 0 0 4px var(--gold),
    0 12px 28px rgba(242, 181, 68, 0.45);
}

/* Kann gerade gewählt werden / meine aktuelle Wahl */
.id-card.is-selectable { cursor: pointer; }
.id-card.is-selected {
  box-shadow:
    0 5px 0 var(--ink),
    0 0 0 5px var(--red-light),
    0 14px 30px rgba(194, 74, 62, 0.5);
}
.id-card.is-selected .id-card__rarity::before {
  content: "✔ ";
  color: var(--red-dark);
}

/* Tot: gleiche graue Optik wie gesperrte Karten, aber Kreuz statt Schloss */
.id-card.is-dead {
  --card-bg: #d5d9e2;
  --card-pattern: rgba(29, 32, 51, 0.05);
  --card-header: #6e7083;
  --card-accent: #9a9cab;
}
.id-card.is-dead .id-card__shine,
.id-card.is-dead .id-card__photo::after { display: none; }
.id-card.is-dead .id-card__silhouette { opacity: 0.4; filter: grayscale(1); }
.id-card.is-dead .id-card__dead { display: grid; }
.id-card.is-dead .id-card__info { opacity: 0.65; }
.id-card.is-dead .id-card__status { color: var(--red-dark); }

/* Von Santa gefangen: lila. Den Zustand schickt der Server nur an Santa selbst. */
.id-card.id-card--flat.is-captured {
  --team: #a969d5;
  background: #e6c9f6;
  border-color: #79429c;
  box-shadow: 0 0 0 3px #a969d5, 0 5px 0 #4c2568;
}
.id-card.is-captured .id-card__photo { background: #bd8ce0; }
.id-card.is-captured .id-card__status { color: #612482; }

/* ---------- Gewinner-Karte im Sieg-Fenster (.id-card--win) ----------
   Statt der Beschreibung groß "… has won!", Karte steht still. */
.id-card--win .id-card__desc {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  color: var(--text-dark);
}
.id-card--win .id-card__body { align-items: center; }
.id-card.id-card--win:hover { transform: none; }


/* =====================================================================
   7. SEITEN
   ===================================================================== */

/* ---------- 7.1 Startseite / Hauptmenü (home.html) ---------- */
.title-screen {
  position: relative;
  min-height: 100vh;
  font-size: var(--ui);      /* alles darin skaliert mit der Fensterbreite */
}

/* "WERDIGO" – oben, leicht rechts der Mitte (zwischen Figur und Mond).
   Wenn das Hintergrundbild anders aufgeteilt ist: --title-x ändern. */
.game-title {
  --title-x: 55.6%;
  position: absolute;
  top: 6.4vh;
  left: var(--title-x);
  transform: translateX(-50%);
  margin: 0;
  font-size: 3.98em;
  line-height: 1;
  white-space: nowrap;
  animation: drop-in 600ms ease-out both;
}

/* Handbuch-Knopf oben rechts */
.title-screen .title-screen__account {
  position: absolute;
  top: 3vh;
  right: 2vw;
  font-size: 0.72em;
}

/* Sprachauswahl oben links (home.html, auth.html): zugeklappt nur Flagge + Name,
   Klick klappt die Liste auf. Die Liste füllt js/i18n.js mit den Sprachen vom Server. */
.language-picker {
  position: absolute;
  z-index: 50;
  top: 16px;
  left: 16px;
  color: #fff4dc;
  font-family: var(--font-body, sans-serif);
  font-size: 14px;
}
.language-picker__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  padding: 8px 12px;
  border: 2px solid var(--gold, #f9dfae);
  border-radius: 14px;
  background: #172331ed;
  box-shadow: 0 6px 18px #0006;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.language-picker__toggle::-webkit-details-marker { display: none; }
.language-picker__toggle:hover { background: #1f3045f2; }
.language-picker__toggle:focus-visible { outline: 3px solid white; outline-offset: 2px; }
.language-picker__flag { width: 40px; height: 28px; object-fit: contain; flex-shrink: 0; }
.language-picker__flag[hidden] { display: none; }
.language-picker__label { display: flex; flex-direction: column; flex: 1; line-height: 1.2; }
.language-picker__label small { font-size: 11px; opacity: .75; }
.language-picker__chevron {
  width: 9px;
  height: 9px;
  margin-left: 4px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s ease;
}
.language-picker[open] .language-picker__chevron { transform: translateY(2px) rotate(-135deg); }
.language-picker__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  padding: 10px;
  border: 2px solid var(--gold, #f9dfae);
  border-radius: 14px;
  background: #172331f5;
  box-shadow: 0 10px 24px #0008;
}
.language-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 280px;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-color: #f9dfae #172331;
  overscroll-behavior: contain;
}
.language-options::-webkit-scrollbar { width: 10px; }
.language-options::-webkit-scrollbar-thumb { background: #f9dfae; border-radius: 6px; }
.language-option {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #ffffff12;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.language-option img { width: 54px; height: 38px; object-fit: contain; flex-shrink: 0; }
.language-option span { overflow-wrap: anywhere; }
.language-option:hover { background: #ffffff25; }
.language-option.is-selected { border-color: #f9dfae; background: #f9dfae25; }
.language-option:focus-visible { outline: 3px solid white; outline-offset: -3px; }
#language-status { font-weight: 800; overflow-wrap: anywhere; }
#language-retry { margin-top: 8px; }
#language-retry[hidden] { display: none; }
@media (max-width: 720px) {
  /* Log-in-Seite: Platz oben, damit die Sprachauswahl nicht über dem Titel liegt */
  .container.container--auth { padding-top: 72px; }
  .language-picker { top: 12px; left: 12px; font-size: 13px; }
  .language-picker__toggle { min-width: 0; padding: 6px 10px; }
  .language-picker__flag { width: 32px; height: 22px; }
  .language-options { max-height: 50vh; }
  .language-option img { width: 36px; height: 28px; }
  .title-screen .title-screen__account { right: 12px; top: 12px; }
  .title-screen .game-title { top: 90px; max-width: 95vw; font-size: clamp(36px, 12vw, 80px); }
}

/* Button-Leiste unten mittig */
.main-menu {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 96vw;
  font-size: 0.84em;
  animation: rise-in 600ms 150ms ease-out both;
}

.main-menu__list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75em;
}
.main-menu__list > li { min-width: 0; max-width: 100%; }
.main-menu .btn { max-width: 100%; white-space: normal; }
.main-menu .btn__label { overflow-wrap: anywhere; }

/* Alle Menü-Buttons gleich groß */
.main-menu .btn {
  font-size: 1em;
  min-width: 7.5em;
}
.main-menu .btn__label { font-size: 1.02em; }
.main-menu .btn--shop  { min-width: 8.25em; }

.main-menu .btn--large {
  min-width: 10.5em;
  height: 4.05em;
  padding-top: 0.6em;
  font-size: 1em;
}
.main-menu .btn--large .btn__label { font-size: 1.6em; }

/* "by OnlyReindeer Gaming" unten rechts */
.credit-line {
  position: absolute;
  right: 1.6vw;
  bottom: 1.3vh;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.64em;
  font-weight: 800;
  color: #2b3048;
}

/* Spielversion unten links (js/menu.js) */
.game-version {
  position: absolute;
  left: 1.6vw;
  bottom: 1.3vh;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.56em;
  font-weight: 800;
  color: #2b3048;
  opacity: 0.75;
}

/* ---------- 7.2 Log-in / Sign up (auth.html) ---------- */

/* Trennlinie "— or —" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 2px dashed rgba(29, 32, 51, 0.5);
}

/* Datenschutz-Fenster beim Sign up (js/auth.js) */
.privacy-text {
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding: 16px 20px;
  border: var(--outline) solid var(--ink);
  border-radius: 12px;
  background: var(--snow);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.privacy-text h3 { margin-bottom: 4px; font-size: 22px; }
.privacy-text h4 { margin: 16px 0 4px; font-size: 17px; }
.privacy-text p  { margin-bottom: 8px; }
.privacy-text ul { margin: 0 0 8px 20px; }
.privacy-accept { justify-content: center; margin-top: var(--space-4); }
.privacy-accept:has(input:disabled) { opacity: 0.55; }

/* ---------- 7.3 Play: Lobby-Liste (lobby.html) ---------- */
.lobby-status {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lobby-status--open { color: var(--green); }
.lobby-status--full { color: var(--red); }

/* ---------- 7.4 Warteraum (lobby-room.html) ---------- */
.lobby-code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 18px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius);
  background: var(--snow);
  color: var(--text-dark);
  box-shadow: inset 0 -5px 0 var(--snow-shade), 0 4px 0 var(--ink);
}
.lobby-code-display__code {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.2em;
  line-height: 1;
}

/* Spielerliste */
.player-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.player-list__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--plum-light);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.03em;
}
.player-list__item.is-host::after {
  content: "Host";
  margin-left: auto;
  padding: 1px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--text-dark);
  font-size: 13px;
  text-transform: uppercase;
}
/* Langer Name wird mit "…" gekürzt statt die Zeile zu sprengen */
.player-list__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Nur der Host sieht sie: Host abgeben (👑) und Kicken (✕).
   Erst beim Drüberfahren (oder mit Tab-Fokus) sichtbar. Sie liegen rechts ÜBER der Zeile,
   damit sie auch bei sehr langen Namen vor dem Namen stehen und klickbar bleiben. */
.player-list__actions {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 1;
  display: flex;
  gap: var(--space-2);
  padding-left: 28px;
  /* Verlauf in Zeilenfarbe: der Name verschwindet weich hinter den Knöpfen */
  background: linear-gradient(to right, transparent, var(--plum-light) 24px);
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.player-list__item:hover .player-list__actions,
.player-list__item:focus-within .player-list__actions {
  opacity: 1;
  pointer-events: auto;
}
/* Touch-Geräte haben kein Drüberfahren: Knöpfe immer zeigen, mit eigenem Platz am Zeilenende */
@media (hover: none) {
  .player-list__actions {
    position: static;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 0;
    background: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}
.player-list__action {
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--snow);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1;
}
.player-list__action:hover { background: var(--gold); }
.player-list__action--kick:hover { background: var(--red-light); color: var(--text-light); }
.player-list__action:disabled { opacity: 0.5; cursor: default; }

/* Freier Platz */
.player-list__item--empty {
  border-style: dashed;
  background: transparent;
  color: rgba(246, 240, 245, 0.45);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
}

/* Rollen-Einstellungen des Hosts */
.role-list { display: flex; flex-direction: column; gap: var(--space-2); }

.role-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--snow);
  color: var(--text-dark);
}
.role-row__icon {
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.role-row__icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.role-row__name {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.02em;
}
.role-row__desc {
  font-size: 13px;
  color: var(--text-muted);
}
/* Rolle, die der Host noch nicht freigeschaltet hat */
.role-row.is-locked { opacity: 0.55; }
.role-row__lock {
  display: inline-block;
  margin-left: var(--space-2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  color: var(--red-dark);
}

/* Zusammenfassung Teams (Werdigo 1 / Neutral 1 / Reindeer 5) */
.team-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---------- 7.5 Profil (profile.html) ---------- */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: var(--space-7);
}

.profile-current {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Passwort-Zeile: Punkte + "Change password" */
.password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding: 4px 6px 4px 14px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
}
.password-row__dots {
  letter-spacing: 0.15em;
  color: var(--text-soft);
}

/* Unterer Bereich mit "Delete account" */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 2px dashed rgba(29, 32, 51, 0.5);
}

/* ---------- 7.6 Rewards (rewards.html) ---------- */

/* Leiste mit 10 Levels */
.reward-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.reward-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--snow-shade);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
}
.reward-step small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
}
.reward-step.is-unlocked {
  background: var(--gold);
  color: var(--text-dark);
}
.reward-step.is-current {
  background: var(--snow);
  color: var(--text-dark);
  box-shadow: 0 0 0 3px var(--gold);
}
/* Level mit Rabattcode (darunter steht z.B. "10%") */
.reward-step.has-reward small { color: var(--plum); }
.reward-step.has-reward:not(.is-unlocked):not(.is-current) {
  background: #fdeccb;
  color: var(--gold-dark);
}

/* Rabattcode */
.code {
  display: inline-block;
  padding: 6px 14px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  background: var(--snow);
  color: var(--text-dark);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.code-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--snow);
  color: var(--text-dark);
}
.code-card__percent {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--plum);
}
.code-card__meta {
  font-size: 13px;
  color: var(--text-muted);
}
.code-card.is-used .code-card__percent,
.code-card.is-used .code-card__code,
.code-card.is-used .code-card__meta { opacity: 0.55; }
.code-card.is-used .code { text-decoration: line-through; }

/* Code + "Show/Hide" in einer Zeile; verdeckter Code ist anklickbar */
.code-card__code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 6px;
}
.code-card .code.is-hidden { cursor: pointer; letter-spacing: 0.25em; color: var(--text-muted); }
.code-card__reveal {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: var(--plum);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.code-card__reveal:hover { color: var(--text-dark); }
.code-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}
@media (max-width: 560px) {
  .code-card { grid-template-columns: auto minmax(0, 1fr); }
  .code-card__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Code-Liste auf Rewards: eigener Scrollbereich, damit viele Codes die Seite nicht lang machen */
.code-list {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;                 /* Platz zwischen Karten und Scrollbalken */
  scrollbar-width: thin;
  scrollbar-color: var(--gold, #f9dfae) transparent;
}
.code-list:empty { display: none; }
.code-list:focus-visible { outline: 3px solid white; outline-offset: 4px; border-radius: var(--radius); }
.code-list::-webkit-scrollbar { width: 8px; }
.code-list::-webkit-scrollbar-thumb { background: var(--gold, #f9dfae); border-radius: 6px; }

/* Rewards-Seite (container--fit): auf Desktop passt alles in den Bildschirm, die Seite selbst
   scrollt nicht – die Code-Liste bekommt den restlichen Platz und scrollt in sich.
   Auf Handys / sehr niedrigen Fenstern bleibt es beim normalen Scrollen der Seite. */
@media (min-width: 721px) and (min-height: 640px) {
  /* etwas kompakter, damit für die Codes mehr Platz bleibt */
  .container--fit .page-header { margin-bottom: var(--space-4); }
  .container--fit .panel { padding: var(--space-5); padding-top: calc(var(--space-5) + 6px); }
  .container--fit .panel__title { margin-bottom: var(--space-3); font-size: 24px; }
  .container--fit .mb-6 { margin-bottom: var(--space-4); }
  .container--fit .mb-4 { margin-bottom: var(--space-3); }
  .container--fit #reward-progress-status { margin: 0 0 var(--space-2); }
  .container--fit .code-list__schedule { margin-top: var(--space-3); font-size: 13px; }

  .container--fit {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-top: var(--space-5);
    padding-bottom: var(--space-5);
    overflow: hidden;
  }
  .container--fit > * { flex-shrink: 0; }
  .container--fit > .layout-split {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  .container--fit .panel--codes {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    min-height: 0;
  }
  .container--fit .code-list {
    flex: 1 1 auto;
    min-height: 110px;
    max-height: none;
  }
  .container--fit .mb-6 + .layout-split { margin-top: 0; }
}

/* Hinweise unter der Code-Liste (keine Codes, nächster Code, Belohnungsplan) */
.code-list__status { color: var(--text-soft); }
.code-list__schedule {
  margin-top: var(--space-5);
  font-size: 14px;
  color: var(--text-soft);
}
.code-list__schedule p + p { margin-top: var(--space-2); }
.code-list__next {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--gold-light);
}

/* "How to earn XP" */
.xp-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid var(--snow-shade);
}
.xp-list strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  color: var(--gold-dark);
}

/* ---------- 7.6b Shop (shop.html, js/shop.js) ----------
   Produkt-Raster, Warenkorb als Seitenleiste von rechts (<dialog>).
   Bildfläche je Kategorie: class="tile tile--meat" usw.                 */

.tile          { background: var(--tile, var(--snow-shade)); }
.tile--meat    { --tile: #f0b7a6; }
.tile--rides   { --tile: #a9c8e6; }
.tile--rental  { --tile: #f5d08a; }
.tile--extras  { --tile: #b9dcbf; }

/* Begrüßung oben */
.shop-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.shop-hero__icon  { font-size: 56px; line-height: 1; }
.shop-hero__title {
  margin-bottom: 6px;
  font-size: 26px;
  text-transform: uppercase;
}

/* Kategorien + Suche */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.shop-toolbar .tabs { max-width: 100%; overflow-x: auto; }
.shop-toolbar .tabs__tab { white-space: nowrap; }
.shop-search { width: 280px; max-width: 100%; }

/* Produkte */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-5);
}

.product {
  display: flex;
  flex-direction: column;
  border: var(--outline) solid var(--ink);
  border-radius: 16px;
  background: var(--snow);
  color: var(--text-dark);
  overflow: hidden;
  box-shadow:
    inset 0 -6px 0 var(--snow-shade),
    0 5px 0 var(--ink),
    0 12px 24px rgba(14, 18, 40, 0.3);
  transition: transform var(--transition);
}
.product:hover { transform: translateY(-3px); }

.product__image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-bottom: var(--outline) solid var(--ink);
  font-size: 64px;
  line-height: 1;
}
.product__tag {
  position: absolute;
  top: 10px;
  left: 10px;
}

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-4) var(--space-4) calc(var(--space-4) + 6px);
}
.product__name { font-size: 20px; }
.product__desc { font-size: 14px; color: var(--text-muted); }

.product__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: auto 0 var(--space-2);
  padding-top: var(--space-2);
}
.product__price {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--plum);
}
.product__unit { font-size: 13px; color: var(--text-muted); }

/* Zahl am Warenkorb-Button */
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.35em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: var(--text-light);
  font-size: 0.8em;
  text-shadow: none;
}
.btn.is-bumped { animation: cart-bump 300ms ease; }

/* Warenkorb: Seitenleiste rechts */
.cart-drawer {
  inset: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-left: var(--outline) solid var(--ink);
  background: var(--snow);
  color: var(--text-dark);
  box-shadow: -12px 0 40px rgba(10, 12, 30, 0.45);
}
.cart-drawer[open] { animation: slide-in-right 220ms ease both; }
.cart-drawer::backdrop {
  background: rgba(14, 18, 40, 0.6);
  backdrop-filter: blur(3px);
}

.cart-drawer__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: var(--outline) solid var(--ink);
  background: var(--plum);
  color: var(--text-light);
}
.cart-drawer__header h2 { font-size: 28px; text-transform: uppercase; }
.cart-drawer__close {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--plum-light);
  color: var(--text-light);
  font-size: 18px;
  box-shadow: 0 2px 0 var(--ink);
}
.cart-drawer__close:hover { background: var(--plum-dark); }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) var(--space-5);
}

.cart-drawer__footer {
  padding: var(--space-5);
  border-top: var(--outline) solid var(--ink);
  background: #fff;
}

/* Fehlertexte sind für dunkle Panels gedacht -> hier dunkler */
.cart-drawer .field__error { color: var(--red-dark); }
.cart-drawer .link-btn     { color: var(--plum); }

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-7) 0;
  color: var(--text-muted);
  text-align: center;
}
.cart-empty__icon { font-size: 48px; line-height: 1; }

.cart-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: 14px 0;
  border-bottom: 2px solid var(--snow-shade);
}
.cart-item__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 28px;
}
.cart-item__name  { font-weight: 800; line-height: 1.25; }
.cart-item__price { font-size: 13px; color: var(--text-muted); }
.cart-item__controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.cart-item__total {
  font-family: var(--font-display);
  font-size: 18px;
}
.cart-item__remove {
  padding: 0;
  border: none;
  background: none;
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.stepper button:disabled { opacity: 0.4; cursor: default; }

/* Rabattcode */
.discount-form { margin-bottom: var(--space-3); }
.discount-form .field__label { display: block; margin-bottom: 6px; }
.discount-form__row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: 6px;
}
.discount-form__row .input {
  min-height: 44px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.applied-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.applied-code__hint {
  width: 100%;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-dark);
}
.applied-code__hint:empty { display: none; }

/* Summen */
.cart-summary { margin: 0 0 var(--space-4); }
.cart-summary div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.cart-summary dt,
.cart-summary dd { margin: 0; }
.cart-summary__discount dd { color: #3f7a2c; font-weight: 800; }
.cart-summary__total {
  margin-top: 6px;
  padding-top: 10px !important;
  border-top: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
}

.cart-note {
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- 7.7 Credits (credits.html) ---------- */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}
.credit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}
.credit-card__name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
}
.credit-card__role {
  font-size: 14px;
  color: var(--text-soft);
}
.panel--snow .credit-card__role { color: var(--text-muted); }

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---------- 7.7b Handbuch (handbook.html, im Spiel Reiter "Handbook") ---------- */
.handbook {
  display: grid;
  gap: var(--space-4);
}
.handbook .panel__title { margin-bottom: var(--space-3); }
.handbook__list {
  display: grid;
  gap: var(--space-2);
  padding-left: 1.3em;
}
.handbook__list--steps li::marker { font-family: var(--font-display); }
.handbook__note {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* ---------- 7.8 Characters (characters.html) ---------- */
.id-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

/* ---------- 7.9 Spiel (game.html) ----------
   Links die Karten (breit), rechts der Chat (fest 380px)               */
.game-header {
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.game-header .page-title { font-size: 40px; }
.game-header__sub {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.game-header__end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-left: auto;
}

/* Countdown der Phase */
.game-timer {
  min-width: 92px;
  padding: 6px 16px 4px;
  border: var(--outline) solid var(--ink);
  border-radius: 999px;
  background: var(--snow);
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 -4px 0 var(--snow-shade), 0 3px 0 var(--ink);
}
.game-timer.is-urgent {
  background: var(--red);
  color: var(--text-light);
  box-shadow: inset 0 -4px 0 var(--red-dark), 0 3px 0 var(--ink);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--space-6);
  align-items: start;
}

/* Hinweis-Leiste: was gerade zu tun ist */
.game-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: 6px 12px 6px 20px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius);
  background: var(--snow);
  color: var(--text-dark);
  box-shadow: inset 0 -5px 0 var(--snow-shade), 0 4px 0 var(--ink);
}
.game-action__text {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.02em;
}

/* Kartenraster: 4 Spalten (bei kleineren Bildschirmen weniger, siehe "10.") */
.game-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}
.game-cards[hidden] { display: none; }

/* Chat */
.game-chat {
  position: sticky;              /* bleibt beim Scrollen der Karten sichtbar */
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  height: min(760px, calc(100vh - 2 * var(--space-5)));
}

/* Hülle um die Kanäle – Bezugspunkt für den Pfeil "nach unten" */
.chat-logs-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Pfeil nach unten, mittig unten im Chat – nur wenn man hochgescrollt hat (js/game.js updateJump) */
.chat-jump {
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--outline) solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: var(--text-dark);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 3px 0 var(--ink), 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
}
.chat-jump:hover { background: var(--gold-light); }
/* Zahl der ungelesenen Nachrichten oben rechts am Pfeil */
.chat-jump__count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

/* Pro Kanal eine Liste, nur die aktive ist sichtbar */
.chat-logs {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-log {
  flex: 1;
  min-height: 0;                 /* nötig, damit die Liste im Flex-Layout scrollt */
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--plum-dark);
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.chat-msg__bubble {
  min-width: 0;
  padding: 6px 12px 7px;
  border: 2px solid var(--ink);
  border-radius: 4px 12px 12px 12px;
  background: var(--snow);
  color: var(--text-dark);
}
.chat-msg__meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
}
.chat-msg__meta strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--plum);
}
.chat-msg__text {
  font-size: 15px;
  overflow-wrap: anywhere;       /* lange Wörter brechen statt das Layout zu sprengen */
}

/* Eigene Nachrichten rechts und in Gold */
.chat-msg--self { flex-direction: row-reverse; }
.chat-msg--self .chat-msg__bubble {
  border-radius: 12px 4px 12px 12px;
  background: var(--gold-light);
}

.chat-form {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.chat-form .input:disabled {
  background: var(--snow-shade);
  cursor: not-allowed;
}
.chat-form__hint {
  margin-top: 6px;
  font-size: 12px;
  text-align: right;
  opacity: 0.7;
}

/* Nacht: <body class="is-night"> dunkelt den Hintergrund ab */
.is-night .screen__bg--dim::after { background: rgba(8, 10, 32, 0.78); }

/* Himmel im Spiel. js/game.js setzt <body data-sky="…"> je nach Phase:
     night  Werdigos sind dran   → Mond oben, Sterne, Sonne unter dem Horizont
     dusk   Santa ist dran       → Sonne geht unter, rot-orange Sonne halb am Horizont
     day    Rentiere sind dran   → Sonne ganz oben (gelb); danach geht sie wieder unter
   Mond und Sonne stehen im freien Platz hinter der Kopfzeile (game.html .sky), deren
   Unterkante ist der Horizont – Karten und Chat würden sie sonst verdecken.
   Der Wechsel ist eine einfache CSS-Transition. */
.game-header {
  --sky-time: 3s;
  position: relative;
  isolation: isolate;      /* .sky (z-index -1) liegt hinter dem Kopfzeilen-Inhalt, aber über dem Seitenhintergrund */
}
.sky {
  position: absolute;
  inset: calc(-1 * var(--space-5)) 0 0 0;   /* bis zum oberen Seitenrand */
  z-index: -1;
  overflow: hidden;        /* unter dem Horizont = unsichtbar */
  pointer-events: none;
  /* Horizont weich auslaufen lassen */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent);
}

.sky__sun,
.sky__moon {
  position: absolute;
  bottom: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, calc(100% + 70px));   /* Ausgangslage: ganz unter dem Horizont (samt Schein) */
  transition: transform var(--sky-time) ease-in-out,
              background-color var(--sky-time) ease, box-shadow var(--sky-time) ease;
}
.sky__sun {
  left: 54%;
  width: clamp(44px, 5vw, 64px);
  background-color: #ff5f2e;
  box-shadow: 0 0 28px 8px rgba(255, 95, 46, 0.6);
}
/* Mondsichel: der Schatten ist der Mond, das Element selbst bleibt durchsichtig */
.sky__moon {
  left: 46%;
  width: clamp(36px, 4vw, 52px);
  box-shadow: inset -12px -5px 0 0 #f4efcf;
  filter: drop-shadow(0 0 10px rgba(244, 239, 207, 0.6));
}

/* Morgenrot rund um die aufgehende Sonne */
.sky__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 40% 120% at 54% 100%, rgba(255, 120, 60, 0.55), rgba(255, 150, 90, 0.15) 55%, transparent 75%);
  opacity: 0;
  transition: opacity var(--sky-time) ease;
}

/* Sterne im ganzen Hintergrund – über der Abdunkelung, nur nachts */
.sky-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 3s ease;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 28% 42%, #fff 99%, transparent),
    radial-gradient(2px 2px at 41% 8%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 57% 33%, #fff 99%, transparent),
    radial-gradient(2px 2px at 66% 6%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 83% 27%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 92% 51%, #fff 99%, transparent),
    radial-gradient(2px 2px at 7% 58%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 49% 61%, #fff 99%, transparent),
    radial-gradient(1.5px 1.5px at 74% 63%, #fff 99%, transparent);
}
.screen__bg--dim:has(.sky-stars)::after { transition-duration: 3s; }

/* Tageshimmel: hellblau statt Nachtblau – liegt über der Abdunkelung und wird am Tag eingeblendet */
.sky-daylight {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 3s ease;
  background: linear-gradient(180deg,
      #4b8fd6 0%,
      #79b4e8 40%,
      #b9dcf4 68%,
      #e4f1fa 82%,
      var(--snow) 100%);
}
[data-sky="day"] .sky-daylight { opacity: 1; }
/* Gelbe Unterzeile ("DISCUSSION") auf hellem Himmel mit dunkler Kontur lesbar halten */
[data-sky="day"] .game-header__sub {
  -webkit-text-stroke: 0.12em var(--ink);
  paint-order: stroke fill;
}

/* Nacht: Mond oben, Sterne an */
[data-sky="night"] .sky__moon  { transform: translate(-50%, -18px); }
[data-sky="night"] .sky-stars  { opacity: 0.85; }

/* Dämmerung: Mond geht unter, Sonne halb am Horizont, rot-orange, warmer Himmel */
[data-sky="dusk"] .sky__sun  { transform: translate(-50%, 50%); }
[data-sky="dusk"] .sky__glow { opacity: 1; }
[data-sky="dusk"] .sky-stars { opacity: 0.2; }
[data-sky="dusk"] .screen__bg--dim::after { background: rgba(48, 24, 46, 0.6); }

/* Tag: Sonne ganz oben, gelb */
[data-sky="day"] .sky__sun {
  transform: translate(-50%, -18px);
  background-color: #ffd54a;
  box-shadow: 0 0 34px 12px rgba(255, 213, 74, 0.5);
}

/* Bestätigen-Knopf im Spiel (js/game.js renderPhase): Auswahl getroffen, aber noch nicht bestätigt.
   Der Rahmen leuchtet golden auf, der Knopf wird kurz größer und wieder kleiner – damit er sofort ins Auge sticht.
   Ohne Animation ("weniger Bewegung") bleibt der Leuchtrahmen stehen. */
.btn.is-pulsing {
  box-shadow:
    inset 0 -0.32em 0 var(--btn-dark),
    0 0.22em 0 var(--ink),
    0 0 0 4px var(--gold-light),
    0 0 16px 4px rgba(242, 181, 68, 0.6);
  animation: confirm-pulse 1.3s ease-in-out infinite;
}
@keyframes confirm-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 -0.32em 0 var(--btn-dark),
      0 0.22em 0 var(--ink),
      0 0 0 0 rgba(248, 201, 98, 0),
      0 0 0 0 rgba(242, 181, 68, 0);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      inset 0 -0.32em 0 var(--btn-dark),
      0 0.22em 0 var(--ink),
      0 0 0 4px var(--gold-light),
      0 0 22px 8px rgba(242, 181, 68, 0.75);
  }
}

/* Phasen-Anzeige beim Phasenwechsel (game.html #phase-banner, js/game.js showPhaseBanner)
   Kurz mittig im Vordergrund, Klicks gehen durch. Farbe passend zur Phase. */
.phase-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: min(92vw, 520px);
  padding: var(--space-5) var(--space-6);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(16, 20, 48, 0.95);
  box-shadow: 0 6px 0 var(--ink), 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--text-light);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}
.phase-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1), visibility 0s;
}
.phase-banner--santa      { background: rgba(72, 30, 44, 0.95); }
.phase-banner--voting     { background: rgba(38, 62, 112, 0.95); }
.phase-banner--death      { background: rgba(78, 22, 32, 0.95); }

/* Tote mit Rolle: "Anna  [Werdigo]" */
.phase-banner__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.phase-banner__list:empty { display: none; }
.phase-banner__list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 100%;
}
.phase-banner__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
}
.phase-banner__list .badge { flex-shrink: 0; }

.phase-banner__icon {
  display: block;
  font-size: 44px;
  line-height: 1;
}
.phase-banner__title {
  margin-top: var(--space-2);
  font-size: clamp(36px, 8vw, 52px);
  line-height: 1.05;
}
.phase-banner__next {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.phase-banner__next:empty { display: none; }
.phase-banner__text {
  margin-top: var(--space-3);
  font-size: 15px;
  font-weight: 700;
  opacity: 0.85;
}

/* Sieg-Fenster am Rundenende (js/game.js showWinnerOnce)
   Ganzer Bildschirm, Konfetti-Canvas hinten, Gewinner-Karte in der Mitte.
   Kein transform am <dialog> selbst – sonst wäre das Canvas nicht bildschirmfüllend. */
.game-end {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
.game-end::backdrop {
  background: rgba(14, 18, 40, 0.7);
  backdrop-filter: blur(4px);
}
.game-end__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.game-end__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  height: 100%;
  padding: 16px;
  text-align: center;
}
.game-end__kicker {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--snow);
  animation: win-fade-up 500ms ease-out both;
}
/* Wrapper animiert – die Karte selbst braucht transform für Hover-Effekte */
.game-end__card {
  width: min(440px, 100%);
  animation: win-card-in 700ms cubic-bezier(0.2, 1.4, 0.4, 1) 150ms both;
}
.game-end__winners {
  max-width: 440px;
  color: var(--text-soft);
  font-weight: 700;
  animation: win-fade-up 500ms ease-out 600ms both;
}
.game-end .btn { animation: win-fade-up 500ms ease-out 750ms both; }

/* "You won!" / "You lost…" */
.game-end__result {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--snow);
  -webkit-text-stroke: 0.06em var(--ink);
  paint-order: stroke fill;
  animation: win-fade-up 500ms ease-out 100ms both;
}
.game-end__result.is-won  { color: var(--gold-light); }
.game-end__result.is-lost { color: var(--snow-shade); }

/* EXP-Balken unter der Karte (Bausteine aus "5.9 XP-Balken") */
.game-end__exp {
  width: min(440px, 100%);
  color: var(--text-light);
  animation: win-fade-up 500ms ease-out 650ms both;
}
.game-end__exp-gain {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-light);
}
.game-end__exp-parts {
  margin: calc(var(--space-2) * -1) 0 var(--space-2);
  font-size: 13px;
  opacity: .8;
}
.game-end__exp-parts:empty { display: none; }
.game-end__levelup {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: 28px;
  text-transform: uppercase;
  color: var(--gold);
  -webkit-text-stroke: 0.05em var(--ink);
  paint-order: stroke fill;
}
.game-end__levelup.is-popping { animation: level-up-pop 700ms cubic-bezier(0.2, 1.6, 0.4, 1) both; }

/* Werdigo-Nacht: Karte, die das Rudel gewählt hat (Namen stehen in der Fußzeile) */
.id-card.is-hunted .id-card__rarity { color: var(--red-dark); }
.id-card.is-considered:not(.is-selected) { outline: 2px dashed var(--gold); outline-offset: 3px; }
.id-card.is-pending { box-shadow: 0 5px 0 var(--ink), 0 0 0 4px var(--gold); }
.id-card.is-pending .id-card__rarity::before { content: "◌ "; color: var(--ink); }
.pack-choice { display: block; padding: 3px 5px; margin-top: 3px; border-radius: 4px; overflow-wrap: anywhere; }
.pack-choice--pending { border: 1px dashed var(--gold); background: #f2b54422; color: var(--ink); }
.pack-choice--locked { border: 1px solid var(--red-dark); background: #d4604f22; color: var(--red-dark); }


/* =====================================================================
   8. HILFSKLASSEN
   ===================================================================== */

/* Nur für Screenreader sichtbar */
.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;
}

/* Ausblenden auch dann, wenn die Klasse sonst ein display setzt (z.B. .btn) */
.hidden      { display: none !important; }
.text-center { text-align: center; }

.stack    { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-6); }
.row      { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--center  { justify-content: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }


/* =====================================================================
   9. ANIMATIONEN
   ===================================================================== */
@keyframes pop-in {                 /* Modals */
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes drop-in {                /* "WERDIGO" auf der Startseite */
  from { opacity: 0; transform: translate(-50%, -20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes rise-in {                /* Hauptmenü auf der Startseite */
  from { opacity: 0; transform: translate(-50%, 24px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes win-fade-up {            /* Sieg-Fenster: Texte und Buttons */
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes win-card-in {            /* Sieg-Fenster: Karte springt herein */
  from { opacity: 0; transform: scale(0.5) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes slide-in-right {         /* Shop: Warenkorb fährt von rechts herein */
  from { transform: translateX(100%); }
  to   { transform: none; }
}

@keyframes cart-bump {              /* Shop: Warenkorb-Button nach "Add to cart" */
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.15); }
}

@keyframes level-up-pop {           /* Sieg-Fenster: "Level up!" */
  0%   { opacity: 0; transform: scale(0.4); }
  60%  { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}


/* =====================================================================
   10. BILDSCHIRMGRÖSSEN
   ===================================================================== */

/* Spiel: 3 Kartenspalten */
@media (max-width: 1280px) {
  .game-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Spiel: Chat unter die Karten */
@media (max-width: 980px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-chat {
    position: static;
    height: 540px;
  }
}

/* Tablets: einspaltig */
@media (max-width: 720px) {
  .id-card-grid, .profile-layout, .layout-split { grid-template-columns: minmax(0, 1fr); }
  .page-header { flex-wrap: wrap; }
  .game-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Handys */
@media (max-width: 560px) {
  .container { padding: var(--space-5) var(--space-4); }
  .page-title { font-size: 36px; }
  .game-cards { grid-template-columns: minmax(0, 1fr); }
  .game-action { flex-wrap: wrap; }
  .shop-search { width: 100%; }
  .shop-hero__icon { display: none; }
  /* Shop-Kopf: Back + Cart in einer Zeile, Titel darunter */
  .page-header--shop { gap: var(--space-4); }
  .page-header--shop .page-title { order: 3; width: 100%; }
  .cart-drawer { border-left: none; }
}

@media (max-width: 480px) {
  .id-card--win .id-card__body { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .id-card--win .id-card__name { font-size: 24px; }
  .id-card--win .id-card__desc { font-size: 20px; }
}

/* Wer im Betriebssystem "weniger Bewegung" eingestellt hat, bekommt keine Animationen */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
