:root {
  color-scheme: light;
  --sunset: #ff6a2a;
  --orange: #ff9815;
  --gold: #ffd45b;
  --cream: #fff3d7;
  --paper: #fff8e8;
  --red: #ef4738;
  --brown: #70400c;
  --shadow: 0 20px 42px rgba(180, 83, 0, 0.28);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--brown);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 252, 223, 0.95) 0 15%, transparent 39%),
    linear-gradient(180deg, #f45c28 0%, #ff9a12 32%, #ffe4b9 74%, #fff5df 100%);
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(100%, 740px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 24px 36px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.hero {
  text-align: center;
  color: white;
  text-shadow: 0 3px 0 rgba(115, 52, 0, 0.2);
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 900;
}

.reward-line {
  margin: 22px 0 14px;
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 900;
}

.reward-line::before,
.reward-line::after {
  content: "✨";
  margin: 0 10px;
  font-size: 0.9em;
}

.max-pill {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 11px 24px;
  border-radius: 999px;
  color: #fff9e9;
  background: rgba(255, 230, 185, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(189, 75, 0, 0.14);
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  font-weight: 900;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 500px;
  padding: 12px 0 20px;
}

.decor {
  position: absolute;
  z-index: 0;
  font-size: clamp(1.8rem, 6vw, 2.9rem);
  filter: drop-shadow(0 8px 8px rgba(172, 83, 0, 0.18));
  opacity: 0.88;
}

.decor-money {
  left: 4%;
  top: 52%;
}

.decor-star {
  right: 3%;
  top: 58%;
}

.wheel-wrap {
  position: relative;
  z-index: 1;
  width: min(82vw, 430px);
  min-width: 330px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(var(--shadow));
}

.wheel {
  position: absolute;
  inset: 0;
  isolation: isolate;
  border: 10px solid #ffd65a;
  border-radius: 50%;
  background: conic-gradient(
    from -22.5deg,
    #ef4738 0deg 45deg,
    #ffd054 45deg 90deg,
    #f18b21 90deg 135deg,
    #fff0bd 135deg 180deg,
    #ef4738 180deg 225deg,
    #ffd054 225deg 270deg,
    #f18b21 270deg 315deg,
    #fff0bd 315deg 360deg
  );
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.65),
    inset 0 0 0 52px rgba(255, 248, 222, 0.08);
  overflow: hidden;
  transition: transform 4.8s cubic-bezier(0.12, 0.72, 0.07, 1);
}

.wheel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 7.5deg,
    #ea4032 7.5deg 11deg,
    transparent 11deg 15deg
  );
  mask: radial-gradient(circle, transparent 0 84%, #000 85% 100%);
  pointer-events: none;
  z-index: 1;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 29%;
  border-radius: 50%;
  background: #ef4738;
  box-shadow:
    inset 0 0 0 4px rgba(255, 211, 91, 0.78),
    0 5px 14px rgba(122, 42, 0, 0.22);
  pointer-events: none;
  z-index: 1;
}

.segment-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 4;
  min-width: 58px;
  transform: translate(-50%, -50%) rotate(var(--angle));
  transform-origin: center;
  color: #67360a;
  font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.segment-label.is-red {
  color: white;
  text-shadow: 0 2px 0 rgba(129, 41, 0, 0.23);
}

.coin {
  position: absolute;
  z-index: 3;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff1a8 0 20%, #d06411 22% 100%);
  box-shadow: inset 0 0 0 1px rgba(117, 58, 0, 0.16);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.gem {
  position: absolute;
  z-index: 3;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #63c6ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.pointer {
  position: absolute;
  top: -17px;
  z-index: 5;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 44px solid #ef4738;
  filter: drop-shadow(0 5px 5px rgba(116, 45, 0, 0.25));
}

.center-button {
  position: relative;
  z-index: 6;
  width: 24%;
  min-width: 74px;
  aspect-ratio: 1;
  border: 4px solid #ffd65a;
  border-radius: 50%;
  color: white;
  background: #ef4738;
  box-shadow: 0 8px 18px rgba(105, 37, 0, 0.22);
  cursor: pointer;
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  font-weight: 1000;
  letter-spacing: 0;
}

.draw-button {
  min-height: 64px;
  width: min(100%, 514px);
  margin: 0 auto;
  border: 0;
  border-radius: 12px;
  color: #69440d;
  background: linear-gradient(90deg, #ffe26d 0%, #ffc337 48%, #ffa713 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 22px rgba(181, 88, 0, 0.15);
  cursor: pointer;
  font-size: clamp(1.2rem, 4.2vw, 1.55rem);
  font-weight: 1000;
}

.draw-button:disabled,
.center-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.draw-button:focus-visible,
.center-button:focus-visible,
.modal-button:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.82);
  outline-offset: 3px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(96, 39, 0, 0.42);
  backdrop-filter: blur(7px);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(390px, 100%);
  border-radius: 12px;
  padding: 28px;
  color: #663707;
  background: linear-gradient(180deg, #fff9e8, #ffd98c);
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-kicker {
  margin: 0 0 12px;
  color: #ef4738;
  font-weight: 1000;
}

.modal h2 {
  margin: 0;
  font-size: clamp(2.4rem, 12vw, 4.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.modal-button {
  min-width: 132px;
  min-height: 46px;
  margin-top: 24px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #ef4738;
  cursor: pointer;
  font-weight: 1000;
}

@media (max-width: 560px) {
  .page-shell {
    padding: 26px 18px 28px;
  }

  .stage {
    min-height: 470px;
    padding-top: 10px;
  }

  .wheel-wrap {
    width: min(90vw, 380px);
    min-width: 305px;
  }

  .decor-money {
    left: 2%;
    top: 58%;
  }

  .decor-star {
    right: 1%;
    top: 61%;
  }
}
