:root {
  --ink: #20243a;
  --paper: #fffdf8;
  --bubble: #fff6d6;
  --line: #252525;
  --pink: #ff5c8a;
  --cyan: #41c7d8;
  --leaf: #51c878;
  --sun: #ffd23f;
  --wheel-size: min(78vw, 430px);
  --spin-duration: 3900ms;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(65, 199, 216, 0.16) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 92, 138, 0.14) 1px, transparent 1px),
    linear-gradient(135deg, #fffaf0 0%, #e7fbff 48%, #fff0f5 100%);
  background-size: 42px 42px, 42px 42px, auto;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff2bf' stroke='%2321242f' stroke-width='2' d='M11 4c1.3 0 2.3 1 2.3 2.3v7.2l.9-.7c1.1-.8 2.6-.6 3.3.5l.4.6.8-.5c1.1-.7 2.5-.4 3.2.7l.4.7.6-.2c1.3-.4 2.7.3 3.1 1.6.3.9.1 2.1-.4 3.4l-1.5 3.5c-1.2 2.8-3.9 4.7-7 4.7h-3.7c-2.4 0-4.6-1.1-6-3l-3.3-4.3c-.8-1-.6-2.5.4-3.3 1-.8 2.5-.6 3.3.4l.9 1.1V6.3C8.7 5 9.7 4 11 4Z'/%3E%3C/svg%3E") 10 3, pointer;
}

.site-return-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 5px 5px 0 rgba(30, 34, 55, 0.16);
  font-size: 0.92rem;
  font-weight: 900;
  text-decoration: none;
}

button {
  font: inherit;
  letter-spacing: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff2bf' stroke='%2321242f' stroke-width='2' d='M11 4c1.3 0 2.3 1 2.3 2.3v7.2l.9-.7c1.1-.8 2.6-.6 3.3.5l.4.6.8-.5c1.1-.7 2.5-.4 3.2.7l.4.7.6-.2c1.3-.4 2.7.3 3.1 1.6.3.9.1 2.1-.4 3.4l-1.5 3.5c-1.2 2.8-3.9 4.7-7 4.7h-3.7c-2.4 0-4.6-1.1-6-3l-3.3-4.3c-.8-1-.6-2.5.4-3.3 1-.8 2.5-.6 3.3.4l.9 1.1V6.3C8.7 5 9.7 4 11 4Z'/%3E%3C/svg%3E") 10 3, pointer;
}

.game-shell {
  width: min(1120px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 30px;
  display: grid;
  align-content: center;
  gap: 20px;
}

.intro-band {
  text-align: center;
}

.eyebrow,
.mini-chant {
  margin: 0;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 800;
  color: #1f7b88;
}

h1 {
  margin: 6px 0 8px;
  color: #121629;
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 4px 0 #ffd23f, 0 7px 0 rgba(32, 36, 58, 0.16);
}

.chant {
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
  padding: 9px 16px 10px;
  color: #ffffff;
  font-size: clamp(1.1rem, 3.6vw, 1.65rem);
  font-weight: 900;
  background: #ff5c8a;
  border: 3px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 0 var(--line);
}

.play-area {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(250px, 350px);
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding-top: 30px;
}

.pointer {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: 76px;
  height: 82px;
  transform: translateX(-50%);
  display: grid;
  place-items: start center;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
  text-shadow: 0 2px 0 #7a1e32;
}

.pointer::before {
  content: "";
  position: absolute;
  top: 28px;
  border-right: 28px solid transparent;
  border-left: 28px solid transparent;
  border-top: 52px solid #ff3f6c;
  filter: drop-shadow(0 5px 0 var(--line));
}

.pointer span {
  position: relative;
  z-index: 1;
  margin-top: 17px;
}

.wheel {
  --wheel-gradient: conic-gradient(from -90deg, #ff6b6b 0 45deg, #ffd166 45deg 90deg, #4dabf7 90deg 135deg, #69db7c 135deg 180deg, #ffa94d 180deg 225deg, #f7c948 225deg 270deg, #74c0fc 270deg 315deg, #ccf55b 315deg 360deg);
  position: relative;
  width: var(--wheel-size);
  aspect-ratio: 1;
  border: clamp(8px, 1.8vw, 14px) solid #20243a;
  border-radius: 50%;
  background: var(--wheel-gradient);
  box-shadow:
    0 16px 0 #1d2438,
    0 24px 32px rgba(32, 36, 58, 0.24),
    inset 0 0 0 10px rgba(255, 255, 255, 0.64),
    inset 0 0 0 18px rgba(32, 36, 58, 0.12);
  overflow: hidden;
  transition: transform var(--spin-duration) cubic-bezier(0.12, 0.76, 0.08, 1);
  transform: rotate(0deg);
}

#wheel {
  touch-action: manipulation;
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 49% -10%;
  height: 4px;
  background: rgba(32, 36, 58, 0.2);
  box-shadow:
    0 calc(var(--wheel-size) * -0.25) 0 rgba(32, 36, 58, 0.14),
    0 calc(var(--wheel-size) * 0.25) 0 rgba(32, 36, 58, 0.14);
  transform: rotate(45deg);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 49% -10%;
  height: 4px;
  background: rgba(32, 36, 58, 0.2);
  box-shadow:
    0 calc(var(--wheel-size) * -0.25) 0 rgba(32, 36, 58, 0.14),
    0 calc(var(--wheel-size) * 0.25) 0 rgba(32, 36, 58, 0.14);
  transform: rotate(90deg);
}

.wheel:focus-visible,
.primary-action:focus-visible,
.talk-action:focus-visible,
.sound-toggle:focus-visible {
  outline: 4px solid #121629;
  outline-offset: 5px;
}

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

.wheel-labels {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.segment-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(96px, 22vw);
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 8px;
  color: #172033;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  transform-origin: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.64);
}

.segment-icon {
  font-size: clamp(1.1rem, 4vw, 1.72rem);
  line-height: 1;
}

.segment-name {
  font-size: clamp(0.78rem, 2.7vw, 1.05rem);
}

.wheel-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(126px, 29vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  font-weight: 900;
  background: #20243a;
  border: 6px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
}

.center-icon {
  font-size: clamp(1.4rem, 5vw, 2.05rem);
  line-height: 0.9;
}

.result-panel {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 24px);
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 8px;
  box-shadow: 9px 9px 0 #41c7d8;
}

.host-character {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 10px;
  background: #fff6d6;
  border: 3px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(32, 36, 58, 0.18);
}

.host-figure {
  position: relative;
  width: 86px;
  height: 94px;
  transform-origin: 50% 80%;
}

.host-character.is-talking .host-figure,
.host-character.is-calling .host-figure {
  animation: host-bounce 560ms ease-in-out infinite alternate;
}

.host-head {
  position: absolute;
  top: 8px;
  left: 18px;
  width: 54px;
  height: 54px;
  background: #ffd6b5;
  border: 3px solid var(--line);
  border-radius: 50%;
  box-shadow: inset 0 -5px 0 rgba(255, 145, 112, 0.26);
}

.host-head::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 7px;
  width: 34px;
  height: 17px;
  background: #43312d;
  border: 3px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 4px 4px;
}

.host-hair {
  position: absolute;
  top: 16px;
  width: 17px;
  height: 22px;
  background: #43312d;
  border: 3px solid var(--line);
  border-radius: 50%;
}

.host-hair.left {
  left: -14px;
}

.host-hair.right {
  right: -14px;
}

.host-bow {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 31px;
  width: 29px;
  height: 19px;
  background: #ff5c8a;
  border: 3px solid var(--line);
  border-radius: 6px 6px 9px 9px;
  transform: rotate(-8deg);
}

.host-eye {
  position: absolute;
  top: 25px;
  width: 6px;
  height: 8px;
  background: var(--line);
  border-radius: 50%;
}

.host-eye.left {
  left: 16px;
}

.host-eye.right {
  right: 16px;
}

.host-smile {
  position: absolute;
  bottom: 12px;
  left: 19px;
  width: 15px;
  height: 8px;
  border-bottom: 3px solid var(--line);
  border-radius: 0 0 20px 20px;
}

.host-body {
  position: absolute;
  bottom: 5px;
  left: 24px;
  width: 42px;
  height: 36px;
  background: #41c7d8;
  border: 3px solid var(--line);
  border-radius: 16px 16px 8px 8px;
}

.host-body::before,
.host-body::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 22px;
  height: 8px;
  background: #ffd6b5;
  border: 3px solid var(--line);
  border-radius: 999px;
}

.host-body::before {
  left: -19px;
  transform: rotate(28deg);
}

.host-body::after {
  right: -20px;
  transform: rotate(-34deg);
}

.host-megaphone {
  position: absolute;
  right: -2px;
  bottom: 24px;
  width: 31px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  background: #ff5c8a;
  border: 3px solid var(--line);
  border-radius: 8px 14px 14px 8px;
  transform: rotate(-12deg);
}

.host-speech {
  position: relative;
  min-height: 76px;
  margin: 0;
  padding: 12px 13px;
  display: grid;
  align-items: center;
  color: #121629;
  font-size: clamp(1.05rem, 3.2vw, 1.32rem);
  font-weight: 900;
  line-height: 1.22;
  background: #ffffff;
  border: 3px solid var(--line);
  border-radius: 8px;
}

.host-speech::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 42px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-left: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  transform: rotate(45deg);
}

.result-text {
  min-height: 5.8rem;
  margin: 0;
  display: grid;
  align-items: center;
  color: #121629;
  font-size: clamp(1.45rem, 4.8vw, 2.25rem);
  font-weight: 900;
  line-height: 1.16;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.primary-action,
.talk-action,
.sound-toggle {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 3px solid var(--line);
  border-radius: 8px;
  color: #121629;
  font-weight: 900;
  box-shadow: 0 5px 0 var(--line);
  transform: translateY(0);
}

.primary-action {
  background: var(--sun);
  font-size: 1.25rem;
}

.talk-action {
  background: #ff9fcd;
  font-size: 1.08rem;
}

.sound-toggle {
  background: #ffffff;
  font-size: 1rem;
}

.primary-action:active,
.talk-action:active,
.sound-toggle:active,
.wheel:active {
  transform: translateY(3px);
}

.primary-action:disabled {
  color: rgba(18, 22, 41, 0.62);
  background: #dfe8ed;
}

.spark {
  position: fixed;
  z-index: 5;
  top: var(--spark-y);
  left: var(--spark-x);
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--spark-color);
  pointer-events: none;
  animation: sparkle 720ms ease-out forwards;
}

@keyframes sparkle {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-dx)), calc(-50% + var(--spark-dy))) rotate(160deg) scale(0.4);
  }
}

@keyframes host-bounce {
  from {
    transform: rotate(-2deg) translateY(0);
  }

  to {
    transform: rotate(3deg) translateY(-4px);
  }
}

@media (max-width: 760px) {
  .game-shell {
    width: min(100% - 18px, 560px);
    padding-top: 18px;
    align-content: start;
  }

  .play-area {
    grid-template-columns: 1fr;
  }

  .result-panel {
    box-shadow: 0 7px 0 #41c7d8;
  }

  .host-character {
    grid-template-columns: 82px 1fr;
    min-height: 104px;
  }

  .host-figure {
    width: 78px;
    transform: scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel {
    transition-duration: 900ms;
  }

  .spark {
    animation: none;
    display: none;
  }

  .host-character.is-talking .host-figure,
  .host-character.is-calling .host-figure {
    animation: none;
  }
}

/* v3 video-style scene */
.video-stage {
  display: block;
}

.stall-scene {
  position: relative;
  min-height: min(680px, calc(100vh - 190px));
  display: grid;
  grid-template-columns: minmax(180px, 0.82fr) minmax(320px, 1.2fr) minmax(260px, 0.86fr);
  align-items: end;
  gap: clamp(14px, 2.6vw, 28px);
  padding: clamp(16px, 3vw, 28px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 246, 214, 0.52)),
    repeating-linear-gradient(90deg, rgba(32, 36, 58, 0.08) 0 2px, transparent 2px 58px),
    linear-gradient(135deg, rgba(255, 92, 138, 0.2), rgba(65, 199, 216, 0.2));
  border: 4px solid var(--line);
  border-radius: 8px;
  box-shadow: 13px 13px 0 #41c7d8;
  overflow: hidden;
}

.stall-scene::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 88px;
  background:
    repeating-linear-gradient(90deg, #ff5c8a 0 56px, #ffd23f 56px 112px, #41c7d8 112px 168px);
  border-bottom: 4px solid var(--line);
}

.stall-scene::after {
  content: "";
  position: absolute;
  right: 5%;
  bottom: -34px;
  left: 5%;
  height: 94px;
  background: rgba(32, 36, 58, 0.12);
  border-radius: 50%;
  filter: blur(14px);
}

.video-stage .wheel-wrap,
.video-stage .host-character,
.video-stage .result-panel {
  z-index: 1;
}

.video-stage .wheel-wrap {
  padding-top: 72px;
  align-self: center;
}

.video-stage .wheel {
  --wheel-size: min(41vw, 500px);
  box-shadow:
    0 18px 0 #1d2438,
    0 28px 36px rgba(32, 36, 58, 0.28),
    inset 0 0 0 10px rgba(255, 255, 255, 0.7),
    inset 0 0 0 22px rgba(32, 36, 58, 0.14);
}

.video-stage .host-character {
  position: relative;
  align-self: end;
  min-height: 430px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 10px;
  padding: 0 6px 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.video-stage .host-speech {
  width: min(240px, 100%);
  min-height: 94px;
  padding: 14px 16px;
  font-size: clamp(1.08rem, 2.2vw, 1.5rem);
  transform: rotate(-2deg);
  box-shadow: 6px 6px 0 #ffd23f;
}

.video-stage .host-speech::before {
  left: 52%;
  top: auto;
  bottom: -13px;
  transform: rotate(-45deg);
}

.video-stage .host-figure {
  width: 188px;
  height: 278px;
}

.video-stage .host-shadow {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 22px;
  background: rgba(32, 36, 58, 0.2);
  border-radius: 50%;
}

.video-stage .host-head {
  top: 30px;
  left: 42px;
  width: 104px;
  height: 104px;
  border-width: 4px;
}

.video-stage .host-head::before {
  top: -12px;
  left: 12px;
  width: 70px;
  height: 34px;
  border-width: 4px;
}

.video-stage .host-hair {
  top: 30px;
  width: 35px;
  height: 45px;
  border-width: 4px;
}

.video-stage .host-hair.left {
  left: -30px;
}

.video-stage .host-hair.right {
  right: -30px;
}

.video-stage .host-bow {
  top: 6px;
  left: 72px;
  width: 52px;
  height: 35px;
  border-width: 4px;
}

.video-stage .host-eye {
  top: 50px;
  width: 10px;
  height: 14px;
}

.video-stage .host-eye.left {
  left: 31px;
}

.video-stage .host-eye.right {
  right: 31px;
}

.video-stage .host-smile {
  bottom: 25px;
  left: 38px;
  width: 30px;
  height: 16px;
  border-bottom-width: 4px;
}

.video-stage .host-body {
  bottom: 40px;
  left: 43px;
  width: 104px;
  height: 122px;
  border-width: 4px;
  border-radius: 38px 38px 18px 18px;
  background: linear-gradient(180deg, #41c7d8 0%, #199eb5 100%);
}

.video-stage .host-body::before,
.video-stage .host-body::after {
  top: 34px;
  width: 58px;
  height: 17px;
  border-width: 4px;
}

.video-stage .host-body::before {
  left: -49px;
  transform: rotate(35deg);
}

.video-stage .host-body::after {
  right: -52px;
  transform: rotate(-46deg);
}

.video-stage .host-leg {
  position: absolute;
  bottom: 11px;
  width: 24px;
  height: 44px;
  background: #30364c;
  border: 4px solid var(--line);
  border-radius: 999px;
}

.video-stage .host-leg.left {
  left: 70px;
  transform: rotate(5deg);
}

.video-stage .host-leg.right {
  right: 68px;
  transform: rotate(-7deg);
}

.video-stage .host-megaphone {
  right: -2px;
  bottom: 118px;
  width: 62px;
  height: 48px;
  border-width: 4px;
  font-size: 1.5rem;
}

.video-stage .host-caption {
  margin: -2px 0 0;
  padding: 8px 12px;
  color: #fff;
  font-weight: 900;
  background: #20243a;
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 5px 0 rgba(32, 36, 58, 0.28);
}

.host-character.is-calling .host-megaphone::after,
.host-character.is-talking .host-megaphone::after {
  content: "中奖概率倍儿高";
  position: absolute;
  left: 48px;
  top: -28px;
  width: 126px;
  color: #ff5c8a;
  font-size: 0.76rem;
  text-shadow: 1px 1px 0 #fff;
  transform: rotate(12deg);
}

.video-stage .result-panel {
  align-self: center;
  padding: clamp(16px, 2.2vw, 22px);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(6px);
}

.prize-marquee {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 6px;
  background: #20243a;
  border: 3px solid var(--line);
  border-radius: 8px;
}

.prize-marquee span {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #121629;
  font-weight: 900;
  background: #ffd23f;
  border-radius: 6px;
  animation: marquee-pop 1.6s ease-in-out infinite alternate;
}

.prize-marquee span:nth-child(2n) {
  background: #ff9fcd;
}

.prize-marquee span:nth-child(3n) {
  background: #9ee7ef;
}

@keyframes marquee-pop {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-3px);
  }
}

@media (max-width: 920px) {
  .stall-scene {
    grid-template-columns: 1fr;
    min-height: auto;
    align-items: center;
  }

  .stall-scene::before {
    height: 58px;
  }

  .video-stage .host-character {
    min-height: 196px;
    grid-template-columns: 130px 1fr;
    grid-template-rows: 1fr auto;
    justify-items: start;
    align-items: center;
    width: 100%;
    padding-top: 60px;
  }

  .video-stage .host-speech {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }

  .video-stage .host-figure {
    grid-column: 1;
    grid-row: 1 / span 2;
    transform: scale(0.68);
    transform-origin: left bottom;
  }

  .video-stage .host-caption {
    grid-column: 2;
    grid-row: 2;
  }

  .video-stage .wheel {
    --wheel-size: min(82vw, 430px);
  }

  .video-stage .wheel-wrap {
    padding-top: 32px;
  }
}

@media (max-width: 520px) {
  .stall-scene {
    padding: 10px;
    box-shadow: 0 8px 0 #41c7d8;
  }

  .video-stage .host-character {
    grid-template-columns: 104px 1fr;
    min-height: 174px;
  }

  .video-stage .host-figure {
    transform: scale(0.56);
  }

  .video-stage .host-speech {
    min-height: 80px;
    font-size: 1rem;
  }
}
