* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: #100e0c;
}

body {
  min-height: 100vh;
  color: #333;
  font-family: Georgia, "Times New Roman", "PingFang SC", "Microsoft YaHei", serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 28px;
  background: #100e0c;
}

.hero {
  position: relative;
  padding: 22px 10px 4px;
  text-align: center;
  background:
    radial-gradient(1.2px 1.2px at 16% 18%, rgba(255, 255, 255, 0.9) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 78% 12%, rgba(255, 220, 150, 0.95) 50%, transparent 52%),
    radial-gradient(1px 1px at 88% 40%, rgba(255, 255, 255, 0.65) 50%, transparent 52%),
    radial-gradient(1px 1px at 24% 58%, rgba(255, 255, 255, 0.5) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 48% 8%, rgba(255, 210, 120, 0.85) 50%, transparent 52%),
    radial-gradient(1px 1px at 68% 72%, rgba(255, 255, 255, 0.4) 50%, transparent 52%),
    radial-gradient(1px 1px at 8% 78%, rgba(255, 214, 140, 0.55) 50%, transparent 52%),
    #100e0c;
}

.brand {
  color: #e8c97a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.4px;
  font-variant: small-caps;
}

.frame {
  position: relative;
  z-index: 1;
  margin: 12px 16px 0;
  padding: 16px 8px 14px;
  border: 1.5px solid #e6c98a;
  box-shadow: 0 0 0 4px #100e0c, 0 0 0 5.5px rgba(230, 201, 138, 0.9);
}

.frame-title,
.win-text,
.hero-title {
  color: #e6c36a;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .frame-title,
  .win-text,
  .hero-title {
    background-image: linear-gradient(180deg, #fff6dc 0%, #f3d78a 32%, #d7ae55 68%, #f6e3a4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.frame-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.15;
  filter: drop-shadow(0 2px 0 rgba(90, 58, 12, 0.55));
}

.frame-sub {
  margin-top: 4px;
  color: #f0d48a;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hero-title {
  margin-top: 8px;
  font-size: 54px;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 3px 0 rgba(92, 62, 16, 0.8)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}

.win-text {
  display: inline-block;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid #e6c98a;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
}

.sub {
  margin-top: 10px;
  color: #f4f4f4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.sub-en {
  margin-top: 3px;
  color: #9a9a9a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  letter-spacing: 1.2px;
}

.wheel-stage {
  position: relative;
  width: min(92vw, 340px);
  margin: 8px auto 6px;
  aspect-ratio: 1;
}

.wheel-rotor {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform 5s cubic-bezier(0.15, 0.65, 0.1, 1);
}

.wheel-rotor svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffe48a 0%, #ffb000 46%, #ff8600 100%);
  box-shadow:
    0 0 0 5px #ffd24a,
    0 0 0 8px #8d4e12,
    0 8px 16px rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
}

.hub::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 20px solid #ffe14a;
  filter: drop-shadow(0 1px 0 #c98912);
}

.hub::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dotted rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  pointer-events: none;
}

.hub:disabled {
  cursor: default;
}

.hub-kicker,
.hub-sub {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 1px 0 rgba(180, 70, 0, 0.65);
}

.hub-kicker {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
}

.hub-sub {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
}

.panel {
  position: relative;
  display: block;
  margin: 16px 12px 0;
  padding: 26px 14px 16px;
  background: #fff;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

.panel[hidden] {
  display: none !important;
}

.tag {
  position: absolute;
  top: 0;
  left: 12px;
  height: 26px;
  padding: 0 16px 0 8px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #ff3b3b 0%, #e10600 100%);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 26px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.field {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.18);
  color: #222;
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: #ff6501;
  box-shadow: 0 0 5px #ff6501;
}

.confirm {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border: 1px solid #ff6501;
  border-bottom-color: #d35605;
  border-radius: 8px;
  background: linear-gradient(#ffa201, #ff6501);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  text-shadow: 0 0 2px #be4205;
}

.confirm:active {
  background: linear-gradient(#ff6501, #ffa201);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prize {
  padding: 8px 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  text-align: center;
}

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 108px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prize-name {
  margin-top: 6px;
  color: #444;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.prize-val {
  color: #666;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.3;
}

.panel-blank {
  height: 72px;
  padding: 0;
}

.confirm:disabled {
  opacity: 0.7;
  cursor: default;
}

.mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(0, 0, 0, 0.72);
}

.mask[hidden] {
  display: none !important;
}

.dialog {
  position: relative;
  width: min(100%, 340px);
  padding: 28px 18px 18px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.dialog h2 {
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  line-height: 1.2;
}

.dialog-desc {
  margin-top: 8px;
  color: #777;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #888;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.code-input {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.12);
  color: #222;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
}

.code-input:placeholder-shown {
  letter-spacing: 1px;
  font-size: 16px;
  font-weight: 500;
}

.code-input:focus {
  border-color: #ff6501;
  box-shadow: 0 0 5px #ff6501;
}

.dialog-error {
  min-height: 20px;
  margin-top: 8px;
  color: #e10600;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

.win-value {
  margin-top: 6px;
  color: #ff6a00;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .wheel-rotor {
    transition: none;
  }
}
