* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #1b1d2a;
  color: #f2f2f2;
  -webkit-user-select: none;
  user-select: none;
  /* kein Doppeltipp-Zoom (stört beim schnellen Drücken), Zoomen mit zwei Fingern bleibt möglich;
     die Spiel-Buttons selbst haben touch-action: none */
  touch-action: manipulation;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 16px;
}

h1 { font-size: 1.2rem; margin: 0; }
#version { font-size: 0.75rem; font-weight: normal; opacity: 0.6; color: inherit; text-decoration: none; }
#version:hover, #version:focus-visible { opacity: 1; text-decoration: underline; }  /* führt zu „Was ist neu?“ */
/* „Open Beta“ neben der Version, auf allen Seiten; Erklärung als Tooltip (header.betaHint); in der App lobby.gd */
.beta-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; vertical-align: 0.25em;
  border: 1px solid #ffb74d; background: #3a2a10; color: #ffcc80;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; cursor: help;
}
#status { font-size: 0.9rem; opacity: 0.8; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

#game canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  border-radius: 6px;
}

/* nach einem Tod gesperrt: erst loslassen, dann zählt der Button wieder */
/* Farben aus client/shared/look.json (buttons.colors, buttons.states – main.js setzt sie als Variablen) */
#my-button.locked, #pad button.locked {
  background: repeating-linear-gradient(45deg, var(--btn-locked, #8e1b1b) 0 8px, var(--btn-lockedStripe, #5d1010) 8px 16px);
}
/* der eigene Button war schuld: kurz gelb umrandet blinken */
#my-button.blamed, #pad button.blamed { animation: blamed 0.5s ease-in-out 6 alternate; }
@keyframes blamed {
  to { box-shadow: 0 0 0 5px var(--btn-blamed, #ffd54f); }
}

#my-button {
  width: 100%;
  min-height: 120px;
  font-size: 2rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  background: var(--btn, #e53935);
  color: #fff;
  touch-action: none;
  cursor: pointer;
}
#my-button.down { background: var(--btn-down, #43a047); transform: scale(0.98); }

/* Mehrere eigene Buttons (Solo oder z. B. 2 Spieler × 2): zum Antippen nebeneinander –
   laufen links, ducken und springen rechts (Daumen). Spalten setzt main.js. */
#pad {
  display: grid;
  gap: 10px;
}
#pad[hidden] { display: none; }
#pad button {
  min-height: 110px;
  font-size: 2.6rem;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  background: var(--btn, #e53935);
  color: #fff;
  cursor: pointer;
  touch-action: none;           /* kein Scrollen/Zoomen beim Drücken */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;  /* iOS: kein Menü bei langem Drücken */
  -webkit-tap-highlight-color: transparent;
}
#pad.many button { font-size: 2rem; }
#my-button, #pad button { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#my-button[hidden] { display: none; }  /* mehrere eigene Buttons: nur das Pad */
/* Tastenkappen auf den Buttons – nur am PC (Klasse .keyboard setzt main.js) */
.key-hint { display: none; }
.keyboard .key-hint { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
/* Tasten des Controllers (🎮) – nur, solange einer verbunden ist (Klasse .gamepad setzt main.js) */
.pad-hint { display: none; }
.gamepad .pad-hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 6px; }
.keyboard.gamepad .pad-hint { margin-top: 4px; }
.pad-hint .pad-icon { font-size: 1rem; line-height: 1; }
/* Tasten einer Rolle neben dem Text eines Knopfs: „Bereit“ (A/Start), „← Menü“ (Back) – #197 */
.gamepad .pad-hint.pad-role { display: inline-flex; margin: 0 0 0 4px; vertical-align: middle; }
.key-hint kbd, .pad-hint kbd {
  padding: 1px 7px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.18);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}
#pad.many .key-hint kbd, #pad.many .pad-hint kbd { padding: 0 4px; font-size: 0.7rem; }
/* Koop: wer den Button hält (und wie oft schuld), klein im Button; in Solo leer */
.button-name { font-size: 0.85rem; font-weight: normal; opacity: 0.9; }
.button-name:empty { display: none; }
#pad.many .button-name { font-size: 0.7rem; }
#pad button.down { background: var(--btn-down, #43a047); transform: scale(0.97); }

.ranking-variant-row { font-size: 0.95rem; }
.ranking-variant-row label { margin-right: 8px; }
#ranking-day, .ranking-day-step, #ranking-more {
  padding: 4px 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
}
.ranking-variant-row { text-align: center; margin: 0 0 12px; }
#my-button:disabled { background: var(--btn-disabled, #444); cursor: default; }

#hint { text-align: center; opacity: 0.7; font-size: 0.9rem; }
#hint:empty { display: none; }

h1 a { color: inherit; text-decoration: none; }
h1 .logo { height: 1.5em; width: auto; margin-right: 8px; vertical-align: -0.35em; }  /* Logo (client/shared/logo.svg, auch in der App) */

#lobby { text-align: center; padding: 48px 0; }
/* Hinweis im Kopf des Dashboards: mittig in der Titelzeile, Schrift so groß wie der Titel; nur im Dashboard
   (nicht im Spiel und nicht auf den anderen Seiten). Schmale Fenster: eigene Zeile unter Titel und Knöpfen. */
.vibe-badge { display: none; margin: 0; font-size: 1.2rem; line-height: 1.4; text-align: center; white-space: nowrap; }
.vibe-pill {
  display: inline-block; padding: 2px 14px; border-radius: 999px;
  border: 1px solid #6c5ce7; background: #2a2550; color: #f2f2f2;
}
.vibe-pill strong { color: #c9b8ff; }
body:has(#lobby:not([hidden])) .vibe-badge { display: block; }
@media (min-width: 1100px) {
  header { position: relative; }
  .vibe-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
}
@media (max-width: 1099px) {
  header { flex-wrap: wrap; row-gap: 8px; }
  .vibe-badge { order: 3; flex-basis: 100%; white-space: normal; }
}
.notice.error-notice { border-color: rgba(255, 82, 82, 0.6); border-left-color: #ff5252; background: rgba(74, 24, 30, 0.9); color: #ffcdd2; }
/* Beitritts-Dialog: Nickname vom Namensfilter abgelehnt (#70) – ein Hinweis in Hinweisfarbe, kein technischer Fehler */
#join-error { color: #90caf9; margin: 0; }
#join-error:empty { display: none; }
.lobby-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.lobby-note { opacity: 0.7; font-size: 0.9rem; }

#dev { margin: 24px auto 0; max-width: 320px; }
#dev summary { cursor: pointer; opacity: 0.7; font-size: 0.9rem; }
#dev[open] summary { margin-bottom: 8px; }
#dev label { margin-right: 8px; }
#start-level {
  width: 6em;
  padding: 6px 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  -webkit-user-select: text;
  user-select: text;
}
#create, #create-solo {
  font-size: 1.4rem;
  font-weight: bold;
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  background: #43a047;
  color: #fff;
  cursor: pointer;
}
#create, #create-solo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 300px;      /* beide gleich breit; der Hinweis bricht um */
  max-width: 100%;
}
#create .start-hint, #create-solo .start-hint { font-size: 0.8rem; font-weight: normal; opacity: 0.9; }
#create-solo { background: #5e35b1; }
#create:disabled, #create-solo:disabled { background: #444; cursor: default; }
/* „🎲 Mitspieler finden“ (main.js): dritter Start-Button unter Koop/Solo. Während der Suche ersetzt der Kasten #match
   die Start-Buttons an derselben Stelle – nichts darüber oder daneben verschiebt sich. */
#match-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 420px;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 10px 24px;
  border: 2px solid #ffb300;
  border-radius: 12px;
  background: transparent;
  color: #ffe082;
  font: inherit;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
}
#match-start .start-hint { font-size: 0.8rem; font-weight: normal; opacity: 0.9; color: #f2f2f2; }
/* wie viele gerade suchen (#77, GET /api/match): Zeile immer da, damit nichts springt, wenn die Zahl kommt */
#match-start .match-count { display: block; min-height: 1.2em; font-size: 0.8rem; font-weight: normal; color: #ffe082; }
#match-start:hover:not(:disabled) { background: rgba(255, 179, 0, 0.12); }
#match-start:disabled { opacity: 0.5; cursor: not-allowed; }
.lobby-start.matching .lobby-actions, .lobby-start.matching #match-start { display: none; }
/* „Einer Session beitreten“ (#38, #164): eine Zeile unter „Mitspieler finden“ – Beschriftung, Link oder Code, Beitreten */
.join { display: flex; align-items: center; justify-content: center; gap: 8px; width: 560px; max-width: 100%; margin: 8px auto 0; }
.join label { font-size: 0.9rem; opacity: 0.85; white-space: nowrap; }
.join input {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid #444a68; border-radius: 6px; background: #2c3047;
  color: #f2f2f2; font: inherit;
}
.join button { padding: 6px 14px; border: none; border-radius: 6px; background: #1e88e5; color: #fff; font: inherit; cursor: pointer; }
.join button:focus-visible, .join input:focus-visible { outline: 2px solid #64b5f6; outline-offset: 2px; }
.lobby-start.matching .join { display: none; }
@media (max-width: 520px) { .join { flex-wrap: wrap; } .join label { flex-basis: 100%; text-align: center; } }
#share .share-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; font-weight: bold; letter-spacing: 0.15em; text-align: center; cursor: pointer; }
/* Beitrittscode erst verdeckt (#164): Punkte statt des Codes, Klick oder „👁 Zeigen“ deckt ihn auf */
#share .share-code.concealed { color: #6b7088; }
#share-code-show { white-space: nowrap; background: #444a68; }
#share-code-show[aria-pressed="true"] { background: #5c6290; }
.match-box { margin-top: 18px; }
.match-box[hidden] { display: none; }
.match-box .options-title { margin-left: 0; margin-right: 0; max-width: none; }
.match-panel {
  padding: 14px 16px;
  border: 1px solid #2c3047;
  border-radius: 12px;
  background: #1f2233;
  text-align: center;
}
.match-box.found .match-panel { border-color: #ffb300; animation: match-pulse 1.1s ease-in-out infinite alternate; }
@keyframes match-pulse { from { box-shadow: 0 0 0 0 rgba(255, 179, 0, 0.15); } to { box-shadow: 0 0 0 6px rgba(255, 179, 0, 0.35); } }
@media (prefers-reduced-motion: reduce) { .match-box.found .match-panel { animation: none; } }
.match-choice { margin: 0 0 8px; opacity: 0.85; }
#match-any-row { margin: 0 auto 8px; max-width: 420px; text-align: left; }
.match-status { margin: 8px 0 4px; min-height: 1.3em; font-size: 1.2rem; font-weight: bold; }
.match-status:empty { display: none; }
.match-detail { margin: 0 0 8px; min-height: 1.2em; opacity: 0.85; }
.match-detail:empty { display: none; }
.match-hint {
  margin: 8px auto; max-width: 520px; padding: 8px 12px; border: 1px solid rgba(144, 202, 249, 0.55);
  border-left: 4px solid #90caf9; border-radius: 8px; background: rgba(26, 39, 61, 0.88); color: #e3f2fd;
}
.match-hint[hidden] { display: none; }
.match-timer { display: block; width: 100%; max-width: 420px; height: 10px; margin: 6px auto; accent-color: #ffb300; }
.match-timer[hidden] { display: none; }
.match-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.match-actions button {
  padding: 10px 18px;
  border: 1px solid #444a68;
  border-radius: 10px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  cursor: pointer;
}
.match-actions button.primary { border-color: #43a047; background: #43a047; font-weight: bold; }
.match-actions button:focus-visible, #match-start:focus-visible { outline: 2px solid #64b5f6; outline-offset: 2px; }

/* oben: Menü und Links links, Pause (bzw. Applaus für Zuschauer) in der Mitte */
.play-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 12px; }
.play-top-left { display: flex; flex-wrap: wrap; gap: 8px; }
.play-top #back { margin-bottom: 0; }
.play-top #pause, .play-top #applause { font-size: 0.9rem; padding: 6px 14px; }
/* Mit Controller bzw. Tastatur gewählt: Kopfzeile im Spiel (.pad-focus, #187) und Menüführung (.pad-nav, padnav.js,
   #197) – gelb mit dunklem Rand wie in der App (pad_focus.gd), auf hellen und dunklen Knöpfen zu sehen; !important,
   weil manche Knöpfe bei :focus-visible ihren Umriss abschalten */
.pad-focus, .pad-nav { outline: 3px solid #ffd54f !important; outline-offset: 2px !important; box-shadow: 0 0 0 7px #10121c !important; }
@media (max-width: 560px) {  /* Handy: alles in einer Zeile, „Links“ kurz, Pause rechts auf gleicher Höhe */
  .play-top { display: flex; align-items: center; }
  .play-top-left { flex-wrap: nowrap; }
  .play-top-center { margin-left: auto; }
  #share-toggle .long { display: none; }
}
/* Links zum Einladen: eingeklappt, damit Spiel und Buttons mehr Platz haben */
#share-toggle {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
#share-toggle:hover { background: #444a68; }
#share-toggle .share-arrow { display: inline-block; transition: transform 0.15s; }
#share-toggle[aria-expanded="true"] .share-arrow { transform: rotate(180deg); }
#share { margin-bottom: 12px; font-size: 0.9rem; }
#share[hidden] { display: none; }
#share label { display: block; opacity: 0.8; margin-bottom: 4px; }
.share-row { display: flex; gap: 8px; }
#share-link {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  -webkit-user-select: text;
  user-select: text;
}
#share [data-copy], #share .qr-button, #share-code-show {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #1e88e5;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
#share .qr-button { background: #5e35b1; }
#share .qr-button[aria-expanded="true"] { background: #43a047; }
.share-item + .share-item { margin-top: 8px; }
.share-item[hidden] { display: none; }

#qr { margin: 12px auto 0; text-align: center; }
#qr-code {
  width: min(260px, 70vw);
  margin: 0 auto;
  padding: 12px;
  border-radius: 8px;
  background: #fff;   /* Scanner brauchen dunkle Punkte auf hellem Grund */
}
#qr-code svg { display: block; width: 100%; height: auto; }
#qr figcaption { margin-top: 6px; opacity: 0.8; }

#back {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font-size: 0.9rem;
  text-decoration: none;
}
#back:hover { background: #444a68; }

.name-row { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.name-input {
  width: 12em;
  padding: 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  -webkit-user-select: text;
  user-select: text;
}
/* Fantasienamen (#87): 🎲 neben dem Namensfeld; ein Fantasiename ist nur lesbar */
.name-tool {
  padding: 7px 10px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  cursor: pointer;
}
.name-tool:hover { background: #444a68; }
.name-tool[hidden] { display: none; }
.name-input.fantasy { cursor: pointer; }
/* Lobby (#96): „Dein Name“, Feld und 🎲 immer in einer Reihe – auf schmalen Handys schrumpft das Feld */
.lobby-name { flex-wrap: nowrap; }
.lobby-name > label { white-space: nowrap; }
.lobby-name > .name-input { flex: 0 1 12em; min-width: 0; }
.lobby-name > .name-tool { flex: none; }
/* Altersabfrage und Hinweis zur Online-Sicherheit (#87): über der Seite, wie das Bild des Levels */
.ask-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 11, 18, 0.8);
}
.ask-overlay[hidden], .ask-card[hidden] { display: none; }
.ask-card {
  max-width: 440px;
  padding: 20px;
  border: 1px solid #444a68;
  border-radius: 10px;
  background: #1b1d2a;
  text-align: center;
}
.ask-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.ask-card button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #43a047;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.ask-card button.ask-secondary { background: #2c3047; border: 1px solid #444a68; font-weight: normal; }
.age-input { width: 5em; text-align: center; }
.ask-error { min-height: 1.2em; margin: 4px 0; color: #ffb74d; }
.safety-tips { text-align: left; margin: 8px 0; padding-left: 1.4em; }
.safety-tips li { margin: 4px 0; }
/* Für Kinder einschränken (#92) */
.kids-suggest { margin-top: 14px; padding-top: 10px; border-top: 1px solid #444a68; }
.kids-suggest[hidden], .kids-pin[hidden], #kids-form [hidden] { display: none; }
.kids-state { font-weight: bold; color: #b0b6d0; }
.kids-state.on { color: #a5d6a7; }
.kids-pins { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.kids-pin { width: 8em; text-align: center; }
.ask-error.ok { color: #a5d6a7; }
#public-hint[hidden], #public-kids[hidden], #match-start[hidden] { display: none; }
#name-form { text-align: center; padding: 48px 0; }
#name-form button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  background: #43a047;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
#name-form button.secondary { background: #2c3047; border: 1px solid #444a68; font-weight: normal; }

/* Lobby: Einstellungen für die neue Session – Zeilen mit Schiebeschalter */
.options-title {
  max-width: 420px;
  margin: 14px auto 6px;
  padding-left: 4px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.options-title[hidden], .options[hidden] { display: none; }
.options {
  max-width: 420px;
  margin: 0 auto 4px;
  border: 1px solid #2c3047;
  border-radius: 12px;
  background: #1f2233;
  text-align: left;
  overflow: hidden;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid #2c3047;
  cursor: pointer;
}
.options > .option:first-child { border-top: none; }  /* die Zusatz-Buttons folgen auf „Level des Tages“: mit Linie */
.option[hidden] { display: none; }
label.option:hover { background: #252a40; }
/* Level des Tages: Schwierigkeit und Zusatz-Buttons sind fest – ausgegraut, nicht klickbar */
.option.locked { opacity: 0.55; cursor: default; }
label.option.locked:hover { background: none; }
.option.locked .segmented label { cursor: default; }
.option-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2c3047;
  font-size: 1.15rem;
}
.option-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.option-text strong { font-size: 1rem; }
.option-text small { font-size: 0.8rem; opacity: 0.7; }
/* Schwierigkeit: alle Hinweise übereinander, nur der gewählte sichtbar – so springt die Höhe beim Wechsel nicht */
#grade-hint { display: grid; }
#grade-hint > span { grid-area: 1 / 1; visibility: hidden; }
#grade-hint > span.on { visibility: visible; }

/* Schiebeschalter (echte Checkbox, nur anders gezeichnet) */
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: #444a68;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}
.switch:checked { background: #43a047; }
.switch:checked::before { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid #64b5f6; outline-offset: 2px; }

/* Segment-Knöpfe für die Spielerzahl (echte Radio-Buttons, nur anders gezeichnet) */
.option-players { cursor: default; flex-wrap: wrap; row-gap: 10px; }
.option-players .option-text { flex: 1 1 calc(100% - 48px); }  /* Knöpfe immer in eigener Zeile darunter: der Kasten ist gleich hoch, egal wie viele Aufteilungen es gibt (App: lobby.gd, below) */
.option-players .segmented { margin-left: auto; }
.lobby-actions { margin-top: 18px; }
.segmented { display: flex; gap: 6px; flex: none; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  line-height: 1.2;
  border: 1px solid #444a68;
  border-radius: 8px;
  background: #2c3047;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.segmented span small { font-size: 0.7rem; opacity: 0.8; }
.segmented input:checked + span { background: #1e88e5; border-color: #1e88e5; }
.segmented input:focus-visible + span { outline: 2px solid #64b5f6; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .switch, .switch::before, .segmented span { transition: none; }
}
/* Lobby: Karte zur Übersicht der laufenden Sessions */
.live-link {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 20px auto 0;
  padding: 12px 16px;
  border: 1px solid #444a68;
  border-radius: 12px;
  background: linear-gradient(135deg, #252a40, #1f2233);
  color: #f2f2f2;
  text-align: left;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.live-link:hover, .live-link:focus-visible {
  border-color: #1e88e5;
  box-shadow: 0 4px 16px rgba(30, 136, 229, 0.25);
  transform: translateY(-2px);
  outline: none;
}
.live-link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2c3047;
  font-size: 1.4rem;
}
.live-link-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-link-text strong { font-size: 1.05rem; }
#live-link-note { font-size: 0.85rem; opacity: 0.75; }
#live-link-note.on { opacity: 1; color: #ef9a9a; }
#live-link-note.on::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e53935;
  vertical-align: 1px;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.6); }
  50% { box-shadow: 0 0 0 5px rgba(229, 57, 53, 0); }
}
.live-link-arrow { flex: none; font-size: 1.3rem; opacity: 0.6; transition: transform 0.15s, opacity 0.15s; }
.live-link:hover .live-link-arrow, .live-link:focus-visible .live-link-arrow { opacity: 1; transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .live-link, .live-link-arrow { transition: none; }
  .live-link:hover, .live-link:hover .live-link-arrow { transform: none; }
  #live-link-note.on::before { animation: none; }
}

#howto-link, #news-link, #releases-link { margin-top: 10px; }

/* „Was ist neu?“ (?view=releases): eine Karte pro Version, die neueste hervorgehoben */
#releases { max-width: 680px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
/* Datenschutz: Blöcke wie „Was ist neu?“, Text markierbar */
#privacy { max-width: 760px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#privacy h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#privacy > .lobby-note { text-align: center; margin-top: 0; }
.privacy-block { margin-top: 12px; padding: 14px 18px; border: 1px solid #333852; border-radius: 14px; background: #22263a; line-height: 1.5; }
.privacy-block h3 { margin: 0 0 6px; font-size: 1.1rem; }
.privacy-block p, .privacy-block ul { margin: 6px 0; }
.privacy-block ul { padding-left: 20px; }
.privacy-operator { white-space: pre-line; }  /* Zeilen aus [server] operator */
.privacy-operator.missing { color: #ffb74d; }
/* Impressum: wie die Datenschutzseite; Angaben aus [imprint] */
#imprint { max-width: 760px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#imprint h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#imprint > .lobby-note { text-align: center; margin-top: 0; }
#imprint .privacy-block p { white-space: pre-line; overflow-wrap: anywhere; }  /* Zeilen aus config.toml */
#imprint .privacy-block a, #privacy .privacy-block a { color: #9ad0ff; }
/* Daten löschen (#100, /?view=loeschen): wie die Datenschutzseite, die Schritte oben hervorgehoben */
#delete { max-width: 760px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#delete h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#delete > .lobby-note { text-align: center; margin-top: 0; }
#delete a { color: #9ad0ff; }
#delete .delete-steps { border-color: #5c6bc0; background: #272c48; }
#delete .delete-steps ol { margin: 6px 0; padding-left: 26px; }
#delete .delete-steps li { margin: 6px 0; }
#delete .delete-steps li::marker { font-weight: 700; color: #ffd54f; }
#delete .delete-email { font-weight: 700; overflow-wrap: anywhere; }
.imprint-label { display: block; font-size: 0.85rem; opacity: 0.7; }
.imprint-missing { color: #ffb74d; }
/* Statistik: Kacheln „Gerade jetzt“ und Tabelle nach Zeitraum */
#stats { max-width: 900px; margin: 0 auto; text-align: left; }
#stats h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#stats > .lobby-note { text-align: center; }
.stats-heading { margin: 20px 0 8px; font-size: 0.8rem; font-weight: bold; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.6; }
.stats-now { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px;
  border: 1px solid #333852; border-radius: 14px; background: #22263a;
}
.stats-value { font-size: 2rem; font-weight: bold; font-variant-numeric: tabular-nums; }
.stats-label { font-size: 0.85rem; opacity: 0.75; text-align: center; }
.stats-scroll { overflow-x: auto; padding: 6px 12px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid #333852; }
.stats-table thead th { opacity: 0.7; font-weight: normal; text-align: right; white-space: nowrap; }
.stats-table tbody th { text-align: left; font-weight: normal; white-space: nowrap; }
.stats-table td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table tr:last-child th, .stats-table tr:last-child td { border-bottom: none; }
/* erste Spalte (Zeilennamen) bleibt beim waagerechten Blättern stehen (#104); der linke Innenabstand des Kastens
   steckt in ihr, damit keine Zahlen links daneben vorbeiziehen */
.stats-scroll { padding-left: 0; }
.stats-table tbody th, .stats-table thead th:first-child {
  position: sticky; left: 0; z-index: 1; background: #22263a; padding-left: 22px;
}
.stats-table thead th:first-child { opacity: 1; }  /* leere Ecke deckt ganz (die Kopfzeile ist sonst blasser) */
#stats-note { text-align: left; }
/* Aufteilungen (#185): vier kleine Tabellen nebeneinander, so viele wie passen */
.stats-splits { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; }
.stats-split h4 { margin: 4px 0 4px 22px; font-size: 0.9rem; }
#stats-split-intro { text-align: left; }
@media (max-width: 600px) {
  .stats-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-value { font-size: 1.6rem; }
  .stats-table { font-size: 0.85rem; }
  .stats-table th, .stats-table td { padding: 6px 5px; }
  .stats-table tbody th, .stats-table thead th:first-child { padding-left: 17px; }
  .stats-table tbody th { white-space: normal; min-width: 8em; }  /* lange Bezeichnungen dürfen umbrechen */
}

/* Lizenzen: Tabelle der Fremdkomponenten (wie die Datenschutz-Blöcke) */
#licenses { max-width: 900px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#licenses h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#licenses > .lobby-note { text-align: center; }
/* Feste Spaltenbreiten: die Tabellen Browser-Client und Server stehen untereinander und sollen gleich aussehen */
.licenses-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; }
.licenses-table th:nth-child(1) { width: 24%; }
.licenses-table th:nth-child(2) { width: 34%; }
.licenses-table th:nth-child(3) { width: 16%; }
.licenses-table th:nth-child(4) { width: 26%; }
.licenses-table td { overflow-wrap: break-word; }  /* Wörter nur trennen, wenn sie allein nicht passen */
.licenses-table th, .licenses-table td { padding: 8px 10px; border-bottom: 1px solid #333852; vertical-align: top; text-align: left; }
.licenses-table th { opacity: 0.7; font-weight: normal; }
.licenses-table small { opacity: 0.7; }
.licenses-table a { color: #90caf9; overflow-wrap: anywhere; }
@media (max-width: 600px) { .licenses-table { font-size: 0.8rem; } .licenses-table th, .licenses-table td { padding: 6px 4px; } }
@media (max-width: 600px) {
  .licenses-table th:nth-child(1) { width: 27%; }
  .licenses-table th:nth-child(2) { width: 30%; }
  .licenses-table th:nth-child(3) { width: 18%; }
  .licenses-table th:nth-child(4) { width: 25%; }
}
/* Fußbereich: abgesetzt durch eine feine Linie über die Seitenbreite */
.site-footer {
  max-width: 1856px;
  margin: 32px auto 0;
  padding: 14px 16px 24px;
  border-top: 1px solid #333852;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: #9aa3c7; text-decoration: none; }
.site-footer a:hover { color: #f2f2f2; text-decoration: underline; }
/* „Für Eltern“ (#92): öffnet den Dialog #kids, sieht aus wie die Links daneben */
.site-footer .footer-button { padding: 0; border: none; background: none; color: #9aa3c7; font: inherit; cursor: pointer; }
.site-footer .footer-button:hover { color: #f2f2f2; text-decoration: underline; }
@media (max-width: 1920px) { .site-footer { margin-left: 16px; margin-right: 16px; } }
@media (min-width: 960px) and (max-width: 1920px) { .site-footer { margin-left: 32px; margin-right: 32px; } }
main:has(> #play:not([hidden])) ~ .site-footer { display: none; }  /* im Spiel: Platz fürs Spielfeld */
/* Fußzeile fest am unteren Rand (#94): Startseite, Lobby und alle Seiten – schmal, Hintergrund wie die Seite, feine
   Linie; unter Hinweisen, Dialogen und Overlays (z-index 40). Der Inhalt bekommt unten so viel Platz, dass sie nichts
   verdeckt (--footer-h). Im Spiel und beim Zuschauen bleibt sie weg (oben). Sehr niedrige Fenster (Handy quer): im Fluss. */
:root { --footer-h: 40px; }
@media (max-width: 700px) { :root { --footer-h: 58px; } }  /* Handy: darf zweizeilig umbrechen */
/* Bricht sie weiter um (Sprache, schmale Handys), setzt main.js (fitFooter) --footer-h auf ihre echte Höhe (#100). */
@media (min-height: 421px) {
  .site-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    max-width: none; margin: 0 !important; padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
    background: #1b1d2a; border-top: 1px solid #333852; line-height: 1.6;
  }
  body:not(:has(main > #play:not([hidden]))) { padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom)); }
}
#releases h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#releases > .lobby-note { text-align: center; margin-top: 0; }
#releases-list { display: grid; gap: 12px; margin-top: 14px; }
.release { padding: 14px 16px; border: 1px solid #333852; border-radius: 14px; background: #22263a; }
.release-latest { border-color: #1e88e5; }
.release h3 { margin: 0; font-size: 1.1rem; }
.release-version {
  display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px;
  background: #333852; color: #9fa8da; font-size: 0.85rem; font-weight: 600; vertical-align: 1px;
}
.release-latest .release-version { background: #1e88e5; color: #fff; }
.release h3 { margin-bottom: 8px; }
.release ul { margin: 0; padding-left: 20px; }
.release li { line-height: 1.5; margin-bottom: 4px; }
.live-link-sub { font-size: 0.85rem; opacity: 0.75; }
/* Karte „Neuigkeiten“: der neueste Beitrag in höchstens zwei Zeilen (nie breiter als die Karte), Kennzeichen „neu“ */
#news-link-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.news-badge {
  display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px;
  background: #e53935; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.5; vertical-align: 2px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.news-badge[hidden] { display: none; }

/* Neuigkeiten (/?view=neuigkeiten, #146): Beiträge des Betreibers, Text aus Knoten gebaut (main.js, newsNodes) */
#news { max-width: 720px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#news h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#news > .lobby-note { text-align: center; margin-top: 0; }
#news-list { display: grid; gap: 12px; margin-top: 14px; }
.news-item { padding: 14px 16px; border: 1px solid #333852; border-left: 4px solid #90caf9; border-radius: 14px; background: #22263a; scroll-margin-top: 80px; }
.news-item.kind-ankuendigung { border-left-color: #81c784; }
.news-item.kind-hinweis { border-left-color: #ffb74d; }
.news-item.kind-entschuldigung { border-left-color: #ef9a9a; }
.news-item.pinned { border-color: #1e88e5; border-left-width: 4px; }
.news-item:target { box-shadow: 0 0 0 2px #1e88e5; }
.news-item > h3 { margin: 0 0 4px; font-size: 1.15rem; }
.news-kind { margin-right: 6px; }
.news-meta { margin: 0 0 8px; font-size: 0.85rem; color: #9fa8da; }
.news-meta a { color: #90caf9; }
.news-body h4 { margin: 12px 0 4px; font-size: 1.05rem; }
.news-body h5 { margin: 10px 0 4px; font-size: 0.98rem; }
.news-body p { margin: 0 0 8px; line-height: 1.55; }
.news-body ul, .news-body ol { margin: 0 0 8px; padding-left: 22px; }
.news-body li { line-height: 1.5; margin-bottom: 3px; }
.news-body strong { font-weight: 700; color: #fff; }
.news-body code { padding: 0 4px; border-radius: 4px; background: #2c3047; font-size: 0.92em; }
.news-body a { color: #90caf9; overflow-wrap: anywhere; }
/* Hinweis-Leiste aus den Neuigkeiten (angeheftete Hinweise und Entschuldigungen) */
.notice.news-notice { border-color: rgba(144, 202, 249, 0.55); border-left-color: #90caf9; background: rgba(26, 39, 61, 0.88); color: #e3f2fd; }
.notice.news-notice.kind-entschuldigung { border-left-color: #ef9a9a; }
.news-notice a { color: #90caf9; white-space: nowrap; }
#news-notice-icon { margin-right: 4px; }

/* Anleitung (/?view=howto) */
#howto { max-width: 820px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#howto h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#howto > .lobby-note { text-align: center; margin-top: 0; }
.howto-toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 18px; }
.howto-toc a {
  padding: 4px 10px;
  border: 1px solid #444a68;
  border-radius: 999px;
  color: #c5cae9;
  font-size: 0.85rem;
  text-decoration: none;
}
.howto-toc a:hover, .howto-toc a:focus-visible { border-color: #1e88e5; color: #fff; outline: none; }
.howto-step {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid #333852;
  border-radius: 14px;
  background: #22263a;
  scroll-margin-top: 12px;
}
.howto-step.howto-wide { grid-template-columns: 1fr; }
.howto-step[hidden], .howto-toc a[hidden] { display: none; }  /* z. B. „In der App“ bis zur Veröffentlichung */
.howto-art { width: 100%; height: auto; display: block; border-radius: 10px; }
.howto-step h3 { margin: 0 0 8px; font-size: 1.1rem; }
.howto-step p, .howto-step li { line-height: 1.5; }
.howto-step p { margin: 0 0 8px; }
.howto-step ul, .howto-step ol { margin: 0 0 8px; padding-left: 20px; }
.howto-step li { margin-bottom: 4px; }
.howto-step a:not(.howto-button) { color: #9ad0ff; }  /* Links im Text (Anleitung, „Für Eltern“) wie im Datenschutz */
.howto-keys { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 0.92rem; }
.howto-keys th, .howto-keys td { padding: 6px 8px; border-bottom: 1px solid #333852; text-align: left; vertical-align: top; }
.howto-keys th { color: #9fa8da; font-weight: 600; }
.howto-keys td:first-child { white-space: nowrap; font-weight: 600; }
.howto-extra td { color: #c5cae9; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid #555b7a;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #2c3047;
  font: 600 0.82rem system-ui, sans-serif;
  text-align: center;
}
.howto-go { text-align: center; margin-top: 12px; }
.howto-button {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  background: #1e88e5;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.howto-button:hover, .howto-button:focus-visible { background: #1976d2; outline: none; }
@media (max-width: 600px) {
  .howto-step { grid-template-columns: 1fr; padding: 12px; }
  .howto-art { max-width: 360px; margin: 0 auto; }
  .howto-keys { font-size: 0.85rem; }
  .howto-keys td:first-child { white-space: normal; }
}

/* Übersicht der öffentlichen Sessions */
#live { max-width: 640px; margin: 0 auto; text-align: left; }
#live h2 { font-size: 1.2rem; text-align: center; margin: 4px 0 4px; }
#live > .lobby-note { text-align: center; margin-top: 0; }
.live-back { margin: 0; }
.live-back a { color: #64b5f6; }
.tabs button[aria-pressed="true"] { background: #1e88e5; border-color: #1e88e5; }
#live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.live-card {
  padding: 12px 14px;
  border: 1px solid #2c3047;
  border-radius: 8px;
  background: #1f2233;
}
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.live-players { font-weight: bold; overflow-wrap: anywhere; }
.live-mode {
  padding: 1px 8px;
  border-radius: 10px;
  background: #2c3047;
  font-size: 0.8rem;
}
.live-stats { margin: 6px 0; font-size: 0.9rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.live-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.85rem; background: #1b5e20; }
.live-status.waiting { background: #6b5a2a; color: #ffd54f; }
.live-status.paused { background: #37474f; }
.live-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.live-actions a.watch-button {
  padding: 6px 14px;
  border-radius: 6px;
  background: #1e88e5;
  color: #fff;
  text-decoration: none;
}
.live-actions button {
  padding: 5px 12px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.live-url { flex-basis: 100%; font-size: 0.8rem; opacity: 0.7; overflow-wrap: anywhere; }

#ranking { margin: 40px auto 0; max-width: 640px; text-align: left; }

/* Lobby auf breiten Bildschirmen: nutzt die ganze Breite – oben die Einstellungen in Spalten und rechts
   Name, Start und Links, darunter das Ranking in einer eigenen Zeile (schmal: eine Spalte wie bisher) */
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.lobby-links .options-title + .live-link { margin-top: 0; }  /* direkt unter „Zuschauen & Infos“ */
/* Handy (eine Spalte): alle Karten so hoch wie die höchste – Überschrift in eigener, normaler Zeile */
@media (max-width: 959px) {
  .lobby-links { display: grid; grid-template-rows: auto; grid-auto-rows: 1fr; justify-items: center; row-gap: 10px; margin-top: 20px; }
  .lobby-links .options-title { margin: 0; width: 100%; justify-self: center; }
  .lobby-links .live-link, .lobby-links #howto-link, .lobby-links #news-link, .lobby-links #releases-link, .lobby-links #parents-link { width: 100%; margin: 0; }
}
@media (min-width: 960px) {
  main:has(> #lobby:not([hidden])) { max-width: 1920px; padding: 0 32px 32px; }
  #lobby { padding-top: 32px; }
  /* Lobby (Spielseite): „← Startseite“ links in der Zeile des Namens, wenig Rand – sie soll am PC ohne Blättern
     passen (main.js fitLobby skaliert sie dazu) */
  #lobby:not(.home-mode) { padding: 12px 0 8px; }
  #lobby:not(.home-mode) > #lobby-intro { margin: 0 0 -1.6em; }  /* hebt den Namen in dieselbe Zeile */
  .lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name name" "a b" "a b" "start start" "links links";
    column-gap: 32px;
    align-items: stretch;  /* Spalten oben und unten bündig */
  }
  /* Kästen füllen die Spaltenhöhe; der zusätzliche Platz verteilt sich gleichmäßig auf ihre Zeilen. Beide Spalten
     haben zwei Zeilen (.lobby-row: Sichtbarkeit + Level des Tages | Zusatz-Buttons, dann Schwierigkeit | Koop), die
     sich über subgrid dieselben Höhen teilen – „Schwierigkeit“ und „Koop“ stehen auf einer Linie (#98) */
  .lobby-group { display: grid; grid-template-rows: subgrid; grid-row: span 2; }
  .lobby-row { display: flex; flex-direction: column; }
  .lobby-row > .options-title, .lobby-row > .options { margin-left: 0; margin-right: 0; align-self: stretch; }
  .lobby-row > .options:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column; }
  .lobby-row > .options > .option:not([hidden]), .lobby-group #extras { flex: 1 1 auto; }
  .lobby-group #extras { display: flex; flex-direction: column; }
  .lobby-group #extras > .option { flex: 1 1 auto; }
  /* Schwierigkeit und Koop: Knöpfe unten im Kasten, gleich hoch (eine Zeile wie zwei: „3 Spieler / je 1 Button“) */
  .lobby-group .option-players { align-content: space-between; }
  .lobby-group .segmented span { justify-content: center; min-height: calc(1.92rem + 10px); }  /* Inhalt beider Zeilen + Rand */
  .lobby-group-a { grid-area: a; }
  .lobby-group-b { grid-area: b; }
  .lobby-name { grid-area: name; align-self: start; }  /* bleibt oben, auch wenn das Dev-Feld daneben aufgeklappt ist */
  .lobby-start { grid-area: start; }
  /* Dev-Modus: in der Zeile des Namens, linksbündig (der Name bleibt mittig) */
  .lobby-grid > #dev { grid-area: name; justify-self: start; align-self: start; z-index: 1; max-width: 300px; margin: 8px 0 0; text-align: left; }
  .lobby-links { grid-area: links; }
  .lobby-grid .options-title, .lobby-grid .options, .lobby-grid .live-link { max-width: none; }
  .lobby-group > .lobby-row:first-child > .options-title:first-child { margin-top: 0; }
  .lobby-grid .name-row { margin: 0 0 20px; }  /* eigene Zeile oben, mittig */
  /* Start-Buttons unter den Einstellungen nebeneinander: Koop unter der linken, Solo unter der rechten Spalte */
  .lobby-start .lobby-actions { flex-wrap: nowrap; gap: 32px; margin-top: 20px; }
  .lobby-start #create, .lobby-start #create-solo { flex: 1 1 0; width: auto; min-width: 0; }
  /* Links: mittlere Breite eine Reihe unter den Start-Buttons */
  .lobby-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; grid-auto-rows: 1fr; gap: 0 16px; margin-top: 20px; }  /* alle Karten gleich hoch */
  .lobby-links .options-title { grid-column: 1 / -1; margin: 0 0 6px; justify-self: stretch; }  /* links wie die anderen */
  /* gleich große Karten: Abstände nur über das Raster (der Abstand oben aus der Handy-Ansicht entfällt) */
  .lobby-links .live-link, .lobby-links #howto-link, .lobby-links #news-link, .lobby-links #releases-link, .lobby-links #parents-link { margin: 0 0 16px; }
  #ranking-page #ranking {
    margin: 12px 0 0;
    max-width: none;
    padding: 4px 24px 24px;
    border: 1px solid #2c3047;
    border-radius: 12px;
    background: #1f2233;
  }
}
@media (min-width: 1280px) {
  .lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(300px, 380px);
    grid-template-areas: "name name name" "a b links" "a b links" "start start links";
  }
  /* breit: Links rechts neben den Einstellungen, untereinander und über die ganze Spaltenhöhe verteilt
     (die Überschrift hält sie oben bündig mit den Kästen). Ein Raster mit gleichen Zeilen (1fr) statt flex: 1 1 0 –
     bei flex blieb eine Karte, deren Text eine Zeile mehr braucht, höher als die anderen (#105); das Raster macht
     alle so hoch wie die höchste und meldet diese Höhe an die Lobby weiter (fitLobby passt dann den Zoom an) */
  .lobby-links { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-auto-rows: 1fr; row-gap: 16px; margin-top: 0; }
  .lobby-links .options-title { margin: 0 0 -10px; }  /* 6 px bis zur ersten Karte wie zuvor */
  .lobby-links .live-link, .lobby-links #howto-link, .lobby-links #news-link, .lobby-links #releases-link, .lobby-links #parents-link { margin: 0; }
}
#ranking h2 { font-size: 1.1rem; text-align: center; margin: 0 0 4px; }
#ranking-lives { text-align: center; margin: 0 0 12px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.tabs button {
  padding: 6px 18px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  cursor: pointer;
}
.phaser-missing { padding: 24px 16px; text-align: center; }
.tabs-small { margin-top: -4px; }
.tabs-small button { font-size: 0.85rem; padding: 4px 12px; }
/* Ranking: Kopf mit Reitern (welche Liste), darunter die Filter mit kleiner Beschriftung */
.ranking-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  border-bottom: 1px solid #2c3047;
  margin-bottom: 16px;
}
.ranking-head h2 { margin: 12px 0 10px; }
.ranking-tabs { display: flex; gap: 4px; }
.ranking-tabs button {
  padding: 10px 16px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: #b8bdd6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ranking-tabs button:hover { color: #f2f2f2; }
.ranking-tabs button[aria-pressed="true"] { color: #f2f2f2; border-bottom-color: #1e88e5; }
.ranking-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px; margin-bottom: 14px; }
.ranking-filter { display: flex; flex-direction: column; gap: 4px; }
.ranking-filter[hidden] { display: none; }
.ranking-filter-label {
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}
.ranking-segmented {
  display: inline-flex;
  border: 1px solid #444a68;
  border-radius: 8px;
  overflow: hidden;
}
.ranking-segmented button {
  padding: 6px 16px;
  border: none;
  border-left: 1px solid #444a68;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.ranking-segmented button:first-child { border-left: none; }
.ranking-segmented button:hover { background: #363b57; }
.ranking-segmented button[aria-pressed="true"] { background: #1e88e5; }
.ranking-day-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ranking-day-step { min-width: 2.2em; }
.ranking-day-step:disabled { opacity: 0.4; cursor: default; }
#ranking-day { color-scheme: dark; }  /* Kalender des Browsers im dunklen Stil */
#ranking-more { display: block; margin: 10px auto 0; padding: 6px 16px; }
#ranking-more[hidden] { display: none; }
@media (max-width: 600px) {
  .ranking-head { justify-content: center; }
  .ranking-tabs { width: 100%; justify-content: center; }
  .ranking-tabs button { flex: 1 1 0; padding: 10px 6px; }
  .ranking-filters { justify-content: center; }
}

/* schmale Bildschirme: nur die Tabelle scrollt waagerecht, Überschrift und Knöpfe bleiben stehen */
.ranking-scroll { overflow-x: auto; }
#ranking-page > #ranking { width: 100%; min-width: 0; justify-self: center; }  /* so breit wie der Platz, nicht wie die Tabelle */
#ranking-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
@media (max-width: 600px) {
  #ranking-table { font-size: 0.8rem; }
  #ranking-table th, #ranking-table td { padding: 5px 6px; }
  #ranking-table td:nth-child(2) { min-width: 7em; }  /* Namen nicht Wort für Wort umbrechen */
}
#ranking-table th, #ranking-table td { padding: 6px 8px; border-bottom: 1px solid #2c3047; }
#ranking-table th { text-align: left; opacity: 0.8; font-weight: normal; }
/* Zahlenspalten (#, Level, Tode, Zeit, Wörter, Mutproben): Werte und Überschrift rechtsbündig untereinander */
#ranking-table :is(td, th):is(:nth-child(1), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8)) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#ranking-table td:nth-child(3) { white-space: nowrap; }  /* Variante: Symbole der Zusatz-Buttons, Spielerzahl */
/* Tages-Rangliste: nur ein Level – die Spalte „Level“ sagt nichts */
#ranking-table.daily th:nth-child(4), #ranking-table.daily td:nth-child(4) { display: none; }
#ranking-day-row[hidden], #ranking-grades[hidden] { display: none; }
#daily-picture, #picture-close, #picture-save {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #5e35b1;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
#daily-picture[hidden] { display: none; }
#picture-close { background: #2c3047; }
/* Bild des ganzen Levels (Level des Tages, ab dem nächsten Tag) */
.picture-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 11, 18, 0.8);
}
.picture-overlay[hidden] { display: none; }
/* Neue Version (#67): über allem, nicht wegzuklicken – nur „Seite neu laden“ */
.reload-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 11, 18, 0.85);
}
.reload-overlay[hidden] { display: none; }
.reload-card {
  max-width: 420px;
  padding: 20px;
  border: 1px solid #444a68;
  border-radius: 10px;
  background: #1b1d2a;
  text-align: center;
}
.reload-card p { margin: 0 0 16px; }
.picture-card {
  width: 100%;
  max-width: 1100px;
  padding: 16px;
  border: 1px solid #444a68;
  border-radius: 10px;
  background: #1b1d2a;
  text-align: center;
}
.picture-card h2 { margin: 0 0 4px; font-size: 1.2rem; }
.picture-scroll {
  overflow-x: scroll;  /* Scrollbalken immer sichtbar: die Level sind viel breiter als der Bildschirm */
  overflow-y: auto;
  max-height: 65vh;
  margin: 12px 0;
  border-radius: 6px;
  background: #000;
  cursor: grab;
  scrollbar-color: #7e57c2 #2c3047;  /* Firefox */
  scrollbar-width: auto;
}
.picture-scroll.dragging { cursor: grabbing; }
.picture-scroll[hidden], #picture-save[hidden] { display: none; }
.picture-scroll::-webkit-scrollbar { height: 16px; width: 16px; }
.picture-scroll::-webkit-scrollbar-track { background: #2c3047; border-radius: 8px; }
.picture-scroll::-webkit-scrollbar-thumb { background: #7e57c2; border: 3px solid #2c3047; border-radius: 8px; }
.picture-scroll::-webkit-scrollbar-thumb:hover { background: #9575cd; }
.picture-scroll canvas { display: block; width: auto; }  /* Höhe setzt showLevelPicture (ganze Höhe sichtbar) */
.picture-actions { display: flex; justify-content: center; gap: 10px; }
#ranking-table th button {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
}
#ranking-table th button[aria-pressed="true"] { font-weight: bold; text-decoration: none; }
#ranking-table th button[aria-pressed="true"]::after { content: " ▾"; }

#pause {
  display: block;
  margin: 0;
  padding: 6px 18px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  cursor: pointer;
}
#pause[hidden] { display: none; }

#applause {
  display: block;
  margin: 0;
  padding: 6px 18px;
  border: 1px solid #6b5a2a;
  border-radius: 6px;
  background: #3a3322;
  color: #ffd54f;
  font: inherit;
  cursor: pointer;
}
#applause:disabled { opacity: 0.5; cursor: default; }
#applause[hidden] { display: none; }

/* 👏 steigt kurz im Spielfeld auf, wenn jemand applaudiert */
.clap {
  position: absolute;
  bottom: 12%;
  font-size: 2.2rem;
  pointer-events: none;
  animation: clap-rise 1.6s ease-out forwards;
}
@keyframes clap-rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-10px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-120px) scale(1); opacity: 0; }
}

.header-right { display: flex; align-items: center; gap: 12px; }
#mute, #music, #settings-open {
  padding: 2px 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font-size: 1rem;
  cursor: pointer;
}
#music[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
/* Sprachumschalter (Optionen baut i18n.js aus client/i18n/languages.json) */
.lang-switch { display: inline-flex; align-items: center; gap: 4px; font-size: 1rem; }
.lang-switch select {
  padding: 2px 4px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font-size: 0.85rem;
  max-width: 9.5em;
  cursor: pointer;
}
@media (max-width: 600px) { .lang-switch select { max-width: 4.2em; } }
#mute.blocked, #music.blocked { animation: sound-hint 1.2s ease-in-out infinite alternate; }
@keyframes sound-hint {
  to { border-color: #ffd54f; box-shadow: 0 0 6px #ffd54f; }
}

#game-wrap { position: relative; margin-bottom: 12px; }
/* Netz-Anzeiger (#110): außerhalb des Spielfelds (#162: im Spielfeld verdeckte er auf dem Handy Boden und Spielfigur).
   Handy, Tablet und schmale Fenster: unter Buttons und Hinweis als Block – mittig, so breit wie die längste Zeile, die
   Zeilen darin linksbündig (Nutzer, #162; dort ist Platz, die Seite darf ohnehin rollen); breite Fenster: rechts oben
   neben „Menü“/„Pause“ in der sonst leeren rechten Spalte der Kopfzeile, so bleibt er auch in einem niedrigen
   PC-Fenster im Bild. Nimmt keine Klicks. */
.netinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 0;
  color: #c9ccd8;
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-align: left;
  pointer-events: none;
}
.netinfo > span { text-wrap: balance; }
@media (min-width: 860px) {
  #play { position: relative; }
  .netinfo {
    position: absolute;
    top: 0;
    right: 0;
    height: 44px;  /* .play-top samt Abstand zum Spielfeld minus 2 px: endet sicher über dem Spielfeld (auch gerundet) */
    max-width: calc(50% - 90px);  /* rechte Spalte: rechts von „Pause“/„Applaus“ */
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    margin: 0;
    font-size: 11px;
    line-height: 1.25;
    text-align: right;
  }
  .netinfo > span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
.netinfo[hidden] { display: none; }
/* Einstellungen (⚙, #110) */
.settings-card { text-align: left; }
.settings-card h2, .settings-card .game-over-actions { text-align: center; }
.settings-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: bold; cursor: pointer; }
.settings-row input { width: 1.2em; height: 1.2em; }
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 28, 0.6);
  border-radius: 6px;
}
.overlay[hidden] { display: none; }
.overlay .card {
  max-width: 90%;
  padding: 16px 24px;
  border-radius: 10px;
  background: #1b1d2a;
  border: 1px solid #444a68;
  text-align: center;
}
.overlay h2 { margin: 0 0 8px; font-size: 1.2rem; }
#watch-players { list-style: none; padding: 0; margin: 8px 0; font-weight: bold; }
#game-over-stats { font-weight: bold; margin: 4px 0; }
#game-over-culprits:empty { display: none; }
.game-over-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 16px; margin-top: 10px; }
#game-over-again, #game-over-ok, #absent-retry {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #43a047;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
#game-over-again[hidden], #game-over-ok[hidden] { display: none; }
#game-over-menu, #absent-menu { color: #64b5f6; }
#absent-retry[hidden] { display: none; }
#watch-ok {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #43a047;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
#ready {
  width: 100%;
  min-height: 70px;
  margin-bottom: 10px;
  border: none;
  border-radius: 12px;
  background: #43a047;
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  cursor: pointer;
  animation: sound-hint 1.2s ease-in-out infinite alternate;
}
#ready[hidden] { display: none; }

/* Bis i18n.js die Texte gesetzt hat, bleibt die Seite unsichtbar (die Elemente sind im HTML leer). */
html.i18n-loading body { visibility: hidden; }
/* Hinweis über übersetzten Rechtstexten („die deutsche Fassung ist maßgeblich“); auf Deutsch leer */
.legal-binding { margin: 0 0 12px; padding: 6px 10px; border-left: 3px solid #ffd54f; color: #c9cbe0; font-size: 0.9rem; }
.legal-binding:empty { display: none; }

/* Hinweise (Wartung, gerettete Runde): eine Ebene vor dem Inhalt, oben unter dem Kopf (bzw. am oberen Rand, wenn
   der Kopf weggeblättert ist) – sie nehmen keinen Platz im Layout ein, nichts verschiebt sich. Klicks gehen außerhalb
   der Kästen durch. Im laufenden Spiel klappen sie nach ein paar Sekunden zu einer Pille ein (main.js, updateNotices). */
.notices {
  position: fixed;
  top: max(env(safe-area-inset-top, 0px), var(--notice-top, 0px));
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  padding-top: 6px;
  pointer-events: none;
}
.notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 1 1 100%;
  max-width: 720px;
  padding: 8px 8px 8px 12px;
  border: 1px solid rgba(255, 183, 77, 0.55);
  border-left: 4px solid #ffb74d;
  border-radius: 8px;
  background: rgba(58, 47, 28, 0.85);
  color: #ffe0b2;
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
  animation: notice-in 0.2s ease-out;
}
.notice[hidden] { display: none; }
.notice.active { border-color: rgba(255, 138, 128, 0.55); border-left-color: #ff8a80; background: rgba(61, 34, 38, 0.85); color: #ffcdd2; }
.notice.ended { border-color: rgba(129, 199, 132, 0.55); border-left-color: #81c784; background: rgba(31, 51, 36, 0.85); color: #c8e6c9; }
.notice.match-full-notice, .notice.info-notice { border-color: rgba(144, 202, 249, 0.55); border-left-color: #90caf9; background: rgba(26, 39, 61, 0.88); color: #e3f2fd; }
.notice.rescue-notice { border-color: rgba(255, 224, 130, 0.55); border-left-color: #ffe082; background: rgba(78, 52, 46, 0.85); color: #fff3cd; }
.notice-body { flex: 1; min-width: 0; }
.notice-body strong { margin-right: 6px; }
#maintenance-operator { display: block; margin-top: 4px; font-style: italic; }
#maintenance-operator:empty { display: none; }
.notice-collapse, .notice-pill {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.notice-collapse { flex: none; padding: 0 6px; border-radius: 6px; font-size: 1rem; line-height: 1.4; opacity: 0.8; }
.notice-collapse:hover, .notice-collapse:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.notice-pill { display: none; padding: 0; white-space: nowrap; font-weight: bold; font-variant-numeric: tabular-nums; }
/* eingeklappt: nur noch eine kleine Pille am oberen Rand, antippen klappt wieder auf */
.notice.collapsed { flex: 0 0 auto; padding: 3px 12px; border-left-width: 1px; border-radius: 999px; font-size: 0.85rem; }
.notice.collapsed .notice-body, .notice.collapsed .notice-collapse { display: none; }
.notice.collapsed .notice-pill { display: inline; }
/* schmales Spielfeld (Handy): die Kopfzeile im Spiel ist klein – Pillen kleiner, damit sie Herzen und Tasten frei lassen */
.notices.compact .notice.collapsed { padding: 1px 8px; font-size: 0.7rem; }
.notices.compact { gap: 4px; }
.notice.ended .notice-collapse { display: none; }  /* „Wartung beendet“ verschwindet ohnehin gleich */
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .notice { animation: none; } }
/* Hinweise an Start-Buttons, „Bereit“ und „Neue Runde“, solange wegen der Wartung nichts Neues beginnt */
.maintenance-hint { margin: 8px 0; color: #ffb74d; text-align: center; font-size: 0.95rem; }
.maintenance-hint[hidden] { display: none; }
/* Lobby: der Hinweis liegt über den ausgegrauten Start-Buttons, statt darunter Platz zu nehmen (nichts verschiebt sich) */
.lobby-start { position: relative; }
#lobby-blocked {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(27, 29, 42, 0.88);
  pointer-events: none;
}
/* „keine neue Runde“ unter dem Spielfeld nur zusammen mit „Bereit“ – mitten im Spiel schöbe er die Buttons nach unten */
#play:has(#ready[hidden]) #ready-blocked { display: none; }
#ready:disabled, #game-over-again:disabled, #create:disabled, #create-solo:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }

/* Gerettete Runde (Wartung): Link zum Weiterspielen – eingeklappt wie die Einladungslinks, aber getrennt davon */
#rescue-toggle {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #4e342e;
  color: #f2f2f2;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
#rescue-toggle[hidden] { display: none; }
#rescue-toggle:hover { background: #6d4c41; }
#rescue-toggle .share-arrow { display: inline-block; transition: transform 0.15s; }
#rescue-toggle[aria-expanded="true"] .share-arrow { transform: rotate(180deg); }
@media (max-width: 560px) { #rescue-toggle > [data-i18n] { display: none; } }  /* Handy: nur das Symbol */
#rescue-box { margin-bottom: 12px; font-size: 0.9rem; }
#rescue-box[hidden] { display: none; }
#rescue-box label { display: block; opacity: 0.8; margin-bottom: 4px; }
#rescue-box .lobby-note { margin: 6px 0 0; font-size: 0.85rem; }
#rescue-link {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #444a68;
  border-radius: 6px;
  background: #2c3047;
  color: #f2f2f2;
  font: inherit;
  -webkit-user-select: text;
  user-select: text;
}
#rescue-copy {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #1e88e5;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
#rescue-overlay .card { max-width: 420px; }
#rescue-overlay h2 { font-size: 1.6rem; }
#rescue-overlay.failed .card { border-color: #ff8a80; }
/* Lobby: gemerkte Runden – eigener Kasten mit Überschrift, über den Einstellungen */
.lobby-rescue[hidden] { display: none; }
#rescue-list { list-style: none; padding: 0; }
.rescue-entry { cursor: default; flex-wrap: wrap; }
.rescue-entry .option-text { min-width: 170px; }  /* schmal: die Buttons rutschen in eine eigene Zeile */
.rescue-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.rescue-continue, .rescue-forget {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.rescue-continue { background: #43a047; color: #fff; font-weight: bold; }
.rescue-continue:hover { background: #388e3c; }
.rescue-forget { background: #2c3047; color: #f2f2f2; }
.rescue-forget:hover { background: #444a68; }
@media (min-width: 960px) {
  .lobby-rescue { grid-area: rescue; margin-bottom: 20px; }
  .lobby-rescue .options-title { margin-top: 0; }
  .lobby-grid { grid-template-areas: "name name" "rescue rescue" "a b" "a b" "start start" "links links"; }
}
@media (min-width: 1280px) {
  .lobby-grid { grid-template-areas: "name name name" "rescue rescue rescue" "a b links" "a b links" "start start links"; }
}

/* Startseite (#94): ersetzt die Lobby, wenn im Browser nicht mitgespielt werden kann (/api/config.webPlay false).
   #lobby bekommt die Klasse home-mode: Einstellungen und Start verschwinden, Links und Ranking bleiben. */
#lobby.home-mode > #lobby-intro,
#lobby.home-mode .lobby-name,
#lobby.home-mode .lobby-rescue,
#lobby.home-mode .lobby-group,
#lobby.home-mode .lobby-start,
#lobby.home-mode #lobby-blocked,
#lobby.home-mode #dev { display: none; }
#lobby.home-mode { padding: 24px 0; }
.home[hidden] { display: none; }
.home { text-align: left; }
.home-intro { margin: 0 0 16px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: stretch; }
.home-apps { display: flex; flex-direction: column; }
.home-apps > .lobby-note { margin-top: auto !important; padding-top: 10px; }  /* Hinweis unten bündig */
.home-apps > .app-cards { flex: 1 1 auto; align-content: stretch; }  /* die App-Karten füllen die Kachelhöhe */
.home-title { margin: 0 0 10px; font-size: 1.9rem; line-height: 1.2; }
.home-lead { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.5; color: #dfe3f5; }
/* Kachel mit Spielbild und den Knöpfen darunter: Bild füllt die Kachelbreite, die Knöpfe teilen sich die Breite
   (je 50 %; ohne „Jetzt spielen“ nimmt „Live zuschauen“ die ganze Breite) */
.home-hero-side {
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.75em; width: 100%;
  padding: 0.75em; border: 1px solid #333852; border-radius: 14px; background: #22263a;
}
.home-cta { margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.75em; }
.home-cta [hidden] { display: none; }
.home-cta .howto-button:not([hidden]) { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 2.6em; }
.home-cta .howto-button { padding: 10px 8px; white-space: nowrap; }  /* Handy: beide Knöpfe einzeilig nebeneinander */
.home-play { background: #43a047; }
.home-play:hover, .home-play:focus-visible { background: #388e3c; }
#lobby:not(.home-mode) > #lobby-intro { text-align: left; margin: 0 0 12px; }
/* Bild aus dem Spiel füllt seinen Platz (oben ausgeschnitten statt verzerrt, der Boden bleibt); darüber als SVG die
   drei Spieler mit ihrem Button und Linien zur Figur – als Vektor, damit sie scharf bleiben */
.home-shot { position: relative; aspect-ratio: 2 / 1; border-radius: 10px; overflow: hidden; background: #6ec6ff; }
.home-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; image-rendering: pixelated; }
.home-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }  /* Namen und Linien zur Figur */

.home-features { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.home-features li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: start;
  padding: 12px 14px; border: 1px solid #333852; border-radius: 12px; background: #22263a; line-height: 1.4;
}
.home-feature-icon { grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #2c3047; font-size: 1.2rem; }
.home-features strong { font-size: 0.98rem; }
.home-features li > span:last-child { font-size: 0.86rem; color: #c5cae9; }
.home-apps {
  margin: 0; padding: 14px 16px; border: 1px solid #2f5b8a; border-radius: 14px;
  background: linear-gradient(135deg, #1d2c48, #1f2233); scroll-margin-top: 12px;
}
.home-apps-title { margin: 0 0 4px; font-size: 1.15rem; }
.home-apps > p { margin: 0 0 10px; line-height: 1.45; font-size: 0.95rem; }
.home-apps > .lobby-note { margin: 10px 0 0; font-size: 0.85rem; }
.app-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.app-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #444a68; border-radius: 12px;
  background: #252a40; color: #f2f2f2; text-decoration: none; text-align: left;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.app-card[href]:hover, .app-card[href]:focus-visible {
  border-color: #1e88e5; box-shadow: 0 4px 16px rgba(30, 136, 229, 0.25); transform: translateY(-2px); outline: none;
}
.app-card.soon { border-style: dashed; color: #b0b6d3; }
.app-card-icon { flex: none; width: 32px; height: 32px; color: #90caf9; }
.app-card.soon .app-card-icon { color: #6f7699; }
.app-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-card-sub { font-size: 0.82rem; opacity: 0.8; }
.app-card-systems { font-size: 0.82rem; color: #c5cae9; }  /* Steam: Windows · Linux · Steam Deck */
.app-card.soon .app-card-sub { font-style: italic; }
@media (prefers-reduced-motion: reduce) {
  .app-card { transition: none; }
  .app-card[href]:hover { transform: none; }
}
@media (min-width: 600px) {
  .home-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  #lobby.home-mode .lobby-grid { grid-template-areas: "home home" "links links"; }
  .home { grid-area: home; }
  .home-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; }
  .home-title { font-size: 2.1rem; }
  .home-features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  #lobby.home-mode .lobby-grid { grid-template-areas: "home home links"; }
}

/* Ohne Mitspielen im Browser (#94): kein Eltern-Schalter im Browser (<html class="watch-only">, er gehört in die App)
   und keine Ton-Knöpfe außerhalb der Spielansicht (<html class="no-audio">, beim Zuschauen wieder da; main.js) */
html.watch-only #kids-footer { display: none; }
html.no-audio #music, html.no-audio #mute { display: none; }
/* Startseite am PC (#94): passt ohne Blättern und nutzt die Fläche – Grundschrift aus Breite UND Höhe des Fensters
   (min(vw, vh), begrenzt), alle Maße darin in em; das Raster ist so hoch wie das Fenster abzüglich Kopf und
   Fußzeile, die Merkmale stehen unten, die fünf Karten rechts teilen sich die Höhe gleichmäßig. Auf sehr breiten
   Bildschirmen begrenzt eine Breite in em (wächst mit der Schrift) die Zeilenlänge, mittig. Keine Sonderfälle für
   einzelne Auflösungen; unter ~650 px sichtbarer Höhe darf geblättert werden. */
@media (min-width: 1000px) {
  main:has(> #lobby.home-mode:not([hidden])) { max-width: min(100%, 100em); font-size: clamp(13px, min(1.05vw, 1.95vh), 42px); }
  #lobby.home-mode { padding: 0.75em 0 0; }
  #lobby.home-mode .lobby-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(18em, 0.62fr);
    column-gap: 2em;
    min-height: calc(100vh - 118px - 1.5em);  /* Kopf (~64 px), feste Fußzeile (--footer-h) und Abstände */
  }
  #lobby.home-mode .home { display: flex; flex-direction: column; justify-content: space-between; gap: 1.2em; }
  #lobby.home-mode .lobby-links { display: flex; flex-direction: column; gap: 0.7em; margin: 0; }
  #lobby.home-mode .lobby-links .options-title { margin: 0; font-size: 0.72em; }
  #lobby.home-mode .lobby-links .live-link {
    flex: 1 1 0; min-height: 0; margin: 0; padding: 0.6em 1em; gap: 0.9em; max-width: none; font-size: 1em;
  }
  #lobby.home-mode .live-link-icon { width: 2.6em; height: 2.6em; font-size: 1.25em; }
  #lobby.home-mode .live-link-text strong { font-size: 1.05em; }
  #lobby.home-mode .live-link-sub, #lobby.home-mode #live-link-note { font-size: 0.85em; }
  .home-intro { margin: 0; }
  /* die beiden Kacheln bekommen die Höhe, die Einleitung und Merkmale übrig lassen (gleich hoch); das Bild wächst
     bzw. schrumpft darin mit, die Zeichnung bleibt mittig – so passt alles bei jeder Fenstergröße */
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 2em; align-items: stretch; flex: 1 1 0; }
  .home-title { font-size: 2.3em; margin-bottom: 0.35em; }
  .home-lead { font-size: 1.1em; margin-bottom: 1em; }
  .home-apps { padding: 1em 1.15em; }
  .home-apps-title { font-size: 1.2em; }
  .home-apps > p { font-size: 0.95em; margin-bottom: 0.7em; }
  .home-apps > .lobby-note { font-size: 0.85em; margin-top: 0.7em; }
  .app-cards { gap: 0.7em; }
  .app-card { padding: 0.7em 1em; gap: 0.85em; }
  .app-card-icon { width: 2.2em; height: 2.2em; }
  .app-card-text strong { font-size: 1em; }
  .app-card-sub, .app-card-systems { font-size: 0.82em; }
  /* Bild füllt die Kachelbreite; höchstens so hoch, dass alles ins Fenster passt (die Zeichnung bleibt mittig) */
  .home-shot { flex: 1 1 0; min-height: 8em; aspect-ratio: auto; }
  .home-cta { font-size: 1em; }
  .home-features { margin: 0; gap: 0.9em; grid-template-columns: repeat(auto-fit, minmax(12em, 1fr)); }  /* 4 nebeneinander, schmal 2 × 2 */
  .home-features li { padding: 0.8em 1em; column-gap: 0.85em; }
  .home-feature-icon { width: 2.4em; height: 2.4em; font-size: 1.15em; }
  .home-features strong { font-size: 1em; }
  .home-features li > span:last-child { font-size: 0.86em; }
}
/* schmalere Fenster (unter 1280 px): Merkmale 2 × 2 (lesbar statt vier schmaler Spalten); hier darf geblättert werden.
   Der Kopf ist unter 1100 px zweizeilig (Vibe-Hinweis): entsprechend weniger Höhe für das Raster */
@media (min-width: 1000px) and (max-width: 1279px) {
  .home-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) and (max-width: 1099px) {
  #lobby.home-mode .lobby-grid { min-height: calc(100vh - 160px - 1.5em); }
}

/* Rangliste als eigene Seite (#94, /?view=rangliste) */
#ranking-page { max-width: 1200px; margin: 0 auto; padding-top: 8px; }

/* Seite „Für Eltern“ (#94, /?view=eltern): wie die Anleitung */
#parents { max-width: 820px; margin: 0 auto; text-align: left; -webkit-user-select: text; user-select: text; }
#parents h2 { font-size: 1.4rem; text-align: center; margin: 4px 0 4px; }
#parents > .lobby-note { text-align: center; margin-top: 0; }

/* Spielerlink im Browser ohne Mitspielen (#94): „In der App mitspielen“, zuschauen geht */
#app-only { max-width: 640px; margin: 0 auto; padding: 24px 0 48px; }
.app-only-card { padding: 24px 18px; border: 1px solid #333852; border-radius: 14px; background: #22263a; text-align: center; }
.app-only-art { display: block; width: 96px; height: 96px; margin: 0 auto 8px; }
.app-only-card h2 { margin: 0 0 10px; font-size: 1.4rem; }
.app-only-card > p { line-height: 1.5; }
#app-only-watch {
  padding: 10px 22px; border: none; border-radius: 10px; background: #43a047; color: #fff;
  font: inherit; font-weight: bold; cursor: pointer;
}
#app-only-watch:hover, #app-only-watch:focus-visible { background: #388e3c; outline: 2px solid #a5d6a7; outline-offset: 2px; }
#app-only-apps .app-cards { margin: 16px 0 4px; }
