:root {
  --pb-primary: #7c3aed;
  --pb-accent: #22d3ee;
  --pb-bg: #050510;
  --pb-panel: rgba(255, 255, 255, .08);
  --pb-panel-strong: rgba(255, 255, 255, .14);
  --pb-text: #f8fafc;
  --pb-muted: rgba(248, 250, 252, .7);
  --pb-danger: #fb7185;
  --pb-radius: 24px;
}

/* Volle Viewport-Breite/-hoehe auf eigenstaendigen Spielseiten (Join + /games/pixel-battle) */
html:has(body.pixel-battle-standalone) {
  height: 100%;
}

/* natives Vollbild auf dem gesamten Dokument (Standalone): sichtbarer Inhalt, keine schwarze Fläche */
html:fullscreen,
html:-webkit-full-screen {
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  background: var(--pb-bg);
}

html:fullscreen body.pixel-battle-standalone,
html:-webkit-full-screen body.pixel-battle-standalone {
  margin: 0;
  width: 100%;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--pb-bg);
}

html:fullscreen body.pixel-battle-standalone .pb-app,
html:-webkit-full-screen body.pixel-battle-standalone .pb-app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.pixel-battle-standalone,
.pixel-battle-standalone body {
  margin: 0;
  background: var(--pb-bg);
}

body.pixel-battle-standalone {
  min-height: 100dvh;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body.pixel-battle-standalone .pb-app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.pb-app,
.pb-app * {
  box-sizing: border-box;
}

/* Max. sinnvoller Browser-z-index; über typischen Chat-/Kommunikations-FABs (oft 2147483000 … 2147483647) */
:root {
  --pb-z-app: 2147483647;
}

.pb-app {
  position: relative;
  z-index: var(--pb-z-app);
  isolation: isolate;
  width: 100%;
  min-height: 72vh;
  color: var(--pb-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--pb-primary), transparent 54%), transparent 34rem),
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--pb-accent), transparent 62%), transparent 32rem),
    linear-gradient(145deg, #050510 0%, #0b1024 52%, #050510 100%);
}

/* Wordmark: unten in der rechten Spalte (.pb-side), Host + Mitspieler gleich */
.pb-host-app .pb-side > .pb-wordmark-lockup,
.pb-player-app .pb-side > .pb-wordmark-lockup {
  position: absolute;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: max(34px, env(safe-area-inset-bottom));
  z-index: 5;
  max-width: min(96vw, 560px);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  line-height: 0;
}

.pb-wordmark-lockup {
  z-index: 5;
  line-height: 0;
}

.pb-wordmark-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.pb-wordmark-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pb-accent), transparent 25%);
  outline-offset: 4px;
  border-radius: 10px;
}

.pb-wordmark-img {
  display: block;
  height: clamp(52px, 14vw, 96px);
  width: auto;
  max-width: min(96vw, 460px);
  object-fit: contain;
  filter: drop-shadow(0 3px 18px rgba(0, 0, 0, 0.55));
  opacity: 0.96;
}

/* Mitspieler: Toolbar + Abmelden unter der Rangliste */
.pb-player-app .pb-player-side-toolbar {
  margin-top: clamp(8px, 2.2vw, 16px);
}

.pb-player-app .pb-player-leave-room {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 12px;
}

/* Ueber feste FABs / Bewertungs-Widgets (typisch hohe z-index-Werte) */
.pb-app:fullscreen,
.pb-app:-webkit-full-screen {
  z-index: var(--pb-z-app);
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.pb-app.pb-pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: var(--pb-z-app) !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: auto;
  display: flex !important;
  flex-direction: column !important;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
}

.pb-app.pb-pseudo-fullscreen.pb-host-app,
.pb-app.pb-pseudo-fullscreen.pb-player-app {
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

body.pb-pixel-battle-no-scroll {
  overflow: hidden !important;
}

/* Divi/Theme: Scroll-Kette auch auf html sperren, sonst zieht der Builder-Wrapper mit */
html.pb-pixel-battle-fs-lock {
  overflow: hidden !important;
  height: 100%;
}

.pb-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pb-fs-btn {
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.pb-host-app {
  width: 100%;
  flex: 1 1 auto;
  min-height: 88vh;
  height: 88vh;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2vw, 28px);
  border-radius: var(--pb-radius);
  overflow: hidden;
}

body.pixel-battle-standalone .pb-host-app {
  min-height: 0;
  height: auto;
}

.pb-host-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(14px, 2vw, 24px);
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-content: stretch;
}

.pb-stage,
.pb-side,
.pb-mobile-card {
  background: rgba(5, 5, 16, .74);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 80px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
}

.pb-host-app .pb-stage,
.pb-player-app .pb-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  border-radius: var(--pb-radius);
  overflow: hidden;
}

.pb-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  border-radius: var(--pb-radius);
  overflow: hidden;
}

.pb-topbar,
.pb-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px clamp(16px, 2vw, 24px);
  background: rgba(255,255,255,.06);
}

.pb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: clamp(24px, 3vw, 44px);
  letter-spacing: -.04em;
}

.pb-logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
  box-shadow: 0 0 30px var(--pb-accent);
}

.pb-room-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  white-space: nowrap;
}

.pb-room-badge strong {
  color: var(--pb-accent);
  letter-spacing: .08em;
}

.pb-host-topbar-min {
  padding-block: 10px;
}

.pb-host-topbar-min .pb-brand {
  font-size: clamp(18px, 2.4vw, 28px);
}

.pb-host-main-slot {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: 'stack';
  min-height: 0;
}

.pb-host-lobby-panel,
.pb-player-lobby-invite,
.pb-host-main-slot > .pb-canvas-wrap {
  grid-area: stack;
  min-height: 0;
}

.pb-host-lobby-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  padding: clamp(16px, 2.5vw, 28px) clamp(16px, 2vw, 24px);
  text-align: center;
  background: rgba(255, 255, 255, .04);
}

/* Raumcode + QR als eine Einheit, mittig in der Stage-Fläche (Bildbereich). */
.pb-host-lobby-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 18px);
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  flex: 0 1 auto;
}

.pb-host-app[data-status="lobby"] .pb-host-lobby-panel,
.pb-host-app:not([data-status]) .pb-host-lobby-panel {
  display: flex;
}

.pb-host-app[data-status="lobby"] .pb-host-main-slot > .pb-canvas-wrap,
.pb-host-app:not([data-status]) .pb-host-main-slot > .pb-canvas-wrap {
  display: none !important;
}

.pb-player-app[data-status="lobby"] .pb-host-main-slot > .pb-canvas-wrap {
  display: none !important;
}

.pb-host-app:not([data-status="lobby"])[data-status] .pb-host-main-slot > .pb-canvas-wrap,
.pb-player-app:not([data-status="lobby"])[data-status] .pb-host-main-slot > .pb-canvas-wrap {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 220px;
}

.pb-host-lobby-room {
  flex: 0 0 auto;
  width: 100%;
}

.pb-host-room-code-main {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: clamp(34px, 9vw, 64px);
  font-weight: 1000;
  letter-spacing: 0.2em;
  line-height: 1.05;
  color: var(--pb-accent);
  text-align: center;
  text-indent: 0.2em;
}

.pb-host-room-code-main:hover {
  filter: brightness(1.08);
}

.pb-host-room-code-main:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pb-accent), transparent 35%);
  outline-offset: 4px;
  border-radius: 8px;
}

.pb-host-scan-feedback {
  margin: 10px 0 0;
  font-size: 0.9rem;
  text-align: center;
  max-width: 36rem;
}

/* Lobby: Thema unter Join-URL — deutlich größer als Statuszeilen */
.pb-host-lobby-theme.pb-host-round-notice {
  margin: 0;
  padding-top: 4px;
  max-width: 38rem;
  font-size: clamp(18px, 3.6vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  color: color-mix(in srgb, var(--pb-text), transparent 8%);
}

/* Lobby: volle Join-URL zwischen QR und Thema (manuell eintippen / kopieren) */
.pb-host-lobby-url-block {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(100%, 36rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.pb-host-lobby-url-hint {
  display: block;
  font-size: clamp(13px, 2.4vw, 16px);
  font-weight: 750;
  color: var(--pb-muted);
  text-align: center;
  line-height: 1.3;
}

.pb-host-lobby-url-feedback {
  display: block;
  min-height: 1.35em;
  margin: 0;
  font-size: clamp(14px, 2.6vw, 17px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #34d399;
  text-align: center;
  text-shadow: 0 0 18px rgba(52, 211, 153, 0.45);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.pb-host-lobby-url-block.pb-host-lobby-url-copied .pb-host-lobby-url-feedback {
  opacity: 1;
  transform: translateY(0);
}

.pb-host-lobby-url-block.pb-host-lobby-url-copied .pb-host-lobby-url-line {
  border-color: color-mix(in srgb, #34d399, transparent 35%);
  background: color-mix(in srgb, #34d399, transparent 88%);
  color: #ecfdf5;
  box-shadow: 0 0 0 2px color-mix(in srgb, #34d399, transparent 55%);
}

.pb-host-lobby-url-hint-sub {
  font-weight: 600;
  opacity: 0.88;
}

.pb-host-lobby-url-line {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--pb-accent), transparent 55%);
  border-radius: 14px;
  background: color-mix(in srgb, var(--pb-accent), transparent 92%);
  cursor: pointer;
  font: inherit;
  font-size: clamp(12px, 3.1vw, 16px);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--pb-accent);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.pb-host-lobby-url-line:hover {
  filter: brightness(1.06);
  border-color: color-mix(in srgb, var(--pb-accent), transparent 40%);
}

.pb-host-lobby-url-line:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pb-accent), transparent 35%);
  outline-offset: 3px;
}

.pb-host-lobby-qr-slot {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 861px) {
  .pb-host-app[data-status="lobby"] .pb-host-main-slot,
  .pb-host-app:not([data-status]) .pb-host-main-slot {
    min-height: 0;
  }

  .pb-host-app[data-status="lobby"] .pb-host-room-code-main,
  .pb-host-app:not([data-status]) .pb-host-room-code-main {
    font-size: clamp(38px, 5.2vw, 80px);
  }

  .pb-host-lobby-theme.pb-host-round-notice {
    font-size: clamp(22px, 3.2vw, 32px);
  }

  .pb-host-lobby-url-line {
    font-size: clamp(13px, 1.35vw, 17px);
  }
}

@media (max-width: 860px) {
  .pb-host-app[data-status="lobby"] .pb-host-lobby-panel,
  .pb-host-app:not([data-status]) .pb-host-lobby-panel {
    padding: clamp(18px, 4vw, 28px) max(0px, env(safe-area-inset-left)) clamp(18px, 4vw, 28px) max(0px, env(safe-area-inset-right));
    justify-content: center;
  }

  .pb-host-app[data-status="lobby"] .pb-host-room-code-main,
  .pb-host-app:not([data-status]) .pb-host-room-code-main {
    font-size: clamp(28px, 8.5vw, 48px);
  }
}

.pb-qr-hero-wrap {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 20px;
  line-height: 0;
  max-width: min(320px, 78vw);
}

.pb-qr-hero-wrap:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pb-accent), transparent 35%);
  outline-offset: 4px;
}

/* QR-Scan-Dialog (body): gleiche Ebene wie Spiel, per appendChild typisch über FABs */
.pb-qr-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--pb-z-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.pb-qr-scan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.pb-qr-scan-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  padding: 20px;
  border-radius: 16px;
  background: rgba(12, 14, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pb-qr-scan-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.pb-qr-scan-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--pb-muted);
  line-height: 1.45;
}

.pb-qr-scan-video {
  width: 100%;
  border-radius: 12px;
  background: #02030a;
  max-height: 44vh;
  object-fit: cover;
}

.pb-qr-scan-overlay:not(.pb-has-detector) .pb-qr-scan-video {
  display: none !important;
}

.pb-qr-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pb-qr-scan-actions .pb-btn {
  flex: 1 1 auto;
  min-width: 0;
}

.pb-room-scan-btn {
  width: 100%;
  margin-top: 4px;
}

.pb-qr-hero-wrap .pb-qr {
  display: block;
}

.pb-qr-hero-wrap .pb-qr svg {
  display: block;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  max-width: 100%;
}

.pb-qr-hero-wrap .pb-qr-fallback {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  max-width: 100%;
  font-size: clamp(22px, 8vw, 40px);
}

/* Lobby-QR: SVG hat nur viewBox — explizite Breite nötig; max. passt sich Slot + viewport an. */
.pb-host-lobby-qr-slot .pb-qr-hero-wrap {
  max-width: 100%;
  max-height: 100%;
  width: fit-content;
  height: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-host-lobby-qr-slot .pb-qr {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr svg {
  display: block;
  width: min(100%, 72vmin, 420px);
  height: auto;
  aspect-ratio: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr-fallback {
  display: grid;
  place-items: center;
  width: min(100%, 72vmin, 420px);
  aspect-ratio: 1;
  max-width: 100%;
  max-height: 100%;
  font-size: clamp(18px, 5vmin, 36px);
}

@media (min-width: 861px) {
  .pb-host-app[data-status="lobby"] .pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr svg,
  .pb-host-app:not([data-status]) .pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr svg {
    width: min(100%, 80vmin, 520px);
  }

  .pb-host-app[data-status="lobby"] .pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr-fallback,
  .pb-host-app:not([data-status]) .pb-host-lobby-qr-slot .pb-qr-hero-wrap .pb-qr-fallback {
    width: min(100%, 80vmin, 520px);
  }
}

.pb-canvas-wrap {
  position: relative;
  height: 100%;
  min-height: 220px;
  background: #03030b;
  cursor: crosshair;
  display: flex;
  flex-direction: column;
}

/* Nur Host-Bühne (.pb-canvas-wrap): Canvas füllt die Flex-Spalte — dieselbe Klasse nutzt der Mitspieler
 * auf Mobil (.pb-mobile-image-button); dort NICHT flex/width/height erben, sonst falsche Skalierung / halbes Bild schwarz. */
.pb-pixel-canvas {
  display: block;
}

.pb-canvas-wrap > .pb-pixel-canvas {
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  min-height: 200px;
}

.pb-stage-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px rgba(0,0,0,.54);
  display: grid;
  place-items: center;
  padding: 24px;
}

.pb-host-app[data-status="round_end"] .pb-stage-overlay,
.pb-host-app[data-status="finished"] .pb-stage-overlay {
  display: none;
}

/* Host: Runden-/Spielende — reiner Text (kein Button-Look), Mobil unter dem Bild, Desktop zentriert über Abmelden */
.pb-host-round-banner {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 10px;
}

.pb-host-round-banner[hidden] {
  display: none !important;
}

.pb-host-round-notice {
  margin: 0;
  padding: 6px 4px 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: clamp(16px, 2.6vw, 22px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--pb-text);
  text-align: center;
  overflow-wrap: anywhere;
}

.pb-host-round-notice.pb-round-notice--win {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.01em;
  animation: pbRoundWinGlow 2.4s ease-in-out infinite;
}

@keyframes pbRoundWinGlow {
  0%,
  100% {
    text-shadow:
      0 0 10px color-mix(in srgb, var(--pb-accent), transparent 40%),
      0 0 22px color-mix(in srgb, var(--pb-primary), transparent 55%);
    filter: brightness(1);
  }

  50% {
    text-shadow:
      0 0 18px color-mix(in srgb, var(--pb-accent), transparent 18%),
      0 0 36px color-mix(in srgb, var(--pb-primary), transparent 35%),
      0 0 52px color-mix(in srgb, var(--pb-accent), transparent 45%);
    filter: brightness(1.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb-host-round-notice.pb-round-notice--win,
  .pb-player-round-notice.pb-round-notice--win {
    animation: none;
    text-shadow: 0 0 14px color-mix(in srgb, var(--pb-accent), transparent 30%);
  }
}

@media (min-width: 861px) {
  .pb-host-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .pb-host-player-card .pb-host-logout,
  .pb-host-player-card .pb-host-join-form button[type="submit"].pb-btn {
    align-self: center;
    width: min(100%, 280px);
  }

  .pb-host-player-card .pb-host-join-form {
    width: 100%;
    max-width: 320px;
    align-self: center;
  }

  .pb-host-player-card .pb-choice-grid-host {
    width: 100%;
    max-width: 320px;
    align-self: center;
  }

  .pb-host-player-card > h2,
  .pb-host-player-card > .pb-feedback {
    align-self: stretch;
    width: 100%;
  }
}

@media (max-width: 860px) {
  .pb-host-round-banner:not([hidden]) {
    text-align: center;
  }
}

/* Host-Hauptslot: Overlay ist nur Dekoration (kein Hit-Test), begrenzt die Box nicht.
 * min-height aus .pb-canvas-wrap > .pb-pixel-canvas blockiert sonst Flex-Shrink in der
 * Grid-Kette und führt mit overflow:hidden der Stage zu abgeschnittenem Canvas. */
.pb-host-main-slot > .pb-canvas-wrap > .pb-pixel-canvas {
  position: relative;
  z-index: 0;
  min-height: 0;
}

.pb-host-main-slot > .pb-canvas-wrap > .pb-stage-overlay {
  z-index: 1;
}

.pb-host-app[data-status="running"] .pb-stage-overlay {
  place-items: end end;
}

.pb-stage-callout {
  max-width: min(760px, 92%);
  padding: clamp(18px, 3vw, 34px);
  border-radius: 22px;
  background: rgba(5, 5, 16, .72);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 24px 90px rgba(0,0,0,.46), 0 0 60px color-mix(in srgb, var(--pb-accent), transparent 55%);
  text-align: center;
}

.pb-stage-callout strong {
  display: block;
  font-size: clamp(34px, 6vw, 86px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.pb-statusbar {
  align-items: center;
  flex-wrap: wrap;
}

.pb-error {
  color: var(--pb-danger);
}

.pb-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pb-btn,
.pb-choice {
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
  padding: 12px 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.pb-btn:hover,
.pb-choice:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  color: #fff;
}

.pb-btn:active,
.pb-choice:active {
  transform: translateY(1px);
}

.pb-back {
  background: rgba(255,255,255,.12);
}

.pb-side {
  position: relative;
  border-radius: var(--pb-radius);
  padding: 16px;
  overflow: auto;
}

.pb-qr-card,
.pb-host-player-card,
.pb-ranking {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  margin-bottom: 14px;
}

.pb-ranking {
  text-align: center;
}

.pb-qr-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.pb-qr img {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  background: white;
  padding: 6px;
}

.pb-qr svg {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 16px;
  background: white;
  padding: 6px;
}

.pb-qr-fallback {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: white;
  color: #111827;
  font-weight: 900;
  font-size: 24px;
}

.pb-join-url strong {
  display: block;
  color: var(--pb-accent);
  font-size: 32px;
  letter-spacing: .1em;
}

.pb-join-url span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--pb-muted);
  font-size: 12px;
}

.pb-host-player-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  text-align: center;
}

/* Technikspieler: Beitreten / Abmelden — gleiche Mindesthöhe wie Antwort-Buttons (.pb-choice) darunter */
.pb-host-player-card .pb-host-join-form button[type="submit"].pb-btn,
.pb-host-player-card .pb-host-logout {
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border-radius: 18px;
}

.pb-host-toolbar {
  --pb-host-toolbar-h: clamp(52px, 12vw, 72px);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin: 0 0 14px;
}

.pb-host-icon-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: var(--pb-host-toolbar-h);
  padding: 6px 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease, transform .1s ease;
}

.pb-host-icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, .16);
}

.pb-host-icon-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.pb-host-icon-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.pb-host-icon-btn svg {
  flex-shrink: 0;
  width: clamp(28px, 6vw, 40px);
  height: clamp(28px, 6vw, 40px);
}

/* Slide-Overlays: Themen + Credits — wie ZIGZAG hof-panel. */
.pb-host-theme-overlay,
.pb-host-credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 4, 14, .72);
  transition: opacity 0.28s ease, visibility 0s linear 0.3s;
}

.pb-host-theme-overlay.is-open,
.pb-host-credits-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

.pb-host-theme-sheet {
  position: absolute;
  inset: clamp(12px, 3vw, 34px);
  box-sizing: border-box;
  padding: clamp(18px, 4.5vw, 44px) clamp(16px, 3.5vw, 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  color: #f3f7ff;
  background:
    linear-gradient(180deg, rgba(64, 231, 255, 0.13) 0%, transparent 42%),
    linear-gradient(165deg, rgba(8, 16, 34, 0.97) 0%, rgba(4, 9, 20, 0.99) 100%);
  border: 1px solid rgba(135, 216, 255, 0.22);
  border-radius: 24px;
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 100px rgba(60, 120, 255, 0.08);
  transform: translate3d(108%, 0, 0);
  transition: transform 0.55s cubic-bezier(0.32, 0.72, 0.25, 1);
}

.pb-host-theme-overlay.is-open .pb-host-theme-sheet {
  transform: translate3d(0, 0, 0);
}

/* Credits: Schiene animiert, Sheet max. 600px, vertikal zentriert. */
.pb-host-credits-rail {
  position: absolute;
  inset: clamp(12px, 3vw, 34px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transform: translate3d(108%, 0, 0);
  transition: transform 0.55s cubic-bezier(0.32, 0.72, 0.25, 1);
}

.pb-host-credits-overlay.is-open .pb-host-credits-rail {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.pb-host-credits-sheet {
  position: relative;
  box-sizing: border-box;
  flex: 0 1 auto;
  width: 100%;
  max-width: 600px;
  max-height: min(92dvh, calc(100vh - 24px));
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #f3f7ff;
  background:
    linear-gradient(180deg, rgba(64, 231, 255, 0.13) 0%, transparent 42%),
    linear-gradient(165deg, rgba(8, 16, 34, 0.97) 0%, rgba(4, 9, 20, 0.99) 100%);
  border: 1px solid rgba(135, 216, 255, 0.22);
  border-radius: 24px;
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.5),
    inset 0 0 100px rgba(60, 120, 255, 0.08);
}

.pb-host-credits-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.42);
  color: #f0f6ff;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pb-host-credits-close:hover {
  filter: brightness(1.15);
  background: rgba(255, 255, 255, 0.1);
}

.pb-host-credits-inner {
  padding: clamp(14px, 3.5vw, 28px) clamp(16px, 3.5vw, 36px) clamp(22px, 4vw, 44px);
  text-align: center;
}

/* Abstand Logo → Text: höchstens ca. 50px (vorher oft mehr durch hohes OG + Padding). */
.pb-host-credits-og:not([hidden]) + .pb-host-credits-inner {
  padding-top: clamp(10px, 2.5vw, 50px);
}

.pb-host-theme-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.42);
  color: #f0f6ff;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pb-host-theme-close:hover {
  filter: brightness(1.15);
  background: rgba(255, 255, 255, 0.1);
}

.pb-host-theme-heading {
  margin: 0 52px 8px 0;
  font-size: clamp(2rem, 6vw, 4.4rem);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #dff8ff;
  text-shadow: 0 6px 30px rgba(64, 231, 255, 0.28);
}

.pb-host-theme-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.pb-host-theme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 52px 0 0;
}

.pb-host-theme-tab {
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: #dbeafe;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  cursor: pointer;
}

.pb-host-theme-tab:hover {
  border-color: rgba(135, 216, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.pb-host-theme-tab.is-active {
  border-color: rgba(98, 255, 180, 0.45);
  background: linear-gradient(145deg, rgba(16, 44, 40, 0.55), rgba(7, 22, 25, 0.5));
  color: #e8fff4;
}

.pb-host-theme-tab-panel {
  margin-top: 10px;
}

.pb-host-theme-tab-panel[hidden] {
  display: none !important;
}

.pb-host-theme-updates-meta {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #b8cce8;
}

.pb-host-theme-updates-paths {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #c5daf0;
  word-break: break-word;
}

.pb-host-theme-updates-paths--note {
  opacity: 0.88;
  font-size: 0.78rem;
}

.pb-host-theme-bootstrap-hint {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 200, 120, 0.35);
  background: rgba(60, 32, 8, 0.35);
}

.pb-host-theme-bootstrap-hint p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #ffe8d4;
}

.pb-host-bootstrap-retry-room {
  display: inline-block;
  margin: 0;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(98, 255, 180, 0.45);
  background: rgba(12, 48, 36, 0.65);
  color: #e8fff4;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.pb-host-bootstrap-retry-room:hover {
  filter: brightness(1.08);
}

.pb-host-theme-updates-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pb-host-theme-updates-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.pb-host-theme-updates-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
}

.pb-host-theme-updates-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-host-theme-updates-thumb--empty {
  background: linear-gradient(135deg, rgba(80, 120, 180, 0.35), rgba(30, 50, 90, 0.45));
}

.pb-host-theme-updates-main {
  flex: 1 1 220px;
  min-width: 0;
}

.pb-host-theme-updates-status {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #dbeafe;
  background: rgba(0, 0, 0, 0.25);
}

.pb-host-theme-updates-status--missing {
  border-color: rgba(120, 200, 255, 0.45);
  color: #d4f4ff;
}

.pb-host-theme-updates-status--update {
  border-color: rgba(255, 200, 120, 0.5);
  color: #ffe8cc;
}

.pb-host-theme-updates-status--current {
  border-color: rgba(98, 255, 180, 0.4);
  color: #d8ffe8;
}

.pb-host-theme-updates-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 850;
  margin: 2px 0 4px;
  color: #f0f6ff;
}

.pb-host-theme-updates-ver {
  display: block;
  font-size: 0.8rem;
  color: #9fb0d3;
  margin-bottom: 6px;
}

.pb-host-theme-updates-desc {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #c5dbf4;
}

.pb-host-theme-updates-actions {
  flex: 0 0 auto;
  align-self: center;
}

.pb-host-theme-sync-btn {
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(135, 216, 255, 0.4);
  background: rgba(30, 70, 120, 0.55);
  color: #f0f8ff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.pb-host-theme-sync-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.pb-host-theme-updates-info {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 20, 40, 0.45);
  font-size: 0.86rem;
  line-height: 1.5;
  color: #c8daf0;
}

.pb-host-theme-updates-info p {
  margin: 0 0 10px;
}

.pb-host-theme-updates-info p:last-child {
  margin-bottom: 0;
}

.pb-host-theme-updates-info a {
  color: #9fd4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pb-host-theme-updates-info-contact {
  margin-top: 8px !important;
}

.pb-host-theme-updates-pack-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(98, 255, 180, 0.28);
  background: rgba(12, 40, 32, 0.35);
}

.pb-host-theme-updates-pack-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #d8ffe8;
  flex: 1 1 200px;
  min-width: 0;
}

.pb-host-theme-updates-pack-select {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #f0f6ff;
  font: inherit;
}

.pb-host-theme-add-own-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #9fd4ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.pb-host-theme-add-own-btn:hover {
  filter: brightness(1.12);
}

.pb-host-theme-prompt-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 22, 0.72);
}

.pb-host-theme-prompt-overlay[hidden] {
  display: none !important;
}

.pb-host-theme-prompt-sheet {
  position: relative;
  width: min(100%, 480px);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(22, 38, 68, 0.98), rgba(10, 18, 36, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.pb-host-theme-prompt-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pb-host-theme-prompt-info-slot .pb-host-theme-updates-info {
  margin-bottom: 12px;
}

.pb-host-theme-prompt-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f6ff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.pb-host-theme-prompt-heading {
  margin: 0 32px 8px 0;
  font-size: 1.1rem;
  font-weight: 850;
  color: #f0f6ff;
}

.pb-host-theme-prompt-pack-name {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 750;
  color: #d4e8ff;
}

.pb-host-theme-prompt-hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pb-host-theme-prompt-copy {
  display: inline-block;
  margin: 0;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid rgba(98, 255, 180, 0.45);
  background: rgba(12, 48, 36, 0.65);
  color: #e8fff4;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pb-host-theme-prompt-copy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pb-host-theme-prompt-copy.is-copied {
  border-color: rgba(72, 220, 140, 0.85);
  background: rgba(24, 120, 72, 0.92);
  color: #f0fff6;
  box-shadow: 0 0 0 2px rgba(72, 220, 140, 0.35);
}

.pb-host-theme-prompt-copy.is-copy-error {
  border-color: rgba(255, 160, 120, 0.75);
  background: rgba(120, 48, 32, 0.88);
  color: #fff4ee;
}

.pb-host-theme-prompt-copy.is-empty-copy {
  border-color: rgba(255, 210, 100, 0.65);
  background: rgba(100, 72, 20, 0.85);
  color: #fff8e8;
}

.pb-host-theme-sync-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.pb-host-theme-sync-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  border-radius: 12px;
  font-weight: 900;
  color: rgba(98, 255, 180, 0.95);
  border: 1px solid rgba(98, 255, 180, 0.35);
  background: rgba(8, 28, 22, 0.5);
}

.pb-host-themes-remote-banner {
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(120, 200, 255, 0.38);
  background: linear-gradient(135deg, rgba(20, 50, 90, 0.55), rgba(8, 18, 40, 0.75));
}

.pb-host-themes-remote-banner[hidden] {
  display: none !important;
}

.pb-host-themes-remote-banner-text {
  flex: 1 1 200px;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #e4f2ff;
}

.pb-host-themes-remote-banner-btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fbff;
  font: inherit;
  font-weight: 750;
  font-size: 0.86rem;
  cursor: pointer;
}

.pb-host-themes-remote-banner-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.pb-host-theme-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 0;
}

.pb-host-theme-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.pb-host-theme-row:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(135, 216, 255, 0.28);
}

.pb-host-theme-row.is-current {
  border-color: rgba(98, 255, 180, 0.42);
  background: linear-gradient(180deg, rgba(16, 44, 40, 0.72), rgba(7, 22, 25, 0.66));
  box-shadow: 0 10px 24px rgba(98, 255, 180, 0.12);
}

.pb-host-theme-row-random {
  background: linear-gradient(145deg, rgba(110, 48, 168, 0.55), rgba(28, 12, 52, 0.82));
  border-color: rgba(200, 160, 255, 0.32);
}

.pb-host-theme-row-random:hover {
  background: linear-gradient(145deg, rgba(130, 62, 195, 0.62), rgba(36, 16, 62, 0.88));
  border-color: rgba(220, 185, 255, 0.42);
}

.pb-host-theme-row-random.is-current {
  border-color: rgba(255, 186, 120, 0.5);
  background: linear-gradient(145deg, rgba(95, 40, 140, 0.88), rgba(32, 10, 58, 0.94));
  box-shadow: 0 10px 28px rgba(255, 160, 90, 0.18);
}

.pb-host-theme-thumb-fallback-shuffle {
  color: rgba(235, 210, 255, 0.95);
}

.pb-host-theme-row-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pb-host-theme-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pb-host-theme-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  opacity: 0.75;
  color: rgba(64, 231, 255, 0.9);
}

.pb-host-theme-name {
  display: block;
  font-weight: 850;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  margin-bottom: 4px;
  color: #f0f6ff;
}

.pb-host-theme-desc {
  display: block;
  font-size: 0.84rem;
  color: #c5dbf4;
  line-height: 1.45;
}

.pb-host-theme-count {
  justify-self: end;
  align-self: center;
  min-width: 2.2em;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 950;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #dff8ff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(135, 216, 255, 0.22);
  text-align: center;
}

.pb-host-theme-empty,
.pb-host-theme-feedback {
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 16px;
  color: #9fb0d3;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

@media (max-width: 860px) {
  .pb-host-theme-sheet {
    inset: 8px;
    border-radius: 14px;
  }

  .pb-host-credits-rail {
    inset: 8px;
  }

  .pb-host-credits-sheet {
    border-radius: 14px;
  }

  .pb-host-credits-og {
    border-radius: 14px 14px 0 0;
  }

  .pb-host-theme-row,
  .pb-host-theme-empty,
  .pb-host-theme-feedback {
    border-radius: 14px;
  }

  .pb-host-theme-close {
    border-radius: 999px;
  }

  .pb-host-credits-close {
    border-radius: 14px;
  }

  .pb-host-theme-heading {
    margin-right: 48px;
  }
}

.pb-host-credits-og {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  object-fit: contain;
  object-position: center top;
  background: rgba(0, 0, 0, 0.22);
  vertical-align: top;
}

.pb-host-credits-og[hidden] {
  display: none !important;
}

.pb-host-credits-body {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.55;
  color: #c5dbf4;
}

.pb-host-credits-body p {
  margin: 0 0 14px;
}

.pb-host-credits-body p:last-child {
  margin-bottom: 0;
}

.pb-host-credits-links {
  font-weight: 700;
  text-align: center;
}

.pb-host-credits-links a {
  color: rgba(64, 231, 255, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(64, 231, 255, 0.35);
}

.pb-host-credits-links a:hover {
  color: #dff8ff;
  border-bottom-color: rgba(223, 248, 255, 0.55);
}

.pb-host-credits-rule {
  display: block;
  margin: 22px auto 20px;
  max-width: 100%;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pb-host-credits-hub {
  max-width: 100%;
  margin: 0 auto;
  padding-top: 4px;
  text-align: center;
}

.pb-host-credits-hub-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #f0f6ff;
  font-weight: 800;
  font-size: 1rem;
}

.pb-host-credits-hub-link:hover {
  color: #dff8ff;
}

.pb-host-credits-hub-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.pb-host-credits-hub-visual img {
  display: block;
  max-height: 56px;
  width: auto;
  max-width: min(100%, 220px);
  object-fit: contain;
}

.pb-host-credits-hub-visual svg {
  width: 40px;
  height: 40px;
  opacity: 0.85;
}

.pb-rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  transition: opacity 0.35s ease;
}

.pb-rank-row.pb-rank-row--self {
  border-color: color-mix(in srgb, var(--pb-accent), #ffffff 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pb-accent), transparent 45%);
}

.pb-rank-row.pb-rank-row--away {
  opacity: 0.28;
  pointer-events: none;
}

.pb-rank-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pb-primary), transparent 5%), color-mix(in srgb, var(--pb-accent), transparent 18%));
  opacity: .86;
  transition: width .45s ease, background .35s ease, opacity .35s ease;
}

.pb-rank-fill.pb-rank-fill--correct {
  background: linear-gradient(90deg, #047857, #34d399, #6ee7b7);
  opacity: .94;
}

.pb-rank-fill.pb-rank-fill--wrong {
  background: linear-gradient(90deg, #991b1b, #f87171, #fecaca);
  opacity: .94;
}

.pb-ranking--show-alive .pb-rank-row {
  grid-template-columns: 34px minmax(40px, auto) minmax(0, 1fr) auto;
}

.pb-rank-alive {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
  white-space: nowrap;
  justify-self: center;
  min-width: 0;
}

.pb-rank-pos,
.pb-rank-name,
.pb-rank-score {
  position: relative;
  z-index: 1;
}

.pb-rank-pos {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  font-weight: 900;
}

.pb-rank-name {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  justify-self: stretch;
  width: 100%;
}

.pb-rank-score {
  font-weight: 1000;
  font-size: 20px;
  text-align: center;
}

.pb-host-join-form,
.pb-room-form,
.pb-name-form {
  display: grid;
  gap: 10px;
  text-align: center;
}

.pb-host-join-form {
  grid-template-columns: 1fr;
  gap: 12px;
}

.pb-host-join-fields {
  display: grid;
  gap: 10px;
}

.pb-name-form label {
  display: block;
  text-align: center;
}

.pb-host-join-form input,
.pb-room-form input,
.pb-name-form input {
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  color: white;
  padding: 12px 14px;
  font-size: 16px;
  text-align: center;
}

.pb-host-join-form input::placeholder,
.pb-room-form input::placeholder,
.pb-name-form input::placeholder {
  color: rgba(255,255,255,.45);
}

.pb-muted {
  color: var(--pb-muted);
}

.pb-feedback {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  font-weight: 800;
}

/* Technik-Spieler-Karte: Hinweise wie „bereits geantwortet“ ohne Kachel-Hintergrund */
.pb-host-player-card .pb-feedback {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

/* Spieler: Sperr-/Runden-Hinweise (auch gegen Theme-Defaults) */
.pb-notice-no-bg {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.pb-flash-correct .pb-canvas-wrap,
.pb-flash-correct .pb-mobile-image-button {
  animation: pbCorrectFlash .8s ease;
}

.pb-flash-wrong .pb-canvas-wrap,
.pb-flash-wrong .pb-mobile-image-button {
  animation: pbWrongFlash .7s ease;
}

@keyframes pbCorrectFlash {
  0% { box-shadow: inset 0 0 0 0 color-mix(in srgb, var(--pb-accent), transparent 10%); }
  45% { box-shadow: inset 0 0 0 10px color-mix(in srgb, var(--pb-accent), transparent 10%), 0 0 70px color-mix(in srgb, var(--pb-accent), transparent 30%); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

@keyframes pbWrongFlash {
  0%, 100% { transform: translateX(0); box-shadow: none; }
  20% { transform: translateX(-8px); box-shadow: inset 0 0 0 8px rgba(251, 113, 133, .8); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.pb-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Spieler-Handy: Antworten nebeneinander (z. B. iPhone SE/10); ungerade letzte Zeile volle Breite */
.pb-mobile-choices .pb-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.pb-mobile-choices .pb-choice-grid .pb-choice:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.pb-choice-grid-host {
  grid-template-columns: 1fr 1fr;
}

/* Runde bereits von anderem beendet: Antworten nur noch grau, nicht antippbar */
.pb-choice-grid--inactive .pb-choice.pb-choice--inactive {
  background: rgba(100, 100, 110, 0.5);
  color: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.92;
  filter: none;
}

.pb-choice-grid--inactive .pb-choice.pb-choice--inactive:hover,
.pb-choice-grid--inactive .pb-choice.pb-choice--inactive:active {
  transform: none;
  filter: none;
}

.pb-choice {
  width: 100%;
  min-height: 56px;
  border-radius: 18px;
  font-size: 17px;
}

/* Mobile player */
.pb-player-app {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

body.pixel-battle-standalone .pb-player-app {
  min-height: 0;
}

/* Mitspieler-Spiel: gleiche Außenmaße wie Host (.pb-host-app) */
.pb-player-app:has(.pb-host-layout) {
  min-height: 88vh;
  height: 88vh;
  padding: clamp(14px, 2vw, 28px);
  border-radius: var(--pb-radius);
  overflow: hidden;
}

.pb-mobile-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 24px;
  padding: 18px;
  min-height: 64vh;
  display: grid;
  align-content: center;
  gap: 12px;
}

body.pixel-battle-standalone .pb-player-app > .pb-mobile-card,
body.pixel-battle-standalone .pb-player-app > .pb-host-layout {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
}

body.pixel-battle-standalone .pb-player-app > .pb-mobile-card.pb-join-share-card {
  border-radius: 18px;
  flex: 0 0 auto;
}

.pb-mobile-card h1 {
  font-size: clamp(34px, 13vw, 64px);
  line-height: .9;
  margin: 0 0 12px;
  letter-spacing: -.06em;
}

/* Standalone Join / Name: Karte max. 600px, OG-Bild oben bündig im Rahmen */
.pb-mobile-card.pb-join-share-card {
  padding: 0;
  gap: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: stretch;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.pb-join-share-hero-wrap {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  line-height: 0;
  box-sizing: border-box;
}

.pb-join-share-og {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
}

.pb-join-share-body {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  padding: 16px 14px max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  flex: 0 1 auto;
  min-height: 0;
}

.pb-join-share-lead {
  margin: 0;
  text-align: center;
  line-height: 1.45;
  color: var(--pb-muted);
  font-weight: 650;
}

.pb-join-share-room {
  margin: 0;
  text-align: center;
}

.pb-join-share-room-code {
  display: block;
  width: 100%;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: clamp(30px, 10vw, 56px);
  font-weight: 1000;
  letter-spacing: 0.16em;
  line-height: 1.08;
  color: var(--pb-accent);
  text-align: center;
  text-indent: 0.12em;
}

.pb-join-share-room-code:hover {
  filter: brightness(1.08);
}

.pb-join-share-room-code:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pb-accent), transparent 35%);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Größer / weniger rund als Standard-.pb-btn — wie Raum-/Namensfelder */
.pb-btn.pb-btn-join-fieldlike {
  border-radius: 16px;
  padding: 14px 18px;
  min-height: 48px;
  box-sizing: border-box;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.pb-join-share-room-code.pb-mobile-room.pb-player-room-share {
  display: block;
  width: 100%;
  font-size: clamp(30px, 10vw, 56px);
  font-weight: 1000;
  letter-spacing: 0.16em;
  line-height: 1.08;
  text-align: center;
}

body.pixel-battle-standalone .pb-player-app:has(.pb-join-share-card) {
  overflow-x: clip;
  min-height: 100dvh;
  min-height: 100svh;
  justify-content: center;
  align-items: center;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.pb-player-app:has(.pb-join-share-card) {
  justify-content: center;
  align-items: center;
}

.pb-player-app:has(.pb-join-share-card) > .pb-mobile-card.pb-join-share-card {
  flex: 0 0 auto;
}

/* Mitspieler-Lobby in derselben Stage-Fläche wie beim Host (Grid-Stack) */
.pb-player-app .pb-host-main-slot > .pb-player-lobby-invite:not([hidden]) {
  justify-content: center;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding: clamp(16px, 2.5vw, 28px) clamp(16px, 2vw, 24px);
  text-align: center;
  background: rgba(255, 255, 255, .04);
}

.pb-player-app .pb-canvas-wrap > .pb-mobile-image-button {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
  width: 100%;
}

/* Lobby (Mitspieler): QR + Teilen — gleiche Join-URL wie am Host-Beamer */
.pb-player-lobby-invite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: min(100%, 320px);
  margin-inline: auto;
  padding: 6px 0 2px;
}

.pb-player-lobby-invite[hidden] {
  display: none !important;
}

.pb-player-lobby-invite-label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--pb-muted);
  text-align: center;
}

.pb-player-lobby-qr-wrap {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pb-player-lobby-qr {
  line-height: 0;
  display: flex;
  justify-content: center;
}

.pb-player-lobby-qr svg {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.pb-player-lobby-qr .pb-qr-fallback {
  display: grid;
  place-items: center;
  min-height: 120px;
  font-size: clamp(22px, 7vw, 40px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--pb-accent);
}

/* Mitspieler: Meldungen (z. B. Fehler vom Server) unter dem Bild, nicht mehr in der entfernten Statuszeile */
.pb-player-feedback {
  margin: 0;
  padding: 6px 10px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--pb-muted);
}

.pb-player-feedback[hidden] {
  display: none !important;
}

/* Mitspieler: lange Runden-/Spielende-Meldung unter dem Bild (nicht in der Statuszeile über dem Bild) */
.pb-player-round-banner {
  width: 100%;
  box-sizing: border-box;
  margin-inline: 0;
}

.pb-player-round-banner[hidden] {
  display: none !important;
}

.pb-player-round-notice {
  margin: 0;
  padding: 6px 4px 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: clamp(16px, 2.6vw, 22px);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: var(--pb-text);
  overflow-wrap: anywhere;
}

.pb-player-round-notice.pb-round-notice--win {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.01em;
  animation: pbRoundWinGlow 2.4s ease-in-out infinite;
}

.pb-mobile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .06);
}

.pb-mobile-top-text {
  flex: 1;
  min-width: 0;
}

.pb-mobile-top strong {
  display: block;
  font-size: 19px;
}

.pb-mobile-room {
  display: block;
  color: var(--pb-accent);
  font-size: 12px;
  letter-spacing: .16em;
}

.pb-mobile-room.pb-mobile-room-btn {
  width: 100%;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--pb-accent);
  text-align: left;
}

.pb-mobile-room.pb-player-room-share {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--pb-accent);
  vertical-align: baseline;
}

.pb-mobile-room.pb-mobile-room-btn:hover,
.pb-mobile-room.pb-player-room-share:hover {
  filter: brightness(1.1);
}

.pb-mobile-room.pb-mobile-room-btn:focus-visible,
.pb-mobile-room.pb-player-room-share:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pb-accent), transparent 40%);
  outline-offset: 2px;
  border-radius: 4px;
}

.pb-player-room-line {
  margin: 0 0 12px;
  line-height: 1.45;
}

.pb-mobile-points {
  display: grid;
  place-items: center;
  min-width: 62px;
  min-height: 42px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
  font-weight: 1000;
}

.pb-mobile-status {
  padding: 12px 16px;
  font-weight: 900;
  color: var(--pb-text);
  text-align: center;
}

/*
 * Mitspieler-Bildfläche mobil: volle Breite, Höhe = Breite (1:1).
 * Einfachste robuste Methode: width 100%, padding-bottom 100% für das Quadrat.
 * Kein aspect-ratio, da es bei Resize in manchen Browsern "kleben" kann.
 */
.pb-mobile-image-button {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #02030a;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0,0,0,.34);
}

.pb-mobile-image-button.is-disabled {
  cursor: default;
  opacity: .78;
}

/* Wrapper-Layer: nur Füllboxen */
.pb-mobile-image-slot,
.pb-mobile-image-square {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Canvas füllt die Box absolut — width/height 100% damit keine schwarzen Balken */
.pb-mobile-image-button .pb-pixel-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  flex: none;
  margin: 0;
  min-height: 0;
  min-width: 0;
}

.pb-mobile-choices {
  padding: 0 14px;
}

.pb-center {
  text-align: center;
}

@media (max-width: 980px) {
  .pb-host-layout {
    grid-template-columns: 1fr;
  }

  /*
   * Einspaltiger Host: .pb-stage hat sonst nur auto-Höhe — Grid-Zeile minmax(0,1fr)
   * kollabiert praktisch auf den Canvas-min-height → breites, niedriges Rechteck statt Quadrat.
   * 1:1 an der Viewport-Breite wie beim Mitspieler (.pb-mobile-image-button).
   */
  .pb-host-app .pb-stage,
  .pb-host-layout > .pb-stage {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    flex: 0 0 auto;
    min-height: 0;
  }

  .pb-side {
    max-height: unset;
  }

  /* Host + Mitspieler: Wordmark in der Seitenleiste unter dem Inhalt, nicht viewport-fixiert */
  .pb-host-app .pb-side > .pb-wordmark-lockup,
  .pb-player-app .pb-side > .pb-wordmark-lockup {
    position: static;
    left: auto;
    right: auto;
    transform: none;
    width: 100%;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
    margin-top: clamp(12px, 3vw, 20px);
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: auto;
  }

  .pb-player-app:has(.pb-host-layout) {
    padding-left: 0;
    padding-right: 0;
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .pb-player-app:has(.pb-host-layout) .pb-host-layout {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(100svh, 100%);
    max-height: min(100dvh, 100%);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pb-app.pb-player-app {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .pb-mobile-status {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .pb-mobile-choices {
    padding-top: 10px;
  }

  /* Mobil: Button immer volle Breite, Quadrat per padding-bottom */
  .pb-player-app .pb-mobile-image-button {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
}

@media (max-width: 860px) {
  /* Host: Bildbereich (Stage + Canvas) bündig links/rechts, ohne Radius, transparent */
  .pb-host-app,
  .pb-player-app:has(.pb-host-layout) {
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: clamp(14px, 2vw, 28px);
    overflow-x: hidden;
  }

  .pb-host-layout .pb-side {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 14px;
    padding-left: clamp(12px, 4vw, 20px);
    padding-right: clamp(12px, 4vw, 20px);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .pb-wordmark-img {
    height: clamp(60px, 18vw, 112px);
    max-width: min(96vw, 520px);
  }

  .pb-host-app .pb-stage,
  .pb-host-layout > .pb-stage {
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .pb-host-main-slot > .pb-canvas-wrap {
    background: transparent;
    border-radius: 0;
  }

  .pb-host-app[data-status="lobby"] .pb-host-lobby-panel,
  .pb-host-app:not([data-status]) .pb-host-lobby-panel,
  .pb-player-app[data-status="lobby"] .pb-player-lobby-invite:not([hidden]) {
    background: transparent;
  }

  .pb-qr-hero-wrap {
    border-radius: 14px;
  }

  .pb-stage-callout {
    border-radius: 14px;
  }

  .pb-btn,
  .pb-choice {
    border-radius: 14px;
  }

  .pb-btn.pb-btn-join-fieldlike {
    border-radius: 14px;
  }

  .pb-host-player-card .pb-host-join-form button[type="submit"].pb-btn,
  .pb-host-player-card .pb-host-logout {
    border-radius: 14px;
  }

  .pb-rank-row {
    border-radius: 14px;
  }

  .pb-rank-pos {
    border-radius: 14px;
  }

  .pb-host-join-form input,
  .pb-room-form input,
  .pb-name-form input {
    border-radius: 14px;
  }

  .pb-qr img,
  .pb-qr svg,
  .pb-qr-fallback {
    border-radius: 14px;
  }

  .pb-mobile-card {
    border-radius: 14px;
  }

  .pb-mobile-points {
    border-radius: 14px;
  }

  .pb-host-layout {
    display: flex;
    flex-direction: column;
  }

  .pb-side {
    padding-top: 0;
    padding-bottom: 0;
  }

  .pb-qr-card,
  .pb-host-player-card,
  .pb-ranking {
    padding: 0;
    border-radius: 14px;
    background: transparent;
  }

  /* Lobby: zuerst Stage (Raumcode + QR), darunter Seitenleiste mit Technik-Anmeldung. */
  .pb-host-app[data-status="lobby"] .pb-stage,
  .pb-host-app:not([data-status]) .pb-stage {
    order: 1;
  }

  .pb-host-app[data-status="lobby"] .pb-side,
  .pb-host-app:not([data-status]) .pb-side {
    order: 2;
  }

  .pb-host-app[data-status="running"] .pb-stage,
  .pb-host-app[data-status="round_end"] .pb-stage,
  .pb-host-app[data-status="finished"] .pb-stage {
    order: 1;
  }

  .pb-host-app[data-status="running"] .pb-side,
  .pb-host-app[data-status="round_end"] .pb-side,
  .pb-host-app[data-status="finished"] .pb-side {
    order: 2;
  }
}

@media (max-width: 560px) {
  .pb-player-app {
    padding-left: 0;
    padding-right: 0;
  }
  .pb-mobile-card {
    border-radius: 14px;
  }

  .pb-mobile-card.pb-join-share-card {
    border-radius: 18px;
  }

  .pb-choice {
    min-height: 58px;
    font-size: 18px;
  }

  .pb-host-player-card .pb-host-join-form button[type="submit"].pb-btn,
  .pb-host-player-card .pb-host-logout {
    min-height: 58px;
    font-size: 18px;
  }
  .pb-rank-row {
    min-height: 42px;
  }
}

/* Spielende: Vollbild-Konfetti (body, gleicher z-index wie .pb-app — als letztes Kind über dem Spiel) */
.pb-game-end-celebration {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: var(--pb-z-app, 2147483647);
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(5, 5, 16, 0.22);
}

.pb-game-end-confetti {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

.pb-game-end-winner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  max-width: min(94vw, 28rem);
  padding: 0 12px;
  text-align: center;
  line-height: 1.12;
  font-weight: 950;
  font-size: clamp(1.75rem, 7vw, 3rem);
  letter-spacing: 0.02em;
  color: #ffe566;
  text-shadow:
    0 0 12px rgba(255, 200, 80, 0.95),
    0 0 36px rgba(255, 180, 40, 0.75),
    0 2px 0 #b45309,
    0 4px 12px rgba(0, 0, 0, 0.55);
  animation: pbGameEndWinnerIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both,
    pbGameEndWinnerShine 2.2s ease-in-out 0.55s infinite alternate;
}

@keyframes pbGameEndWinnerIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes pbGameEndWinnerShine {
  from {
    filter: brightness(1) saturate(1.05);
    text-shadow:
      0 0 10px rgba(255, 220, 120, 0.9),
      0 0 28px rgba(255, 170, 40, 0.65),
      0 2px 0 #b45309,
      0 4px 12px rgba(0, 0, 0, 0.55);
  }
  to {
    filter: brightness(1.18) saturate(1.22);
    text-shadow:
      0 0 20px rgba(255, 245, 210, 1),
      0 0 46px rgba(255, 200, 60, 0.95),
      0 2px 0 #92400e,
      0 4px 14px rgba(0, 0, 0, 0.62);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb-game-end-winner {
    animation: none;
    opacity: 1;
    filter: none;
  }
}
