/* ============ WOODSTOCK DINNER WHEEL — psychedelic arcade cabinet ============ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --pink: #ff2d95;
  --orange: #ff9100;
  --yellow: #ffea00;
  --lime: #76ff03;
  --cyan: #00e5ff;
  --purple: #b388ff;
  --magenta: #ea80fc;
  --ink: #0d0018;
  --panel: rgba(20, 2, 38, 0.92);
}

html, body { height: 100%; }

body {
  background: var(--ink);
  color: #fff;
  font-family: 'Bungee', 'Arial Black', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ---------- background layers ---------- */

.bg-swirl {
  position: fixed;
  inset: -60%;
  z-index: -4;
  background:
    conic-gradient(from 0deg at 50% 50%,
      #ff006e, #fb5607, #ffbe0b, #8ac926, #00f5d4, #00bbf9,
      #8338ec, #ff006e, #fb5607, #ffbe0b, #8ac926, #00f5d4, #00bbf9, #8338ec, #ff006e);
  animation: swirl 46s linear infinite, hueDrift 18s linear infinite;
  opacity: 0.5;
  filter: saturate(1.4) brightness(0.65);
}

@keyframes swirl {
  to { transform: rotate(360deg) scale(1.15); }
}
@keyframes hueDrift {
  to { filter: saturate(1.4) brightness(0.65) hue-rotate(360deg); }
}

/* lava-lamp blobs */
.blobs { position: fixed; inset: 0; z-index: -3; overflow: hidden; }
.blob {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: screen;
  opacity: 0.5;
}
.b1 { background: #ff2d95; top: -10%; left: -8%;  animation: drift1 26s ease-in-out infinite alternate; }
.b2 { background: #00e5ff; top: 30%;  left: 60%;  animation: drift2 31s ease-in-out infinite alternate; }
.b3 { background: #ffea00; top: 55%;  left: -12%; animation: drift3 24s ease-in-out infinite alternate; }
.b4 { background: #8338ec; top: -15%; left: 45%;  animation: drift1 35s ease-in-out infinite alternate-reverse; }
.b5 { background: #76ff03; top: 60%;  left: 55%;  animation: drift2 28s ease-in-out infinite alternate-reverse; }
.b6 { background: #ff6d00; top: 20%;  left: 20%;  animation: drift3 38s ease-in-out infinite alternate; }

@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(18vw, 22vh) scale(1.35); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1.2); }
  100% { transform: translate(-24vw, -18vh) scale(0.9); }
}
@keyframes drift3 {
  0%   { transform: translate(0, 0) scale(0.9) rotate(0deg); }
  100% { transform: translate(14vw, -20vh) scale(1.3) rotate(90deg); }
}

/* kaleidoscope starburst behind the wheel */
.rays {
  position: fixed;
  left: 50%;
  top: 46%;
  width: 160vmax;
  height: 160vmax;
  transform: translate(-50%, -50%);
  z-index: -2;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 255, 255, 0.055) 0deg 5deg,
    transparent 5deg 11deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 46%);
  mask-image: radial-gradient(circle, #000 0%, transparent 46%);
  animation: raysSpin 70s linear infinite;
  pointer-events: none;
}
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* retro CRT scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0.28) 0px, rgba(0, 0, 0, 0.28) 1px,
    transparent 1px, transparent 4px);
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 39;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 0, 12, 0.75) 100%);
}

/* ---------- header ---------- */

.cab-header {
  text-align: center;
  padding: 2.2rem 1rem 0.4rem;
  z-index: 2;
}

.coin-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.5rem, 1.4vw, 0.7rem);
  color: var(--yellow);
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px var(--yellow), 0 0 22px rgba(255, 234, 0, 0.6);
  animation: blinkTag 1.6s steps(2, start) infinite;
  margin-bottom: 0.9rem;
}
@keyframes blinkTag { 50% { opacity: 0.25; } }

.neon-title {
  font-family: 'Monoton', cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 7.5vw, 4.6rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
}
.neon-title .ltr {
  display: inline-block;
  animation: neonFlicker 3.4s linear infinite;
}
@keyframes neonFlicker {
  0%, 6.5%, 8%, 100% { opacity: 1; }
  7% { opacity: 0.55; }
  41%, 42.5% { opacity: 0.7; }
  43.5%, 100% { opacity: 1; }
}

.tagline {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.45rem, 1.3vw, 0.65rem);
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
  margin-top: 0.9rem;
  letter-spacing: 0.08em;
}

/* ---------- wheel stage ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  width: 100%;
  padding: 0.6rem 1rem 1rem;
  z-index: 2;
}

.wheel-wrap {
  width: min(88vw, 58vh, 620px);
  aspect-ratio: 1;
  position: relative;
  filter: drop-shadow(0 0 34px rgba(255, 45, 149, 0.35)) drop-shadow(0 0 90px rgba(131, 56, 236, 0.3));
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- arcade button ---------- */

.arcade-btn {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  color: #fff;
  background: linear-gradient(180deg, #ff5db1 0%, #ff2d95 45%, #c1006b 100%);
  border: 4px solid #fff;
  border-radius: 18px;
  padding: 0.85rem 3.2rem;
  cursor: pointer;
  position: relative;
  text-shadow: 0 2px 0 rgba(90, 0, 45, 0.65), 0 0 14px rgba(255, 255, 255, 0.5);
  box-shadow:
    0 8px 0 #7a0044,
    0 12px 26px rgba(0, 0, 0, 0.55),
    0 0 26px rgba(255, 45, 149, 0.85),
    0 0 70px rgba(255, 45, 149, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.55);
  animation: btnPulse 1.5s ease-in-out infinite;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@keyframes btnPulse {
  0%, 100% {
    box-shadow:
      0 8px 0 #7a0044, 0 12px 26px rgba(0,0,0,0.55),
      0 0 26px rgba(255,45,149,0.85), 0 0 70px rgba(255,45,149,0.4),
      inset 0 2px 3px rgba(255,255,255,0.55);
  }
  50% {
    box-shadow:
      0 8px 0 #7a0044, 0 12px 26px rgba(0,0,0,0.55),
      0 0 44px rgba(255,45,149,1), 0 0 110px rgba(255,45,149,0.65),
      inset 0 2px 3px rgba(255,255,255,0.55);
  }
}
.arcade-btn:hover { filter: brightness(1.12); }
.arcade-btn:active, .arcade-btn.pressed {
  transform: translateY(7px);
  box-shadow:
    0 1px 0 #7a0044, 0 4px 12px rgba(0,0,0,0.5),
    0 0 30px rgba(255,45,149,0.9),
    inset 0 2px 3px rgba(255,255,255,0.4);
  animation: none;
}
.arcade-btn:disabled {
  filter: grayscale(0.5) brightness(0.75);
  cursor: wait;
  animation: none;
}
.arcade-btn.small {
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  padding: 0.7rem 2rem;
  border-radius: 14px;
}

.hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
}
.hint kbd {
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--yellow);
}

.history {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--purple);
  text-shadow: 0 0 8px rgba(179, 136, 255, 0.7);
  min-height: 1em;
  letter-spacing: 0.05em;
}

/* ---------- footer ticker ---------- */

.cab-footer { width: 100%; z-index: 2; }

.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 0, 22, 0.6);
  padding: 0.45rem 0;
}
.ticker-inner {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--lime);
  text-shadow: 0 0 8px rgba(118, 255, 3, 0.8);
  animation: tickScroll 36s linear infinite;
  will-change: transform;
}
@keyframes tickScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.foot {
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.7rem 1rem 1rem;
}

/* ---------- mute button ---------- */

.mute-btn {
  position: fixed;
  top: 0.8rem;
  right: 0.9rem;
  z-index: 60;
  font-size: 1.15rem;
  background: rgba(20, 2, 38, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.2s;
}
.mute-btn:hover { transform: scale(1.12); border-color: var(--cyan); }

/* ---------- winner overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 42%, rgba(131, 56, 236, 0.35), rgba(5, 0, 12, 0.88) 70%);
  animation: overlayIn 0.35s ease-out;
}
.overlay.hidden { display: none; }

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.win-card {
  text-align: center;
  background: var(--panel);
  border: 4px solid var(--yellow);
  border-radius: 26px;
  padding: clamp(1.4rem, 4vw, 2.8rem) clamp(1.6rem, 5vw, 3.4rem);
  max-width: min(92vw, 640px);
  box-shadow:
    0 0 30px rgba(255, 234, 0, 0.55),
    0 0 90px rgba(255, 45, 149, 0.45),
    inset 0 0 40px rgba(131, 56, 236, 0.35);
  animation: cardPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both, borderFlash 0.9s linear infinite;
}
@keyframes cardPop {
  from { transform: scale(0.4) rotate(-6deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes borderFlash {
  0%, 100% { border-color: var(--yellow); box-shadow: 0 0 30px rgba(255,234,0,0.55), 0 0 90px rgba(255,45,149,0.45), inset 0 0 40px rgba(131,56,236,0.35); }
  33%      { border-color: var(--pink);   box-shadow: 0 0 30px rgba(255,45,149,0.6), 0 0 90px rgba(0,229,255,0.45), inset 0 0 40px rgba(255,45,149,0.3); }
  66%      { border-color: var(--cyan);   box-shadow: 0 0 30px rgba(0,229,255,0.6), 0 0 90px rgba(118,255,3,0.4), inset 0 0 40px rgba(0,229,255,0.3); }
}

.win-kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.55rem, 1.6vw, 0.75rem);
  color: var(--lime);
  text-shadow: 0 0 10px rgba(118, 255, 3, 0.9);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  animation: blinkTag 1.1s steps(2, start) infinite;
}

.win-name {
  font-family: 'Monoton', cursive;
  font-weight: 400;
  font-size: clamp(1.9rem, 6.5vw, 3.8rem);
  line-height: 1.15;
  color: #fff;
  text-shadow:
    0 0 10px #fff,
    0 0 26px var(--pink),
    0 0 55px var(--pink),
    0 0 90px var(--magenta);
  animation: winHue 4s linear infinite;
  margin-bottom: 0.9rem;
  overflow-wrap: break-word;
}
@keyframes winHue {
  to { filter: hue-rotate(360deg); }
}

.win-tag {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.5rem, 1.5vw, 0.65rem);
  color: var(--ink);
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  letter-spacing: 0.08em;
  box-shadow: 0 0 18px rgba(255, 234, 0, 0.6);
  margin-bottom: 1rem;
}

.win-blurb {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  color: var(--purple);
  text-shadow: 0 0 12px rgba(179, 136, 255, 0.8);
  margin-bottom: 1.6rem;
}

.win-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.maps-link {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 2px dotted var(--cyan);
  padding-bottom: 2px;
}
.maps-link:hover { color: #fff; border-bottom-color: #fff; text-shadow: 0 0 10px var(--cyan); }

.respin {
  display: block;
  margin: 1.2rem auto 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  transition: color 0.2s, text-shadow 0.2s;
}
.respin:hover { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }

/* ---------- confetti ---------- */

#confetti {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}

/* ---------- helpers ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* win flash on the whole cabinet */
body.won .bg-swirl { animation: swirl 4s linear infinite, hueDrift 2s linear infinite; }
body.won .rays { animation-duration: 8s; }

@media (prefers-reduced-motion: reduce) {
  .bg-swirl, .blob, .rays, .ticker-inner, .neon-title .ltr,
  .coin-tag, .arcade-btn, .win-card, .win-kicker, .win-name {
    animation: none !important;
  }
}

@media (max-width: 560px) {
  .wheel-wrap { width: min(94vw, 52vh); }
  .arcade-btn { padding: 0.75rem 2.2rem; }
}
