/* ── Design Tokens ───────────────────────────────────────────────────── */
:root {
  /* Farben */
  --bg:           #0f0f1a;
  --surface:      #1a1a2e;
  --surface-2:    #242444;
  --surface-3:    #2e2e58;
  --accent:       #f5a623;
  --accent-dark:  #c4821a;
  --danger:       #e74c3c;
  --success:      #2ecc71;
  --text:         #ffffff;
  --text-2:       #a0a0c0;
  --text-3:       #606080;
  --border:       rgba(255 255 255 / 0.08);
  /* Hintergrund für Kopf-/Fußleisten (themefähig) */
  --bar-bg:       rgba(15 15 26 / 0.92);
  /* Schatten/Halo der Brett-Feldzahlen (dunkel = schwarzer Halo für Kontrast) */
  --cell-num-shadow: 0 1px 2px #000, 0 0 3px #000;

  /* Typografie — „Nunito": rund, klar, seriös (Fallback = System-Schrift). */
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-xs:  11px;
  --font-size-sm:  13px;
  --font-size-md:  15px;
  --font-size-lg:  18px;
  --font-size-xl:  24px;
  --font-size-2xl: 32px;

  /* Abstände */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  40px;

  /* Radien */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-full: 9999px;

  /* Schatten */
  --shadow-sm: 0 2px 8px rgba(0 0 0 / 0.4);
  --shadow-md: 0 4px 24px rgba(0 0 0 / 0.5);
  --shadow-lg: 0 8px 40px rgba(0 0 0 / 0.6);

  /* Animationen */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:  120ms;
  --dur-mid:   220ms;
  --dur-slow:  380ms;

  /* Layout */
  --content-max: 600px;
  --header-h:    56px;
  --bottom-nav-h: 64px;
}

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

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── App Shell ───────────────────────────────────────────────────────── */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Splash Screen ───────────────────────────────────────────────────── */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-lg);
  animation: fade-in var(--dur-slow) var(--ease-out);
}

.splash-icon {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 24px rgba(245 166 35 / 0.5));
  animation: float 3s ease-in-out infinite;
}

.splash-label {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.splash-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Typografie ──────────────────────────────────────────────────────── */
h1 { font-size: var(--font-size-2xl); font-weight: 700; letter-spacing: -1px; line-height: 1.2; }
h2 { font-size: var(--font-size-xl);  font-weight: 600; letter-spacing: -0.5px; line-height: 1.3; }
h3 { font-size: var(--font-size-lg);  font-weight: 600; }
h4 { font-size: var(--font-size-md);  font-weight: 600; }

.text-sm  { font-size: var(--font-size-sm); }
.text-xs  { font-size: var(--font-size-xs); }
.text-2   { color: var(--text-2); }
.text-3   { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* ── Layout-Helfer ───────────────────────────────────────────────────── */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--gap-md);
  /* F2: die untere Leiste ragt zusätzlich um die Safe-Area (Home-Indikator/Notch) nach unten —
     diese hier MIT einrechnen, sonst wird der Seiten-Fuß (z. B. „Team löschen") verdeckt/abgeschnitten. */
  padding-bottom: calc(var(--bottom-nav-h) + var(--gap-md) + env(safe-area-inset-bottom));
  animation: fade-in var(--dur-mid) var(--ease-out);
}

.page--centered {
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding-bottom: var(--gap-md);
}

.stack {
  display: flex;
  flex-direction: column;
}
.stack--xs  { gap: var(--gap-xs); }
.stack--sm  { gap: var(--gap-sm); }
.stack--md  { gap: var(--gap-md); }
.stack--lg  { gap: var(--gap-lg); }
.stack--xl  { gap: var(--gap-xl); }

.row {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.row--between { justify-content: space-between; }
.row--center  { justify-content: center; }
.row--sm  { gap: var(--gap-sm); }
.row--md  { gap: var(--gap-md); }

.grow { flex: 1; }
.w-full { width: 100%; }

/* ── Card ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-md);
}

.card--elevated {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.card--accent {
  border-color: rgba(245 166 35 / 0.3);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(245 166 35 / 0.05) 100%);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: 12px var(--gap-lg);
  border: none;
  border-radius: var(--r-full);
  font-size: var(--font-size-md);
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              background var(--dur-fast);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

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

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--surface-3); }

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px var(--gap-md);
}
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }

.btn--sm {
  padding: 8px var(--gap-md);
  font-size: var(--font-size-sm);
}

.btn--lg {
  padding: 16px var(--gap-xl);
  font-size: var(--font-size-lg);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-md);
}

.btn--icon {
  padding: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
}

/* ── Inputs ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
}

.field label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px var(--gap-md);
  color: var(--text);
  /* 16px verhindert das automatische Hineinzoomen von iOS beim Fokussieren. */
  font-size: 16px;
  outline: none;
  transition: border-color var(--dur-fast);
}
textarea.input { line-height: 1.4; }
select.input, .range-select { font-size: 16px; }
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); }
.input--error { border-color: var(--danger); }

.field-error {
  font-size: var(--font-size-xs);
  color: var(--danger);
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  color: var(--text-3);
  font-size: var(--font-size-sm);
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Avatar ──────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-2);
  overflow: hidden;
}
.avatar--sm  { width: 32px;  height: 32px;  font-size: var(--font-size-sm); }
.avatar--md  { width: 48px;  height: 48px;  font-size: var(--font-size-md); }
.avatar--lg  { width: 72px;  height: 72px;  font-size: var(--font-size-xl); }
.avatar--xl  { width: 96px;  height: 96px;  font-size: var(--font-size-2xl); }

/* ── Badge ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge--accent  { background: rgba(245 166 35 / 0.15); color: var(--accent); }
.badge--success { background: rgba(46 204 113 / 0.15); color: var(--success); }
.badge--danger  { background: rgba(231 76 60 / 0.15);  color: var(--danger); }

/* ── List Item (klickbare Zeile) ─────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  color: var(--text);
  text-align: left;
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.list-item:active { transform: scale(0.99); }
button.list-item:hover { background: var(--surface-3); }
/* L4: Karten-Button (z. B. Team-Spiele-Log) soll wie eine .card aussehen, nicht wie eine list-item-Kachel
   (sonst überschreibt .list-item den helleren .card-Hintergrund → wirkt grau/abgesetzt). */
.card.list-item { background: var(--surface); }
button.card.list-item:hover { background: var(--surface-2); }

/* ── Team-Code / Monospace-Snippet ───────────────────────────────────── */
.team-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px var(--gap-md);
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  overflow-x: auto;
  white-space: nowrap;
}

/* ── Toast ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + var(--gap-md));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  align-items: center;
  pointer-events: none;
  width: min(calc(100vw - 2 * var(--gap-md)), var(--content-max));
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px var(--gap-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-mid) var(--ease-spring) forwards;
  max-width: 100%;
  text-align: center;
}
.toast--success { border-color: rgba(46 204 113 / 0.4); color: var(--success); }
.toast--error   { border-color: rgba(231 76 60 / 0.4);  color: var(--danger); }
.toast--out     { animation: toast-out var(--dur-mid) var(--ease-in) forwards; }

/* ── Header ──────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--gap-md);
  gap: var(--gap-md);
}

.header-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  flex: 1;
  color: var(--accent);
  letter-spacing: -0.5px;
}
/* Kopf mit Untertitel (Team · Start · Dauer) */
.header-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.header-title-wrap .header-title { flex: 0 0 auto; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-sub { font-size: 11px; color: var(--text-2); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-sub:empty { display: none; }
/* Im Beamer-Modus bekommt der Kopf etwas mehr Luft (größere Schrift). */
body.kiosk .header-title { font-size: var(--font-size-xl); }
body.kiosk .header-sub { font-size: var(--font-size-sm); }

/* ── Bottom Nav ──────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--bar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dur-fast);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent); }
.nav-item:active { opacity: 0.7; }

.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute; top: -5px; right: -9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* Team-Switcher (Teamname im Kopf, antippbar) */
.team-switcher {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text); cursor: pointer;
}
.team-switcher h2 { margin: 0; }
.team-switcher:active { opacity: 0.7; }

/* Rechtsseite */
.legal h4 { margin-top: var(--gap-sm); }
.legal p, .legal li { color: var(--text-2); line-height: 1.55; }

/* Profil-Avatar im Kopf (rechts) */
.hdr-profile { background: none; border: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.hdr-profile:active { opacity: 0.7; }

/* Untere Leiste auf breiten Schirmen (Desktop/Tablet) zentrieren statt randlos */
@media (min-width: 768px) {
  .bottom-nav {
    width: var(--content-max);
    max-width: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

/* ── Skeleton Loader ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: shimmer 1.4s ease infinite;
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.mt-auto  { margin-top: auto; }
.p-md     { padding: var(--gap-md); }
.gap-sm   { gap: var(--gap-sm); }

/* ── Auth ────────────────────────────────────────────────────────────── */
.auth-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  filter: drop-shadow(0 0 16px rgba(245 166 35 / 0.4));
  animation: float 3s ease-in-out infinite;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0 0 0 / 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--gap-md);
  /* unterer Sicherheitsabstand (iPhone-Home-Leiste) → Buttons nie abgeschnitten */
  padding-bottom: calc(var(--gap-md) + env(safe-area-inset-bottom));
  animation: fade-in var(--dur-fast) var(--ease-out);
}

@media (min-width: 480px) {
  .modal-overlay { align-items: center; }
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  overflow-y: auto;
  animation: slide-up var(--dur-mid) var(--ease-spring);
}

.modal-body {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: var(--gap-sm);
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Avatar Upload Button ────────────────────────────────────────────── */
.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  border: 2px solid var(--bg);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.avatar-upload-btn:hover { transform: scale(1.1); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .page { padding: var(--gap-xl) var(--gap-lg) calc(var(--bottom-nav-h) + var(--gap-xl)); }
}

/* Kiosk / Beamer-Modus — erzwungenes Querformat. Der KOPF bleibt sichtbar (gleicher Kopf wie im
   normalen Modus, mit Team · Start · Dauer); nur untere Leiste & Eingabe sind aus (read-only). */
body.kiosk .bottom-nav,
body.kiosk .game-controls,
body.kiosk .viewer-note { display: none; }
body.kiosk { overflow: hidden; }
/* Seit v0.13.0 bleibt der KOPF im Beamer sichtbar → die Seite muss IMMER die Kopfhöhe abziehen
   (nicht nur, wenn die Vollmodus-Regel #game-main.page per Spezifität gewinnt). Sonst wird das Brett
   auf Geräten/Fenstern unterhalb der Vollmodus-Schwelle um 56px nach unten gedrückt und unten abgeschnitten. */
body.kiosk .page { padding: 8px; max-width: 100%; height: calc(100dvh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow: hidden; }
body.kiosk .game-layout { flex-direction: row; height: 100%; align-items: stretch; gap: 10px; }
body.kiosk .board-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
body.kiosk #board-host { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
body.kiosk .side-wrap { flex: 0 0 32%; max-width: 36%; min-height: 0; display: flex; }
body.kiosk #ticker-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.kiosk .ticker-log { flex: 1; max-height: none; }
body.kiosk #status-banner h3 { font-size: var(--font-size-lg); }

/* Beamer/Kiosk im Hochformat: klarer „Gerät drehen"-Hinweis statt unzuverlässiger CSS-Drehung. */
.kiosk-rotate-hint { display: none; }
@media (orientation: portrait) {
  body.kiosk .game-layout { display: none; }
  body.kiosk .kiosk-rotate-hint {
    display: flex; position: fixed; inset: 0; z-index: 400; background: var(--bg);
    flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 18px; padding: 28px; font-size: var(--font-size-lg); color: var(--text);
  }
}
/* F1: Im Hochformat-Vollbild liegt der „bitte drehen"-Hinweis über dem Kopf → eigener Beenden-Knopf
   oben rechts (sonst käme man ohne Drehen nicht aus dem Vollbild). */
.kiosk-hint-exit {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
  background: var(--surface-2); border: 1px solid var(--border);
}

/* Beamer-Modus wird über den (jetzt sichtbaren) Kopf-Button verlassen — kein separates X mehr. */
.kiosk-exit { display: none !important; }

/* ── Selektierbare Elemente (Wizard, Listen) ─────────────────────────── */
.list-item.selected,
.variant-card.selected { border-color: var(--accent); background: rgba(245 166 35 / 0.08); }

.check-box {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 2px solid var(--text-3); border-radius: 50%;
  position: relative; transition: all var(--dur-fast);
}
.check-box.on { border-color: var(--accent); background: var(--accent); }
.check-box.on::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 6px; height: 11px; border: solid #000; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.choice--on { background: var(--accent) !important; color: #000 !important; }

/* ── Wizard ──────────────────────────────────────────────────────────── */
.wizard-progress { display: flex; gap: var(--gap-xs); }
.wizard-dot {
  flex: 1; height: 4px; border-radius: var(--r-full); background: var(--surface-3);
  transition: background var(--dur-mid);
}
.wizard-dot.active { background: var(--accent); }
.wizard-dot.done { background: var(--accent-dark); }
.order-num {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--accent); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: var(--font-size-sm);
}
#order-list.shuffling { opacity: 0.6; transition: opacity 90ms; }
/* D1: Spieleranzahl-Range in der Spielauswahl */
.variant-range { font-size: var(--font-size-xs); color: var(--accent); font-weight: 700; }
/* D2: Reihenfolge-Karte mit integrierter Glückszahl-Eingabe (zweizeilig) */
.order-row--gz { flex-direction: column; align-items: stretch; gap: 8px; cursor: default; }
.order-main { display: flex; align-items: center; gap: 8px; width: 100%; }
.order-gz { display: flex; align-items: center; gap: 8px; }
.order-gz .gz-num { flex: 1 1 auto; min-width: 0; }
.order-gz .gz-rand { flex: 0 0 auto; }

/* ── Spielansicht-Layout (Hoch-/Querformat) ──────────────────────────── */
.game-layout { display: flex; flex-direction: column; gap: var(--gap-md); flex: 1; min-height: 0; }
.board-wrap { display: flex; flex-direction: column; gap: var(--gap-sm); min-width: 0; }
.side-wrap { display: flex; flex-direction: column; gap: var(--gap-md); }
.viewer-note { display: none; color: var(--text-2); font-size: var(--font-size-sm); text-align: center; }

/* Querformat-Layout NUR für die Spielansicht (#game-main) — NICHT global, sonst leakt es in den
   Stream (gleiche Klassen) und drückt dort die Brett-Höhe auf 0. Der Stream hat eigene .stream-layout-Regeln. */
@media (orientation: landscape) and (min-width: 640px) {
  #game-main .game-layout { flex-direction: row; align-items: flex-start; }
  #game-main .board-wrap { flex: 1 1 62%; }
  #game-main .side-wrap { flex: 0 0 36%; max-width: 380px; }
  #game-main .ticker-log { max-height: 64vh; }
}
/* Reiner Betrachter (keine Eingabe) im Querformat NUR im Handy-Modus (kurze Seite < 500,
   d. h. Handy quer). Tablet/Laptop (Höhe ≥ 500) fallen NICHT hierunter → dort immer eingeben. */
@media (orientation: landscape) and (max-height: 499px) {
  .game-controls { display: none; }
  .viewer-note { display: block; }
  /* KM: Höhenrestriktionen aufheben → Szene wächst frei, Page scrollt zum Tisch */
  #game-main .km-cq { height: auto; }
  #game-main .km-scene { height: auto; overflow: visible; }
  #game-main .km-table-wrap,
  #game-main .km-bracket-wrap { overflow: visible; flex: 0 0 auto; }
}

/* Vollmodus (Tablet/Laptop): HARTE Trennung — links NUR das Brett (unberührt vom Eingabemodus),
   rechts EINE Spalte für Banner/Eingabe/Ticker/Controls. Alles ohne Scrollen, nichts skaliert herum. */
@media (min-width: 700px) and (min-height: 500px) {
  #game-main.page {
    max-width: none; width: 100%;
    height: calc(100dvh - var(--header-h));
    /* max-height ist PFLICHT zusätzlich zu height: ein Flex-Item mit flex:1 (flex-basis:0%) ignoriert
       `height` für die Hauptachse und wächst mit dem Inhalt mit. max-height deckelt das hart → das
       gefittete Brett kann #game-main nicht über den Bildschirm hinaus wachsen lassen (kein Rest-Scroll). */
    max-height: calc(100dvh - var(--header-h));
    overflow: hidden; padding: var(--gap-md);
  }
  #game-main .game-layout { flex-direction: row; height: 100%; align-items: stretch; gap: var(--gap-md); min-height: 0; }
  /* Linke Spalte = NUR das Brett (Banner/Eingabe/Ende liegen rechts, daher hier ausgeblendet).
     min-height:0 ist PFLICHT: ohne sie kann die Spalte nicht unter ihre Inhaltsgröße schrumpfen, sodass
     ein (kurzzeitig) im Fluss stehendes großes Brett die ganze Spalte/#game-main aufbläht (wie im Stream). */
  #game-main .board-wrap { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }
  #game-main #input-host,
  #game-main #status-banner,
  #game-main #end-host { display: none; }
  #game-main #board-host { flex: 1; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
  /* Rechte Spalte = Banner + Eingabe + Ticker + Controls + Ende. Wird der Inhalt (Numpad) zu hoch,
     scrollt NUR diese Spalte intern (oberstes Objekt bleibt, Rest rutscht runter) — das Brett links
     bleibt komplett unberührt und nie abgeschnitten. */
  #game-main .side-wrap { flex: 0 0 340px; max-width: 380px; min-height: 0; display: flex; flex-direction: column; gap: var(--gap-sm); overflow-y: auto; overflow-x: hidden; }
  #game-main #ticker-card { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
  #game-main .ticker-log { flex: 1; max-height: none; }
  #game-main .viewer-note { display: none; }
}
/* Beamer/Kiosk: Brett-Host als Fit-Container (Brett absolut). Der Kopf bleibt sichtbar, daher gilt
   die normale Vollmodus-Höhe (calc(100dvh - Kopf)) → kein „Rahmen". */
body.kiosk #board-host { position: relative; overflow: hidden; }
/* Im Handy-Modus liegen die rechten Zweit-Hosts brach → ausblenden. */
@media not all and (min-width: 700px) and (min-height: 500px) {
  #side-banner, #side-input, #side-end { display: none; }
}
/* Leere Zweit-Hosts nehmen keinen Platz (sonst Gap-Lücke rechts). */
#side-banner:empty, #side-input:empty, #side-end:empty { display: none; }

/* ── Schlangen-Spielbrett ────────────────────────────────────────────── */
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 4px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
}
/* Pixel-gefittetes Brett (Beamer/Stream/Vollmodus): ABSOLUT positioniert, damit seine Größe
   den Host NICHT beeinflusst → keine Rückkopplung/Selbst-Verkleinerung, kein Ruckeln.
   Standard: zentriert (Stream/Beamer-Anzeige). In der Spielansicht (#game-main) OBEN ausgerichtet,
   damit das Brett bündig mit der rechten Spalte (Eingabe/Ticker) oben beginnt. */
.board.is-fitted { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#game-main .board.is-fitted { top: 0; transform: translateX(-50%); }
.board-cell {
  position: relative;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  min-width: 0;
  overflow: hidden;
}
.cell-num { position: absolute; bottom: 2px; left: 4px; font-size: clamp(10px, 1.7vw, 15px); font-weight: 800; color: var(--text-2); text-shadow: var(--cell-num-shadow); pointer-events: none; }
.board-cell.is-start { background: rgba(74 163 255 / 0.16); }
.board-cell.is-start .cell-num { color: #4aa3ff; }
.board-cell.is-goal { background: rgba(46 204 113 / 0.20); box-shadow: inset 0 0 0 1.5px rgba(46 204 113 / 0.5); }
.board-cell.is-goal .cell-num { font-size: 13px; }

.kegel-layer { position: absolute; inset: 6px; pointer-events: none; }
.kegel {
  position: absolute;
  /* Sitzt im Feld (Kopf ragt NICHT über den oberen Feldrand); Anker etwas unter der Feldmitte.
     Kopf bewusst etwas kleiner (0.68 statt 0.74), damit er sauber INNERHALB des Felds bleibt. */
  transform: translate(-50%, -56%);
  width: calc(100% / var(--cols) * 0.68);
  background: none; border: none; padding: 0;
  pointer-events: auto; cursor: pointer; z-index: 2;
}
.kegel.moving { z-index: 6; }
.kegel-inner { display: flex; flex-direction: column; align-items: center; will-change: transform; }
.kegel-head {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--pc); background: var(--surface-3);
  object-fit: cover; object-position: 50% 22%; overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: clamp(8px, 2.4vw, 17px); line-height: 1;
}
.kegel-head--initials { background: var(--pc); color: #08101f; }
/* Körper nur noch angedeutet (kurz), damit der Kopf groß bleibt und nichts übersteht. */
.kegel-body {
  width: 56%; aspect-ratio: 1 / 0.7; margin-top: -14%;
  background: var(--pc); opacity: 0.92;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  border-radius: 0 0 45% 45%;
}
.kegel.is-winner .kegel-head { border-color: var(--success); box-shadow: 0 0 0 3px var(--success), 0 0 16px rgba(46 204 113 / 0.7); }
.kegel.is-winner .kegel-inner::before {
  content: '👑'; position: absolute; top: -64%; left: 50%; transform: translateX(-50%);
  font-size: clamp(10px, 3vw, 20px);
}
.kegel.knocked .kegel-head { filter: grayscale(0.5) brightness(0.8); }

.six-pill {
  background: var(--accent); color: #000; border-radius: var(--r-full);
  padding: 2px 10px; font-size: var(--font-size-xs); font-weight: 700;
}

/* ── Liveticker ──────────────────────────────────────────────────────── */
.ticker-log {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 180px; overflow-y: auto; scroll-behavior: smooth;
}
.ticker-item {
  font-size: var(--font-size-sm); padding: 6px var(--gap-sm);
  border-radius: var(--r-sm); background: var(--surface-2);
  border-left: 3px solid var(--surface-3);
}
.tick-time { color: var(--text-3); font-size: 0.9em; font-variant-numeric: tabular-nums; margin-right: 3px; }
.ticker-order-btn { gap: 5px; padding: 4px 8px; }
.ticker-order-btn .text-xs { color: var(--text-3); }
.ticker-knockout { border-left-color: var(--danger); }
.ticker-win { border-left-color: var(--success); font-weight: 700; }
.ticker-roll_six { border-left-color: var(--accent); }
.ticker-overshoot, .ticker-pump, .ticker-triple_six { border-left-color: var(--text-3); color: var(--text-2); }

/* ── Wurfpad ─────────────────────────────────────────────────────────── */
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap-sm); }
.pad-btn {
  aspect-ratio: 1; border: none; border-radius: var(--r-md);
  background: var(--surface-3); color: var(--text); font-size: var(--font-size-xl);
  font-weight: 700; transition: transform var(--dur-fast), background var(--dur-fast);
}
.pad-btn:active { transform: scale(0.92); }
.pad-btn:hover { background: var(--accent); color: #000; }
.pad-btn:disabled { opacity: 0.4; }
.pad-six { box-shadow: inset 0 0 0 2px var(--accent); }
.pad-zero { color: var(--text-3); }
.correct-details summary { cursor: pointer; padding: var(--gap-xs) 0; }

/* ── Pulse-Dot (aktives Spiel) ───────────────────────────────────────── */
.pulse-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--success); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(46 204 113 / 0.6); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46 204 113 / 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(46 204 113 / 0); }
  100% { box-shadow: 0 0 0 0 rgba(46 204 113 / 0); }
}

.stat-num { font-size: var(--font-size-2xl); font-weight: 700; color: var(--accent); }

/* ── Animationen (Event-Overlays) ────────────────────────────────────── */
.anim-overlay {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--gap-sm); overflow: hidden;
  /* Milchglas: Hintergrund während der Kill-/Sieg-Animation einfrieren/abdunkeln */
  background: rgba(10 10 20 / 0.45);
  backdrop-filter: blur(7px) saturate(0.85);
  -webkit-backdrop-filter: blur(7px) saturate(0.85);
  animation: anim-fade var(--dur-mid) var(--ease-out);
}
@keyframes anim-fade { from { opacity: 0; } to { opacity: 1; } }
.anim-sub {
  font-size: var(--font-size-lg); font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px #000; max-width: 86%; text-align: center;
  /* Dunkle Pille hinter dem Text → weiß bleibt in BEIDEN Themes (auch Hell-Modus) gut lesbar. */
  background: rgba(8 10 20 / 0.62); padding: 7px 16px; border-radius: var(--r-full);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.anim-knockout { background: radial-gradient(circle, rgba(231 76 60 / 0.25), transparent 65%); }
.anim-weapon { font-size: 96px; animation: smash 0.5s var(--ease-spring); }
.anim-bam {
  font-size: 72px; font-weight: 900; color: #fff; -webkit-text-stroke: 3px var(--danger);
  text-stroke: 3px var(--danger); animation: pop-bam 0.6s var(--ease-spring);
}
@keyframes smash {
  0% { transform: translateY(-200px) scale(0.4) rotate(-30deg); opacity: 0; }
  60% { transform: translateY(20px) scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
@keyframes pop-bam {
  0% { transform: scale(0) rotate(-15deg); }
  70% { transform: scale(1.3) rotate(8deg); }
  100% { transform: scale(1) rotate(-3deg); }
}
.anim-win { background: radial-gradient(circle, rgba(245 166 35 / 0.25), transparent 70%); }
.anim-trophy { font-size: 110px; animation: trophy-rise 0.8s var(--ease-spring); }
.anim-win-label {
  font-size: 56px; font-weight: 900; color: var(--accent);
  -webkit-text-stroke: 2px #000; animation: pop-bam 0.7s var(--ease-spring);
}
@keyframes trophy-rise {
  0% { transform: scale(0) rotate(0); }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.anim-confetti { position: absolute; top: -40px; font-size: 28px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.7; }
}
.anim-puff { background: rgba(0 0 0 / 0.15); }
.anim-puff-emoji { font-size: 90px; animation: puff 1.1s var(--ease-out); }
@keyframes puff {
  0% { transform: scale(0.5); opacity: 0; }
  40% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Kill-Animation: zwei Kegelmännchen (Cartoon/Slapstick), links = Werfer „killt" rechts ─────
   Die Köpfe sind die Profilbilder/Initialen der Spieler (wie auf dem Brett). 6 Varianten über eine
   v-*-Klasse auf .kill-stage. Bewusst comichaft/übertrieben (Looney-Tunes-Stil), kein Realismus. */
.anim-kill { gap: 14px; }
.kill-stage {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  gap: 76px; width: min(94vw, 480px); height: 210px;
}
.kill-fig {
  position: relative; width: 88px; height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  transform-origin: 50% 100%;
}
.kill-head {
  width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--pc);
  background: var(--surface-3); object-fit: cover; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 22px; line-height: 1; box-shadow: var(--shadow-md); z-index: 3;
}
.kill-head--initials { background: var(--pc); color: #08101f; }
.kill-body {
  width: 62px; height: 58px; margin-top: -7px; background: var(--pc); opacity: .95;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); border-radius: 0 0 42% 42%; z-index: 2;
}
.kill-arm, .kill-leg, .kill-tool, .kill-stars { position: absolute; opacity: 0; }
.kill-arm { width: 44px; height: 13px; border-radius: 8px; background: var(--pc); top: 62px; left: 68%; transform-origin: 0 50%; z-index: 4; }
.kill-leg { width: 42px; height: 13px; border-radius: 8px; background: var(--pc); bottom: 14px; left: 64%; transform-origin: 0 50%; z-index: 4; }
.kill-tool { top: 40px; left: 84%; font-size: 34px; line-height: 1; z-index: 5; }
.kill-stars { top: -14px; left: 50%; transform: translateX(-50%); font-size: 28px; z-index: 5; }
/* Nur der Werfer zeigt Gliedmaßen/Werkzeug, nur das Opfer zeigt Sterne. */
.kill-victim .kill-arm, .kill-victim .kill-leg, .kill-victim .kill-tool { display: none; }
.kill-killer .kill-stars { display: none; }
.kill-impact {
  position: absolute; top: 24%; left: 50%; transform: translate(-50%, -50%) scale(0);
  font-size: clamp(38px, 12vw, 58px); font-weight: 900; color: #fff;
  -webkit-text-stroke: 3px var(--danger); z-index: 6; opacity: 0; white-space: nowrap;
}

/* gemeinsame Effekte */
@keyframes kill-impact-pop { 0%{opacity:0;transform:translate(-50%,-50%) scale(0) rotate(-12deg)} 55%{opacity:1;transform:translate(-50%,-50%) scale(1.25) rotate(7deg)} 82%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(-3deg)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1.05)} }
@keyframes kill-stars { 0%{opacity:0;transform:translateX(-50%) translateY(0) scale(.4) rotate(0)} 25%{opacity:1} 100%{opacity:0;transform:translateX(-50%) translateY(-22px) scale(1.1) rotate(60deg)} }
@keyframes kill-windup { 0%{transform:rotate(0)} 30%{transform:rotate(-6deg)} 100%{transform:rotate(0)} }

/* Variante 1 — Boxhieb (Handschuh) */
.v-punch .kill-killer { animation: kill-windup 1.1s var(--ease-out) both; }
.v-punch .kill-killer .kill-arm { opacity: 1; animation: kp-arm 1.1s var(--ease-out) .25s both; }
.v-punch .kill-killer .kill-tool { opacity: 1; animation: kp-glove 1.1s var(--ease-out) .25s both; }
.v-punch .kill-killer .kill-tool::before { content: '🥊'; }
.v-punch .kill-impact { animation: kill-impact-pop 1.6s var(--ease-spring) .82s both; }
.v-punch .kill-victim { animation: kv-flyout 1.7s var(--ease-in) .92s both; }
.v-punch .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.5s ease-out .92s both; }
@keyframes kp-arm { 0%,30%{transform:rotate(0) scaleX(.55)} 58%{transform:rotate(-3deg) scaleX(1.3)} 100%{transform:rotate(0) scaleX(.9)} }
@keyframes kp-glove { 0%,30%{transform:translateX(-24px) scale(.8)} 58%{transform:translateX(34px) scale(1.2)} 100%{transform:translateX(10px) scale(1)} }
@keyframes kv-flyout { 0%,40%{transform:translateX(0) rotate(0)} 100%{transform:translateX(200px) rotate(300deg); opacity:0} }

/* Variante 2 — Kegelkugel (Strike): Kugel rollt heran, Opfer fällt wie ein Kegel */
.v-strike .kill-killer .kill-tool { opacity: 1; top: 78px; left: 78%; animation: ks-ball 1.4s linear .2s both; }
.v-strike .kill-killer .kill-tool::before { content: '🎳'; }
.v-strike .kill-impact { animation: kill-impact-pop 1.5s var(--ease-spring) 1.15s both; }
.v-strike .kill-victim { animation: kv-topple 1.7s var(--ease-in) 1.2s both; }
.v-strike .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.5s ease-out 1.2s both; }
@keyframes ks-ball { 0%{transform:translateX(0) rotate(0)} 100%{transform:translateX(150px) rotate(720deg)} }
@keyframes kv-topple { 0%,42%{transform:rotate(0)} 72%{transform:rotate(80deg) translateY(6px)} 100%{transform:rotate(92deg) translate(56px,18px); opacity:0} }

/* Variante 3 — Tritt */
.v-kick .kill-killer { animation: kill-windup 1.1s var(--ease-out) both; }
.v-kick .kill-killer .kill-leg { opacity: 1; animation: kk-leg 1.1s var(--ease-out) .3s both; }
.v-kick .kill-impact { animation: kill-impact-pop 1.6s var(--ease-spring) .88s both; }
.v-kick .kill-victim { animation: kv-launch 1.7s var(--ease-in) .98s both; }
.v-kick .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.5s ease-out .98s both; }
@keyframes kk-leg { 0%,35%{transform:rotate(0) scaleX(.7)} 60%{transform:rotate(-30deg) scaleX(1.15)} 100%{transform:rotate(-10deg) scaleX(.9)} }
@keyframes kv-launch { 0%,40%{transform:translate(0,0) rotate(0)} 68%{transform:translate(80px,-58px) rotate(170deg)} 100%{transform:translate(210px,40px) rotate(430deg); opacity:0} }

/* Variante 4 — Holzhammer von oben */
.v-mallet .kill-killer .kill-arm { opacity: 1; top: 48px; animation: km-arm 1.2s var(--ease-out) .2s both; }
.v-mallet .kill-killer .kill-tool { opacity: 1; top: 2px; left: 90%; transform-origin: 50% 100%; animation: km-mallet 1.2s var(--ease-out) .2s both; }
.v-mallet .kill-killer .kill-tool::before { content: '🔨'; }
.v-mallet .kill-impact { animation: kill-impact-pop 1.6s var(--ease-spring) .98s both; }
.v-mallet .kill-victim { animation: kv-squash 1.8s var(--ease-out) 1.02s both; }
.v-mallet .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.6s ease-out 1.02s both; }
@keyframes km-arm { 0%,28%{transform:rotate(-42deg) scaleX(.8)} 55%{transform:rotate(18deg) scaleX(1)} 100%{transform:rotate(6deg) scaleX(.9)} }
@keyframes km-mallet { 0%,28%{transform:translate(0,-34px) rotate(-58deg)} 54%{transform:translate(74px,28px) rotate(16deg)} 100%{transform:translate(64px,22px) rotate(8deg)} }
@keyframes kv-squash { 0%,44%{transform:scaleY(1) scaleX(1)} 56%{transform:scaleY(.42) scaleX(1.28)} 72%{transform:scaleY(1.06) scaleX(.95)} 100%{transform:scaleY(1) scaleX(1); opacity:0} }

/* Variante 5 — Kopfnuss / Rempler */
.v-headbutt .kill-killer { animation: khb-lunge 1.2s var(--ease-out) .3s both; }
.v-headbutt .kill-impact { animation: kill-impact-pop 1.5s var(--ease-spring) .9s both; }
.v-headbutt .kill-victim { animation: kv-topple-back 1.6s var(--ease-in) .96s both; }
.v-headbutt .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.5s ease-out .96s both; }
@keyframes khb-lunge { 0%,30%{transform:translateX(0) rotate(0)} 52%{transform:translateX(42px) rotate(12deg)} 100%{transform:translateX(6px) rotate(0)} }
@keyframes kv-topple-back { 0%,42%{transform:rotate(0) translateX(0)} 100%{transform:rotate(94deg) translate(70px,16px); opacity:0} }

/* Variante 6 — Karate-Hieb */
.v-chop .kill-killer .kill-arm { opacity: 1; top: 28px; left: 62%; animation: kc-arm 1.1s var(--ease-out) .25s both; }
.v-chop .kill-impact { animation: kill-impact-pop 1.5s var(--ease-spring) .85s both; }
.v-chop .kill-victim { animation: kv-spinout 1.6s var(--ease-in) .95s both; }
.v-chop .kill-victim .kill-stars { opacity: 1; animation: kill-stars 1.5s ease-out .95s both; }
@keyframes kc-arm { 0%,30%{transform:rotate(-72deg) scaleX(.9)} 55%{transform:rotate(22deg) scaleX(1.15)} 100%{transform:rotate(6deg) scaleX(.95)} }
@keyframes kv-spinout { 0%,42%{transform:rotate(0) scale(1)} 60%{transform:rotate(18deg) scale(.96)} 100%{transform:translateX(160px) rotate(-280deg) scale(.6); opacity:0} }

@media (prefers-reduced-motion: reduce) {
  .anim-weapon, .anim-bam, .anim-trophy, .anim-win-label, .anim-confetti, .anim-puff-emoji { animation-duration: 0.01ms; }
  /* Kill-Animation statisch zeigen (zwei Köpfe + Treffer-Wort), ohne Bewegung. */
  .kill-fig, .kill-arm, .kill-leg, .kill-tool { animation: none !important; }
  .kill-arm, .kill-leg, .kill-tool { display: none !important; }
  .kill-impact { animation: none !important; opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .kill-stars { animation: none !important; opacity: 1; }
}

/* ── Kompakte Statistik-Kärtchen (Profil + Spieler-Karte) ────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: var(--gap-sm); }
.stat-chip {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--gap-sm); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-chip-emoji { font-size: 22px; line-height: 1; }
.stat-chip-val { font-size: var(--font-size-lg); font-weight: 800; color: var(--accent); }
.stat-chip-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; }

/* ── Hauptmenü-Kacheln (edel/dezent — Dark-UI mit Icon-Badge & Akzent-Hierarchie) ── */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-md); }
.tile {
  position: relative;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--gap-md); display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  text-align: left; color: var(--text); min-height: 104px;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tile:hover { transform: translateY(-2px); border-color: rgba(245 166 35 / 0.32); box-shadow: var(--shadow-sm); }
.tile:active { transform: translateY(0) scale(0.99); }
/* Nacktes Icon → Badge (kein Markup nötig): die direkten <svg>-Kinder der Aktions-Kacheln. */
.tile > svg {
  width: 42px; height: 42px; padding: 9px; box-sizing: border-box;
  background: rgba(245 166 35 / 0.10); border: 1px solid rgba(245 166 35 / 0.20);
  border-radius: 13px; color: var(--accent); flex-shrink: 0;
}
.tile .tile-title { font-weight: 700; font-size: var(--font-size-md); }
.tile .tile-sub { font-size: var(--font-size-sm); color: var(--text-3); }
.tile .grow { width: 100%; }
.tile--wide { grid-column: span 2; }
.tile[data-blocked] { opacity: 0.5; cursor: default; }
.tile[data-blocked]:hover { transform: none; border-color: var(--border); box-shadow: none; }

/* Primäre Aktion (lokales Spiel) — dezent akzentuiert, gefüllter Badge, KEIN greller Verlauf. */
.tile--game-local {
  background: linear-gradient(160deg, rgba(245 166 35 / 0.13), rgba(245 166 35 / 0.03));
  border-color: rgba(245 166 35 / 0.30);
}
.tile--game-local > svg { background: var(--accent); border-color: transparent; color: #1a1a2e; }
/* Multi-Team — mittlere Stufe: leichter Akzent-Schimmer, Umriss-Badge. */
.tile--game-tvt { background: linear-gradient(160deg, rgba(245 166 35 / 0.06), transparent); }

/* Aktiv/Live — grüne Semantik, aber dezent (kein satter Verlauf mehr). */
.tile--active {
  border-color: rgba(46 204 113 / 0.42);
  background: linear-gradient(160deg, rgba(46 204 113 / 0.10), rgba(46 204 113 / 0.02));
}

/* ── Team-Statistik-Tabelle ──────────────────────────────────────────── */
.stats-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); white-space: nowrap; }
.stats-table th, .stats-table td { padding: 8px 7px; text-align: center; }
.stats-table th.txt, .stats-table td.txt { text-align: left; }
.stats-table thead th { color: var(--text-3); font-weight: 700; border-bottom: 1px solid var(--border); }
.stats-table th.col-icon { cursor: pointer; font-size: 16px; user-select: none; }
.stats-table th.col-icon.active { color: var(--accent); }
.stats-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; }
.stats-table tbody tr:last-child { border-bottom: none; }
.stats-table tbody tr:active { background: var(--surface-2); }
.stats-table td.active { color: var(--accent); font-weight: 700; }
.stats-table .rank { color: var(--text-3); font-weight: 800; }
.stats-table .pcell { display: flex; align-items: center; gap: 8px; }
.lb-sort-row { display: flex; gap: var(--gap-sm); flex-wrap: wrap; }

/* Kompakte Tabelle (mehr Zeilen ohne Scrollen, Bundesliga-Stil) */
.stats-table.compact th, .stats-table.compact td { padding: 4px 6px; }
.stats-table.compact tbody .avatar { width: 22px; height: 22px; font-size: 10px; }
.stats-table.compact .pcell { gap: 6px; }
.range-select.w-full { max-width: none; width: 100%; }
.stat-chip { cursor: pointer; }
.stat-chip:active { transform: scale(0.97); }

/* J2: Summenzeile der Team-Tabelle (fachlich sinnvolle Spalten; „Spiele" bleibt leer). */
.stats-table tfoot td { border-top: 2px solid var(--border); font-weight: 800; color: var(--text-2); padding-top: 6px; }
.stats-table tfoot .rank { color: var(--accent); }
.stats-table tfoot tr { cursor: default; }

/* H1: Mobiles Kartenlayout der Team-Statistik (statt breiter Tabelle auf schmalen Handys).
   Standard = aus (Desktop zeigt die Tabelle); per Media-Query unten auf schmalen Screens an. */
.stats-cards { display: none; }
.stat-card { width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.stat-card:active { background: var(--surface-3); }
.stat-card-head { display: flex; align-items: center; gap: 8px; }
.stat-card-rank { font-weight: 800; color: var(--text-3); min-width: 1.4em; text-align: center; }
.stat-card-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card-wins { font-size: var(--font-size-sm); font-weight: 800; color: var(--accent); white-space: nowrap; flex: 0 0 auto; }
.stat-card-wins.active { background: rgba(245 166 35 / 0.18); border-radius: 6px; padding: 1px 7px; }
.stat-card-games { font-size: var(--font-size-xs); color: var(--text-3); white-space: nowrap; flex: 0 0 auto; }
.stat-card-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.scm { display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--surface); border-radius: 8px; padding: 5px 4px; }
.scm.active { background: rgba(245 166 35 / 0.16); }
.scm-emoji { font-size: 14px; line-height: 1; }
.scm-val { font-weight: 800; font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }
.scm-label { font-size: 10px; color: var(--text-3); }
.stat-card--sum { background: var(--surface); border-style: dashed; cursor: default; }
.stat-card--sum:active { background: var(--surface); }
.stat-card--sum .stat-card-rank, .stat-card--sum .stat-card-name { color: var(--accent); }
@media (max-width: 560px) {
  #lb-card .stats-table-wrap { display: none; }
  #lb-card .stats-cards { display: flex; flex-direction: column; gap: 8px; }
}

/* C4: moderne Varianten-Karte (Icon + Name + Spiele links, Kennzahlen-Strip rechts; eine Zeile,
   bei Platzmangel scrollt der Strip horizontal statt umzubrechen). */
.variant-stat-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md); display: flex; flex-direction: column; gap: 5px;
}
.variant-stat-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vsh-icon { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.vsh-name { font-weight: 700; font-size: var(--font-size-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.vsh-games { font-size: var(--font-size-xs); color: var(--text-3); flex-shrink: 0; white-space: nowrap; margin-left: auto; }
.variant-stat-metrics {
  display: flex; gap: 9px; min-width: 0; justify-content: space-between;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 1px;
}
.variant-stat-metrics::-webkit-scrollbar { display: none; }
.vsm { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; white-space: nowrap; font-size: var(--font-size-xs); background: none; border: none; padding: 0; color: var(--text); }
.vsm-emoji { font-size: 13px; line-height: 1; }
.vsm-val { font-weight: 800; font-variant-numeric: tabular-nums; }
.vsm:active { transform: scale(0.94); }

/* C5: Profil-Statistik-Filter (Team/Zeitraum) — auf schmalen Handys gestapelt statt überlaufend. */
.stats-head { gap: var(--gap-sm); }
#profile-filters { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 560px) {
  .stats-head { flex-direction: column; align-items: stretch; }
  .stats-head #profile-filters { flex-direction: column; align-items: stretch; }
  .stats-head #profile-filters .range-select { max-width: none; width: 100%; }
}

/* 6er-Vorschau: durchscheinender Geist-Kegel + gepunkteter Pfad */
.kegel.ghost { opacity: 0.5; z-index: 1; pointer-events: none; filter: grayscale(0.2); }
.kegel.ghost .ghost-badge {
  position: absolute; top: -55%; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; font-size: 9px; font-weight: 800;
  border-radius: var(--r-full); padding: 0 5px; white-space: nowrap;
}
.board-cell.preview-path { box-shadow: inset 0 0 0 1.5px rgba(245 166 35 / 0.55); background: rgba(245 166 35 / 0.10); }

/* Performance-Graph */
.perf-chart { width: 100%; height: auto; background: var(--surface-2); border-radius: var(--r-md); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--gap-sm); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: var(--font-size-xs); color: var(--text-2); }
.chart-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ── Feedback-Einstieg (klein, präsent) ──────────────────────────────── */
.home-foot { display: flex; flex-direction: column; gap: var(--gap-sm); align-items: center; margin-top: var(--gap-sm); }
.feedback-link { display: inline-flex; align-items: center; gap: 6px; }
.feedback-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--r-full); background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
}

/* ── Quick-Info-Popover ──────────────────────────────────────────────── */
.popover {
  position: fixed; z-index: 1200; max-width: min(260px, calc(100vw - 24px));
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px var(--gap-md); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 4px; animation: pop-in var(--dur-fast) var(--ease-out);
}
.popover-title { font-weight: 700; font-size: var(--font-size-sm); }
.popover-text { font-size: var(--font-size-sm); color: var(--text-2); line-height: 1.4; }

/* ── Info-Badge (Spielregeln im Wizard) ──────────────────────────────── */
.info-badge {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(245 166 35 / 0.18); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 800; font-size: 16px;
  cursor: pointer; user-select: none; line-height: 1;
}
.info-badge:active { transform: scale(0.92); }

/* ── Zeitraum-Auswahl (Statistik) ────────────────────────────────────── */
.range-select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 6px 12px; font-weight: 600; max-width: 56%;
}

/* ── Eingabe-Terminal (Wähltastatur) ─────────────────────────────────── */
.input-terminal { }
.lock-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); }
.lock-state { font-weight: 700; color: var(--accent); font-size: var(--font-size-sm); }
.lock-bar .btn { white-space: nowrap; }
.turn-indicator {
  display: flex; align-items: center; gap: var(--gap-md);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--gap-md);
}
.pad-value {
  text-align: center; font-size: var(--font-size-xl); font-weight: 800; color: var(--accent);
  background: var(--surface-2); border-radius: var(--r-md); padding: 10px; border: 1px solid var(--border);
}
.dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-sm); }
.dialpad .pad-btn { aspect-ratio: 1.4; font-size: var(--font-size-2xl); }
.dialpad .dial-zero { grid-column: 1 / -1; aspect-ratio: auto; padding: 14px 0; font-size: var(--font-size-xl); }
.pad-btn.sel { background: var(--accent); color: #000; box-shadow: 0 0 0 3px rgba(245 166 35 / 0.35); }
/* „Pumpe"-Taste im Korrektur-Editor (5er-Grid): volle Breite, normale Höhe statt quadratisch. */
.pad .pad-zero { grid-column: 1 / -1; aspect-ratio: auto; font-size: var(--font-size-md); padding: 12px 0; }

/* Eingabe gesperrt, solange ein Wurf verarbeitet wird UND die Animation läuft: Wähltastatur +
   Korrektur ausgegraut/blockiert, „Eintragen" zeigt einen Spinner. Erst wenn alles fertig ist
   (Terminal-Neuaufbau nach der Animation) wird wieder freigegeben. */
.input-terminal.is-busy .dialpad,
.input-terminal.is-busy .correct-details { opacity: 0.4; pointer-events: none; filter: grayscale(0.4); }
.input-terminal.is-busy .pad-value { opacity: 0.6; }
.input-terminal.is-busy #btn-commit { opacity: 1; } /* Knopf voll sichtbar (Spinner), bleibt aber gesperrt */
.btn-spinner {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid rgba(0 0 0 / 0.25); border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

/* Vollmodus: Eingabe-Terminal rechts kompakt (nicht breiter als der Ticker, ohne Scrollen). */
#side-input .input-terminal { gap: var(--gap-sm); }
#side-input .dialpad .pad-btn { aspect-ratio: auto; padding: 9px 0; font-size: var(--font-size-xl); }
#side-input .turn-indicator { padding: var(--gap-sm); }
#side-input .pad-value { font-size: var(--font-size-lg); padding: 6px; }
#side-input .btn--lg { padding: 12px var(--gap-lg); font-size: var(--font-size-md); }

/* ── Stream-Ansicht ──────────────────────────────────────────────────── */
.stream-head {
  position: sticky; top: 0; z-index: 100; height: 44px; display: flex; align-items: center; gap: 8px;
  padding: 0 var(--gap-md); background: var(--bar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  font-weight: 700; color: var(--accent);
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.live-dot.on { background: var(--danger); box-shadow: 0 0 0 0 rgba(231 76 60 / 0.6); animation: pulse 1.6s infinite; }
.stream-main {
  flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px;
  width: 100%; max-width: 100%; height: calc(100dvh - 44px); overflow: hidden;
}
.stream-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--gap-md); }
.stream-layout { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.stream-layout .board-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }
.stream-layout #s-board,
.stream-layout .stream-fit-host { flex: 1; position: relative; overflow: hidden; min-height: 0; min-width: 0; }
.stream-layout .side-wrap { flex: 0 0 auto; min-height: 0; }
/* TvT-Stream-Seitenleiste (Teams/Ergebnis) darf bei knapper Höhe intern scrollen. */
.stream-layout .side-wrap.tvt-side { overflow-y: auto; overflow-x: hidden; }
.stream-layout #s-ticker { max-height: 22vh; }
@media (orientation: landscape) and (min-width: 700px) {
  .stream-layout { flex-direction: row; }
  .stream-layout .board-wrap { flex: 1 1 auto; min-width: 0; }
  /* Schmaler als zuvor (war 32–36%) → das Spielfeld bekommt mehr Platz. */
  .stream-layout .side-wrap { flex: 0 0 26%; max-width: 30%; display: flex; }
  .stream-layout .ticker-card-stream { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .stream-layout #s-ticker { flex: 1; max-height: none; }
}
/* Stream-Ticker kompakter als im Spiel (er wirkte dort zu groß). */
.ticker-card-stream .ticker-item { font-size: var(--font-size-xs); padding: 4px 7px; }

/* ── Brett-Gedränge: ein Cluster + Anzahl-Badge (Punkt 11) ───────────────── */
.kegel .stack-count {
  /* Zahl sitzt rechts OBEN am Kopf (innerhalb des Felds) — aber NICHT über den Kopf hinaus nach oben,
     damit sie auf dem Start-Feld (oberste Reihe) nicht vom Header abgeschnitten wird. */
  position: absolute; top: 0; right: -3px;
  min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--accent); color: #000; border: 1.5px solid var(--surface);
  border-radius: var(--r-full); font-size: 9px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 8;
}
.kegel.is-front .kegel-head { box-shadow: 0 0 0 2px var(--pc), var(--shadow-sm); }
.kegel.is-stacked:not(.is-front):not(.moving) .kegel-inner { filter: brightness(0.82); }

/* Bedrohte Kegel (auf 6er-Halten während laufender Serie) wackeln schräg (Punkt 3/17) */
@keyframes wobble-threat { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.kegel.threatened .kegel-inner { animation: wobble-threat 0.5s ease-in-out infinite; transform-origin: 50% 90%; }
/* berührte 6er-Halte stärker markieren (nur bei aktiver Sonderregel) */
.board-cell.six-stop { box-shadow: inset 0 0 0 2px var(--danger); background: rgba(231 76 60 / 0.16); }

/* ── Team-Aktionszeilen (Stream / Einladen / Löschen) ───────────────────── */
.action-row .live-dot { width: 12px; height: 12px; }
.action-row--danger { color: var(--danger); border-color: rgba(231 76 60 / 0.30); }
.action-row--danger svg { color: var(--danger) !important; }
.action-row--danger .text-3 { color: var(--danger); opacity: 0.75; }

/* ── Team-vs-Team (TvT) Lobby ────────────────────────────────────────────── */
.tvt-team { display: flex; align-items: center; gap: var(--gap-md); }
.tvt-team--mine { box-shadow: 0 0 0 2px var(--accent); }
.tvt-color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.tvt-pick .tvt-check { color: var(--accent); font-weight: 800; width: 1em; text-align: center; }
/* Spielauswahl-Grid (Phase A) */
.tvt-variant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-sm); }
.tvt-variant {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 96px;
  padding: var(--gap-md); background: var(--surface-2); border: 2px solid var(--border);
  border-radius: var(--r-md); color: var(--text); cursor: pointer; text-align: center;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.tvt-variant:active { transform: scale(0.98); }
.tvt-variant.selected { border-color: var(--accent); background: rgba(245 166 35 / 0.10); }
.tvt-variant-ico { color: var(--accent); }
.tvt-variant-name { font-weight: 700; font-size: var(--font-size-sm); }
.tvt-variant-votes { display: flex; gap: 3px; min-height: 10px; }
/* Reihenfolge-Vorschau (Phase C) */
.tvt-order { display: flex; flex-wrap: wrap; gap: 6px; }
.tvt-order-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 4px 10px; font-size: var(--font-size-sm); font-weight: 600; }
/* Schreiber-Hoheit-Leiste (M3) */
.tvt-writer-bar { display: flex; align-items: center; gap: var(--gap-sm); font-size: var(--font-size-sm); }
.tvt-writer-me { border-color: rgba(46 204 113 / 0.4); background: linear-gradient(135deg, var(--surface), rgba(46 204 113 / 0.10)); }
/* Spielansicht (M4) */
.tvt-banner { display: flex; align-items: center; gap: var(--gap-sm); font-weight: 700; }
.tvt-board-host { width: 100%; max-width: 640px; margin: 0 auto; }
/* TvT-Spielansicht: Querformat-Layout (scoped auf #tvt-main — analog #game-main, verhindert Leak) */
@media (orientation: landscape) and (min-width: 640px) {
  #tvt-main .game-layout { flex-direction: row; align-items: flex-start; }
  #tvt-main .board-wrap  { flex: 1 1 62%; }
  #tvt-main .side-wrap   { flex: 0 0 36%; max-width: 380px; }
}
/* Mobiles Querformat — Brett gefittet links, Eingabe-Spalte rechts scrollbar (wie #game-main, B4/B5) */
@media (orientation: landscape) and (max-height: 480px) {
  #tvt-main.tvt-is-game { max-width: none; width: 100%; height: calc(100dvh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow: hidden; padding: var(--gap-md); gap: var(--gap-sm); }
  #tvt-main.tvt-is-game .game-layout { flex: 1; flex-direction: row; align-items: stretch; min-height: 0; gap: var(--gap-md); }
  #tvt-main.tvt-is-game .board-wrap  { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }
  #tvt-main.tvt-is-game .tvt-board-host { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: none; margin: 0; }
  #tvt-main.tvt-is-game #tvt-board  { flex: 1; position: relative; overflow: hidden; min-height: 0; }
  #tvt-main.tvt-is-game .side-wrap  { flex: 0 0 300px; max-width: 340px; min-height: 0; display: flex; flex-direction: column; gap: var(--gap-sm); overflow-y: auto; overflow-x: hidden; }
}
/* Abbruch-Banner (M5) — auffällig, immer ganz oben im Vordergrund */
.tvt-abort-banner { border-color: rgba(231 76 60 / 0.5); background: linear-gradient(135deg, var(--surface), rgba(231 76 60 / 0.12)); }
/* Hausnummern-Stellenwahl im TvT-Eingabe-Terminal (M4-TEIL-2) */
.tvt-hn-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tvt-hn-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 54px; padding: 6px 8px; background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--r-md); color: var(--text); cursor: pointer; }
.tvt-hn-slot.sel { border-color: var(--accent); background: rgba(245 166 35 / 0.12); }
.tvt-hn-slot.is-filled { opacity: 0.8; cursor: default; }
.tvt-hn-slot-d { font-size: var(--font-size-lg); font-weight: 800; line-height: 1.1; }
.tvt-hn-slot-p { font-size: var(--font-size-xs); color: var(--text-3); }

/* ── Zahl-Stepper (z. B. Zielfeld in den Spieloptionen, Punkt 22) ────────── */
.num-stepper { align-items: center; }
.num-stepper .btn { min-width: 46px; font-size: var(--font-size-xl); padding: 6px 12px; line-height: 1; }
.num-stepper .num-val { -moz-appearance: textfield; appearance: textfield; }
.num-stepper .num-val::-webkit-outer-spin-button,
.num-stepper .num-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Performance-Graph: interaktive Legende (Punkt 8) ────────────────────── */
.chart-legend-item {
  background: none; border: none; padding: 3px 6px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-2); max-width: 47%;
}
.chart-legend-item:active { transform: scale(0.96); }
.chart-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend-item.off { opacity: 0.45; }
.chart-legend-item.off .chart-legend-name { text-decoration: line-through; }

/* ── Segmented Control (Theme-Auswahl, Punkt 21) ─────────────────────────── */
.seg {
  display: flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-full); padding: 4px;
}
.seg-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border: none; background: none; color: var(--text-2);
  border-radius: var(--r-full); font-size: var(--font-size-sm); font-weight: 700;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.seg-btn svg { width: 16px; height: 16px; }
.seg-btn.on { background: var(--accent); color: #000; }
.seg-btn.on svg { color: #000; }

/* ── Light-Theme (Punkt 21) ──────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:        #f3f4fb;
  --surface:   #ffffff;
  --surface-2: #eceef7;
  --surface-3: #dfe2ef;
  --accent:      #d9870f;
  --accent-dark: #b06f0c;
  --danger:    #d6362a;
  --success:   #1f9e54;
  --text:      #16161f;
  --text-2:    #4a4a63;
  --text-3:    #76768f;
  --border:    rgba(22 22 50 / 0.13);
  --bar-bg:    rgba(243 244 251 / 0.9);
  --cell-num-shadow: 0 1px 2px rgba(255 255 255 / 0.95);
  --shadow-sm: 0 2px 8px rgba(20 20 50 / 0.10);
  --shadow-md: 0 4px 24px rgba(20 20 50 / 0.12);
  --shadow-lg: 0 8px 40px rgba(20 20 50 / 0.16);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg:        #f3f4fb;
    --surface:   #ffffff;
    --surface-2: #eceef7;
    --surface-3: #dfe2ef;
    --accent:      #d9870f;
    --accent-dark: #b06f0c;
    --danger:    #d6362a;
    --success:   #1f9e54;
    --text:      #16161f;
    --text-2:    #4a4a63;
    --text-3:    #76768f;
    --border:    rgba(22 22 50 / 0.13);
    --bar-bg:    rgba(243 244 251 / 0.9);
    --shadow-sm: 0 2px 8px rgba(20 20 50 / 0.10);
    --shadow-md: 0 4px 24px rgba(20 20 50 / 0.12);
    --shadow-lg: 0 8px 40px rgba(20 20 50 / 0.16);
  }
}

/* ══ Hausnummern: kurvige Straße + Hausnummernschilder ════════════════════ */
/* Szene wie das Brett: im Hochformat fließend (aspect-ratio gibt die Höhe), im Voll-/Beamer-
   Modus absolut gefittet (.is-fitted). Größen skalieren über Container-Query-Einheiten (cqw),
   damit Schilder/Icons in jeder Größe automatisch mitwachsen (kein JS-Pixelnachrechnen). */
.street {
  position: relative;
  width: 100%;
  aspect-ratio: 1.6;
  background: radial-gradient(120% 90% at 50% 100%, var(--surface-2) 0%, var(--surface) 70%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  container-type: inline-size;
}
.street.is-fitted { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: auto; }
#game-main .street.is-fitted { top: 0; transform: translateX(-50%); }

.hn-road { position: absolute; inset: 0; width: 100%; height: 100%; }
.hn-asphalt   { fill: none; stroke: #3c3d49; stroke-width: 132; stroke-linecap: round; stroke-linejoin: round; }
.hn-centerline{ fill: none; stroke: #f5c542; stroke-width: 11; stroke-linecap: round; stroke-dasharray: 46 40; opacity: 0.9; }
:root[data-theme="light"] .hn-asphalt { stroke: #5b5c68; }

.hn-stations { position: absolute; inset: 0; pointer-events: none; }
.hn-station {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.14em;
  font-size: calc(3.15cqw * var(--st-scale, 1));
  width: max-content;
}
/* Nördlich der Straße (oben): Icon aufs Dach (ganz oben), Haus darunter, Name oben analog.
   Südlich (unten): Haus oben, Icon DARUNTER, Name unten. (DOM = [sign, icon, name].) */
.hn-station.hn-above { flex-direction: column-reverse; }
.hn-sign {
  position: relative;
  display: flex; gap: 0.16em; padding: 0.34em 0.4em;
  background: linear-gradient(180deg, #fbfdff, #d7deea);
  border: 0.07em solid rgba(0 0 0 / 0.25);
  border-radius: 0.1em 0.1em 0.34em 0.34em;
  box-shadow: 0 0.18em 0.4em rgba(0 0 0 / 0.45), inset 0 0.05em 0 rgba(255 255 255 / 0.9);
  margin-top: 0.62em; /* Platz für das Dach */
}
/* Kleines Hausdach über dem Schild (Spielerfarbe) → Schild sieht aus wie ein Häuschen. */
.hn-sign::before {
  content: ''; position: absolute; bottom: 100%; left: -0.14em; right: -0.14em; height: 0.62em;
  background: var(--pc, #8a8aa0);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 -0.03em 0.05em rgba(0 0 0 / 0.3));
}
.hn-slot {
  position: relative;
  width: 0.95em; height: 1.32em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0.16em;
  background: rgba(20 24 40 / 0.10);
  box-shadow: inset 0 0 0 0.05em rgba(20 24 40 / 0.18);
}
.hn-slot.is-filled { background: rgba(20 24 40 / 0.04); }
.hn-digit { font-weight: 800; font-size: 1.12em; line-height: 1; color: #16161f; font-variant-numeric: tabular-nums; }
.hn-icon {
  font-size: inherit; /* Buttons erben font-size NICHT → sonst skaliert das em-Icon nicht mit der Station */
  width: 3em; height: 3em; border-radius: 50%;
  border: 0.16em solid var(--pc); background: var(--surface-3);
  padding: 0; overflow: hidden; pointer-events: auto; cursor: pointer;
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.hn-head { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05em; color: #fff; line-height: 1; }
.hn-head--initials { background: var(--pc); color: #08101f; }
.hn-name {
  max-width: 9em; font-size: 0.66em; font-weight: 700; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--bar-bg); padding: 0.05em 0.4em; border-radius: var(--r-full);
}
/* Aktiver Spieler hervorgehoben (wie „wer ist dran") */
.hn-station.is-current { z-index: 5; }
.hn-station.is-current .hn-sign { box-shadow: 0 0 0 0.16em var(--accent), 0 0.18em 0.5em rgba(0 0 0 / 0.5); }
.hn-station.is-current .hn-icon { border-color: var(--accent); box-shadow: 0 0 0 0.12em var(--accent), 0 0 0.9em rgba(245 166 35 / 0.7); animation: hn-bob 1.4s ease-in-out infinite; }
.hn-station.is-current .hn-name { color: var(--accent); }
@keyframes hn-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.18em); } }
.hn-station.is-winner .hn-icon { border-color: var(--success); box-shadow: 0 0 0 0.14em var(--success), 0 0 0.9em rgba(46 204 113 / 0.7); }
.hn-station.is-tied .hn-sign { box-shadow: 0 0 0 0.16em var(--danger), 0 0.18em 0.5em rgba(0 0 0 / 0.5); }

/* „Wie eingeschlagen": Ziffer slammt herab, Schild wackelt, Hammer+Krach blitzt auf */
@keyframes hn-slam { 0% { transform: translateY(-1.3em) scale(2); opacity: 0; } 55% { transform: translateY(0) scale(1.25); opacity: 1; } 76% { transform: scale(0.88); } 100% { transform: none; } }
.hn-slot.hn-hammering .hn-digit { animation: hn-slam 0.46s var(--ease-spring); display: inline-block; }
@keyframes hn-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-3deg) translateY(0.06em); } 50% { transform: rotate(2.5deg); } 80% { transform: rotate(-1.5deg); } }
.hn-station.hn-shake .hn-sign { animation: hn-shake 0.4s ease-out; }
.hn-impact { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.hn-impact .hn-mallet, .hn-impact .hn-bang, .hn-impact .hn-dust { position: absolute; left: 50%; opacity: 0; }
.hn-impact .hn-mallet { top: -1.3em; font-size: 1.4em; transform: translateX(-50%); }
.hn-impact .hn-bang { top: -0.9em; font-size: 0.72em; font-weight: 900; color: var(--accent); white-space: nowrap; transform: translateX(-50%); text-shadow: 0 1px 2px rgba(0 0 0 / 0.5); }
.hn-impact .hn-dust { bottom: -0.2em; font-size: 1em; transform: translateX(-50%); }
.hn-impact.go .hn-mallet { animation: hn-mallet 0.42s var(--ease-in); }
.hn-impact.go .hn-bang { animation: hn-bang 0.7s var(--ease-out); }
.hn-impact.go .hn-dust { animation: hn-dust 0.6s ease-out; }
@keyframes hn-mallet { 0% { transform: translateX(-50%) translateY(-1em) rotate(-45deg); opacity: 0; } 55% { transform: translateX(-50%) translateY(0) rotate(0); opacity: 1; } 100% { transform: translateX(-50%) translateY(0) rotate(8deg); opacity: 0; } }
@keyframes hn-bang { 0% { transform: translateX(-50%) scale(0.4); opacity: 0; } 30% { transform: translateX(-50%) scale(1.15); opacity: 1; } 100% { transform: translateX(-50%) scale(1) translateY(-0.7em); opacity: 0; } }
@keyframes hn-dust { 0% { opacity: 0; transform: translateX(-50%) scale(0.3); } 40% { opacity: 0.95; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) scale(1.5); } }
@media (prefers-reduced-motion: reduce) {
  .hn-slot.hn-hammering .hn-digit, .hn-station.hn-shake .hn-sign, .hn-station.is-current .hn-icon { animation: none; }
}

/* ── Hausnummern: Stellen-Auswahl im Eingabe-Terminal (nach dem Wurf) ─────── */
.hn-pick { display: flex; gap: var(--gap-sm); justify-content: center; flex-wrap: wrap; }
.hn-pick-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hn-pick-label { font-size: var(--font-size-xs); color: var(--text-3); font-weight: 700; }
.hn-pick-slot {
  min-width: 48px; height: 60px; padding: 0 6px;
  border-radius: var(--r-md); border: 2px solid transparent;
  background: var(--surface-3); color: var(--text);
  font-size: var(--font-size-2xl); font-weight: 800; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.hn-pick-slot.is-free { box-shadow: inset 0 0 0 1.5px var(--border); }
.hn-pick-slot.is-free:hover { border-color: var(--accent); }
.hn-pick-slot.is-filled { opacity: 0.55; cursor: default; }
.hn-pick-slot.sel { border-color: var(--accent); background: var(--accent); color: #000; box-shadow: 0 0 0 3px rgba(245 166 35 / 0.35); }
.hn-pick-slot:active { transform: scale(0.93); }
.hn-pick-hint { text-align: center; color: var(--text-2); font-size: var(--font-size-sm); }
.hn-digit-preview { color: var(--accent); font-weight: 800; }
.input-terminal.is-busy .hn-pick { opacity: 0.4; pointer-events: none; filter: grayscale(0.4); }

/* ── Hausnummern: Gleichstand-Auswahl (Sieger am Tisch festlegen) ─────────── */
.hn-tiebreak .hn-tb-opt { width: 100%; }
.hn-tiebreak .hn-tb-opt.sel { box-shadow: inset 0 0 0 2px var(--accent); }

/* ── Hausnummern: Ergebnistabelle (Spielende) ────────────────────────────── */
.hn-result-table { display: flex; flex-direction: column; gap: 6px; }
.hn-result-row { display: flex; align-items: center; gap: var(--gap-sm); padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.hn-result-row.is-winner { background: rgba(245 166 35 / 0.16); box-shadow: inset 0 0 0 1.5px var(--accent); }
.hn-rank { min-width: 1.8em; text-align: center; font-size: var(--font-size-lg); }
.hn-result-name { text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-result-num { font-weight: 800; font-size: var(--font-size-lg); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }

/* Antippbare Siegzahl in den Statistiken (Hausnummern: hoch/niedrig-Aufschlüsselung) */
.wins-breakdown {
  background: none; border: none; padding: 0; cursor: pointer;
  color: inherit; font: inherit; font-weight: inherit;
  text-decoration: underline dotted var(--accent); text-underline-offset: 3px;
}
.wins-breakdown .wins-info { color: var(--accent); font-size: 0.85em; margin-left: 2px; vertical-align: super; }

/* Hausnummern-Sieger-Animation: der Sieger als Häuschen (Dach + Wand mit Profilkopf + Hausnummer) */
.anim-hn-win { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7em; }
.anim-hn-house { font-size: clamp(15px, 4.4vw, 30px); display: flex; flex-direction: column; align-items: center; animation: hn-win-pop 0.55s var(--ease-spring) both; }
.hn-win-roof {
  width: 0; height: 0;
  border-left: 5.2em solid transparent; border-right: 5.2em solid transparent;
  border-bottom: 2.7em solid var(--pc, #f5a623);
  filter: drop-shadow(0 -0.08em 0.12em rgba(0 0 0 / 0.35)); margin-bottom: -0.08em; z-index: 1;
}
.hn-win-wall {
  background: linear-gradient(180deg, #fbfdff, #dbe2ee); color: #16161f;
  border: 0.1em solid rgba(0 0 0 / 0.2); border-radius: 0.16em 0.16em 0.5em 0.5em;
  padding: 0.7em 1.1em 0.9em; display: flex; flex-direction: column; align-items: center; gap: 0.5em;
  box-shadow: 0 0.4em 1.2em rgba(0 0 0 / 0.5); min-width: 8em;
}
.hn-win-head {
  width: 4.8em; height: 4.8em; border-radius: 50%; object-fit: cover;
  border: 0.18em solid var(--pc, #f5a623); background: var(--pc, #f5a623); color: #08101f;
  display: flex; align-items: center; justify-content: center; font-weight: 800; line-height: 1; box-shadow: var(--shadow-sm);
}
.hn-win-head--initials { font-size: 2em; }
.hn-win-number { display: flex; gap: 0.12em; }
.hn-win-digit {
  font-weight: 900; font-size: 2.4em; line-height: 1; font-variant-numeric: tabular-nums; color: #16161f;
  background: rgba(20 24 40 / 0.06); border-radius: 0.12em; padding: 0.04em 0.14em;
}
@keyframes hn-win-pop { 0% { transform: scale(0.3) translateY(1.5em); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .anim-hn-house { animation: none; } }

/* ── Nachrichten / Postfach ──────────────────────────────────────────────── */
.msg-card.is-unread { border-left: 3px solid var(--accent); background: rgba(245 166 35 / 0.06); }
/* Empfänger-Auswahl als Chips (Dropdown statt vieler Checkboxen, Block C8) */
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.cp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: var(--r-full); padding: 3px 6px 3px 11px; font-size: var(--font-size-sm); font-weight: 600; }
.cp-chip--all { background: rgba(245 166 35 / 0.18); color: var(--accent); }
.cp-chip button { background: none; border: none; color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.cp-chip button:hover { color: var(--danger); }

/* ── Chat (E3): Konversationsliste + Verlauf ─────────────────────────────── */
.msg-conv { align-items: center; gap: var(--gap-sm); border: 1px solid var(--border); cursor: pointer; }
.msg-conv.is-unread { border-left: 3px solid var(--accent); background: rgba(245 166 35 / 0.06); }
.msg-conv-title { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-conv-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-unread-badge { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent); color: #08101f; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
/* Chat-Verlauf als hohes Modal mit interner Scroll-Fläche */
.chat-modal { display: flex; flex-direction: column; gap: var(--gap-sm); width: min(560px, 100%); height: min(80dvh, 720px); padding: var(--gap-md); }
.chat-head { flex: 0 0 auto; align-items: flex-start; }
.chat-head h3 { font-size: var(--font-size-lg); }
/* Empfängerzeile im Entwurf (neuer Chat): fester Block oben, Rest scrollt. */
.chat-recipients { flex: 0 0 auto; border-bottom: 1px solid var(--border); padding-bottom: var(--gap-sm); }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.chat-bubble { max-width: 82%; display: flex; flex-direction: column; gap: 2px; padding: 7px 11px; border-radius: 14px; font-size: var(--font-size-sm); line-height: 1.35; word-break: break-word; }
.chat-theirs { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 4px; }
.chat-mine { align-self: flex-end; background: var(--accent); color: #08101f; border-bottom-right-radius: 4px; }
.chat-sender { font-size: var(--font-size-xs); font-weight: 800; color: var(--accent); }
.chat-text { white-space: pre-wrap; }
.chat-time { font-size: 10px; opacity: 0.7; align-self: flex-end; }
.chat-mine .chat-time { color: rgba(8 16 31 / 0.7); }
.chat-compose { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1 1 auto; resize: none; max-height: 96px; min-width: 0; }
.chat-compose .btn--icon { flex: 0 0 auto; }
/* E4: anklickbare Duell-Namen → Profil */
.h2h-link { background: none; border: none; padding: 0; font: inherit; font-weight: 800; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.h2h-link:active { opacity: 0.7; }

/* ── Statistik: Spielzeit pro Variante (Block A) ─────────────────────────── */
.pt-list { display: flex; flex-direction: column; gap: 4px; }
/* C6: Zeiten dürfen NICHT umbrechen; bei Platzmangel schrumpft der Variantenname (Ellipse). */
.pt-row { display: flex; justify-content: space-between; gap: var(--gap-sm); align-items: baseline; font-size: var(--font-size-sm); flex-wrap: nowrap; overflow: hidden; }
.pt-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.pt-vals { color: var(--text-2); font-size: var(--font-size-xs); text-align: right; white-space: nowrap; flex: 0 0 auto; }
.pt-total { border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 2px; }
.pt-total .pt-name { color: var(--accent); }

/* ── Wiederverwendbare GROSSE Sieger-Feier (Block E) ─────────────────────── */
/* Gemeinsame Komponente für Hausnummern, Sarg, Glückszahl: zentrales, großes Profil-Gesicht. */
.anim-bigwin { gap: 0.4em; }
.bigwin-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35em; animation: hn-win-pop 0.55s var(--ease-spring) both; }
.bigwin-crown { font-size: clamp(34px, 12vw, 76px); line-height: 1; margin-bottom: -0.15em; animation: trophy-rise 0.8s var(--ease-spring); }
.bigwin-face {
  width: min(46vw, 230px, 38vh); height: min(46vw, 230px, 38vh); border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  border: 5px solid var(--pc, var(--accent)); background: var(--surface-3);
  box-shadow: 0 0 0 6px rgba(255 255 255 / 0.12), 0 10px 40px rgba(0 0 0 / 0.55);
  display: flex; align-items: center; justify-content: center; line-height: 1; color: #fff; font-weight: 900; overflow: hidden;
}
.bigwin-face--initials { background: var(--pc, var(--accent)); color: #08101f; font-size: clamp(48px, 22vw, 120px); }
.bigwin-number { display: flex; gap: 0.12em; margin-top: 0.15em; }
/* S5: Sieger-Feier auf niedrigen (Handy-Querformat-)Höhen kompakter → Icon/Krone/Name werden NICHT mehr oben abgeschnitten. */
@media (max-height: 430px) {
  .bigwin-crown { font-size: min(10vw, 8vh, 44px); margin-bottom: -0.08em; }
  .bigwin-face { width: min(42vw, 30vh); height: min(42vw, 30vh); }
  .bigwin-face--initials { font-size: min(20vw, 15vh); }
  .anim-win-label { font-size: min(9vw, 7vh, 44px); -webkit-text-stroke: 1px #000; }
  .anim-sub { font-size: var(--font-size-sm); }
  .anim-bigwin { gap: 0.08em; }
}

/* Team-Sieg (Tannenbaum): Teamname + alle Mitglieder-Gesichter groß nebeneinander */
.teamwin-name { font-weight: 900; font-size: clamp(22px, 7vw, 42px); color: var(--pc, var(--accent)); -webkit-text-stroke: 1px rgba(0 0 0 / 0.4); }
.teamwin-faces { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 92vw; }
.teamwin-face {
  width: min(22vw, 96px); height: min(22vw, 96px); border-radius: 50%; overflow: hidden;
  border: 4px solid var(--pc, var(--accent)); background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  font-weight: 900; color: #08101f; font-size: clamp(20px, 8vw, 40px); animation: pop-in 0.5s var(--ease-spring) both;
}
.teamwin-face img { width: 100%; height: 100%; object-fit: cover; }
.teamwin-face span { background: var(--pc); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .bigwin-stage, .bigwin-crown, .teamwin-face { animation: none; } }

/* ══ Sarg: gezeichnete Särge (Galgenmännchen-Stil) ════════════════════════ */
.coffins-scene {
  position: relative; width: 100%; aspect-ratio: 1.4;
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2), var(--surface) 75%);
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; container-type: inline-size;
  display: flex; flex-direction: column; gap: 1.5cqw; padding: 2.5cqw;
}
.coffins-scene.is-fitted { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: auto; }
#game-main .coffins-scene.is-fitted { top: 0; transform: translateX(-50%); }
.coffin-grid-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.coffin-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), calc(var(--cw, 18) * 1cqw)); gap: 3cqw; justify-content: center; align-content: center; }
.coffin {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.4cqw;
  width: calc(var(--cw, 18) * 1cqw); font-size: calc(var(--cw, 18) * 0.22cqw);
}
/* Icon liegt OBEN (eigenes Flex-Kind), darunter nur noch der gezeichnete Sarg (B1/B2). */
.coffin-art { position: relative; width: 100%; aspect-ratio: 0.83; }
.cf-svg { width: 100%; height: 100%; display: block; }
.cf-stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cf-bold { stroke: var(--pc, var(--accent)); stroke-width: 6; opacity: 1; }
.coffin-face {
  position: relative; width: 54%; aspect-ratio: 1; border-radius: 50%; padding: 0;
  border: 0.55cqw solid transparent; background: var(--surface-3); cursor: pointer; overflow: visible;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); z-index: 2;
}
.coffin-face img, .coffin-face > span { width: 100%; height: 100%; border-radius: 50%; }
.coffin-face img { object-fit: cover; object-position: 50% 22%; }
.coffin-face > span { display: flex; align-items: center; justify-content: center; background: var(--pc); color: #08101f; font-weight: 800; font-size: 1.4em; overflow: hidden; }
.coffin-counter { font-size: 1.05em; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1; }
.coffin-name { font-size: 0.82em; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.coffin.is-current { z-index: 3; }
.coffin.is-current .coffin-face { border-color: var(--accent); box-shadow: 0 0 0 0.5cqw var(--accent), 0 0 1.6cqw rgba(245 166 35 / 0.7); animation: coffin-bob 1.4s ease-in-out infinite; }
.coffin.is-current .coffin-counter { color: var(--accent); }
.coffin.is-winner .coffin-face { border-color: var(--success); box-shadow: 0 0 0 0.5cqw var(--success); }
/* S3: Sarg-eigene, kräftigere Hebe-Bewegung des aktiven Spielers (Hausnummern/Glückszahl nutzen weiter hn-bob). */
@keyframes coffin-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.34em); } }
/* S1: zuletzt geworfene Zahl (zu schlagen) — groß am Sarg des Werfers, in ALLEN Modi sichtbar (auch Vollbild/Stream). */
/* mittig über dem gezeichneten Sarg (unter dem Gesicht) → Gesicht + Name bleiben frei, trotzdem groß & lesbar. */
.coffin-beat {
  position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); z-index: 6;
  min-width: 1.5em; height: 1.5em; padding: 0 0.18em;
  display: flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; font-size: 1.5em; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; border-radius: 999px; border: 0.12em solid var(--surface-2);
  box-shadow: 0 0.14em 0.5em rgba(0 0 0 / 0.7);
}
.coffin.is-dead .coffin-face { filter: grayscale(0.7) brightness(0.65); }
.coffin.is-dead .cf-bold { stroke: var(--text-3); opacity: 0.85; }
/* Toten-Reihe (klein, gleich groß, unten) */
.coffin-dead-row { display: flex; flex-wrap: wrap; gap: 2cqw; justify-content: center; align-items: flex-start; padding-top: 1.4cqw; border-top: 1px dashed var(--border); }
.coffin--dead { width: 11cqw; max-width: 11cqw; font-size: 2.1cqw; gap: 0.2cqw; }
.coffin-face--mini { width: 62%; border-width: 0.4cqw; }
@media (prefers-reduced-motion: reduce) { .coffin.is-current .coffin-face { animation: none; } }
/* H2: kompakter Sarg-Modus bei vielen Spielern auf SCHMALEM Container (Handy-Hochformat).
   Container-Query auf der Szene selbst: ist sie schmal (fließendes Handy-Hochformat) UND dicht
   besetzt (.cf-dense, ab 10 Lebenden), blenden wir den Namen aus und betonen Icon + Zähler
   → trotz vieler Särge lesbar. Im Voll-/Beamer-Modus ist die Szene breit → Namen bleiben. */
@container (max-width: 520px) {
  .coffins-scene.cf-dense .coffin-name { display: none; }
  .coffins-scene.cf-dense .coffin-face { width: 66%; }
  /* Zählergröße von der (kleinen) Sarggröße entkoppeln → bleibt auf dem Handy lesbar. */
  .coffins-scene.cf-dense .coffin-counter { font-size: 3.4cqw; color: var(--text); }
  .coffins-scene.cf-dense .coffin-grid { gap: 2cqw; }
}
/* Sarg-Eingabe: die zu übertreffende Zahl sehr präsent */
.sarg-beat { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: var(--gap-sm); border-radius: var(--r-md); background: linear-gradient(135deg, var(--surface-2), rgba(231 76 60 / 0.12)); border: 1px solid rgba(231 76 60 / 0.35); }
.sarg-beat-label { font-size: var(--font-size-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.sarg-beat-val { font-size: 44px; font-weight: 900; color: var(--danger); line-height: 1; }
.sarg-beat-pred { font-size: var(--font-size-sm); color: var(--text-2); text-align: center; }
.sarg-beat--first { background: var(--surface-2); border-color: var(--border); }
.ticker-strike { border-left-color: var(--accent); }
.ticker-throw { border-left-color: var(--text-3); color: var(--text-2); }
.ticker-cross { border-left-color: var(--success); }
.ticker-miss { border-left-color: var(--text-3); color: var(--text-2); }

/* ══ Glückszahl: Lotto-/Bingo-Kugel-Liste ════════════════════════════════ */
.ln-scene {
  position: relative; width: 100%; aspect-ratio: 1;
  --ln-ball: min(calc(42cqw / var(--ln-rows, 5)), calc(58cqw / var(--ln-cols, 5)));
  background: radial-gradient(120% 100% at 50% 0%, var(--surface-2), var(--surface) 80%);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: center; gap: 1cqw; padding: 2cqw;
}
.ln-scene.is-fitted { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: auto; }
#game-main .ln-scene.is-fitted { top: 0; transform: translateX(-50%); }
/* B7: mehr (symmetrische) vertikale Polsterung → die Aktiv-Umrandung sitzt oben wie unten gleich
   weit von Icon bzw. Name entfernt (vorher klebte sie oben am Profil-Icon). */
.ln-row { display: flex; align-items: center; gap: 2cqw; min-height: 0; flex: 0 0 auto; padding: 1cqw 1.2cqw; border-radius: var(--r-md); }
.ln-row.is-current { background: rgba(245 166 35 / 0.12); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ln-row.is-winner { background: rgba(46 204 113 / 0.14); box-shadow: inset 0 0 0 1.5px var(--success); }
.ln-id { display: flex; flex-direction: column; align-items: center; gap: 0.15cqw; width: 18cqw; max-width: 18cqw; flex: 0 0 auto; }
.ln-ava {
  width: var(--ln-ball); height: var(--ln-ball); max-width: 14cqw; max-height: 14cqw;
  border-radius: 50%; overflow: hidden; padding: 0; border: 0.4cqw solid var(--pc); background: var(--surface-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ln-ava img { width: 100%; height: 100%; object-fit: cover; }
.ln-ava span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--pc); color: #08101f; font-weight: 800; font-size: calc(var(--ln-ball) * 0.5); }
.ln-name { font-size: calc(var(--ln-ball) * 0.32); font-weight: 700; color: var(--text-2); max-width: 20cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-row.is-current .ln-name { color: var(--accent); }
.ln-balls { display: flex; flex: 1; gap: 1cqw; align-items: center; flex-wrap: nowrap; justify-content: flex-start; min-width: 0; }
/* B6: Ziffer zuerst BLASS, nach dem Treffer KRÄFTIG (statt Durchstreichen) + Kleeblatt-Wasserzeichen.
   Beamer-tauglich (hell = getroffen), thematisch (Glücksklee), kein Platzbedarf → max. Spieler bleibt. */
.ln-ball {
  width: var(--ln-ball); height: var(--ln-ball); flex-shrink: 0; position: relative;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #eef1f7, #c0c6d4 78%);
  box-shadow: inset -0.07em -0.09em 0.16em rgba(0 0 0 / 0.22), 0 0.06em 0.16em rgba(0 0 0 / 0.28);
  opacity: 0.4; filter: saturate(0.45); transition: opacity 0.3s, filter 0.3s, background 0.3s, box-shadow 0.3s;
}
.ln-digit { position: relative; z-index: 2; font-weight: 900; font-size: calc(var(--ln-ball) * 0.5); color: #2a2f3a; font-variant-numeric: tabular-nums; line-height: 1; }
.ln-clover { position: absolute; inset: 14%; z-index: 1; color: #2ea043; opacity: 0; transform: scale(0.4) rotate(-12deg); transition: opacity 0.35s var(--ease-spring), transform 0.35s var(--ease-spring); pointer-events: none; }
.ln-ball.is-crossed {
  opacity: 1; filter: none;
  background: radial-gradient(circle at 35% 28%, #ffffff, #dff3e4 80%);
  box-shadow: inset 0 0 0 0.1em #2ea043, 0 0.08em 0.2em rgba(0 0 0 / 0.32);
}
.ln-ball.is-crossed .ln-digit { color: #14532d; }
.ln-ball.is-crossed .ln-clover { opacity: 0.5; transform: scale(1) rotate(0); }
.ln-ball.ln-just { animation: ln-pop 0.5s var(--ease-spring); }
@keyframes ln-pop { 0% { transform: scale(1.5); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ln-ball.ln-just { animation: none; } .ln-clover { transition: none; } }
/* Glückszahl-Eingabe: eigene Nummer als kleine Kugeln (feste Größe außerhalb der Szene) */
.gz-mynum { display: flex; flex-direction: column; gap: 4px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--gap-sm); }
.gz-mynum-balls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ln-ball.gz-mini { width: 2.1em; height: 2.1em; }
.ln-ball.gz-mini .ln-digit { font-size: var(--font-size-md); }

/* ══ Tannenbaum: Mannschafts-Bäume ════════════════════════════════════════ */
.tb-scene {
  position: relative; width: 100%; aspect-ratio: 1.45;
  background: radial-gradient(120% 100% at 50% 100%, var(--surface-2), var(--surface) 82%);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  container-type: inline-size; display: flex; flex-direction: row; gap: 2cqw; padding: 2cqw;
}
.tb-scene.is-fitted { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: auto; }
#game-main .tb-scene.is-fitted { top: 0; transform: translateX(-50%); }
.tb-rail { display: flex; flex-direction: column; gap: 2cqw; justify-content: center; align-items: center; flex: 0 0 auto; max-width: 27cqw; min-width: 0; }
.tb-rail:empty { display: none; }
.tb-focus-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.tb-tree { display: flex; flex-direction: column; align-items: center; gap: 0.4cqw; }
/* B9: Fokus-Baum wächst beim Mannschaftswechsel kurz herein (kleiner → groß). */
@keyframes tb-grow-in { 0% { transform: scale(0.62); opacity: 0.35; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
.tb-focus-wrap .tb-tree.tb-anim-focus { animation: tb-grow-in 0.45s var(--ease-spring); transform-origin: center bottom; }
@media (prefers-reduced-motion: reduce) { .tb-focus-wrap .tb-tree.tb-anim-focus { animation: none; } }
.tb-crown { position: relative; display: flex; align-items: center; justify-content: center; padding: 9% 11% 5%; }
.tb-silhouette { position: absolute; inset: -4% 0 0 0; width: 100%; height: 108%; }
.tb-silhouette polygon { fill: color-mix(in srgb, var(--tc, #2ecc71) 26%, transparent); stroke: var(--tc, #2ecc71); stroke-width: 1.1; stroke-linejoin: round; }
.tb-star { position: absolute; top: -2%; left: 50%; transform: translateX(-50%); line-height: 1; z-index: 2; }
.tb-numbers { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.tb-row { display: flex; justify-content: center; }
.tb-cell {
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e7ecf5 78%); color: #14331f; font-weight: 800;
  box-shadow: inset -0.04em -0.05em 0.1em rgba(0 0 0 / 0.25), 0 0.05em 0.12em rgba(0 0 0 / 0.3);
  font-variant-numeric: tabular-nums;
}
.tb-cell.is-gone { background: transparent; box-shadow: none; border: 1px dashed color-mix(in srgb, var(--tc, #2ecc71) 50%, transparent); color: transparent; }
.tb-trunk { background: linear-gradient(180deg, #8a5a2b, #6b4420); border-radius: 0 0 0.2em 0.2em; display: flex; align-items: center; justify-content: center; max-width: 90%; }
.tb-trunk-name { color: #ffeccd; font-weight: 800; padding: 0 0.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tb-remaining { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tb-tree.is-current .tb-crown { filter: drop-shadow(0 0 1.4cqw color-mix(in srgb, var(--tc) 60%, transparent)); }
.tb-tree.is-current .tb-trunk { box-shadow: 0 0 0 0.3cqw var(--accent); }
.tb-tree.is-winner .tb-trunk { box-shadow: 0 0 0 0.3cqw var(--success); }
/* Fokus (groß) vs. Mini-Bäume (klein, oben in der Reihe) */
.tb-tree.is-focus .tb-cell { width: 5.6cqw; height: 5.6cqw; font-size: 3.1cqw; margin: 0.4cqw; }
.tb-tree.is-focus .tb-star { font-size: 5.2cqw; }
.tb-tree.is-focus .tb-trunk { height: 4cqw; }
.tb-tree.is-focus .tb-trunk-name { font-size: 2.2cqw; }
.tb-tree.is-focus .tb-remaining { font-size: 2cqw; }
.tb-tree.is-mini { max-width: 26cqw; }
.tb-tree.is-mini .tb-cell { width: 1.6cqw; height: 1.6cqw; font-size: 0.95cqw; margin: 0.1cqw; }
.tb-tree.is-mini .tb-crown { padding: 5% 8% 3%; }
.tb-tree.is-mini .tb-star { display: none; }
.tb-tree.is-mini .tb-trunk { height: 1.7cqw; }
.tb-tree.is-mini .tb-trunk-name { font-size: 1.1cqw; }
.tb-tree.is-mini .tb-remaining { font-size: 1.2cqw; }
/* Kugel rollt heran, Ziffer „zerbricht" */
.tb-cell.tb-break { animation: tb-shatter 0.55s ease-out forwards; }
@keyframes tb-shatter { 0% { transform: scale(1); } 35% { transform: scale(1.35) rotate(8deg); background: #ffd27a; } 100% { transform: scale(0) rotate(40deg); opacity: 0; } }
.tb-ball { position: absolute; left: -120%; top: 50%; transform: translateY(-50%); font-size: 1.2em; animation: tb-roll 0.4s ease-in forwards; }
@keyframes tb-roll { from { left: -160%; transform: translateY(-50%) rotate(0); } to { left: 10%; transform: translateY(-50%) rotate(360deg); } }
.tb-result-faces { display: flex; gap: 3px; }
@media (prefers-reduced-motion: reduce) { .tb-cell.tb-break, .tb-ball { animation: none; } }
/* Tannenbaum: Mannschafts-Zuordnung im Wizard (Drag & Drop, touch- & maustauglich) */
.tb-team-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.tb-dnd-section { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--gap-sm); display: flex; flex-direction: column; gap: 8px; transition: box-shadow var(--dur-fast), background var(--dur-fast); }
.tb-dnd-section.tb-over { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(245 166 35 / 0.07); }
.tb-dnd-list { display: flex; flex-direction: column; gap: 6px; min-height: 34px; }
.tb-dnd-card { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 10px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.tb-dnd-card:active { cursor: grabbing; }
.tb-dnd-card.tb-dragging { opacity: 0.35; }
.tb-grip { color: var(--text-3); font-size: 18px; letter-spacing: -3px; flex-shrink: 0; }
.tb-empty { padding: 4px 2px; }
.tb-drag-clone { position: fixed; z-index: 2000; transform: translate(-50%, -50%); pointer-events: none; box-shadow: var(--shadow-lg); opacity: 0.96; }
.tb-hint-on .tb-dnd-card { animation: tb-wiggle 0.55s ease-in-out 2; }
@keyframes tb-wiggle { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .tb-hint-on .tb-dnd-card { animation: none; } }

/* ══════════════════════════════════════════════════════════════════════
   Kegelmeister (Liga-Ansicht) — Tabelle (A) + aktuelles Match (B).
   Responsive über container-type:inline-size + cqw (KEIN Uniform-Zoom-Fit).
   .km-cq = Query-Container (Host-Breite). Ab 640px zwei Spalten, sonst gestapelt.
   Beide Panes sind eigene cqw-Container → Inhalt skaliert zur Pane-Breite.
   ══════════════════════════════════════════════════════════════════════ */
.km-cq { container-type: inline-size; width: 100%; height: 100%; min-height: 0; }
.km-scene { display: flex; flex-direction: column; gap: 10px; width: 100%; height: 100%; min-height: 0; overflow: hidden; }

/* Gestapelt (Handy/Hochformat): Match oben, Tabelle/Bracket darunter scrollbar. */
.km-match { container-type: inline-size; flex: 0 0 auto; min-width: 0; }
.km-table-wrap, .km-bracket-wrap { container-type: inline-size; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; }

/* Zwei Spalten (Querformat/Laptop/Beamer): Tabelle/Bracket links, Match rechts. */
@container (min-width: 640px) {
  .km-scene { flex-direction: row; align-items: stretch; gap: 16px; }
  .km-table-wrap, .km-bracket-wrap { order: 0; flex: 0 0 42%; max-height: 100%; }
  .km-match { order: 1; flex: 1 1 58%; min-height: 0; align-self: stretch; }
}

/* ── (B) Match-Panel ─────────────────────────────────────────────────── */
.km-match { display: flex; flex-direction: column; align-items: center; gap: 2cqw; padding: 2cqw 1cqw; }
.km-match--done { justify-content: center; }
.km-phase { font-weight: 800; color: var(--text-2); font-size: clamp(12px, 4.2cqw, 26px); letter-spacing: .02em; }
.km-phase-sub { font-weight: 700; color: var(--text-3); font-size: 0.72em; }
.km-arena { display: flex; align-items: center; justify-content: center; gap: 3cqw; width: 100%; margin: auto 0; }

.km-fighter { display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; min-width: 0; flex: 0 1 auto; }
.km-head { width: clamp(48px, min(26cqw, 22vh), 168px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 0.6cqw solid var(--pc, var(--border)); background: var(--surface-2); display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: var(--shadow-sm); }
.km-head img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.km-head span { font-size: clamp(18px, 11cqw, 76px); font-weight: 800; color: var(--text-2); }
.km-fname { font-weight: 800; font-size: clamp(12px, 4.6cqw, 30px); max-width: 30cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }

.km-score { display: flex; align-items: baseline; gap: 1.2cqw; font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.km-sc { font-size: clamp(26px, min(15cqw, 18vh), 120px); line-height: 1; color: var(--text); }
.km-colon { font-size: clamp(18px, 9cqw, 70px); color: var(--text-3); transform: translateY(-0.1em); }

/* Striche-Wurfzähler (grau → schwarz/akzent bei erfolgtem Wurf). */
.km-strikes { display: flex; gap: 0.8cqw; height: 2.6cqw; min-height: 8px; align-items: center; }
.km-strike { width: 0.9cqw; min-width: 3px; height: 100%; border-radius: 2px; background: var(--border); transition: background .2s; }
.km-strike.is-done { background: var(--accent); }

/* Form-Trend (letzte 3): grüner Punkt = Sieg, rotes ✕ = Niederlage, grauer Punkt = Remis, mit Trennstrich. */
.km-form { display: flex; gap: 1cqw; min-height: 2.4cqw; align-items: center; }
.km-formline { display: inline-flex; align-items: center; }
.km-fd { width: 2.4cqw; min-width: 9px; aspect-ratio: 1; border-radius: 50%; flex: 0 0 auto; }
.km-fd--w { background: #2fb344; }
.km-fd--d { background: var(--text-3); }
.km-fx { color: #e5484d; font-weight: 800; line-height: 1; font-size: clamp(11px, 3.3cqw, 21px); display: inline-flex; align-items: center; }
.km-form-sep { color: var(--text-3); opacity: .5; margin: 0 0.36em; font-size: clamp(9px, 2.6cqw, 16px); }
.km-form-empty { color: var(--text-3); font-size: clamp(10px, 3cqw, 18px); }

/* Aktiver Werfer: leuchtet + hüpft. */
.km-fighter.is-current .km-head { border-color: var(--accent); box-shadow: 0 0 0 0.5cqw rgba(245 166 35 / 0.35), var(--shadow-md); }
.km-fighter.is-current { animation: km-bob 1s ease-in-out infinite; }
@keyframes km-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.6cqw); } }
.km-fighter.is-winner .km-head { border-color: #2fb344; }

.km-beat { margin-top: 1cqw; font-size: clamp(12px, 3.6cqw, 22px); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.6cqw 2cqw; }
.km-beat b { color: var(--accent); }
/* Nächste Paarung: lesbarer Chip unten-rechts (Label klein/dim oben, Namen groß in Primärfarbe) — sekundär, aber gut lesbar. */
.km-next { align-self: flex-end; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; max-width: 82cqw; text-align: right;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: clamp(3px, 0.8cqw, 7px) clamp(6px, 1.7cqw, 13px); }
.km-next-lbl { color: var(--text-3); font-size: clamp(8px, 2cqw, 12px); text-transform: uppercase; letter-spacing: .04em; line-height: 1.1; }
.km-next-pair { font-size: clamp(12px, 3.2cqw, 21px); font-weight: 700; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.km-next-pair b { color: var(--text); }
.km-next-vs { color: var(--text-3); font-weight: 400; margin: 0 0.25em; }

/* Champion-Karte (Saisonende im Match-Panel). */
.km-champ { display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; }
.km-champ-cup { font-size: clamp(34px, 18cqw, 130px); line-height: 1; }
.km-head--champ { width: clamp(56px, min(30cqw, 26vh), 190px); border-color: var(--accent); }
.km-champ-name { font-weight: 800; font-size: clamp(18px, 7cqw, 48px); }
.km-champ-sub { font-weight: 700; color: var(--accent); font-size: clamp(12px, 4cqw, 26px); letter-spacing: .04em; text-transform: uppercase; }
.km-champ--result { padding: 8px 0 2px; }

/* ── (A) Liga-Tabelle ────────────────────────────────────────────────── */
.km-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.km-table th, .km-table td { padding: clamp(3px, 1.2cqw, 9px) clamp(2px, 1cqw, 8px); font-size: clamp(11px, 3cqw, 20px); }
.km-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--text-3); font-weight: 700; text-align: center; border-bottom: 2px solid var(--border); }
.km-table th.km-c-rank, .km-table th.km-c-name { text-align: left; }
.km-num { text-align: center; white-space: nowrap; }
.km-c-rank { width: 1px; color: var(--text-3); font-weight: 700; padding-right: clamp(4px, 1.4cqw, 10px) !important; }
.km-c-name { text-align: left; }
/* Spieler-Spalte nimmt den REST-Platz (Zahlenspalten bleiben inhaltsschmal) → Avatar + Name haben Luft,
   die Icons kleben nicht mehr an der Siege-Spalte. (Tabellen-Trick: eine Zelle width:99%, Rest = Inhalt.) */
.km-c-name { width: 99%; }
.km-c-pts { font-weight: 800; color: var(--text); }
.km-row td { border-bottom: 1px solid var(--border); }
.km-row .km-c-name { display: flex; align-items: center; gap: clamp(4px, 1.4cqw, 9px); min-width: 0; }
/* Avatar: width UND height explizit + min-width als harter Boden → Foto-Avatar (img) und Initialen-Avatar
   (span) sind IMMER exakt gleich groß und können in der Flex-Namenszelle (max-width:0) nicht auf 0 kollabieren. */
.km-av { width: clamp(18px, 5cqw, 34px); height: clamp(18px, 5cqw, 34px); min-width: clamp(18px, 5cqw, 34px); border-radius: 50%; object-fit: cover; object-position: 50% 22%; flex: 0 0 auto; }
.km-av--init { display: grid; place-items: center; color: #08101f; font-weight: 800; font-size: clamp(9px, 2.4cqw, 15px); }
.km-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Playoff-Plätze: nur Schattierung (klarer getönt, KEINE Trennlinie mehr). */
.km-row.is-cut td { background: rgba(245 166 35 / 0.18); }
/* Aktuell spielende Paarung: Profil-Icon nach rechts gerückt + hüpfend (wie der aktive Werfer), dezente Tönung. */
.km-row.is-playing td { background: rgba(245 166 35 / 0.12); }
.km-row.is-playing .km-nm { font-weight: 800; }
.km-row.is-playing .km-av { margin-left: clamp(4px, 1.6cqw, 11px); animation: km-av-bob 0.95s ease-in-out infinite; }
@keyframes km-av-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .km-row.is-playing .km-av { animation: none; } }
.km-row.is-champion td { background: rgba(245 166 35 / 0.16); font-weight: 800; }
.km-cut-note { padding: 6px 4px 2px; font-size: clamp(9px, 2.4cqw, 14px); color: var(--text-3); }

/* ── End-/Ergebnisansicht: Champion-Kopf + GESAMTE Tabelle als No-Scroll-Bild (zweispaltig) ── */
.km-result { container-type: inline-size; }
.km-result-head { display: flex; align-items: center; gap: clamp(6px, 2cqw, 18px); flex-wrap: wrap; padding: 2px 2px 4px; }
.km-result-cup { font-size: clamp(24px, 7cqw, 60px); line-height: 1; }
.km-head--rhead { width: clamp(34px, 9cqw, 68px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); background: var(--surface-2); display: grid; place-items: center; flex: 0 0 auto; }
.km-head--rhead img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.km-head--rhead span { font-weight: 800; color: var(--text-2); font-size: clamp(14px, 4cqw, 28px); }
.km-result-name { font-weight: 800; font-size: clamp(16px, 5cqw, 34px); }
.km-result-sub { font-weight: 700; color: var(--accent); font-size: clamp(11px, 3cqw, 19px); letter-spacing: .04em; text-transform: uppercase; }
.km-result-tables { display: flex; flex-wrap: wrap; gap: clamp(8px, 2cqw, 20px); align-items: flex-start; }
.km-result-col { container-type: inline-size; flex: 1 1 300px; min-width: 0; }
.km-table--compact th, .km-table--compact td { padding: clamp(2px, 0.8cqw, 7px) clamp(3px, 1.1cqw, 8px); font-size: clamp(11px, 3cqw, 21px); line-height: 1.16; }
.km-table--compact .km-av { width: clamp(15px, 4cqw, 26px); height: clamp(15px, 4cqw, 26px); min-width: clamp(15px, 4cqw, 26px); }

/* LIVE-Badge (nur Live-Tabelle, nicht Endansicht) — signalisiert die laufend aktualisierte Tabelle. */
.km-tablecap { display: flex; justify-content: flex-end; padding: 0 2px 2px; }
.km-live { display: inline-flex; align-items: center; gap: 5px; font-size: clamp(9px, 2.4cqw, 13px); font-weight: 800; color: #e5484d; letter-spacing: .1em; }
.km-live-dot { width: clamp(6px, 1.6cqw, 9px); aspect-ratio: 1; border-radius: 50%; background: #e5484d; animation: km-live-pulse 1.4s ease-in-out infinite; }
@keyframes km-live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.55); } }
@media (prefers-reduced-motion: reduce) { .km-live-dot { animation: none; } }
.km-endcap { font-size: clamp(9px, 2.4cqw, 13px); font-weight: 800; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; }

/* ── (A') Playoff-Bracket (KM3): Spalten je Runde, innerhalb des Panes scrollbar ── */
.km-bracket-cap { font-weight: 800; color: var(--accent); font-size: clamp(12px, 3.4cqw, 20px); padding: 2px 2px 8px; letter-spacing: .02em; }
.km-bracket { display: flex; gap: clamp(8px, 2.4cqw, 22px); align-items: center; min-width: min-content; padding-bottom: 4px; }
.km-bk-col { display: flex; flex-direction: column; gap: clamp(8px, 2.2cqw, 18px); flex: 0 0 auto; justify-content: center; }
.km-bk-title { font-size: clamp(9px, 2.4cqw, 14px); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; text-align: center; white-space: nowrap; }
.km-bk-match { position: relative; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: clamp(3px, 1cqw, 7px); display: flex; flex-direction: column; gap: 3px; min-width: clamp(98px, 26cqw, 200px); }
.km-bk-match.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245 166 35 / 0.3); }
.km-bk-match.is-done { opacity: 0.92; }
.km-bk-side { display: flex; align-items: center; gap: clamp(3px, 1cqw, 7px); min-width: 0; }
.km-bk-side.is-pending { opacity: 0.5; }
.km-bk-side.is-win .km-bk-nm { font-weight: 800; color: var(--text); }
.km-bk-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11px, 3cqw, 18px); color: var(--text-2); }
.km-bk-sc { flex: 0 0 auto; font-weight: 800; font-variant-numeric: tabular-nums; font-size: clamp(11px, 3cqw, 18px); color: var(--text); }
.km-av--ph { display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); font-weight: 800; }
.km-bk-sd { position: absolute; top: -7px; right: -6px; background: #e5484d; color: #fff; font-size: clamp(8px, 2cqw, 11px); font-weight: 800; border-radius: 999px; padding: 1px 5px; letter-spacing: .04em; }

/* Phase im Playoff (Akzent) + Sudden-Death-Tag im Match-Panel. */
.km-phase--po { color: var(--accent); }
.km-sd-tag { display: inline-block; background: #e5484d; color: #fff; font-size: 0.66em; font-weight: 800; border-radius: 999px; padding: 1px 8px; vertical-align: middle; letter-spacing: .04em; }

/* Podium (Endansicht bei Playoffs): Champion · Vize · Platz 3. */
.km-podium { display: flex; flex-wrap: wrap; gap: clamp(6px, 2cqw, 16px); padding: 0 2px 2px; }
.km-podium-item { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: clamp(12px, 3.2cqw, 20px); color: var(--text-2); }
.km-podium-medal { font-size: 1.15em; }

/* ── (B') Münzwurf-Hinweis im Match-Panel (KM4): ausstehender Tiebreak, Beamer-taugliche Vorab-Erklärung ── */
.km-match--coin { justify-content: center; gap: 2.5cqw; text-align: center; }
.km-coin-cap { font-weight: 900; color: var(--accent); font-size: clamp(16px, 5.2cqw, 34px); letter-spacing: .01em; }
.km-coin-icon { display: inline-block; animation: km-coin-wobble 2.2s ease-in-out infinite; }
@keyframes km-coin-wobble { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
.km-coin-group { display: flex; flex-direction: column; align-items: center; gap: 1.2cqw; }
.km-coin-line { font-size: clamp(11px, 3cqw, 18px); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.km-coin-heads { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2.6cqw, 22px); flex-wrap: wrap; }
.km-coin-head { display: flex; flex-direction: column; align-items: center; gap: 0.6cqw; }
.km-head--coin { width: clamp(44px, min(20cqw, 16vh), 120px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 0.6cqw solid var(--pc, var(--accent)); background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.km-coin-nm { font-weight: 800; font-size: clamp(12px, 3.6cqw, 22px); max-width: 26cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km-coin-vs { font-size: clamp(16px, 4.6cqw, 30px); color: var(--text-3); font-weight: 800; }
.km-coin-explain { font-size: clamp(11px, 3cqw, 18px); color: var(--text-2); max-width: 92%; margin: 0 auto; line-height: 1.3; }

/* ── Münzwurf-Animation (Overlay, ~10 s): Spotlight wandert zwischen den Köpfen, landet beim Sieger ── */
.anim-coinflip { background: radial-gradient(circle, rgba(245 166 35 / 0.22), rgba(10 10 20 / 0.55) 70%); gap: 0.5em; }
.coin-spin { font-size: clamp(48px, 16vw, 110px); animation: coin-spin3d 1.1s linear infinite; }
@keyframes coin-spin3d { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.coin-explain {
  font-size: clamp(15px, 3.6vw, 26px); font-weight: 800; color: #fff; text-align: center; max-width: 88%;
  text-shadow: 0 1px 3px #000; background: rgba(8 10 20 / 0.62); padding: 7px 16px; border-radius: var(--r-full);
}
.coin-heads { display: flex; align-items: flex-start; justify-content: center; gap: clamp(14px, 6vw, 54px); flex-wrap: wrap; max-width: 94vw; }
.coin-head { display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0.42; transition: opacity .12s, transform .12s; }
.coin-head.is-lit { opacity: 1; transform: scale(1.12); }
.coin-head-face {
  width: clamp(72px, 22vw, 168px); height: clamp(72px, 22vw, 168px); border-radius: 50%; overflow: hidden;
  border: 4px solid var(--pc, var(--accent)); background: var(--surface-2); display: grid; place-items: center;
  box-shadow: 0 0 0 0 rgba(245 166 35 / 0); transition: box-shadow .15s;
}
.coin-head-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.coin-head-init { font-size: clamp(30px, 10vw, 76px); font-weight: 800; color: var(--pc, var(--accent)); }
.coin-head.is-lit .coin-head-face { box-shadow: 0 0 0 6px rgba(245 166 35 / 0.45), 0 0 28px 6px rgba(245 166 35 / 0.5); }
.coin-head.is-winner .coin-head-face { box-shadow: 0 0 0 7px rgba(46 213 115 / 0.6), 0 0 36px 10px rgba(46 213 115 / 0.55); border-color: #2ed573; }
.coin-head.is-winner { animation: coin-win-pop 0.6s var(--ease-spring); }
@keyframes coin-win-pop { 0% { transform: scale(1.12); } 55% { transform: scale(1.32); } 100% { transform: scale(1.2); } }
.coin-head-nm { font-weight: 800; font-size: clamp(13px, 3.4vw, 24px); color: #fff; text-shadow: 0 1px 3px #000; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-result {
  min-height: 1.2em; font-size: clamp(20px, 6vw, 44px); font-weight: 900; color: #2ed573;
  -webkit-text-stroke: 1.5px #04220f; text-stroke: 1.5px #04220f; display: flex; align-items: center; gap: .2em;
}
.anim-coinflip.is-decided .coin-result { animation: pop-bam 0.6s var(--ease-spring); }
.coin-crown { font-size: 0.9em; }
@media (prefers-reduced-motion: reduce) {
  .km-coin-icon, .coin-spin, .coin-head.is-winner { animation: none; }
  .coin-head { transition: none; }
}

/* ── Kegelmeister-Feieranimationen (KM4 Teil 2) ───────────────────────────────────────────── */
/* Meister-Kür: Pokal reckt sich hoch, Champion-Gesicht groß, „KEGELMEISTER" + Name. Nutzt die .bigwin-*
   Bausteine (großes Gesicht + Krone) wie die anderen Sieger-Feiern; eigener Pokal + Titel obendrauf. */
.anim-kmcup { background: radial-gradient(circle, rgba(245 166 35 / 0.3), rgba(10 10 20 / 0.55) 72%); gap: 0.25em; }
.kmcup-trophy { font-size: clamp(46px, 15vw, 104px); line-height: 1; animation: kmcup-rise 0.9s var(--ease-spring) both; }
@keyframes kmcup-rise { 0% { transform: translateY(40px) scale(0.4) rotate(-12deg); opacity: 0; } 60% { transform: translateY(-8px) scale(1.22) rotate(8deg); opacity: 1; } 100% { transform: translateY(0) scale(1) rotate(0); } }
.kmcup-title {
  font-size: clamp(15px, 4.6vw, 34px); font-weight: 900; letter-spacing: .18em; color: var(--accent);
  -webkit-text-stroke: 1px #1a1205; text-stroke: 1px #1a1205; text-transform: uppercase; margin-top: 0.1em;
  animation: pop-bam 0.7s var(--ease-spring) both;
}
.kmcup-name { font-size: clamp(26px, 8vw, 60px); color: #fff; -webkit-text-stroke: 2px #000; }

/* Match-Intro: zwei Köpfe fahren von links/rechts ein, „VS" pop. Liga schnell; .is-dramatic = größer + Label. */
.anim-kmintro { background: rgba(10 10 20 / 0.5); gap: 0.5em; }
.kmintro-label {
  font-size: clamp(16px, 5vw, 40px); font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); -webkit-text-stroke: 1px #1a1205; text-stroke: 1px #1a1205; animation: pop-bam 0.5s var(--ease-spring) both;
}
.kmintro-arena { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 40px); max-width: 96vw; }
.kmintro-fig { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kmintro-a { animation: kmintro-in-l 0.5s var(--ease-spring) both; }
.kmintro-b { animation: kmintro-in-r 0.5s var(--ease-spring) both; }
@keyframes kmintro-in-l { 0% { transform: translateX(-70vw); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes kmintro-in-r { 0% { transform: translateX(70vw); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.kmintro-face {
  width: clamp(62px, 18vw, 130px); height: clamp(62px, 18vw, 130px); border-radius: 50%; overflow: hidden;
  border: 4px solid var(--pc, var(--accent)); background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow-md);
}
.kmintro-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.kmfig-init { font-size: clamp(26px, 8vw, 60px); font-weight: 800; color: var(--pc, var(--accent)); }
.kmintro-nm { font-weight: 800; font-size: clamp(13px, 3.6vw, 24px); color: #fff; text-shadow: 0 1px 3px #000; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kmintro-vs {
  font-size: clamp(22px, 7vw, 52px); font-weight: 900; color: #fff; -webkit-text-stroke: 2px var(--danger);
  text-stroke: 2px var(--danger); animation: pop-bam 0.6s 0.18s var(--ease-spring) both;
}
.anim-kmintro.is-dramatic { background: radial-gradient(circle, rgba(231 76 60 / 0.28), rgba(10 10 20 / 0.6) 70%); }
.anim-kmintro.is-dramatic .kmintro-face { width: clamp(78px, 24vw, 168px); height: clamp(78px, 24vw, 168px); border-width: 5px; }
.anim-kmintro.is-dramatic .kmintro-vs { font-size: clamp(30px, 10vw, 72px); }

/* Match-Sieg: Sieger-Kopf + Trophäe — kurze Feier vor dem nächsten Match-Intro. */
.anim-kmmatchwin { background: rgba(10 10 20 / 0.50); gap: 0.45em; }
.kmwin-trophy { font-size: clamp(40px, 13vw, 86px); animation: kmwin-pop 0.45s var(--ease-spring) both; }
.kmwin-fig { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: kmwin-pop 0.45s var(--ease-spring) 0.15s both; }
.kmwin-face {
  width: clamp(70px, 20vw, 138px); height: clamp(70px, 20vw, 138px); border-radius: 50%; overflow: hidden;
  border: 4px solid var(--pc, var(--accent)); background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.kmwin-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.kmwin-nm { font-weight: 800; font-size: clamp(15px, 4.2vw, 28px); color: #fff; text-shadow: 0 1px 3px #000; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes kmwin-pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Remis-Handschlag: zwei Köpfe + 🤝, „Unentschieden"-Banner. */
.anim-kmdraw { background: rgba(10 10 20 / 0.45); gap: 0.5em; }
.kmdraw-arena { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2vw, 18px); }
.kmdraw-fig { animation: kmdraw-nudge 0.7s var(--ease-spring) both; }
.kmdraw-fig:last-of-type { animation-name: kmdraw-nudge-r; }
@keyframes kmdraw-nudge { 0% { transform: translateX(-28px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes kmdraw-nudge-r { 0% { transform: translateX(28px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.kmdraw-face {
  width: clamp(54px, 15vw, 110px); height: clamp(54px, 15vw, 110px); border-radius: 50%; overflow: hidden;
  border: 4px solid var(--pc, var(--accent)); background: var(--surface-2); display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.kmdraw-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.kmdraw-hands { font-size: clamp(34px, 11vw, 76px); animation: kmdraw-shake 0.9s ease-in-out 0.3s; z-index: 1; }
@keyframes kmdraw-shake { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-10deg) scale(1.12); } 75% { transform: rotate(10deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .kmcup-trophy, .kmcup-title, .kmintro-a, .kmintro-b, .kmintro-vs, .kmintro-label, .kmdraw-fig, .kmdraw-fig:last-of-type, .kmdraw-hands, .kmwin-trophy, .kmwin-fig { animation: none; }
}

/* ── Tutorial / Demo-Onboarding ───────────────────────────────────────── */

/* Overlay — auf Phones: Vollbild; auf ≥480px: zentriertes Modal */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: fade-in var(--dur-fast) var(--ease-out);
}
@media (min-width: 480px) {
  .tutorial-overlay {
    background: rgba(0 0 0 / 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: var(--gap-md);
  }
}

.tutorial-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
@media (min-width: 480px) {
  .tutorial-modal {
    max-width: 520px;
    height: auto;
    max-height: 93dvh;
    background: var(--bg);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
}

.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-sm) var(--gap-md);
  padding-top: max(var(--gap-sm), env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tutorial-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap-md);
  min-height: 0;
}

.tutorial-footer {
  flex-shrink: 0;
  padding: var(--gap-sm) var(--gap-md);
  padding-bottom: calc(var(--gap-sm) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  align-items: center;
}

.tut-dots { display: flex; gap: 7px; align-items: center; }
.tut-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--surface-3); border: none; cursor: pointer; padding: 0;
  transition: background var(--dur-fast), transform var(--dur-fast);
  flex-shrink: 0;
}
.tut-dot--on { background: var(--accent); transform: scale(1.35); }

.tut-nav {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
/* Feste Mindestbreite verhindert Layout-Sprung zwischen "← Zurück", "Weiter →", "Fertig 🎉". */
.tut-nav-btn { min-width: 7rem; }

/* ── Folie — gemeinsam ── */
.tut-slide { display: flex; flex-direction: column; gap: var(--gap-md); }
.tut-slide-head { text-align: center; }
.tut-slide-head h2 { margin-bottom: 4px; }

/* ── Folie 1: Willkommen ── */
.tut-welcome { align-items: center; text-align: center; padding-top: var(--gap-sm); }
.tut-logo {
  width: 68px; height: 85px;
  filter: drop-shadow(0 4px 14px rgba(245 166 35 / 0.45));
}
.tut-title { font-size: var(--font-size-2xl); letter-spacing: -1px; }
.tut-features { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 7px; }
.tut-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--r-md);
  font-size: var(--font-size-sm); text-align: left;
}
.tut-feat-icon { font-size: 20px; flex-shrink: 0; }

/* ── Folie 2: Handy + Beamer — container-query-skalierte Mockups ── */
.tut-split-arena {
  display: flex; align-items: center; justify-content: center; gap: var(--gap-sm);
  container-type: inline-size;
}
.tut-device { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tut-device-label { font-size: var(--font-size-xs); color: var(--text-2); font-weight: 600; }

.tut-phone-frame {
  width: min(35cqw, 155px); height: min(56cqw, 248px);
  background: var(--surface-2); border: 2px solid var(--surface-3);
  border-radius: min(5cqw, 22px);
  padding: min(2.5cqw, 11px) min(2cqw, 9px);
  display: flex; flex-direction: column; gap: min(1.8cqw, 8px); overflow: hidden;
}
.tut-beamer-frame {
  width: min(42cqw, 186px); height: min(27cqw, 120px);
  background: var(--surface-2); border: 2px solid var(--surface-3);
  border-radius: min(2cqw, 9px);
  padding: min(1.8cqw, 8px);
  display: flex; flex-direction: column; gap: min(1.2cqw, 5px); overflow: hidden;
}
.tut-mock-title {
  font-size: min(2.6cqw, 11.5px); font-weight: 700; color: var(--accent);
  white-space: nowrap; overflow: hidden;
}
.tut-pin-grid { display: flex; flex-wrap: wrap; gap: min(1cqw, 4px); }
.tut-pin {
  width: min(7.5cqw, 33px); height: min(7.5cqw, 33px);
  display: grid; place-items: center;
  border: 1px solid var(--surface-3); border-radius: min(1.4cqw, 6px);
  font-size: min(3cqw, 13px); font-weight: 600; color: var(--text);
  background: var(--bg); flex-shrink: 0;
}
.tut-pin--on { background: var(--accent); border-color: var(--accent); color: #1a1a2e; }
.tut-mock-player {
  font-size: min(2.2cqw, 9.5px); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tut-standings-mini { display: flex; flex-direction: column; gap: min(0.9cqw, 4px); }
.tut-row-live {
  display: flex; align-items: center; gap: min(0.8cqw, 4px);
  font-size: min(2.5cqw, 11px);
}
.tut-row-live--lead .tut-pts-sm { color: var(--accent); font-weight: 700; }
.tut-rank-sm { font-size: min(2cqw, 9px); color: var(--text-2); font-weight: 700; width: min(2.5cqw, 11px); text-align: center; }
.tut-pname-sm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tut-pts-sm { font-weight: 600; flex-shrink: 0; }
.tut-split-arrow { flex-shrink: 0; }

/* ── Folie 3: Teams ── */
.tut-team-mock { display: flex; flex-direction: column; }
.tut-team-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--gap-sm); flex-wrap: wrap;
}
.tut-avatar-row { display: flex; }
.tut-avatar-row .tut-face { margin-left: -10px; border: 2px solid var(--surface); }
.tut-avatar-row .tut-face:first-child { margin-left: 0; }
.tut-code-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--gap-sm); padding-top: var(--gap-sm); border-top: 1px solid var(--border);
}
.tut-code-badge {
  font-size: var(--font-size-sm); background: var(--surface-2);
  padding: 4px 10px; border-radius: var(--r-sm); letter-spacing: 0.06em;
}
.tut-or-row { display: flex; align-items: center; gap: var(--gap-sm); }
.tut-divider { flex: 1; border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── Folie 4: Spielauswahl ── */
.tut-game-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-sm);
}
.tut-game-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; background: var(--surface-2); border-radius: var(--r-md);
  text-align: center; border: 1.5px solid transparent;
}
.tut-game-icon { width: 30px; height: 30px; color: var(--accent); }
.tut-game-name { font-size: var(--font-size-xs); font-weight: 700; line-height: 1.2; }
.tut-game-range { font-size: 10px; color: var(--text-2); }

/* ── Folie 5: Statistiken ── */
.tut-stats-mock { display: flex; flex-direction: column; gap: 0; }
.tut-stats-banner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--font-size-xs); font-weight: 600;
  padding-bottom: var(--gap-sm); border-bottom: 1px solid var(--border); margin-bottom: var(--gap-sm);
}
.tut-stats-head {
  display: grid; grid-template-columns: 22px 24px 1fr 38px 38px;
  gap: 4px; align-items: center;
  font-size: var(--font-size-xs); color: var(--text-2); font-weight: 600;
  padding-bottom: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.tut-stats-row {
  display: grid; grid-template-columns: 22px 24px 1fr 38px 38px;
  gap: 4px; align-items: center;
  font-size: var(--font-size-sm); padding: 3px 0;
}
.tut-stats-row--lead {
  background: rgba(245 166 35 / 0.07); border-radius: var(--r-sm); padding: 4px;
}
.tut-rank { font-size: var(--font-size-xs); color: var(--text-2); font-weight: 700; text-align: center; }
.tut-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tut-pts { font-weight: 700; text-align: right; }
.tut-stats-row--lead .tut-pts { color: var(--accent); }
.tut-avg { font-size: var(--font-size-xs); color: var(--text-2); text-align: right; }

/* ── Folie 6: TvT ── */
.tut-tvt-slide .tut-slide-head { text-align: center; }
.tut-tvt-arena {
  display: flex; align-items: center; justify-content: center; gap: var(--gap-sm);
}
.tut-tvt-team { flex: 1; text-align: center; padding: var(--gap-sm); }
.tut-tvt-lbl { font-size: var(--font-size-xs); color: var(--text-2); margin-bottom: 4px; }
.tut-tvt-score {
  font-size: var(--font-size-2xl); font-weight: 800;
  color: var(--accent); letter-spacing: -1px; line-height: 1.1;
}
.tut-tvt-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.tut-tvt-signal { font-size: 22px; }

/* ── Face-Avatar ── */
.tut-face {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: center;
}

/* Tutorial-Button in der Home-View (oben rechts im Header) */
.tut-header-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--font-size-xs); font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: var(--r-full); cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.tut-header-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Landing-Page (Willkommen-Seite für Gäste) ───────────────────────── */

.landing-page {
  display: flex; flex-direction: column; min-height: 100dvh;
}

.landing-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--gap-sm) var(--gap-md);
  background: var(--bar-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.landing-logo-row { display: flex; align-items: center; gap: var(--gap-sm); }
.landing-logo-name { font-size: var(--font-size-lg); font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }

/* Hero */
.landing-hero {
  text-align: center; padding: var(--gap-xl) var(--gap-md);
  display: flex; flex-direction: column; align-items: center; gap: var(--gap-md);
}
.landing-hero-logo {
  width: 72px; height: 90px;
  filter: drop-shadow(0 6px 20px rgba(245 166 35 / 0.45));
}
.landing-hero-title {
  font-size: clamp(var(--font-size-xl), 6vw, var(--font-size-2xl));
  font-weight: 800; letter-spacing: -1px; line-height: 1.2;
}
.landing-hero-sub {
  font-size: var(--font-size-md); color: var(--text-2);
  max-width: 40ch; line-height: 1.5;
}
.landing-hero-ctas { display: flex; gap: var(--gap-sm); flex-wrap: wrap; justify-content: center; }

/* Value Props */
.landing-props { padding: var(--gap-xl) var(--gap-md); background: var(--surface); }
.landing-prop-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--gap-md);
  max-width: 640px; margin: 0 auto;
}
@media (min-width: 480px) { .landing-prop-grid { grid-template-columns: 1fr 1fr; } }
.landing-prop {
  display: flex; align-items: flex-start; gap: var(--gap-md);
  padding: var(--gap-md); background: var(--surface-2); border-radius: var(--r-md);
}
.landing-prop-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.landing-prop-title { font-size: var(--font-size-md); font-weight: 700; margin-bottom: 4px; }
.landing-prop-sub { font-size: var(--font-size-sm); color: var(--text-2); line-height: 1.4; }

/* Spiele — horizontale Schaufenster-Leiste (wirkt wie eine offene Auswahl, nicht erschöpfend) */
.landing-games { padding: var(--gap-xl) 0; text-align: center; }
.landing-section-title { font-size: var(--font-size-xl); font-weight: 800; margin-bottom: var(--gap-sm); padding: 0 var(--gap-md); }
.landing-section-sub { font-size: var(--font-size-sm); color: var(--text-2); margin-bottom: var(--gap-lg); padding: 0 var(--gap-md); }
/* Wrapper mit weichem Auslauf rechts → suggeriert „es geht weiter". */
.landing-game-rail-wrap { position: relative; }
.landing-game-rail-wrap::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, transparent, var(--bg));
  pointer-events: none;
}
.landing-game-rail {
  display: flex; gap: var(--gap-sm); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px var(--gap-md) var(--gap-sm); -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.landing-game-rail::-webkit-scrollbar { display: none; }
.landing-game-card {
  flex: 0 0 auto; width: 116px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; background: var(--surface-2);
  border-radius: var(--r-md); text-align: center; border: 1px solid var(--border);
}
.landing-game-icon { width: 34px; height: 34px; color: var(--accent); }
.landing-game-name { font-size: var(--font-size-sm); font-weight: 700; line-height: 1.2; }
.landing-game-range { font-size: 11px; color: var(--text-2); }
.landing-game-card--more {
  background: transparent; border: 1px dashed var(--border); color: var(--accent); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.landing-game-card--more:hover { border-color: var(--accent); background: rgba(245 166 35 / 0.06); }
.landing-game-card--more .landing-game-range { color: var(--text-3); }
/* Auf großen Screens zentriert die Leiste statt links zu kleben. */
@media (min-width: 640px) { .landing-game-rail { justify-content: center; } }

/* Handy + Beamer */
.landing-split {
  padding: var(--gap-xl) var(--gap-md); background: var(--surface);
  display: flex; flex-direction: column; gap: var(--gap-xl); align-items: center;
}
@media (min-width: 640px) {
  .landing-split { flex-direction: row; justify-content: center; }
}
.landing-split-text { max-width: 320px; }
.landing-split-text h2 { font-size: var(--font-size-xl); font-weight: 800; margin-bottom: var(--gap-sm); }
.landing-split-list {
  margin-top: var(--gap-md); padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.landing-split-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--font-size-sm); color: var(--text-2);
}
.landing-split-list li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.landing-split-mockup { display: flex; align-items: center; gap: var(--gap-sm); flex-shrink: 0; }
.landing-device { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.landing-device-label { font-size: var(--font-size-xs); color: var(--text-2); font-weight: 600; }
.landing-phone-inner {
  width: 130px; height: 210px; background: var(--surface-2);
  border: 2px solid var(--surface-3); border-radius: 18px;
  padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.landing-beamer-inner {
  width: 175px; height: 112px; background: var(--surface-2);
  border: 2px solid var(--surface-3); border-radius: 8px;
  padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.landing-mock-badge { font-size: 11px; font-weight: 700; color: var(--accent); }
.landing-mock-pins { display: flex; flex-wrap: wrap; gap: 4px; }
.landing-pin {
  width: 31px; height: 31px; display: grid; place-items: center;
  border: 1px solid var(--surface-3); border-radius: 6px;
  font-size: 12px; font-weight: 600; background: var(--bg);
}
.landing-pin--on { background: var(--accent); border-color: var(--accent); color: #1a1a2e; }
.landing-mock-player { font-size: 9px; color: var(--text-2); }
.landing-mock-rows { display: flex; flex-direction: column; gap: 5px; }
.landing-mock-row {
  display: flex; gap: 6px; font-size: 11px; align-items: center;
}
.landing-mock-row span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-mock-pts { font-weight: 700; }
.landing-mock-row--lead .landing-mock-pts { color: var(--accent); }
.landing-split-arrow { flex-shrink: 0; }

/* CTA-Abschnitt */
.landing-cta-section {
  padding: var(--gap-xl) var(--gap-md); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--gap-md);
}
.landing-cta-title { font-size: var(--font-size-xl); font-weight: 800; letter-spacing: -0.5px; }
.landing-cta-sub { font-size: var(--font-size-sm); color: var(--text-2); max-width: 40ch; }

/* Footer */
.landing-footer {
  padding: var(--gap-md); text-align: center;
  border-top: 1px solid var(--border); margin-top: auto;
}
