/* Casino-Halle als Querschnitt-Diorama. */

.hall {
  position: relative;
  min-height: 100%;
  padding: var(--s4) calc(var(--s3) + var(--safe-right)) calc(var(--s6) + var(--safe-bottom)) calc(var(--s3) + var(--safe-left));
  overflow: hidden;
}

.hall-ambient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hall > *:not(.hall-ambient) {
  position: relative;
  z-index: 1;
}

/* Lichtkegel von der Decke */
.hall::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 520px;
  background:
    conic-gradient(from 180deg at 18% -20%, transparent 0 168deg, color-mix(in srgb, var(--accent) 14%, transparent) 175deg 185deg, transparent 192deg),
    conic-gradient(from 180deg at 82% -20%, transparent 0 168deg, color-mix(in srgb, var(--accent-2) 12%, transparent) 175deg 185deg, transparent 192deg);
  pointer-events: none;
  animation: beams 9s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes beams {
  from { opacity: 0.6; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(12px); }
}

/* ---------- Leuchtschild ---------- */

.hall-sign {
  margin: var(--s2) auto var(--s4);
  text-align: center;
}

.hall-sign h1 {
  margin: 0;
  font-size: var(--fs-xxl);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 4px #fff,
    0 0 14px var(--accent),
    0 0 34px var(--accent),
    0 0 60px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: sign-flicker 7s linear infinite;
}

.hall-sign h1 .flick {
  animation: letter-flicker 5.3s linear infinite;
}

.hall-sign p {
  margin: var(--s2) 0 0;
  color: var(--accent-2);
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--accent-2);
}

@keyframes sign-flicker {
  0%, 18%, 20%, 62%, 64%, 100% { opacity: 1; }
  19%, 63% { opacity: 0.82; }
}

@keyframes letter-flicker {
  0%, 40%, 42%, 44%, 100% { opacity: 1; }
  41%, 43% { opacity: 0.25; }
}

/* ---------- Bonus-Leiste ---------- */

.hall-perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin: 0 auto var(--s4);
  max-width: 900px;
}

.perk {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255, 197, 61, 0.16), rgba(255, 197, 61, 0.04));
  border: 1px solid rgba(255, 197, 61, 0.5);
  box-shadow: 0 0 20px rgba(255, 197, 61, 0.18);
  animation: pop-in var(--t-slow) var(--ease-spring) both;
}

.perk-ico {
  font-size: 26px;
}

.perk strong {
  display: block;
  font-size: var(--fs-sm);
}

.perk small {
  color: var(--ink-dim);
  font-size: var(--fs-xs);
}

/* ---------- Bereiche ---------- */

.zones {
  display: grid;
  gap: var(--s5);
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 1000px) {
  .zones {
    grid-template-columns: 1.15fr 1fr;
    grid-template-areas:
      "lounge lounge"
      "slots tables"
      "arcade arcade";
  }
  .zone-lounge { grid-area: lounge; }
  .zone-slots { grid-area: slots; }
  .zone-tables { grid-area: tables; }
  .zone-arcade { grid-area: arcade; }
}

.zone {
  position: relative;
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s3) 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 64px),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  box-shadow: inset 0 -80px 80px -60px rgba(0, 0, 0, 0.6), var(--shadow-1);
  overflow: hidden;
}

.zone-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin: 0 0 var(--s2);
  font-size: var(--fs-md);
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 6px var(--zone-color, var(--accent)), 0 0 18px var(--zone-color, var(--accent));
}

.zone-sign::before,
.zone-sign::after {
  content: "";
  height: 2px;
  width: 28px;
  border-radius: 2px;
  background: var(--zone-color, var(--accent));
  box-shadow: 0 0 8px var(--zone-color, var(--accent));
}

.zone-slots { --zone-color: var(--pink); }
.zone-tables { --zone-color: var(--lime); }
.zone-arcade { --zone-color: var(--cyan); }

/* Boden mit perspektivischem Raster */
.zone-floor {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: var(--s3) var(--s2);
  padding: var(--s3) 0 var(--s4);
}

.zone-floor::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: 0;
  height: 70px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--zone-color) 30%, transparent) 1px, transparent 1px) 0 0 / 40px 100%,
    linear-gradient(0deg, color-mix(in srgb, var(--zone-color) 30%, transparent) 1px, transparent 1px) 0 0 / 100% 14px,
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--zone-color) 10%, transparent));
  transform: perspective(160px) rotateX(55deg);
  transform-origin: bottom;
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Automaten ---------- */

.machine {
  --m-glow: var(--zone-color, var(--accent));
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: var(--m-w, 132px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  touch-action: manipulation;
  transition: transform var(--t-med) var(--ease-spring), filter var(--t-med);
}

.machine svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.machine::after {
  /* Bodenschatten + Lichtpfütze */
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 30px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--m-glow) 50%, transparent), transparent);
  filter: blur(4px);
  z-index: -1;
  opacity: 0.7;
  transition: opacity var(--t-med);
}

.machine-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 34px;
  line-height: 1.15;
}

.machine-plate strong {
  font-size: var(--fs-sm);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.machine-plate small {
  font-size: 11px;
  color: var(--ink-dim);
  font-weight: 700;
}

.machine-best {
  position: absolute;
  top: 2px;
  right: -4px;
  z-index: 2;
}

@media (hover: hover) {
  .machine:hover {
    transform: translateY(-6px) scale(1.03);
  }
  .machine:hover::after {
    opacity: 1;
  }
}

.machine:active {
  transform: translateY(-2px) scale(0.98);
}

.machine:focus-visible {
  outline: none;
}

.machine:focus-visible svg {
  filter: drop-shadow(0 0 10px var(--m-glow)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.m-table { --m-w: 200px; }
.m-wide { --m-w: 150px; }

@media (max-width: 520px) {
  .machine { --m-w: 102px; }
  .m-table { --m-w: 158px; }
  .m-wide { --m-w: 118px; }
  .zone-floor { gap: var(--s3) 6px; }
  .machine-plate strong { font-size: 12px; }
  .machine-plate small { font-size: 10px; }
}

@media (max-width: 360px) {
  .machine { --m-w: 94px; }
  .m-table { --m-w: 146px; }
  .m-wide { --m-w: 108px; }
}

@media (min-width: 700px) {
  .machine { --m-w: 150px; }
  .m-table { --m-w: 240px; }
  .m-wide { --m-w: 170px; }
}

@media (min-width: 1000px) {
  .m-table { --m-w: 280px; }
}

/* ---------- SVG-Animationen ---------- */

.bulb {
  animation: bulb 1.2s steps(1) infinite;
}

@keyframes bulb {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.blink {
  animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.reel-strip {
  animation: reel-scroll var(--d, 3s) linear infinite;
}

@keyframes reel-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(var(--dist, -60px)); }
}

.spin-slow {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 14s linear infinite;
}

.spin-rev {
  transform-box: view-box;
  animation: spin-rev 5s linear infinite;
}

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

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

.pusher-bar {
  animation: pusher 2.4s ease-in-out infinite alternate;
}

@keyframes pusher {
  from { transform: translateY(0); }
  to { transform: translateY(9px); }
}

.hoop-ball {
  animation: hoop-ball 2.6s cubic-bezier(0.3, 0, 0.7, 1) infinite;
}

@keyframes hoop-ball {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  8% { opacity: 1; }
  45% { transform: translate(2px, -78px) scale(0.62); }
  62% { transform: translate(4px, -58px) scale(0.55); }
  80% { transform: translate(4px, -30px) scale(0.55); opacity: 1; }
  100% { transform: translate(4px, -10px) scale(0.55); opacity: 0; }
}

.stack-row {
  animation: stack-move 1.6s steps(4) infinite alternate;
}

@keyframes stack-move {
  from { transform: translateX(0); }
  to { transform: translateX(32px); }
}

.screen-glow {
  animation: screen-glow 3.4s ease-in-out infinite;
}

@keyframes screen-glow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

.lamp-cone {
  animation: lamp 6s ease-in-out infinite;
}

@keyframes lamp {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.8; }
}

/* ---------- Fußleiste der Halle ---------- */

.hall-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2);
  margin: var(--s5) auto 0;
}

.hall-note {
  max-width: 640px;
  margin: var(--s4) auto 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: var(--fs-xs);
}

.hall-note a {
  color: var(--ink-dim);
}

/* Reduzierte Bewegung: Deko anhalten */
.reduce-motion .bulb,
.reduce-motion .blink,
.reduce-motion .reel-strip,
.reduce-motion .spin-slow,
.reduce-motion .spin-rev,
.reduce-motion .pusher-bar,
.reduce-motion .hoop-ball,
.reduce-motion .stack-row,
.reduce-motion .screen-glow,
.reduce-motion .lamp-cone,
.reduce-motion .hall::before,
.reduce-motion .hall-sign h1,
.reduce-motion .hall-sign h1 .flick {
  animation: none !important;
}

.chase {
  animation: chase var(--cd, 1.44s) linear infinite;
  opacity: 0.25;
}

@keyframes chase {
  0% { opacity: 1; }
  12% { opacity: 1; }
  30% { opacity: 0.25; }
  100% { opacity: 0.25; }
}

.reduce-motion .chase {
  animation: none !important;
  opacity: 0.8;
}

/* LED-Laufschrift */
.hall-ticker {
  position: relative;
  max-width: 720px;
  margin: 0 auto var(--s4);
  overflow: hidden;
  border-radius: var(--r-sm);
  background: #07040e;
  border: 1px solid rgba(255, 197, 61, 0.35);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 197, 61, 0.12);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.hall-ticker::after {
  /* LED-Raster */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 0 1px, rgba(7, 4, 14, 0.55) 1.4px) 0 0 / 3px 3px;
  pointer-events: none;
}

.ticker-track {
  display: inline-flex;
  gap: 48px;
  padding: 7px 0;
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(255, 197, 61, 0.8);
  animation: ticker 30s linear infinite;
}

.ticker-track span:nth-child(3n + 2) { color: var(--cyan); text-shadow: 0 0 6px rgba(45, 226, 230, 0.8); }
.ticker-track span:nth-child(3n) { color: var(--pink); text-shadow: 0 0 6px rgba(255, 61, 154, 0.8); }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.reduce-motion .ticker-track {
  animation: none !important;
}

.plinko-ball {
  animation: plinko-ball 2.4s cubic-bezier(0.4, 0, 0.8, 1) infinite;
}

@keyframes plinko-ball {
  0% { transform: translate(0, 0); opacity: 0; }
  5% { opacity: 1; }
  20% { transform: translate(-6px, 22px); }
  35% { transform: translate(0, 44px); }
  50% { transform: translate(6px, 66px); }
  65% { transform: translate(0, 82px); }
  85% { transform: translate(-6px, 98px); opacity: 1; }
  100% { transform: translate(-6px, 100px); opacity: 0; }
}

.reduce-motion .plinko-ball { animation: none !important; }

.claw-swing {
  animation: claw-swing 4s ease-in-out infinite;
}

@keyframes claw-swing {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-34px); }
}

.reduce-motion .claw-swing { animation: none !important; }

.derby-horse {
  animation: derby 1.8s ease-in-out infinite alternate;
}

@keyframes derby {
  from { transform: translateX(-10px); }
  to { transform: translateX(14px); }
}

.reduce-motion .derby-horse { animation: none !important; }

/* ---------- V1.2: Palast-Lounge (Jukebox & Lotto-Studio) ---------- */

.zone-lounge { --zone-color: #ffc53d; }

.m-fixture { --m-w: 132px; }
@media (max-width: 520px) { .m-fixture { --m-w: 102px; } }
@media (min-width: 700px) { .m-fixture { --m-w: 150px; } }

/* Jukebox: vor dem Kauf dunkel, mit Verkaufsschild */
.fx-jukebox svg { filter: brightness(0.55) saturate(0.5) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); transition: filter 600ms ease; }
.fx-jukebox .jb-notes, .fx-jukebox .jb-led { opacity: 0; }
.fx-jukebox .jb-tube { opacity: 0.25; }
.fx-jukebox .jb-arch { opacity: 0.35; }
.fx-jukebox.is-owned svg { filter: drop-shadow(0 0 10px rgba(255, 140, 60, 0.45)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)); }
.fx-jukebox.is-owned .jb-sale { display: none; }
.fx-jukebox.is-owned .jb-tube { opacity: 0.85; }
.fx-jukebox.is-owned .jb-arch, .fx-jukebox.is-owned .jb-led { opacity: 1; }
.fx-jukebox.is-playing .jb-tube { animation: jb-tube 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.18s); }
.fx-jukebox.is-playing .jb-arch { animation: jb-arch 3.2s linear infinite; }
.fx-jukebox.is-playing .jb-notes { opacity: 1; animation: jb-notes 2.4s ease-in-out infinite; }
.fx-jukebox .fixture-sub { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-jukebox.is-playing .fixture-sub { color: var(--gold); }
/* Einschalten nach dem Kauf: Licht flackert an */
.fx-jukebox.is-powering svg { animation: jb-power 1.4s steps(1, end) both; }
@keyframes jb-tube { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes jb-arch { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes jb-notes { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes jb-power {
  0% { filter: brightness(0.55) saturate(0.5); }
  12% { filter: brightness(1.4); }
  18% { filter: brightness(0.6); }
  30% { filter: brightness(1.3); }
  36% { filter: brightness(0.7); }
  55%, 100% { filter: brightness(1.15) drop-shadow(0 0 16px rgba(255, 197, 61, 0.8)); }
}

/* Lotto-Studio */
.machine[data-game="lotto"] .lt-live { opacity: 0; }
.machine[data-game="lotto"] .lt-ball { animation: lt-bob 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.4s); transform-box: fill-box; transform-origin: center; }
.machine[data-game="lotto"].is-live .lt-live { opacity: 1; animation: blink 1s steps(2, start) infinite; }
.machine[data-game="lotto"].is-live .lt-ball { animation: lt-mix 0.6s linear infinite; animation-delay: calc(var(--i) * -0.1s); }
.machine[data-game="lotto"].has-attention::before {
  content: "";
  position: absolute;
  inset: -6px -6px 34px;
  border-radius: 16px;
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(255, 197, 61, 0.55);
  animation: lt-attn 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes lt-mix { 0% { transform: translate(0, 0); } 25% { transform: translate(6px, -8px); } 50% { transform: translate(-4px, -3px); } 75% { transform: translate(3px, 5px); } 100% { transform: translate(0, 0); } }
@keyframes lt-attn { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.reduce-motion .fx-jukebox .jb-tube, .reduce-motion .fx-jukebox .jb-arch, .reduce-motion .fx-jukebox .jb-notes,
.reduce-motion .machine[data-game="lotto"] .lt-ball, .reduce-motion .machine[data-game="lotto"]::before { animation: none !important; }
.reduce-motion .fx-jukebox.is-powering svg { animation: none; }
@media (min-width: 1000px) {
  .zone-lounge { justify-self: center; width: min(100%, 760px); }
}
