/* Fucsia Lucky Wheel — lacquer cabinet, brass bezel, fuchsia sectors. */

:root {
  --lacquer: #2a0616;
  --lacquer-deep: #190309;
  --fuchsia: #e6007e;
  --fuchsia-deep: #8a0049;
  --brass: #d9a94c;
  --brass-light: #f7e3a1;
  --cream: #fff4f8;

  --bezel: min(92vw, min(420px, 56vh));
  --display: "Big Shoulders Display", "Haettenschweiler", "Arial Narrow", sans-serif;
  --script: "Caveat", "Bradley Hand", "Segoe Script", cursive;
  --body: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(118% 78% at 50% 6%, #4a0d26 0%, var(--lacquer) 42%, var(--lacquer-deep) 100%);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 4vh, 34px) 20px calc(clamp(14px, 4vh, 34px) + env(safe-area-inset-bottom));
  gap: 12px;
}

/* ---------- cabinet signage ---------- */

.wordmark {
  font-family: var(--script);
  font-weight: 700;
  font-size: clamp(42px, 13vw, 62px);
  line-height: 1;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--brass-light);
  text-shadow: 0 2px 0 #6d4d12, 0 0 26px rgba(230, 0, 126, 0.5);
}

.wordmark .star {
  display: inline-block;
  margin: 0 -0.07em;
  font-size: 0.86em;
  transform: translateY(0.1em);
  color: var(--fuchsia);
  text-shadow: 0 0 18px rgba(230, 0, 126, 0.95);
}

.tagline {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #e7bcd2;
  letter-spacing: 0.01em;
}

.sign { text-align: center; }

/* ---------- bezel ---------- */

.bezel {
  position: relative;
  width: var(--bezel);
  height: var(--bezel);
  flex: none;
  border-radius: 50%;
  background:
    conic-gradient(from 210deg, #6b4d16, #e7c877 14%, #8d6a20 28%, #f3dc9c 44%,
                   #7c5a19 60%, #e1bd62 76%, #6b4d16 92%, #6b4d16);
  padding: calc(var(--bezel) * 0.062);
  box-shadow:
    0 0 0 2px #41300d,
    0 18px 44px rgba(0, 0, 0, 0.6),
    0 0 70px rgba(230, 0, 126, 0.3);
}

.bezel::after { /* inner lip shadow so the wheel sits down inside the ring */
  content: "";
  position: absolute;
  inset: calc(var(--bezel) * 0.055);
  border-radius: 50%;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  z-index: 3;
}

.bulb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--bezel) * 0.042);
  height: calc(var(--bezel) * 0.042);
  margin: calc(var(--bezel) * -0.021) 0 0 calc(var(--bezel) * -0.021);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #fffbe9, var(--brass-light) 48%, #b9893a);
  box-shadow: 0 0 8px rgba(255, 240, 190, 0.9);
  opacity: 0.34;
  animation: bulb 2s linear infinite;
  z-index: 4;
}

@keyframes bulb {
  0%, 72% { opacity: 0.3; box-shadow: 0 0 5px rgba(255, 240, 190, 0.35); }
  82% { opacity: 1; box-shadow: 0 0 14px rgba(255, 243, 205, 1); }
  100% { opacity: 0.3; box-shadow: 0 0 5px rgba(255, 240, 190, 0.35); }
}

.spinning .bulb { animation-duration: 0.75s; }

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

.wheel-well {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lacquer-deep);
  z-index: 1;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--bezel) * 0.17);
  height: calc(var(--bezel) * 0.17);
  margin: calc(var(--bezel) * -0.085) 0 0 calc(var(--bezel) * -0.085);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #f6e2a6, var(--brass) 52%, #7d5a18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), inset 0 0 0 2px #4e3a0e;
  z-index: 5;
  display: grid;
  place-items: center;
}

.hub::after {
  content: "";
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #ff7ec4, var(--fuchsia) 60%, #6d0038);
  box-shadow: 0 0 10px rgba(230, 0, 126, 0.9);
}

.pointer {
  position: absolute;
  top: calc(var(--bezel) * -0.022);
  left: 50%;
  width: calc(var(--bezel) * 0.085);
  height: calc(var(--bezel) * 0.15);
  margin-left: calc(var(--bezel) * -0.0425);
  z-index: 6;
  transform-origin: 50% 12%;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.65));
}

.pointer svg { display: block; width: 100%; height: 100%; }
.pointer.tick { animation: tick 110ms ease-out; }

@keyframes tick {
  0% { transform: rotate(0deg); }
  38% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- controls ---------- */

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}

#spin {
  width: 100%;
  padding: 17px 0 19px;
  border: 0;
  border-radius: 14px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #3b1f00;
  background: linear-gradient(180deg, #ffeeba 0%, var(--brass) 46%, #ad7f27 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -4px 0 rgba(90, 60, 8, 0.5),
    0 7px 0 #6d4d12,
    0 12px 26px rgba(0, 0, 0, 0.55);
  touch-action: manipulation;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease;
}

#spin:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(90, 60, 8, 0.5),
    0 2px 0 #6d4d12,
    0 5px 14px rgba(0, 0, 0, 0.5);
}

#spin:disabled { filter: saturate(0.45) brightness(0.72); cursor: default; }

:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 3px; }

.notice {
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.45;
  color: #f0cada;
  padding: 14px 18px;
  border: 1px solid rgba(217, 169, 76, 0.4);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  width: 100%;
}

.notice b { color: var(--brass-light); font-weight: 600; }

.sound {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: var(--brass);
  cursor: pointer;
  z-index: 60;
}

.sound svg { width: 21px; height: 21px; }
.hidden { display: none !important; }

/* ---------- result ---------- */

.dim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(14, 2, 10, 0.72);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 320ms ease both;
}

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

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

.plaque {
  position: relative;
  z-index: 50;
  max-width: 330px;
  width: 100%;
  text-align: center;
  padding: 30px 26px 26px;
  border-radius: 18px;
  border: 2px solid var(--brass);
  background: linear-gradient(170deg, #45082a 0%, #2a0616 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 233, 180, 0.25);
}

.plaque h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 9.6vw, 42px);
  line-height: 0.96;
  text-wrap: balance;
  color: var(--brass-light);
  text-shadow: 0 0 26px rgba(230, 0, 126, 0.65);
}

.plaque.lose h2 { color: #f3cede; text-shadow: none; }
.plaque p { margin: 12px 0 0; font-size: 15px; color: #eec6da; }

.plaque.win {
  animation: fade 320ms ease both, pulse 2.4s ease-in-out 320ms infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
                0 0 0 0 rgba(230, 0, 126, 0), inset 0 0 0 1px rgba(255, 233, 180, 0.25);
  }
  50% {
    transform: scale(1.035);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.7),
                0 0 44px 6px rgba(230, 0, 126, 0.42), inset 0 0 0 1px rgba(255, 233, 180, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bulb, .plaque.win, .pointer.tick { animation: none !important; }
  .plaque.win { animation: fade 320ms ease both !important; }
  .bulb { opacity: 0.75; }
}

@media (max-height: 620px) {
  .tagline { display: none; }
  .wordmark { font-size: 38px; }
  #spin { padding: 13px 0 15px; font-size: 25px; }
}
