/* ============================================================
   TTCount – Premium 3D UI
   Display: "Anton"  ·  UI: "Outfit"
   ============================================================ */
:root {
  --bg-0: #070a12;
  --bg-1: #0d1322;
  --ink: #eef2fb;
  --muted: #93a0bb;
  --line: rgba(255, 255, 255, 0.10);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.085);

  --p1: #3b82f6;   --p1-2: #60a5fa;   --p1-glow: rgba(59, 130, 246, 0.55);
  --p2: #fb3b4e;   --p2-2: #ff7a6b;   --p2-glow: rgba(251, 59, 78, 0.5);
  --gold: #ffd76e; --gold-2: #f5a524;
  --mint: #36e6b0;

  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ===== App-Feel: Web-Gesten aus (Text markieren, Callout-Lupe, Bild-Drag, Doppeltipp-Zoom) =====
   Macht die WebView-Oberfläche ununterscheidbar von nativ. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;         /* kein Doppeltipp-Zoom, kein 300ms-Tap-Delay */
}
img, svg, a, button { -webkit-user-drag: none; }
/* Eingabefelder & bewusst markierbarer Text bleiben nutzbar */
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Grundverlauf aufs html, damit der animierte .tt-bg (z-index:-1) durchscheint. */
html {
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(1100px 700px at 100% 0%, rgba(251, 59, 78, 0.18), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(54, 230, 176, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
}
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
body { min-height: 100vh; min-height: 100dvh; background: transparent; }
a { color: var(--mint); }

/* ---------------- Animierter Tischtennis-Hintergrund ---------------- */
.tt-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.tt-table { position: absolute; left: 50%; top: 47%; width: min(92vw, 920px); height: min(44vh, 380px);
  transform: translate(-50%, -50%) perspective(950px) rotateX(57deg); border-radius: 16px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.38), rgba(28, 78, 165, 0.16));
  border: 2px solid rgba(255, 255, 255, 0.3); box-shadow: 0 70px 140px rgba(0, 0, 0, 0.55), inset 0 0 90px rgba(59, 130, 246, 0.25); opacity: 0.96; }
.tt-net { position: absolute; left: 50%; top: -16%; height: 132%; width: 3px; transform: translateX(-50%); background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.75), transparent); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.tt-line { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(255, 255, 255, 0.3); }
.tt-ball { position: absolute; width: 18px; height: 18px; left: 14%; top: 60%; margin: -9px 0 0 -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #ffd76e 55%, #f5a524); box-shadow: 0 0 18px rgba(255, 210, 110, 0.95), 0 0 48px rgba(245, 165, 36, 0.6);
  transform-origin: 50% 85%;
  animation: ttRallyX 3s linear infinite, ttRallyY 1.5s linear infinite, ttHit 1.5s linear infinite; }
.tt-shadow { position: absolute; width: 28px; height: 9px; left: 14%; top: 63%; margin: -4px 0 0 -14px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); filter: blur(4px);
  animation: ttRallyX 3s linear infinite, ttShadowRally 1.5s linear infinite; }
/* Seitenansicht: konstante Horizontalgeschwindigkeit, Richtungswechsel = Rueckschlag am Rand */
@keyframes ttRallyX {
  0%   { left: 14%; }   /* Aufprall/Rueckschlag links */
  50%  { left: 86%; }   /* Aufprall/Rueckschlag rechts */
  100% { left: 14%; }
}
/* Parabel wie ein echter Ballwechsel von der Seite:
   Aufprall -> steil hoch, ueber das Netz (Mitte) -> Aufprall auf der anderen Seite. Schwerkraft = ease-out hoch / ease-in runter */
@keyframes ttRallyY {
  0%   { top: 60%; animation-timing-function: ease-out; }   /* verlaesst den Aufprall schnell nach oben */
  50%  { top: 22%; animation-timing-function: ease-in; }    /* Scheitel hoch ueber dem Netz, dann Schwerkraft */
  100% { top: 60%; }                                        /* Aufprall auf der anderen Seite */
}
/* Stauchung + kurzer Blitz im Moment des Aufpralls (an den sichtbaren Seiten) */
@keyframes ttHit {
  0%, 100% { transform: scale(1.36, 0.6); filter: brightness(1.7); }  /* Aufprall: platt gedrueckt + Blitz */
  8%       { transform: scale(0.86, 1.2); filter: brightness(1); }    /* Absprung: nach oben gestreckt */
  22%, 82% { transform: scale(1, 1); filter: brightness(1); }
  95%      { transform: scale(1.12, 0.88); filter: brightness(1); }   /* kurz vor dem Aufprall leicht gestaucht */
}
/* Schatten: gross & dunkel beim Aufprall, winzig & blass am Scheitel */
@keyframes ttShadowRally {
  0%, 100% { opacity: 0.62; transform: scaleX(1.22); }
  50%      { opacity: 0.08; transform: scaleX(0.3); }
}

/* ---------------- In-App-Animationen ---------------- */
@keyframes popIn { 0% { transform: scale(0.85); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
.pop-in { animation: popIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.slide-up { animation: slideUp 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.25s ease both; }
@media (prefers-reduced-motion: reduce) { .tt-ball, .tt-shadow, .pop-in, .slide-up, .fade-in { animation: none !important; } }

h1, h2, h3 { margin: 0 0 12px; font-weight: 800; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.display { font-family: "Anton", "Outfit", sans-serif; font-weight: 400; letter-spacing: 0.01em; }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------------- Glass panel ---------------- */
.panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ---------------- 3D Buttons ---------------- */
.btn {
  position: relative; appearance: none; border: 1px solid var(--line); cursor: pointer;
  font-family: "Outfit", sans-serif; font-weight: 800; letter-spacing: 0.01em; font-size: 16px;
  color: var(--ink); border-radius: 16px; padding: 14px 22px;
  background: linear-gradient(180deg, #2a3245, #161c2b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 5px 12px rgba(0, 0, 0, 0.45); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.lg { padding: 18px 28px; font-size: 18px; border-radius: 18px; }
.btn.ghost { background: rgba(255, 255, 255, 0.04); }
.btn.primary {
  color: #2a1c00; border-color: transparent;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 30px rgba(245, 165, 36, 0.4);
}
.btn.p1 { background: linear-gradient(180deg, var(--p1-2), var(--p1)); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 30px var(--p1-glow); }
.btn.p2 { background: linear-gradient(180deg, var(--p2-2), var(--p2)); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 30px var(--p2-glow); }

input, select {
  font: inherit; font-weight: 700; color: var(--ink);
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; width: 100%;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}
input:focus, select:focus { outline: none; border-color: var(--mint); }
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }

.seg { display: inline-flex; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: inset 0 2px 8px rgba(0,0,0,.35); }
.seg button { appearance: none; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 800; padding: 12px 18px; cursor: pointer; transition: color .1s; }
.seg button.on { color: #2a1c00; background: linear-gradient(180deg, var(--gold), var(--gold-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }

.pill { font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); color: var(--muted); letter-spacing: .02em; }
.pill.live { background: rgba(54, 230, 176, 0.16); color: var(--mint); border-color: transparent; }

/* Einheitlicher Zurück-/Nav-Button (auf allen Seiten gleich, ordentliche Größe) */
.nav-back { padding: 10px 16px; font-size: 15px; border-radius: 12px; font-weight: 800; white-space: nowrap; flex-shrink: 0; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ===================== LANDING ===================== */
.landing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; min-height: 100dvh; text-align: center; padding: 24px; }
.brandmark { font-family: "Anton", sans-serif; font-size: clamp(54px, 12vw, 104px); line-height: 0.9; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff, #9fb4e6); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 14px 40px rgba(59, 130, 246, 0.3); }
.tagline { color: var(--muted); font-size: 18px; margin-top: -6px; }
/* ---- Logo-Lockup (Emblem + Wortmarke) ---- */
.brand-lockup { display: inline-flex; align-items: center; justify-content: center; gap: 0.4em; line-height: 1; }
.brand-emblem { width: 1.18em; height: 1.18em; flex: none; filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.5)); transform: translateY(-0.04em); }
.dash-head .brand-lockup { gap: 0.28em; }
.dash-head .brand-emblem { width: 1.5em; height: 1.5em; animation: emblemFloat 4.5s ease-in-out infinite; }
@keyframes emblemFloat { 0%, 100% { transform: translateY(-0.04em) rotate(0deg); } 50% { transform: translateY(-0.16em) rotate(-3deg); } }
.o-ball { background: radial-gradient(circle at 35% 30%, #ffffff, #ffd76e 52%, #f5a524 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(245, 165, 36, 0.5); }
/* ---- SmashScore-Logo (schwebend) ---- */
.brand-logo { display: block; width: clamp(260px, 58vw, 440px); height: auto; margin: 0 auto 2px;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(245, 80, 50, 0.28));
  animation: logoFloat 5s ease-in-out infinite; transform-origin: 50% 60%; will-change: transform;
  transition: transform 0.28s ease, filter 0.28s ease; }
.brand-logo:hover { animation-play-state: paused; transform: translateY(-10px) scale(1.045) rotate(-1.2deg);
  filter: drop-shadow(0 28px 46px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 40px rgba(245, 80, 50, 0.45)); }
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-15px) rotate(1.2deg); }
}
@media (prefers-reduced-motion: reduce) { .brand-logo { animation: none; } }
/* Entwickler-Testmodus-Button (links oben) */
.dev-fab { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 14px; z-index: 50;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  font-family: "Outfit", sans-serif; font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
  color: #cfe0ff; text-decoration: none; background: rgba(20, 30, 54, 0.72); border: 1px solid rgba(120, 150, 220, 0.3);
  backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.12s, background 0.12s; opacity: 0.78; }
.dev-fab:hover { transform: translateY(-2px); background: rgba(30, 44, 78, 0.9); opacity: 1; }
.dev-fab:active { transform: translateY(0) scale(0.97); }
.choices { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.choice { display: block; text-decoration: none; color: var(--ink); width: 260px; padding: 30px; border-radius: 24px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.choice:hover { transform: translateY(-6px); }
.choice .big { font-size: 48px; }
.choice .t { font-family: "Anton", sans-serif; font-size: 30px; margin-top: 10px; letter-spacing: 0.02em; }
.choice .d { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* ===================== DASHBOARD ===================== */
.dash { max-width: 920px; margin: 0 auto; padding: 7vh 22px calc(5vh + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.dash-actions { display: flex; flex-direction: column; gap: 16px; }
.dash-head { text-align: center; }
.dash-head .brandmark { font-size: clamp(52px, 12vw, 96px); }
.dash-head .tagline { margin-top: 6px; }
.dash-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) {
  .dash {
    height: 100dvh; min-height: 100dvh; overflow: hidden;
    padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 14px);
    gap: 12px;
  }
  .dash-actions { gap: 12px; }
  .dash-primary { grid-template-columns: 1fr; gap: 12px; }
  .brand-logo { width: clamp(170px, 44vw, 280px); margin-bottom: 0; }
  .tagline { font-size: 15px; margin-top: 2px; }
  .dash-card { padding: 16px 20px; gap: 4px; border-radius: 18px; }
  .dash-card .dash-ic { font-size: 32px; }
  .dash-card .dash-t { font-size: 22px; }
  .dash-card .dash-d { font-size: 12.5px; line-height: 1.35; }
  .dash-card .dash-go { margin-top: 2px; }
  .dash-secondary { gap: 10px; }
  .dash-mini { padding: 11px 18px; }
}
.dash-card { display: flex; flex-direction: column; gap: 8px; padding: 26px; text-decoration: none; color: var(--ink); border-radius: 24px; position: relative; transition: transform 0.14s ease, box-shadow 0.14s ease; border-top: 3px solid transparent; }
.dash-card:hover { transform: translateY(-4px); }
.dash-card:active { transform: translateY(-1px) scale(0.99); }
.dash-card.host { border-top-color: var(--p1-2); }
.dash-card.join { border-top-color: var(--mint); }
.dash-card .dash-ic { font-size: 44px; }
.dash-card .dash-t { font-size: 30px; }
.dash-card .dash-d { color: var(--muted); font-size: 14px; line-height: 1.5; }
.dash-card .dash-go { margin-top: 8px; font-weight: 800; color: var(--mint); }
.dash-card.host .dash-go { color: var(--p1-2); }
.dash-secondary { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.dash-mini { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 14px 22px; border-radius: 16px; font-weight: 800; transition: transform 0.12s; }
.dash-mini:hover { transform: translateY(-2px); }
.dash-mini .mi { font-size: 20px; }
.dash-foot { text-align: center; font-size: 13px; max-width: 540px; margin: 0 auto; line-height: 1.6; }

/* ===================== LOCKER ROOM ===================== */
.locker { max-width: 1100px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 22px calc(40px + env(safe-area-inset-bottom)); min-height: 100dvh; }
.locker.hidden { display: none; }
.locker-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.locker-titles { line-height: 1.2; }
.locker-title { font-size: 30px; letter-spacing: 0.02em; }
.locker-sub { font-size: 13px; }
@media (max-width: 640px) {
  .locker-head { gap: 10px; margin-bottom: 16px; }
  .locker-title { font-size: 24px; }
  .locker-sub { font-size: 12px; }
  .locker-head #refreshBtn { flex-shrink: 0; padding: 10px 15px; font-size: 18px; }
}
.locker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.locker-card { position: relative; border-radius: 20px; overflow: hidden; min-height: 268px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1b2230, #11161f); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease; }
.locker-card:hover { transform: translateY(-4px); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5); }
.locker-vent { height: 8px; margin: 10px 16px 0; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 10px, transparent 10px 16px); opacity: 0.5; }
.locker-body { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; padding: 4px 8px 0;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c, #3b82f6) 28%, transparent), transparent 65%); }
.locker-body img { width: 100%; max-width: 170px; height: auto; object-fit: contain; object-position: bottom; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.5)); }
.locker-plate { text-align: center; font-size: 20px; letter-spacing: 0.03em; padding: 10px 8px; background: rgba(0, 0, 0, 0.3); border-top: 1px solid var(--line); }
.kebab { position: absolute; top: 10px; right: 8px; z-index: 3; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.38); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; transition: transform 0.08s; }
.kebab:hover { background: rgba(0, 0, 0, 0.55); }
.kebab:active { transform: scale(0.9); }
.locker-badge { position: absolute; top: 12px; right: 10px; z-index: 3; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); padding: 4px 8px; border-radius: 999px; }
.locker-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(7, 10, 18, 0.72); backdrop-filter: blur(3px); color: var(--muted); font-size: 12px; font-weight: 700; }
.locker-loading .spinner { width: 40px; height: 40px; border-width: 5px; margin: 0; }
.locker-add { align-items: center; justify-content: center; gap: 14px; cursor: pointer; border-style: dashed; border-color: rgba(255, 255, 255, 0.18); background: linear-gradient(180deg, rgba(54, 230, 176, 0.08), rgba(54, 230, 176, 0.02)); color: var(--ink); font: inherit; }
.locker-add:hover { border-color: var(--mint); }
.add-ring { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; color: #04231a; background: linear-gradient(180deg, var(--mint), #15b98a); box-shadow: 0 10px 26px rgba(54, 230, 176, 0.4); }
.add-t { font-size: 18px; text-align: center; letter-spacing: 0.02em; }
.card-menu { position: fixed; z-index: 60; min-width: 190px; background: var(--glass-2); border: 1px solid var(--line); border-radius: 14px; padding: 6px; backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.card-menu.hidden { display: none; }
.card-menu button { appearance: none; border: none; background: transparent; color: var(--ink); font: inherit; font-weight: 700; text-align: left; padding: 11px 14px; border-radius: 10px; cursor: pointer; }
.card-menu button:hover { background: rgba(255, 255, 255, 0.07); }
.card-menu button.danger { color: #ff9a9a; }

/* ===================== PLAYER (Handy) ===================== */
.pl { min-height: 100dvh; display: flex; flex-direction: column; }
.home-link { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 16px; z-index: 6; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }

/* --- Join / Carousel --- */
.pl-join { padding: calc(30px + env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; min-height: 100dvh; }
.join-brand { font-family: "Anton", sans-serif; font-size: 34px; text-align: center; letter-spacing: 0.03em;
  background: linear-gradient(180deg, #fff, #9fb4e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.join-sub { text-align: center; color: var(--muted); margin: 2px 0 14px; font-size: 14px; }
.code-field { letter-spacing: 10px; font-weight: 800; font-size: 26px; text-align: center; text-transform: uppercase; }

.carousel { position: relative; height: 340px; margin: 14px 0 4px; perspective: 1300px; }
.carousel-glow { position: absolute; left: 50%; top: 46%; width: 320px; height: 320px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--spot, var(--mint)) 0%, transparent 62%); opacity: 0.45; filter: blur(18px); z-index: 0; transition: background 0.4s; }
.reel { position: absolute; inset: 0; transform-style: preserve-3d; z-index: 1; }
.reel-card { position: absolute; top: 8px; left: 50%; width: 232px; height: 308px; margin-left: -116px;
  display: flex; align-items: flex-end; justify-content: center; cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.2, 0.75, 0.2, 1), opacity 0.5s ease, filter 0.5s ease; }
.reel-card img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 26px 26px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.reel-card .ring { position: absolute; bottom: -2px; left: 50%; width: 180px; height: 36px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 70%); z-index: -1; }
.reel-card.center { transform: translateZ(110px); opacity: 1; z-index: 5; }
.reel-card.left  { transform: translateX(-138px) translateZ(-30px) rotateY(40deg) scale(0.82); opacity: 0.42; filter: brightness(0.45); z-index: 3; }
.reel-card.right { transform: translateX(138px) translateZ(-30px) rotateY(-40deg) scale(0.82); opacity: 0.42; filter: brightness(0.45); z-index: 3; }
.reel-card.hide  { transform: scale(0.5); opacity: 0; pointer-events: none; }
.reel-card.taken-c { filter: grayscale(0.85) brightness(0.5); }
.reel-card .taken-tag { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--p2); color: #fff;
  font-weight: 800; font-size: 12px; padding: 4px 12px; border-radius: 999px; letter-spacing: 0.06em; }

.arrow { position: absolute; top: 44%; transform: translateY(-50%); z-index: 8; width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); font-size: 22px;
  background: var(--glass-2); border: 1px solid var(--line); backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15); transition: transform 0.08s; }
.arrow:active { transform: translateY(-50%) scale(0.9); }
.arrow.left { left: 2px; } .arrow.right { right: 2px; }

.spot-name { font-family: "Anton", sans-serif; font-size: 52px; text-align: center; letter-spacing: 0.04em; line-height: 1; margin-top: 2px;
  background: linear-gradient(180deg, #ffffff, var(--spot, #9fb4e6)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 36px var(--spot-glow, rgba(59,130,246,0.45)); transition: text-shadow 0.4s; }
.char-del { display: block; margin: 8px auto 0; background: transparent; border: 1px solid rgba(251, 59, 78, 0.45); color: #ff9a9a; font: inherit; font-weight: 700; font-size: 13px; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.char-del:active { transform: scale(0.96); }
.dots { display: flex; gap: 8px; justify-content: center; margin: 10px 0 2px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); transition: all 0.3s; }
.dots i.on { width: 22px; border-radius: 6px; background: var(--spot, var(--mint)); }
.join-err { text-align: center; color: #ff9a9a; font-weight: 700; min-height: 20px; margin-top: 8px; }

/* --- Charakter erstellen --- */
.create-view { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; width: 100%; }
.create-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.photo-pick { display: inline-flex; align-items: center; justify-content: center; width: 100%; cursor: pointer; margin-top: 6px; }
.mask-wrap { display: flex; justify-content: center; margin: 12px 0; }
.mask-canvas { width: min(78vw, 320px); height: auto; aspect-ratio: 540 / 680; border-radius: 18px; background: #0b0e14; touch-action: none; box-shadow: var(--shadow-lg); }
input[type="range"] { accent-color: var(--mint); }

/* Lade-Ansicht der KI-Umwandlung */
.create-loading { text-align: center; padding: 18px 0; }
.spinner { width: 64px; height: 64px; margin: 14px auto 18px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.12); border-top-color: var(--mint); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.create-status { font-size: 22px; margin-bottom: 6px; }
.create-timer { font-family: "Anton", sans-serif; font-size: 42px; color: var(--mint); letter-spacing: 0.04em; }
.create-result { width: min(72vw, 300px); border-radius: 18px; margin: 4px auto 14px; display: block; box-shadow: var(--shadow-lg); }

/* --- Player live --- */
.pl-live { flex: 1; display: flex; flex-direction: column; }
.pl-head { padding: 16px 20px calc(8px); display: flex; align-items: center; gap: 12px; }
.pl-avatar { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; object-position: top; border: 1px solid var(--line); background: var(--glass); }
.pl-head .you { font-family: "Anton", sans-serif; font-size: 24px; letter-spacing: 0.02em; }
.pl-score { text-align: center; padding: 6px 16px 4px; font-family: "Anton", sans-serif; font-size: 30px; }
.pl-score .me { color: var(--mint); }
.pl-score #setLine { display: block; font-family: "Outfit"; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; }
.tapbtn {
  flex: 1; margin: 14px 18px calc(18px + env(safe-area-inset-bottom)); border: none; border-radius: 30px; color: #fff;
  font-family: "Anton", sans-serif; font-size: 46px; letter-spacing: 0.04em; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.06s ease, filter 0.12s ease; position: relative; overflow: hidden;
}
.tapbtn::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 18%, rgba(255,255,255,0.35), transparent 55%); pointer-events: none; }
.tapbtn:active { transform: scale(0.98); filter: brightness(1.12); }
.tapbtn.p1 { background: linear-gradient(180deg, var(--p1-2), var(--p1)); box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 22px 50px var(--p1-glow); }
.tapbtn.p2 { background: linear-gradient(180deg, var(--p2-2), var(--p2)); box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 22px 50px var(--p2-glow); }
.tapbtn:disabled { opacity: 0.5; }
.tapbtn .sub { font-family: "Outfit"; font-size: 16px; font-weight: 700; opacity: 0.9; letter-spacing: 0.02em; }
.tap-dual { flex: 1; display: flex; flex-direction: column; gap: 12px; margin: 14px 18px calc(18px + env(safe-area-inset-bottom)); }
.tap-dual .tapbtn { margin: 0; flex: 1; font-size: 38px; }
.pl-foot { display: flex; gap: 12px; padding: 0 20px 16px; align-items: center; }

/* ===================== SCOREBOARD ===================== */
.sb { min-height: 100dvh; display: flex; flex-direction: column; }
.sb-top { display: flex; align-items: center; gap: 12px; padding: 16px 24px; }
.sb-title { font-family: "Anton", sans-serif; font-size: 24px; letter-spacing: 0.04em; }

/* Setup */
.setup { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; max-width: 1040px; margin: 0 auto; padding: 6px 24px 24px; width: 100%; }
.setup .card { padding: 22px; }
.setup-grid { display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.setup-left { flex: 0 0 auto; }
.setup-right { flex: 1 1 340px; min-width: 300px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 12px; }
.settings-grid label { margin: 0 0 6px; }
.qrbox { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.qrbox img { width: 180px; height: 180px; border-radius: 16px; background: #fff; padding: 8px; box-shadow: var(--shadow-lg); }
.codebig { font-family: "Anton", sans-serif; font-size: 52px; letter-spacing: 10px; color: var(--gold); text-shadow: 0 10px 30px rgba(245, 165, 36, 0.4); }
.players-wait { display: flex; gap: 14px; margin-top: 0; }
.pwait { flex: 1; display: flex; align-items: center; gap: 14px; background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; }
.pwait.on { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint), 0 10px 30px rgba(54, 230, 176, 0.18); }
.wait-avatar { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; object-position: top; }
.pwait .pname { font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--mint); box-shadow: 0 0 10px var(--mint); }

/* Lokal-Auswahl (Spieler am Gerät wählen) */
.local-title { margin-top: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; }
.local-pick { display: flex; gap: 12px; margin-top: 8px; }
.lp-col { flex: 1; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.lp-head { font-family: "Anton", sans-serif; font-size: 16px; letter-spacing: 0.04em; margin-bottom: 8px; }
.lp-head.p1 { color: var(--p1-2); }
.lp-head.p2 { color: var(--p2-2); }
.lp-chips { display: flex; gap: 6px; }
.chip { flex: 1; appearance: none; cursor: pointer; background: var(--glass); border: 2px solid var(--line); border-radius: 12px;
  padding: 6px 3px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); font: inherit; transition: border-color 0.1s, transform 0.06s; }
.chip:active { transform: scale(0.96); }
.chip img { width: 100%; max-width: 48px; aspect-ratio: 1; object-fit: cover; object-position: top; border-radius: 9px; background: var(--glass); }
.chip span { font-weight: 800; font-size: 12px; }
.chip.on { border-color: var(--mint); box-shadow: 0 0 0 2px var(--mint), 0 8px 22px rgba(54, 230, 176, 0.2); }

/* Live board */
.board { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0; position: relative; }
.side { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; position: relative; padding: 2.4vh 12px 0; overflow: hidden; }
.side::before { content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0.9; }
.side.p1::before { background: radial-gradient(120% 80% at 50% 0%, rgba(59, 130, 246, 0.28), transparent 60%); }
.side.p2::before { background: radial-gradient(120% 80% at 50% 0%, rgba(251, 59, 78, 0.26), transparent 60%); }

/* Porträt: kleiner, Unterkante bündig am Panelboden, nach unten ausgeblendet.
   Steht hinter den oberen Texten und beginnt klar UNTERHALB der Punktzahl. */
.board-portrait { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: auto;
  height: clamp(230px, 46vh, 520px); max-width: 92%; object-fit: contain; object-position: bottom; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.42)); }

.side .name, .side .pts, .side .sets { position: relative; z-index: 3; }
.side .name { font-family: "Anton", sans-serif; font-size: clamp(26px, 3.6vw, 48px); letter-spacing: 0.03em; line-height: 1; }
.side.p1 .name { color: #cfe0ff; } .side.p2 .name { color: #ffd2cf; }
.side .pts { font-family: "Anton", sans-serif; font-size: clamp(104px, 16vw, 240px); line-height: 0.85; letter-spacing: -0.02em; }
.side.p1 .pts { background: linear-gradient(180deg, #d4e4ff, var(--p1)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 14px 46px var(--p1-glow), 0 3px 22px rgba(0,0,0,0.6); }
.side.p2 .pts { background: linear-gradient(180deg, #ffd6d2, var(--p2)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 14px 46px var(--p2-glow), 0 3px 22px rgba(0,0,0,0.6); }
.side .sets { display: flex; gap: 8px; align-items: center; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; font-size: 17px; text-transform: uppercase; }
.side .add { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 4; border: none; cursor: pointer;
  color: #fff; font-family: "Outfit", sans-serif; font-weight: 800; font-size: 18px; padding: 13px 32px; border-radius: 16px;
  transition: transform 0.06s, filter 0.1s; }
.side .add:active { transform: translateX(-50%) scale(0.95); }
.side.p1 .add { background: linear-gradient(180deg, var(--p1-2), var(--p1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 26px var(--p1-glow); }
.side.p2 .add { background: linear-gradient(180deg, var(--p2-2), var(--p2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 26px var(--p2-glow); }
.side.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; animation: flash 0.5s ease; pointer-events: none; z-index: 2; }
@keyframes flash { 0% { opacity: 0.22; } 100% { opacity: 0; } }

.midbar { position: absolute; left: 50%; top: 12%; bottom: 12%; width: 1px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18), transparent); z-index: 2; }
.vs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; font-family: "Anton", sans-serif;
  font-size: 26px; color: var(--muted); background: var(--bg-0); border: 1px solid var(--line); width: 56px; height: 56px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }

.situation { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); z-index: 6; padding: 12px 30px; border-radius: 999px;
  font-family: "Anton", sans-serif; font-size: 28px; letter-spacing: 0.06em; white-space: nowrap; color: #fff; }
.situation.set { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a1c00; box-shadow: 0 12px 40px rgba(245, 165, 36, 0.5); animation: pulseSit 1.2s ease-in-out infinite; }
.situation.match { background: linear-gradient(180deg, var(--p2-2), var(--p2)); box-shadow: 0 12px 50px var(--p2-glow); animation: pulseSit 0.7s ease-in-out infinite; }
@keyframes pulseSit { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.08); } }

.winner-banner { text-align: center; padding: 20px; font-family: "Anton", sans-serif; font-size: clamp(28px, 4vw, 46px); letter-spacing: 0.03em;
  background: linear-gradient(180deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 10px 40px rgba(245, 165, 36, 0.4); }

/* Match-Ende-Screen */
.end-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(900px 600px at 50% 30%, rgba(245, 165, 36, 0.18), transparent 60%), rgba(7, 10, 18, 0.74);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: endIn 0.35s ease; }
@keyframes endIn { from { opacity: 0; } to { opacity: 1; } }
.end-card { text-align: center; padding: 28px 34px; max-width: 480px; width: 100%; }
.end-trophy { font-size: 46px; animation: pulseSit 1.4s ease-in-out infinite; }
.end-avatar { width: clamp(120px, 22vh, 190px); height: clamp(120px, 22vh, 190px); object-fit: contain; object-position: bottom; margin: 2px auto; display: block; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55)); }
.end-title { font-size: clamp(28px, 4vw, 40px); margin-top: 4px; letter-spacing: 0.02em; background: linear-gradient(180deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-score { font-size: clamp(44px, 8vw, 64px); line-height: 1; margin-top: 2px; }
.end-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.end-congrats { font-size: clamp(20px, 3.2vw, 30px); letter-spacing: 0.02em; margin-bottom: 2px;
  background: linear-gradient(90deg, #ffd76e, #fff, #ffd76e); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(245, 165, 36, 0.4); animation: congratsPop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes congratsPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.end-sub { color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 2px; }
.end-count { margin-top: 16px; color: var(--muted); font-size: 13px; }
.end-count span { color: var(--ink); font-weight: 800; }
.end-bar { margin: 8px auto 0; width: min(320px, 80%); height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.end-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.confetti-canvas { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.toast.err { border-color: rgba(239, 68, 68, 0.6); color: #ffd7d7; }

/* ===================== 3D-CHARAKTER-BUILDER ===================== */
.builder-body { overflow: hidden; }
.builder { display: flex; flex-direction: column; height: 100dvh; }
.builder-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px); border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 26, 0.6); backdrop-filter: blur(10px); z-index: 5; }
.builder-title { font-size: 20px; letter-spacing: 0.02em; margin-right: auto; }
.builder-name { background: var(--glass); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; padding: 10px 14px;
  font-family: "Outfit", sans-serif; font-weight: 700; font-size: 15px; width: 150px; }
.builder-name:focus { outline: none; border-color: var(--p1-2); }
.builder-main { flex: 1; display: flex; min-height: 0; }
.builder-stage { flex: 1; position: relative; min-width: 0; touch-action: none;
  background: radial-gradient(120% 90% at 50% 15%, rgba(59, 130, 246, 0.12), transparent 60%); }
.builder-stage canvas { display: block; }
.stage-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; color: var(--muted); font-weight: 800; letter-spacing: 0.02em; }
.builder-panel { width: 340px; flex: none; overflow-y: auto; padding: 14px; border-left: 1px solid var(--line);
  background: rgba(12, 18, 32, 0.55); display: flex; flex-direction: column; gap: 12px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { flex: 1 1 auto; min-width: 88px; text-align: center; cursor: pointer; border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass); color: var(--ink); font-family: "Outfit", sans-serif; font-weight: 800; font-size: 14px; padding: 10px 12px; transition: transform 0.1s, background 0.1s; }
.chip-btn:hover { transform: translateY(-1px); background: var(--glass-2); }
.chip-btn:active { transform: scale(0.97); }
.chip-btn.photo { display: inline-flex; align-items: center; justify-content: center; }
.photo-hint { font-size: 13px; color: var(--gold); font-weight: 700; }
.builder-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.builder-tab { cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 10px;
  padding: 7px 11px; font-family: "Outfit", sans-serif; font-weight: 700; font-size: 12.5px; transition: all 0.1s; }
.builder-tab:hover { color: var(--ink); }
.builder-tab.on { background: var(--p1-2); border-color: var(--p1-2); color: #fff; }
.builder-options { display: block; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { cursor: pointer; border: 1px solid var(--line); background: var(--glass); color: var(--ink); border-radius: 12px;
  padding: 12px 10px; font-family: "Outfit", sans-serif; font-weight: 700; font-size: 14px; transition: all 0.1s; }
.opt:hover { background: var(--glass-2); transform: translateY(-1px); }
.opt.on { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35) inset; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.14); cursor: pointer; transition: transform 0.1s; }
.swatch:hover { transform: scale(1.06); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3), 0 6px 16px rgba(0, 0, 0, 0.4); transform: scale(1.06); }
/* KayKit-Charakterwahl */
.builder-hint { font-size: 13px; line-height: 1.5; }
.kit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kit-card { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 12px 8px;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink); border-radius: 16px;
  font-family: "Outfit", sans-serif; font-weight: 800; font-size: 14px; transition: transform 0.1s, box-shadow 0.1s, background 0.1s; }
.kit-card img { width: 84px; height: 84px; object-fit: contain; }
.kit-card:hover { transform: translateY(-2px); background: var(--glass-2); }
.kit-card.on { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.4) inset; }
@media (max-width: 760px) {
  .builder-main { flex-direction: column; }
  .builder-stage { flex: 1 1 45%; min-height: 40vh; }
  .builder-panel { width: auto; flex: 1 1 55%; border-left: none; border-top: 1px solid var(--line); }
  .builder-title { display: none; }
  .builder-name { width: 110px; }
}

/* ===================== 3D-ARENA ===================== */
.arena { display: flex; flex-direction: column; height: 100dvh; }
.arena-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 26, 0.6); backdrop-filter: blur(10px); z-index: 5; }
.arena-title { font-size: 20px; margin-right: auto; letter-spacing: 0.02em; }
.arena-scores { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 12px 20px; }
.ascore { flex: 1; text-align: center; max-width: 320px; }
.ascore .aname { font-size: clamp(18px, 3vw, 30px); letter-spacing: 0.02em; }
.ascore .apts { font-size: clamp(40px, 8vw, 78px); line-height: 0.95; }
.ascore .asets { color: var(--muted); font-weight: 700; font-size: 14px; }
.amid { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.amid .avs { font-size: 26px; color: var(--muted); }
.arena-sit { padding: 8px 18px; border-radius: 999px; font-family: "Anton", sans-serif; letter-spacing: 0.06em; font-size: 15px; }
.arena-sit.set { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.5); color: #bcd4ff; }
.arena-sit.match { background: rgba(245, 165, 36, 0.22); border: 1px solid rgba(245, 165, 36, 0.6); color: var(--gold); animation: pulseSit 1s ease-in-out infinite; }
.arena-stages { flex: 1; display: flex; min-height: 0; }
.arena-stage { flex: 1; min-width: 0; position: relative;
  background: radial-gradient(120% 90% at 50% 20%, rgba(59, 130, 246, 0.1), transparent 62%); }
.arena-stage:first-child { border-right: 1px solid rgba(255, 255, 255, 0.06); }
.arena-stage canvas { display: block; }
.arena-sub { min-height: 30px; text-align: center; padding: 6px 20px; font-weight: 700; color: var(--ink);
  opacity: 0; transition: opacity 0.2s; font-size: clamp(15px, 2.4vw, 21px); }
.arena-sub.show { opacity: 1; }
.arena-buttons { display: flex; gap: 14px; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); justify-content: center; }
.add-btn { flex: 1; max-width: 340px; font-size: 18px; padding: 18px; border: none; color: #08131f; font-weight: 800; }
.add-btn.p1 { background: linear-gradient(180deg, #7cc0ff, #3b82f6); }
.add-btn.p2 { background: linear-gradient(180deg, #ffd27c, #f59e0b); }
.add-btn:active { transform: scale(0.98); }
.arena-end { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(900px 600px at 50% 30%, rgba(245, 165, 36, 0.18), transparent 60%), rgba(7, 10, 18, 0.7); backdrop-filter: blur(6px); }
.arena-end-card { text-align: center; padding: 30px 40px; }
@media (max-width: 640px) {
  .arena-scores { gap: 10px; padding: 8px; }
  .amid { min-width: 70px; }
  .add-btn { padding: 14px; font-size: 15px; }
}

.sb-bottom { display: flex; gap: 14px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); align-items: center; }
.sethist { color: var(--muted); font-weight: 700; letter-spacing: 0.03em; }

/* ===== Scoreboard mobil (iPhone) – verhindert Überlauf/Überlappung ===== */
@media (max-width: 640px) {
  .sb-top { gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 14px 6px; }
  .sb-title { font-size: 20px; }
  .pill { font-size: 11px; padding: 5px 10px; }

  /* Setup: eine Spalte, alles passt in die Breite */
  .setup .card { padding: 16px; }
  .setup-grid { flex-direction: column; gap: 18px; }
  .setup-left, .setup-right { flex: 1 1 auto; min-width: 0; width: 100%; }
  .qrbox { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .qrbox img { width: 190px; height: 190px; }
  .codebig { font-size: 40px; letter-spacing: 8px; }
  #joinUrl { font-size: 12px; word-break: break-all; }
  .players-wait { flex-direction: column; gap: 10px; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 12px 6px; text-align: center; }
  #startBtn { width: 100%; }

  /* Live-Board: passt auf schmale Screens */
  .side { padding: 2vh 8px 0; }
  .side .name { font-size: clamp(20px, 5.5vw, 32px); }
  .side .pts { font-size: clamp(76px, 26vw, 150px); }
  .side .sets { font-size: 13px; }
  .side .add { font-size: 15px; padding: 12px 18px; }
  .sb-bottom { flex-wrap: wrap; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
}

/* ===================== BESTENLISTE ===================== */
.stats-wrap { padding-top: calc(env(safe-area-inset-top) + 14px); padding-bottom: 48px; }
.stats-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.section-title { font-size: 22px; margin: 28px 0 14px; letter-spacing: 0.03em; }
.player-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.player-card { padding: 18px; text-align: center; border-top: 3px solid var(--c, var(--mint)); }
.player-av { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; object-position: top; box-shadow: var(--shadow-lg); }
.player-name { font-size: 26px; margin: 8px 0 12px; }
.player-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 8px; }
.player-stats div { display: flex; flex-direction: column; gap: 2px; }
.player-stats b { font-family: "Anton", sans-serif; font-size: 24px; }
.player-stats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.record-card { padding: 16px 18px; }
.record-icon { font-size: 28px; }
.record-value { font-size: 30px; margin: 2px 0; color: var(--gold); }
.record-title { font-weight: 800; }
.record-detail { color: var(--muted); font-size: 14px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.mini-av { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; object-position: top; }
.h2h-list { display: flex; flex-direction: column; gap: 10px; }
.h2h-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.h2h-side { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.h2h-side.right { justify-content: flex-end; }
.h2h-score { font-size: 24px; }

.audio-btn { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; font-family: "Outfit", sans-serif;
  font-weight: 800; font-size: 16px; border: none; cursor: pointer; color: #2a1c00; padding: 13px 24px; border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  box-shadow: 0 12px 30px rgba(245, 165, 36, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: pulseSit 1.4s ease-in-out infinite; }
.audio-btn:active { filter: brightness(0.95); }
/* Mobil: Ton-Button unten statt über dem Header (nach der Basis-Regel, damit top:auto greift) */
@media (max-width: 640px) {
  .audio-btn { top: auto; bottom: calc(env(safe-area-inset-bottom) + 18px); font-size: 15px; padding: 12px 20px; }
}

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--glass-2); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 14px; font-weight: 800; opacity: 0; transition: opacity 0.2s; pointer-events: none; backdrop-filter: blur(12px); }
.toast.show { opacity: 1; }
