:root {
  --bg-red: #4f0705;
  --panel-red: rgba(113, 11, 8, 0.78);
  --accent-red: #ff2b17;
  --accent-gold: #ffd86d;
  --text-main: #fff8ef;
  --text-muted: rgba(255, 248, 239, 0.8);
  --shadow-strong: 0 30px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 89, 26, 0.16), transparent 34%),
    url("img/bg.jpg") center center / cover no-repeat fixed;
  overflow-x: hidden;
}

button,
img {
  display: block;
}

button {
  border: 0;
}

.page-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.hero-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 34px 48px 0;
}

.hero-logo {
  width: min(260px, 34vw);
}

.hero-tiger-logo {
  width: min(190px, 24vw);
}

.scene-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.decor {
  position: absolute;
  user-select: none;
}

.decor-coins {
  width: 100%;
  left: 0;
  bottom: 0;
  opacity: 0.82;
  animation: decorFloat 6s ease-in-out infinite;
}

.decor-flag {
  width: min(190px, 18vw);
  top: 44px;
  left: 27%;
  animation: decorBob 5s ease-in-out infinite;
}

.decor-tiger-left {
  width: min(480px, 32vw);
  left: calc(50% - 540px);
  bottom: 0;
  animation: decorBob 4.6s ease-in-out infinite;
}

.decor-tiger-right {
  width: min(360px, 26vw);
  right: calc(50% - 500px);
  bottom: -12px;
  animation: decorBob 4.2s ease-in-out infinite reverse;
}

.hero-main {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 8px 24px 48px;
}

.hero-ribbon {
  margin: 36px 0 48px;
  transform: rotate(-5.5deg);
}

.hero-ribbon span {
  display: inline-block;
  padding: 16px 38px;
  font-size: clamp(22px, 2.5vw, 42px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-red);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  transform: skew(-10deg);
}

.wheel-section {
  width: min(920px, 100%);
  display: flex;
  justify-content: center;
}

.wheel-stage {
  display: flex;
  justify-content: center;
}

.wheel-stack {
  position: relative;
  width: min(74vw, 660px);
  aspect-ratio: 1;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.35));
}

.wheel-base {
  position: absolute;
  inset: 0;
  background: url("img/subwheel.png") center center / contain no-repeat;
}

.wheel-disc {
  position: absolute;
  inset: 3%;
  --disc-rotation: 0deg;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 247, 222, 0.98) 0 19%, rgba(255, 247, 222, 0) 19.5%),
    conic-gradient(
      from -18deg,
      #f7ecdc 0deg 36deg,
      #e90f08 36deg 72deg,
      #f7ecdc 72deg 108deg,
      #e90f08 108deg 144deg,
      #f7ecdc 144deg 180deg,
      #e90f08 180deg 216deg,
      #f7ecdc 216deg 252deg,
      #e90f08 252deg 288deg,
      #f7ecdc 288deg 324deg,
      #e90f08 324deg 360deg
    );
  box-shadow:
    inset 0 0 0 12px rgba(255, 48, 35, 0.75),
    inset 0 0 0 20px rgba(255, 207, 120, 0.16);
  transition: transform 3.8s cubic-bezier(0.14, 0.82, 0.2, 1);
  will-change: transform;
  overflow: hidden;
}

.wheel-disc.is-spinning {
  filter: saturate(1.08);
}

.wheel-logo-ring {
  position: absolute;
  inset: 0;
}

.wheel-logo {
  position: absolute;
  width: 11.2%;
  aspect-ratio: 0.42 / 1;
  transform: translate(-50%, -50%) rotate(var(--slot-tilt));
  border-radius: 22px;
  background: rgba(20, 20, 20, 0.92);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.22),
    inset 0 0 0 2px rgba(255, 255, 255, 0.78),
    0 0 0 3px rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  overflow: hidden;
}

.wheel-logo img {
  width: 250%;
  height: auto;
  max-width: none;
  transform: rotate(90deg) scale(1.02);
  transform-origin: center;
  border-radius: 18px;
  display: block;
}

.wheel-logo--1 { left: 50%; top: 20.5%; --slot-tilt: 0deg; }
.wheel-logo--2 { left: 68%; top: 26.5%; --slot-tilt: 36deg; }
.wheel-logo--3 { left: 79.5%; top: 40.5%; --slot-tilt: 72deg; }
.wheel-logo--4 { left: 79.5%; top: 59.5%; --slot-tilt: 108deg; }
.wheel-logo--5 { left: 68%; top: 73.5%; --slot-tilt: 144deg; }
.wheel-logo--6 { left: 50%; top: 79.5%; --slot-tilt: 180deg; }
.wheel-logo--7 { left: 32%; top: 73.5%; --slot-tilt: 216deg; }
.wheel-logo--8 { left: 20.5%; top: 59.5%; --slot-tilt: 252deg; }
.wheel-logo--9 { left: 20.5%; top: 40.5%; --slot-tilt: 288deg; }
.wheel-logo--10 { left: 32%; top: 26.5%; --slot-tilt: 324deg; }

.wheel-pointer {
  position: absolute;
  top: 3%;
  left: 50%;
  width: 7%;
  height: 9%;
  transform: translateX(-50%);
  background: url("img/pointer.png") center center / contain no-repeat;
  z-index: 5;
}

.wheel-spin-button {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 26%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: url("img/wheel-center.png") center center / contain no-repeat;
  cursor: pointer;
  z-index: 6;
  transition: transform 0.2s ease;
}

.wheel-spin-button:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

.wheel-spin-button:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.wheel-spin-icon {
  position: absolute;
  inset: 35%;
  background: url("img/icon-refresh.svg") center center / contain no-repeat;
  animation: spinIcon 1.4s linear infinite alternate;
}

.result-modal[hidden] {
  display: none;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.result-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 6, 3, 0.72);
  backdrop-filter: blur(6px);
}

.result-modal__card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
}

.result-modal__surface {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  min-height: 600px;
  padding: 16px 18px 20px;
  border-radius: 28px;
  background: transparent;
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border: 4px solid #48c300;
}

.result-modal__surface::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/dikuang.png") center center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
}

.result-modal__surface::before {
  content: none;
}

.result-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(245, 245, 245, 0.96);
  color: #1d1d1d;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.result-modal__logo-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 455px);
  min-height: 230px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  margin-top: 10px;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-modal__logo {
  width: 100%;
  max-width: 100%;
  max-height: 300px;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}

.result-modal__content {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  padding: 10px 6px 0;
  color: #242424;
}

.result-modal__headline,
.result-modal__meta,
.result-modal__slots,
.result-modal__recommend,
.result-modal__stars {
  margin: 0;
}

.result-modal__headline {
  font-size: clamp(18px, 2.8vw, 30px);
  line-height: 1.3;
  font-weight: 500;
}

.result-modal__emoji {
  margin-right: 6px;
}

.result-modal__meta {
  margin-top: 8px;
  font-size: clamp(18px, 2.8vw, 28px);
  line-height: 1.3;
}

.result-modal__meta strong {
  display: block;
  font-weight: 600;
}

.result-modal__slots {
  margin-top: 10px;
  font-size: clamp(18px, 2.8vw, 26px);
  letter-spacing: 4px;
}

.result-modal__recommend {
  margin-top: 10px;
  font-size: clamp(18px, 2.9vw, 30px);
  line-height: 1.2;
}

.result-modal__stars {
  margin-top: 6px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 2px;
}

.result-modal__actions {
  position: relative;
  z-index: 1;
  width: min(100%, 500px);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.result-modal__action {
  flex: 1 1 0;
  min-height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.result-modal__action-image {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes spinIcon {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-100deg);
  }
}

@keyframes decorFloat {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.96);
  }
}

@keyframes decorBob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

@media (max-width: 980px) {
  .hero-header {
    padding: 28px 22px 0;
    gap: 10px;
  }

  .hero-logo {
    width: 180px;
  }

  .hero-tiger-logo {
    width: 126px;
  }

  .decor-tiger-left {
    display: none;
  }

  .decor-tiger-right {
    width: 50vw;
    right: auto;
    left: -8vw;
    bottom: 16vh;
  }

  .decor-flag {
    left: 10vw;
    top: 90px;
    width: 26vw;
  }

  .wheel-logo {
    width: 10.6%;
  }
}

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at top, rgba(255, 89, 26, 0.18), transparent 34%),
      url("img/bg-mob.jpg") center center / cover no-repeat fixed;
  }

  .hero-header {
    padding: 14px 12px 0;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
  }

  .hero-logo {
    width: 128px;
  }

  .hero-tiger-logo {
    width: 104px;
  }

  .hero-main {
    min-height: calc(100vh - 56px);
    justify-content: flex-start;
    padding: 4px 10px 18px;
  }

  .hero-ribbon {
    margin: 10px 0 12px;
    transform: rotate(-4deg);
  }

  .hero-ribbon span {
    padding: 10px 14px;
    font-size: clamp(18px, 4.8vw, 30px);
  }

  .wheel-stack {
    width: min(94vw, 500px);
  }

  .wheel-logo {
    width: 12%;
    border-radius: 16px;
    padding: 7px 3px;
  }

  .wheel-logo img {
    width: 265%;
    border-radius: 14px;
  }

  .result-modal__surface {
    min-height: 500px;
    padding: 16px 12px 16px;
    border-radius: 22px;
  }

  .result-modal__logo-frame {
    width: min(100%, 360px);
    min-height: 165px;
    border-radius: 22px;
  }

  .result-modal__actions {
    gap: 10px;
  }

  .result-modal__action {
    min-height: 54px;
    border-radius: 18px;
    min-height: auto;
  }

  .decor-flag {
    top: 52px;
    left: 8vw;
    width: 24vw;
  }

  .decor-tiger-right {
    width: 58vw;
    top: auto;
    bottom: 6vh;
    left: -18vw;
  }
}
