:root { color-scheme: dark; font-family: Arial, Helvetica, sans-serif; background: #1c003f; }
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow-x: hidden; }

body {
  min-height: 100svh;
  color: #fff;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,62,245,.55), transparent 31%),
    radial-gradient(circle at 18% 72%, rgba(0,244,90,.28), transparent 28%),
    linear-gradient(145deg, #090018, #320065 49%, #0b001b);
}

button, a { -webkit-tap-highlight-color: transparent; }

.page {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(15px, env(safe-area-inset-top)) 6px max(20px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image: radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.8px);
  background-size: 36px 36px;
  mask-image: linear-gradient(transparent, #000 22%, #000 85%, transparent);
}

.logo {
  position: relative;
  z-index: 2;
  display: block;
  width: min(570px, 86vw);
  height: auto;
  margin: 0 auto 4px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.55));
}

.game {
  position: relative;
  z-index: 2;
  width: min(1060px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  text-align: center;
  color: #fff;
  text-shadow: 0 4px 2px #31004d, 0 0 10px #ea4dff;
}

.stage {
  position: relative;
  width: min(780px, 97vw);
  aspect-ratio: 1;
  margin-top: 1px;
}

.wheel-wrap {
  position: absolute;
  width: 83%;
  aspect-ratio: 1;
  top: 3%;
  left: 8.5%;
}

.rotor {
  position: absolute;
  inset: 10.3%;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;
  transform: rotate(0deg);
  will-change: transform;
}

.rotor img, .wheel-frame { display: block; width: 100%; height: 100%; }
.rotor img { position: absolute; inset: 0; object-fit: contain; }
.rotor .wheel-base { z-index: 0; }
.rotor .wheel-labels { z-index: 1; }
.wheel-frame { position: absolute; inset: 0; z-index: 0; object-fit: contain; pointer-events: none; }

.pointer {
  position: absolute;
  z-index: 4;
  width: 14%;
  height: auto;
  top: -.5%;
  left: 43%;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.55));
}

.spin {
  position: absolute;
  z-index: 5;
  width: 23%;
  aspect-ratio: 1;
  top: 38.5%;
  left: 38.5%;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent url("assets/burningHot/img/wheel-btn.webp") center / contain no-repeat;
  font: 900 clamp(17px, 3vw, 30px)/1 Arial, sans-serif;
  text-shadow: 0 3px 2px #4d001e, 0 0 6px #fff;
  cursor: pointer;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.52));
  animation: pulse 1.4s ease-in-out infinite;
}

.spin:disabled { cursor: default; animation: none; opacity: .94; }
.spin:focus-visible, .claim:focus-visible, .close:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

.decor { position: absolute; z-index: 3; height: auto; pointer-events: none; filter: drop-shadow(0 8px 7px rgba(0,0,0,.48)); }
.decor-left { width: 25%; left: -5%; bottom: 7%; }
.decor-right { width: 23%; right: -2%; bottom: 7%; }

.status {
  position: relative;
  z-index: 6;
  min-height: 28px;
  margin: -6% 0 0;
  text-align: center;
  font-size: clamp(17px, 2.4vw, 24px);
  font-weight: 900;
  text-shadow: 0 2px 3px #210031;
}

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17,0,38,.86);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(500px, 94vw);
  max-height: calc(100vh - 28px);
  max-height: calc(100svh - 28px);
  padding: 34px 24px 29px;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  border: 4px solid #ffd434;
  border-radius: 28px;
  color: #fff;
  background: radial-gradient(circle at 50% 22%, #d448fa, #5920b7 55%, #23005c);
  box-shadow: 0 0 0 6px #a15000, 0 18px 70px rgba(0,0,0,.72), inset 0 0 30px rgba(255,255,255,.18);
}

.win-art { display: block; width: min(82vw, 420px); max-width: 100%; max-height: min(18vh, 110px); max-height: min(18svh, 110px); height: auto; object-fit: contain; margin: 0 auto 12px; }
.modal h2 { margin: 4px 0 8px; font-size: clamp(25px, 7vw, 39px); text-shadow: 0 3px 2px #450063; }
.modal p { margin: 0; font-size: 20px; font-weight: 800; }
.result { display: block; margin: 5px 0 20px; color: #ffe43c; font-size: clamp(31px, 9vw, 48px); text-shadow: 0 3px 2px #692d00; }

.claim {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 230px;
  min-height: 62px;
  padding: 14px 30px;
  border: 3px solid #efff9c;
  border-radius: 999px;
  color: #163600;
  background: linear-gradient(#dcff55, #6ee000 58%, #3a9a00);
  box-shadow: 0 5px 0 #1d6000, 0 8px 22px rgba(0,0,0,.42);
  text-decoration: none;
  font-size: 25px;
  font-weight: 900;
}

.close { position: absolute; top: 8px; right: 12px; border: 0; color: #fff; background: transparent; font: 700 38px/1 Arial, sans-serif; cursor: pointer; }
@keyframes pulse { 50% { transform: scale(1.06); filter: drop-shadow(0 5px 12px rgba(200,255,0,.8)); } }

@media (max-width: 640px) {
  .page { padding-left: 4px; padding-right: 4px; }
  .logo { width: min(540px, 92vw); }
  .stage { width: min(630px, 108vw); }
  .wheel-wrap { width: 89%; left: 5.5%; top: 2%; }
  .decor-left { width: 23%; left: 1%; bottom: 8%; }
  .decor-right { width: 21%; right: 1%; bottom: 8%; }
  .status { margin-top: -8%; }
  .modal { padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
  .modal-card { width: calc(100vw - 20px); max-width: 430px; max-height: calc(100vh - 20px); max-height: calc(100svh - 20px); padding: 30px 18px 24px; }
  .win-art { width: min(82vw, 360px); margin-bottom: 10px; }
}

@media (max-width: 360px), (max-height: 620px) {
  .modal-card { padding: 24px 14px 18px; }
  .win-art { width: min(78vw, 300px); max-height: 14vh; max-height: 14svh; margin-bottom: 7px; }
  .modal h2 { margin-top: 0; font-size: clamp(23px, 7vw, 31px); }
  .result { margin-bottom: 14px; font-size: clamp(29px, 9vw, 38px); }
  .claim { min-height: 54px; padding-block: 10px; }
}

@media (max-height: 720px) and (orientation: landscape) {
  .logo { width: 300px; }
  .game h1 { font-size: 22px; }
  .stage { width: min(510px, 74vh); }
  .status { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
