:root {
  --night-top: #140a24;
  --night-mid: #2a1140;
  --night-bottom: #140a24;
  --moon: #ff9d3d;
  --moon-glow: #ffb15c;
  --gold: #ffd54a;
  --purple: #5b2a86;
  --orange: #ff8c2e;
  --green: #1fae6b;
  --red: #e63956;
  --dark: #241a38;
  --card-bg: #1c1130;
  --text: #f4ecff;
  --text-dim: #c9b9e8;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--night-mid);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* ---------- Background video ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--night-top);
  overflow: hidden;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sky-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(20, 10, 36, 0.15) 0%, rgba(20, 10, 36, 0.55) 60%, rgba(20, 10, 36, 0.85) 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 10%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 30%, #fff, transparent),
    radial-gradient(2px 2px at 35% 45%, #fff, transparent),
    radial-gradient(1px 1px at 90% 60%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 10% 65%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 50% 75%, #fff, transparent),
    radial-gradient(1px 1px at 75% 80%, #fff, transparent),
    radial-gradient(2px 2px at 15% 90%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 95% 15%, #fff, transparent);
  background-repeat: no-repeat;
  opacity: 0.5;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.25; }
  to { opacity: 0.6; }
}

/* ---------- Flying bats ---------- */
.bat-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.flying-bat {
  position: absolute;
  font-size: 1.6rem;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
  animation-name: flap;
  animation-timing-function: steps(2, end);
  animation-iteration-count: infinite;
  will-change: transform;
}

@keyframes flap {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.75); }
}

.flying-bat-path {
  position: absolute;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes flyAcross {
  from { transform: translate(var(--x-start), var(--y-start)); }
  to { transform: translate(var(--x-end), var(--y-end)); }
}

/* ---------- Settings gear ---------- */
.settings-gear {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 30;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 10, 36, 0.55);
  backdrop-filter: blur(4px);
  color: var(--text-dim);
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.settings-gear:hover {
  color: var(--gold);
  background: rgba(20, 10, 36, 0.75);
  transform: rotate(25deg);
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
  min-height: 100vh;
}

.title-block {
  position: relative;
  z-index: 3; /* liegt ueber den Fluegelspitzen der Fledermaus */
  text-align: center;
  margin-bottom: 8px;
}

.logo {
  display: block;
  width: min(80vw, 340px, 32vh);
  height: auto;
  margin: 0 auto 4px;
  filter: drop-shadow(0 0 18px rgba(255, 157, 61, 0.5));
}

.subtitle {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- Wheel ---------- */
/* Radgroesse: passt sich Breite UND Hoehe an, damit Fledermaus + Rad + Button auf den Schirm passen */
.wheel-wrap {
  --wheel: min(88vw, 540px, 50vh);
  position: relative;
  width: var(--wheel);
  aspect-ratio: 1 / 1;
  margin: calc(var(--wheel) * 0.36) auto calc(var(--wheel) * 0.08);
}

/* ---------- Fledermaus hinter dem Rad ---------- */
/* Neues Clipart-Design (tools/fledermaus_rad.py, Masse in public/assets/bat-rig.json):
   Leinwand 1188x532, Gesicht bei x=50 %, Radoberkante knapp unter dem Kinn (22,2 % der Breite).
   Die Fledermaus ist 1,55x so breit wie das Rad; Bauch und Beine verschwinden hinter dem Rad. */
.bat-rig {
  position: absolute;
  width: 155%;
  aspect-ratio: 1188 / 532;
  left: calc(50% - 0.5005 * 155%);
  top: calc(-0.2217 * 155%);
  pointer-events: none;
}

.bat-back { z-index: 0; }
.bat-front { z-index: 7; }

.bat-part {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

/* Gesicht: Sprite-Sheets, Frame wird per JS gewaehlt (background-position) */
.bat-eyes,
.bat-mouth {
  position: absolute;
  background-repeat: no-repeat;
  background-position: 0 0;
}

.bat-eyes {
  left: 43.384%;
  top: 28.668%;
  width: 13.889%;
  height: 13.544%;
  background-image: url("assets/bat-eyes.webp");
  background-size: 800% 100%;
  background-position: calc(2 / 7 * 100%) 0;
}

/* Mund ist im neuen Design Teil des Koerpers (laechelt) */
.bat-mouth { display: none; }

.bat-back .bat-body {
  transform-origin: 50% 80%;
  animation: batBreathe 3.2s ease-in-out infinite;
}

.bat-wing-left {
  transform-origin: 41.4% 48.1%;
  animation: batFlapLeft 3.2s ease-in-out infinite;
}

.bat-wing-right {
  transform-origin: 58.7% 48.1%;
  animation: batFlapRight 3.2s ease-in-out infinite;
}

.bat-front .bat-wing-right {
  opacity: 0;
  animation: none;
}

@keyframes batBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-0.8%) scale(1.01); }
}

@keyframes batFlapLeft {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg); }
}

@keyframes batFlapRight {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

/* Leerlauf: einzelner kraeftiger Fluegelschlag (per JS ausgeloest) */
.bat-back .bat-wing-left.flap { animation: batBigFlapLeft 0.9s ease-in-out both; }
.bat-back .bat-wing-right.flap { animation: batBigFlapRight 0.9s ease-in-out both; }
/* Kopf leicht neigen (per JS) */
.bat-back .bat-body.tilt-l { animation: batTiltL 1.6s ease-in-out both; }
.bat-back .bat-body.tilt-r { animation: batTiltR 1.6s ease-in-out both; }

@keyframes batBigFlapLeft {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-11deg) scaleY(0.96); }
  60% { transform: rotate(6deg); }
  80% { transform: rotate(-2deg); }
}

@keyframes batBigFlapRight {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(11deg) scaleY(0.96); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(2deg); }
}

@keyframes batTiltL {
  0%, 100% { transform: rotate(0deg); }
  25%, 70% { transform: rotate(-3.5deg) translateY(-0.6%); }
}

@keyframes batTiltR {
  0%, 100% { transform: rotate(0deg); }
  25%, 70% { transform: rotate(3.5deg) translateY(-0.6%); }
}

/* Anstossen: Fluegel holt aus, schwingt VOR das Rad nach unten und zieht zurueck */
.bat-back.push .bat-wing-right { animation: batPushBack 1.1s cubic-bezier(0.45, 0, 0.3, 1) both; }
.bat-front.push .bat-wing-right { animation: batPushFront 1.1s cubic-bezier(0.45, 0, 0.3, 1) both; }
.bat-back.push .bat-body { animation: batLean 1.1s ease-in-out both; }
.bat-back.push .bat-wing-left { animation: batLeftBrace 1.1s ease-in-out both; }

/* Neuer Fluegel liegt waagerecht: ausholen = nach oben, Anstossen = nach unten vor das Rad */
@keyframes batPushBack {
  0% { transform: rotate(0deg); opacity: 1; }
  30% { transform: rotate(-24deg) scale(1.02); opacity: 1; }
  30.1% { opacity: 0; }
  80% { opacity: 0; transform: rotate(20deg); }
  80.1% { opacity: 1; }
  100% { transform: rotate(0deg); opacity: 1; }
}

@keyframes batPushFront {
  0% { transform: rotate(-24deg) scale(1.02); opacity: 0; }
  30% { transform: rotate(-24deg) scale(1.02); opacity: 0; }
  30.1% { transform: rotate(-24deg) scale(1.02); opacity: 1; }
  48% { transform: rotate(58deg) scale(1.06); }
  58% { transform: rotate(52deg) scale(1.04); }
  80% { transform: rotate(20deg) scale(1.02); opacity: 1; }
  80.1% { opacity: 0; }
  100% { transform: rotate(0deg); opacity: 0; }
}

@keyframes batLean {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-3deg) translateY(-1%); }
  50% { transform: rotate(4deg) translateY(0.6%); }
}

@keyframes batLeftBrace {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-6deg); }
  55% { transform: rotate(4deg); }
}

/* ---------- Zeiger ---------- */
.pointer {
  position: absolute;
  top: -5.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 9%;
  aspect-ratio: 40 / 52;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,0.6));
  z-index: 5;
  transform-origin: 50% 12%;
}

.pointer.landed {
  animation: pointerBounce 0.6s ease;
}

@keyframes pointerBounce {
  0% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-14deg); }
  50% { transform: translateX(-50%) rotate(10deg); }
  75% { transform: translateX(-50%) rotate(-5deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

/* ---------- Rad ---------- */
.wheel-outer {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 7.5%;
  /* Rahmen: Gold aussen, dunkles Burgunder mit Lampen, Gold innen */
  background:
    radial-gradient(circle, transparent 0 82%, #ffd76a 82.5%, #a8650f 84.5%, transparent 85%),
    radial-gradient(circle, #5a0f1e 0 70%, #3a0812 88%, #22040b 100%);
  box-shadow:
    0 0 0 3px #7a4300,
    0 0 0 7px #f3c04a,
    0 0 0 9px #6b3a00,
    0 0 40px rgba(255, 140, 40, 0.35),
    0 25px 50px rgba(0,0,0,0.65),
    inset 0 0 18px rgba(0,0,0,0.7);
}

.wheel-lights {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.wheel-lights span {
  position: absolute;
  inset: 0;
}

.wheel-lights span::before {
  content: "";
  position: absolute;
  top: 2.1%;
  left: 50%;
  width: 3.4%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #ffe9a8 40%, #ffb02e 75%, #a35a00 100%);
  box-shadow: 0 0 8px 2px rgba(255, 200, 90, 0.9);
  animation: bulbChase 1.2s steps(1, end) infinite;
  animation-delay: var(--d, 0s);
}

.wheel-outer.is-spinning .wheel-lights span::before { animation-duration: 0.3s; }

@keyframes bulbChase {
  0%, 100% { opacity: 1; filter: brightness(1.15); }
  50% { opacity: 0.35; filter: brightness(0.7); box-shadow: none; }
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  transform: rotate(0deg);
  box-shadow: 0 0 0 4px #2b0610, 0 0 0 6px #e6ac3a;
  transition: transform 6.8s cubic-bezier(0.1, 0.9, 0.08, 1);
}

.wheel-segments,
.wheel-shade {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

/* Tiefe: innen dunkler, aussen Lichtkante */
.wheel-shade {
  background:
    radial-gradient(circle, rgba(0,0,0,0.45) 0 18%, rgba(0,0,0,0) 45%, rgba(255,255,255,0.08) 80%, rgba(0,0,0,0.35) 100%);
}

.wheel-labels,
.wheel-pins {
  position: absolute;
  inset: 0;
}

.wheel-label-pivot {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 50%;
  transform-origin: 50% 100%;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  top: 7%;
  left: 0;
  transform: translateX(-50%);
  width: calc(var(--wheel) * 0.24);
  text-align: center;
  font-family: 'Lilita One', 'Arial Black', sans-serif;
  font-size: calc(var(--wheel) * 0.036);
  color: #fff;
  line-height: 1.05;
  letter-spacing: 0.01em;
  -webkit-text-stroke: 0.09em rgba(30, 6, 20, 0.85);
  paint-order: stroke fill;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  pointer-events: none;
}

.wheel-label .wl-icon {
  display: block;
  font-size: 1.9em;
  line-height: 1.1;
  margin-bottom: 0.1em;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.55));
}

.wheel-label.jackpot {
  color: #fff6c8;
  -webkit-text-stroke-color: #6b2400;
}

/* Goldnieten auf den Trennlinien */
.wheel-pins span {
  position: absolute;
  inset: 0;
}

.wheel-pins span::before {
  content: "";
  position: absolute;
  top: 2.2%;
  left: 50%;
  width: 3.6%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8d6 0 15%, #f2c34e 45%, #8a5208 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.6);
}

/* Glanz liegt fest ueber dem drehenden Rad */
.wheel-gloss {
  position: absolute;
  inset: 7.5%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 35% 18%, rgba(255,255,255,0.22), rgba(255,255,255,0) 70%),
    radial-gradient(circle, rgba(0,0,0,0) 62%, rgba(0,0,0,0.35) 100%);
  z-index: 3;
}

/* ---------- Nabe: JUMPHOUSE im Halloween-Look (= Dreh-Button) ---------- */
.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 31%;
  aspect-ratio: 1/1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 4;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, #4b1a63 0%, #1f0a2c 55%, #0b0412 100%);
  box-shadow:
    0 0 0 4px #5a3000,
    0 0 0 8px #f0b93a,
    0 0 0 11px #7a4300,
    0 0 26px 10px rgba(255, 120, 20, 0.45),
    0 8px 16px rgba(0,0,0,0.6),
    inset 0 0 22px rgba(0,0,0,0.85),
    inset 0 0 50px rgba(255, 110, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: hubGlow 2.6s ease-in-out infinite;
}

@keyframes hubGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.hub:hover { transform: translate(-50%, -50%) scale(1.04); }
.hub:active, .hub.pressed { transform: translate(-50%, -50%) scale(0.92); }
.hub:disabled { cursor: not-allowed; }

/* Spinnennetz */
.hub-web {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background:
    repeating-radial-gradient(circle, transparent 0 13%, rgba(255,255,255,0.9) 13.4% 14%, transparent 14.4% 20%),
    repeating-conic-gradient(rgba(255,255,255,0.9) 0deg 1.2deg, transparent 1.2deg 45deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 60%, transparent 72%);
          mask-image: radial-gradient(circle, #000 0 60%, transparent 72%);
}

.hub-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: 'Creepster', 'Lilita One', 'Arial Black', sans-serif;
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: #ff8a1c;
  background: linear-gradient(180deg, #ffe08a 0%, #ff9a1f 45%, #e2410b 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 110, 0, 0.85)) drop-shadow(0 2px 0 #2a0700);
}

.hub-jump {
  font-size: calc(var(--wheel) * 0.085);
}

.hub-house {
  font-size: calc(var(--wheel) * 0.06);
}

.spin-cta {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 14px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2a0d00;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  border-radius: 999px;
  box-shadow: 0 6px 0 #b85c00, 0 10px 20px rgba(0,0,0,0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.spin-cta:hover { transform: translateY(-2px); }
.spin-cta:active { transform: translateY(2px); box-shadow: 0 2px 0 #b85c00, 0 6px 14px rgba(0,0,0,0.4); }
.spin-cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: 0 6px 0 #6b4a00;
  transform: none;
}

.status {
  margin-top: 14px;
  min-height: 1.3em;
  color: var(--text-dim);
  text-align: center;
  font-size: 0.95rem;
}

/* ---------- Gewinnbildschirm (Vollbild, siehe win-screen.js) ---------- */
.win-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  font-family: 'Lilita One', 'Arial Black', Impact, sans-serif;
}

.win-screen.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.ws-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(70, 20, 60, 0.55) 0%, rgba(14, 5, 22, 0.88) 55%, rgba(6, 2, 10, 0.96) 100%);
  backdrop-filter: blur(4px);
}

.ws-rays {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 180vmax;
  height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 200, 90, 0.11) 0deg 7deg, rgba(255, 200, 90, 0) 7deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.5) 15%, transparent 35%);
          mask-image: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.5) 15%, transparent 35%);
  animation: wsRays 22s linear infinite;
}

.win-screen.lvl-super .ws-rays { background: repeating-conic-gradient(from 0deg, rgba(110, 170, 255, 0.2) 0deg 7deg, rgba(110, 170, 255, 0) 7deg 20deg); }
.win-screen.lvl-mega .ws-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 230, 120, 0.26) 0deg 7deg, rgba(255, 230, 120, 0) 7deg 20deg); animation-duration: 12s; }

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

.ws-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ws-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  gap: clamp(4px, 1.5vh, 16px);
}

.ws-emblem {
  display: block;
  width: min(100vw, calc(58vh * 1380 / 860));
  height: auto;
  flex: 0 1 auto;
  overflow: visible;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}

.ws-label {
  font-family: 'Lilita One', 'Arial Black', Impact, sans-serif;
  font-size: 86px;
  fill: url(#wsLabel);
  stroke: #24123a;
  stroke-width: 14px;
  stroke-linejoin: round;
  paint-order: stroke;
}

.ws-win {
  font-family: 'Lilita One', 'Arial Black', Impact, sans-serif;
  font-size: 250px;
}

.ws-win-extrude {
  fill: #a0381c;
  stroke: #4a1408;
  stroke-width: 22px;
  stroke-linejoin: round;
  paint-order: stroke;
}

.ws-win-front {
  fill: url(#wsWin);
  stroke: #6b2208;
  stroke-width: 7px;
  stroke-linejoin: round;
  paint-order: stroke;
}

/* Preis gross unter dem Emblem */
.ws-prize {
  text-align: center;
  max-width: min(94vw, 1100px);
  opacity: 0;
  transform: scale(0.4) translateY(30px);
}

.ws-prize.show {
  animation: wsPrizeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes wsPrizeIn {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ws-eyebrow {
  margin: 0 0 2px;
  color: #fff;
  font-size: clamp(1rem, 2.6vw, 1.7rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #3a1650, 0 0 18px rgba(0, 0, 0, 0.8);
}

.ws-prize-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  font-size: clamp(2.2rem, min(6.5vw, 7vh), 5.4rem);
}

@media (max-width: 700px) {
  .ws-prize-row { flex-direction: column; gap: 0.05em; }
}

.ws-icon {
  font-size: 1.1em;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6));
  animation: wsFloat 2.2s ease-in-out infinite;
}

@keyframes wsFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-0.12em) rotate(4deg); }
}

.ws-prize-name {
  margin: 0;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.05;
  color: #ffd84a;
  background: linear-gradient(180deg, #fffcc2 0%, #f9e135 35%, #f6b01c 70%, #e0560c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.06em #4a1408;
  paint-order: stroke fill;
  filter: drop-shadow(0 0.07em 0 #a0381c) drop-shadow(0 0 22px rgba(255, 190, 60, 0.55));
}

.ws-close {
  appearance: none;
  border: none;
  cursor: pointer;
  margin-top: clamp(4px, 1vh, 12px);
  padding: 14px 44px;
  font-family: inherit;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  color: #2a0d00;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  border-radius: 999px;
  box-shadow: 0 6px 0 #b85c00, 0 12px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ws-close.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ws-close:active { transform: translateY(3px); box-shadow: 0 3px 0 #b85c00; }

@media (prefers-reduced-motion: reduce) {
  .ws-rays, .ws-icon { animation: none; }
}

/* ---------- Stats panel ---------- */
.stats-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 4, 20, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.stats-panel.show {
  opacity: 1;
  pointer-events: auto;
}

.stats-inner {
  width: min(90vw, 360px);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 18px 20px 22px;
}

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stats-head h3 { margin: 0; font-size: 1.05rem; }
.stats-head button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
}

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.stats-list .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.stats-total {
  margin: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: right;
}

.reset-btn {
  margin-top: 10px;
  width: 100%;
  background: rgba(230, 57, 86, 0.15);
  border: 1px solid rgba(230, 57, 86, 0.5);
  color: #ff9eb0;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
}
.reset-btn:hover { background: rgba(230, 57, 86, 0.28); }

/* ---------- PIN overlay ---------- */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 4, 20, 0.82);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pin-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.pin-card {
  position: relative;
  width: min(90vw, 320px);
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 28px 22px 24px;
  text-align: center;
}

.pin-card h3 {
  margin: 0 0 2px;
  font-size: 1.1rem;
}

.pin-sub {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.pin-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
}
.pin-back:hover { background: rgba(255,255,255,0.16); }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pin-dots span.filled {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.1);
}

.pin-dots.shake {
  animation: pinShake 0.4s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.pin-error {
  min-height: 1.1em;
  margin: 0 0 10px;
  color: #ff9eb0;
  font-size: 0.8rem;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-keypad button {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 14px 0;
  min-height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.1s ease, transform 0.1s ease;
}

.pin-keypad button:active { background: rgba(255,255,255,0.18); transform: scale(0.96); }
.pin-keypad .pin-clear,
.pin-keypad .pin-back-key {
  background: rgba(230, 57, 86, 0.12);
  color: #ff9eb0;
  font-size: 0.95rem;
}

/* =========================================================
   FERNSEHER / QUERFORMAT (16:9, z.B. 1920x1080 oder 4K)
   Logo links, Rad + Fledermaus gross in der Mitte, Button rechts.
   Alles in vh/vw -> skaliert auf jede TV-Groesse, kein Scrollen.
========================================================== */
@media (min-aspect-ratio: 4/3) {
  html, body { overflow: hidden; }

  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 2vw;
    height: 100vh;
    min-height: 0;
    padding: 3vh 3.5vw; /* Sicherheitsrand gegen Overscan des Fernsehers */
  }

  .title-block {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    align-self: center;
  }

  .logo {
    width: min(26vw, 52vh);
    margin-bottom: 1.5vh;
  }

  .subtitle {
    font-size: max(1rem, 2.3vh);
    max-width: 24vw;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }

  .wheel-wrap {
    --wheel: min(58vh, 42vw);
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0 0 1vh;
  }

  .spin-cta {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    font-size: max(1.1rem, 3vh);
    padding: 2vh 4.5vh;
    box-shadow: 0 0.8vh 0 #b85c00, 0 1.4vh 3vh rgba(0, 0, 0, 0.45);
    transform: translateY(-5vh);
  }

  .spin-cta:hover { transform: translateY(calc(-5vh - 2px)); }
  .spin-cta:active { transform: translateY(calc(-5vh + 2px)); }
  .spin-cta:disabled { transform: translateY(-5vh); }

  .status {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    margin: 0;
    transform: translateY(5vh);
    font-size: max(0.95rem, 2.2vh);
    max-width: 24vw;
    justify-self: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }

  .settings-gear {
    width: max(44px, 4.5vh);
    height: max(44px, 4.5vh);
  }
}

