:root {
  --bg: #050504;
  --panel: rgba(13, 18, 17, 0.82);
  --panel-strong: rgba(21, 28, 26, 0.96);
  --teal: #00d5bd;
  --teal-soft: #1f8e7f;
  --gold: #f0cf82;
  --gold-deep: #8f6831;
  --red: #dc4a32;
  --paper: #fff7e6;
  --ink: #f6f0df;
  --muted: #aeb7ad;
  --line: rgba(240, 207, 130, 0.34);
  --shadow: rgba(0, 0, 0, 0.56);
  font-family: "Microsoft YaHei", "Noto Sans SC", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 76% 12%, rgba(220, 74, 50, 0.23), transparent 28rem),
    radial-gradient(circle at 16% 22%, rgba(0, 213, 189, 0.2), transparent 26rem),
    linear-gradient(145deg, #050504 0%, #10110d 46%, #070a09 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 110px),
    linear-gradient(25deg, rgba(0, 213, 189, 0.08) 0 1px, transparent 1px 120px);
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.2;
}

button {
  font: inherit;
  color: inherit;
}

.page-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.event-screen {
  min-height: calc(100vh - 44px);
  padding: 20px;
  border: 1px solid rgba(240, 207, 130, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 247, 230, 0.05), transparent 36%),
    linear-gradient(132deg, rgba(0, 213, 189, 0.08), transparent 44%),
    rgba(5, 5, 4, 0.72);
  box-shadow: 0 26px 80px var(--shadow), inset 0 0 80px rgba(0, 213, 189, 0.04);
}

.topbar,
.hero-grid,
.wheel-header,
.status-strip,
.brand,
.draw-meter,
.panel-title {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 6px 22px;
}

.brand {
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid var(--teal);
  clip-path: polygon(50% 3%, 96% 90%, 4% 90%);
  filter: drop-shadow(0 0 14px rgba(0, 213, 189, 0.42));
}

.brand-mark::after {
  position: absolute;
  inset: 13px 11px 9px;
  content: "";
  border: 2px solid var(--gold);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.36rem;
  font-weight: 900;
}

.brand span,
.status-strip span,
.eyebrow,
.lead,
.result-panel span,
.info-band p {
  color: var(--muted);
}

.status-strip {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-strip span {
  padding: 8px 12px;
  border: 1px solid rgba(0, 213, 189, 0.35);
  background: rgba(0, 213, 189, 0.08);
}

.hero-grid {
  align-items: stretch;
  gap: 20px;
  min-height: 680px;
}

.campaign-panel,
.wheel-stage,
.side-panel {
  position: relative;
  border: 1px solid rgba(240, 207, 130, 0.28);
  background: var(--panel);
}

.campaign-panel {
  flex: 0 0 30%;
  min-width: 300px;
  padding: 28px;
  overflow: hidden;
}

.campaign-panel::before,
.wheel-stage::before,
.side-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translate(5px, 5px);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 4.6rem;
  line-height: 0.96;
  font-weight: 950;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.52), 0 0 22px rgba(255, 247, 230, 0.12);
}

h1 em {
  color: var(--teal);
  font-style: normal;
}

.lead {
  max-width: 29rem;
  margin: 18px 0 24px;
  font-size: 1.02rem;
  line-height: 1.8;
}

.offer-rack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.offer-item {
  min-height: 112px;
  padding: 14px 10px;
  border: 1px solid rgba(0, 213, 189, 0.5);
  background:
    linear-gradient(180deg, rgba(0, 213, 189, 0.16), rgba(0, 0, 0, 0.18)),
    rgba(7, 26, 23, 0.82);
  box-shadow: inset 0 0 28px rgba(0, 213, 189, 0.08);
}

.offer-item.hot {
  border-color: rgba(240, 207, 130, 0.68);
  background:
    linear-gradient(180deg, rgba(240, 207, 130, 0.2), rgba(0, 0, 0, 0.18)),
    rgba(30, 23, 12, 0.88);
}

.offer-item strong,
.offer-item span {
  display: block;
  text-align: center;
}

.offer-item strong {
  color: var(--gold);
  font-size: 1.72rem;
  line-height: 1.15;
}

.offer-item span {
  margin-top: 8px;
  color: var(--paper);
  font-size: 0.95rem;
  line-height: 1.45;
}

.supply-art {
  position: absolute;
  right: -18px;
  bottom: 30px;
  width: 82%;
  max-width: 430px;
  height: 270px;
  opacity: 0.94;
}

.case-lid,
.case-body {
  position: absolute;
  left: 54px;
  width: 270px;
  border: 2px solid rgba(240, 207, 130, 0.45);
  background: linear-gradient(145deg, #161b18, #070908 58%, #302417);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), inset 0 0 28px rgba(0, 213, 189, 0.08);
  transform: skewX(-9deg) rotate(-4deg);
}

.case-lid {
  top: 54px;
  height: 62px;
}

.case-body {
  top: 112px;
  height: 108px;
}

.case-body span {
  position: absolute;
  top: 28px;
  width: 38px;
  height: 50px;
  border: 1px solid rgba(255, 247, 230, 0.22);
  background: rgba(0, 213, 189, 0.09);
}

.case-body span:nth-child(1) {
  left: 32px;
}

.case-body span:nth-child(2) {
  left: 116px;
}

.case-body span:nth-child(3) {
  right: 32px;
}

.coin-stack {
  position: absolute;
  width: 84px;
  height: 70px;
  border-radius: 50%;
  background:
    repeating-linear-gradient(to bottom, var(--gold) 0 7px, #6b4a20 7px 11px),
    var(--gold);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
}

.coin-stack::before {
  position: absolute;
  inset: -8px 0 auto;
  height: 24px;
  content: "";
  border-radius: 50%;
  background: linear-gradient(90deg, #fff0b6, var(--gold), #8e6025);
}

.coin-stack.one {
  right: 62px;
  bottom: 52px;
  transform: rotate(7deg);
}

.coin-stack.two {
  right: 138px;
  bottom: 26px;
  transform: rotate(-8deg) scale(0.72);
}

.wheel-stage {
  flex: 1 1 auto;
  min-width: 420px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 214, 74, 0.2), transparent 30%),
    radial-gradient(circle at 30% 24%, rgba(0, 194, 255, 0.2), transparent 34%),
    radial-gradient(circle at 78% 72%, rgba(255, 79, 183, 0.17), transparent 36%),
    var(--panel);
}

.wheel-stage::after {
  position: absolute;
  right: -16%;
  bottom: -20%;
  width: 62%;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(19, 221, 255, 0.22);
  transform: rotate(24deg);
}

.wheel-header {
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.wheel-header p {
  margin: 0 0 4px;
  color: var(--muted);
}

.wheel-header strong {
  color: var(--gold);
  font-size: 1.3rem;
}

.ghost-button,
.mini-action,
.primary-action {
  min-height: 42px;
  border: 1px solid rgba(240, 207, 130, 0.5);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button {
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  color: var(--paper);
  text-decoration: none;
  background: rgba(240, 207, 130, 0.08);
}

.admin-link {
  min-width: 68px;
}

.ghost-button:hover,
.mini-action:hover,
.primary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--paper);
}

.wheel-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 660px);
  aspect-ratio: 1;
  margin: 8px auto 0;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.44));
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.wheel-pointer {
  position: absolute;
  top: -3px;
  left: 50%;
  z-index: 5;
  width: 0;
  height: 0;
  border-right: 26px solid transparent;
  border-left: 26px solid transparent;
  border-top: 54px solid var(--red);
  filter: drop-shadow(0 0 12px rgba(220, 74, 50, 0.6));
  transform: translateX(-50%);
}

.wheel-pointer::after {
  position: absolute;
  top: -52px;
  left: -11px;
  width: 22px;
  height: 22px;
  content: "";
  border-radius: 50%;
  background: var(--paper);
}

.spin-button {
  position: absolute;
  z-index: 4;
  width: 28%;
  min-width: 132px;
  aspect-ratio: 1;
  border: 3px solid rgba(240, 207, 130, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.26), transparent 26%),
    linear-gradient(145deg, #4f3920, #15100c 58%, #8c6230);
  box-shadow:
    inset 0 0 0 7px rgba(255, 247, 230, 0.08),
    0 0 34px rgba(240, 207, 130, 0.34),
    0 14px 26px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.spin-button span,
.spin-button strong {
  display: block;
}

.spin-button span {
  margin-top: 4px;
  color: var(--paper);
  font-size: 1.18rem;
  font-weight: 800;
}

.spin-button strong {
  color: var(--gold);
  font-size: 2.18rem;
  line-height: 1.05;
  font-weight: 950;
}

.spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.side-panel {
  flex: 0 0 25%;
  min-width: 280px;
  padding: 22px;
}

.draw-meter {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(0, 213, 189, 0.42);
  background: rgba(0, 213, 189, 0.08);
}

.code-panel {
  padding: 16px;
  border: 1px solid rgba(0, 213, 189, 0.42);
  background: rgba(0, 213, 189, 0.08);
}

.code-panel label {
  display: block;
  margin-bottom: 9px;
  color: var(--gold);
  font-weight: 900;
}

.code-panel .panel-heading {
  display: block;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 900;
}

.code-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.code-input-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(240, 207, 130, 0.42);
  color: var(--paper);
  background: rgba(0, 0, 0, 0.3);
  outline: none;
  padding: 10px 12px;
  font: inherit;
  text-transform: uppercase;
}

.code-input-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 213, 189, 0.12);
}

.code-panel p {
  min-height: 44px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.code-panel p[data-type="error"] {
  color: #ffb8aa;
}

.code-panel p[data-type="success"] {
  color: #8affef;
}

.draw-meter span,
.result-panel p,
.panel-title span,
.info-band span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.draw-meter strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 3rem;
  line-height: 1;
}

.mini-action {
  flex: 0 0 auto;
  padding: 0 12px;
  background: rgba(220, 74, 50, 0.18);
}

.result-panel,
.log-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.result-panel strong {
  display: block;
  min-height: 64px;
  margin: 8px 0;
  color: var(--paper);
  font-size: 1.8rem;
  line-height: 1.18;
}

.result-panel span {
  display: block;
  min-height: 48px;
  line-height: 1.55;
}

.primary-action {
  width: 100%;
  margin-top: 16px;
  padding: 0 16px;
  color: #1c1308;
  font-weight: 900;
  background: linear-gradient(180deg, #fff2b9, var(--gold) 48%, #b67e35);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.panel-title {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title small {
  color: var(--gold);
}

#historyList {
  min-height: 228px;
  max-height: 228px;
  margin: 14px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

#historyList li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#historyList li::before {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--gold);
  content: counter(item);
  counter-increment: item;
  border: 1px solid rgba(240, 207, 130, 0.46);
  border-radius: 50%;
}

#historyList {
  counter-reset: item;
}

#historyList strong,
#historyList span {
  display: block;
}

#historyList strong {
  overflow: hidden;
  color: var(--paper);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#historyList span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.info-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.info-band article {
  padding: 18px;
  border: 1px solid rgba(240, 207, 130, 0.25);
  background: rgba(8, 11, 10, 0.76);
}

.info-band strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 1.16rem;
}

.info-band p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.win-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 0;
  border: 1px solid rgba(240, 207, 130, 0.62);
  color: var(--ink);
  background: rgba(13, 18, 17, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.64);
}

.win-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-inner {
  position: relative;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(240, 207, 130, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(0, 213, 189, 0.08), transparent);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.dialog-inner p {
  margin: 0;
  color: var(--muted);
}

.dialog-inner strong {
  display: block;
  margin: 8px auto 10px;
  color: var(--gold);
  font-size: 2.2rem;
  line-height: 1.12;
}

.dialog-inner span {
  display: block;
  min-height: 48px;
  color: var(--paper);
  line-height: 1.6;
}

.screenshot-tip {
  display: block;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 213, 189, 0.34);
  color: #8affef;
  background: rgba(0, 213, 189, 0.08);
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .hero-grid {
    flex-wrap: wrap;
    min-height: 0;
  }

  .campaign-panel {
    flex: 1 1 100%;
    min-height: 380px;
  }

  .wheel-stage {
    flex: 1 1 560px;
  }

  .side-panel {
    flex: 1 1 320px;
  }

  .supply-art {
    width: 44%;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 18px, 720px);
    padding: 9px 0 18px;
  }

  .event-screen {
    min-height: 0;
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .hero-grid {
    gap: 12px;
  }

  .campaign-panel,
  .wheel-stage,
  .side-panel {
    min-width: 0;
    width: 100%;
    padding: 16px;
  }

  .campaign-panel {
    min-height: auto;
  }

  h1 {
    font-size: 3rem;
  }

  .offer-rack,
  .info-band {
    grid-template-columns: 1fr;
  }

  .supply-art {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(100%, 300px);
    height: 160px;
    margin: 22px auto 0;
    transform: none;
  }

  .case-lid,
  .case-body {
    left: 28px;
    width: 204px;
  }

  .case-lid {
    top: 28px;
    height: 46px;
  }

  .case-body {
    top: 72px;
    height: 78px;
  }

  .case-body span {
    top: 20px;
    width: 28px;
    height: 36px;
  }

  .case-body span:nth-child(1) {
    left: 24px;
  }

  .case-body span:nth-child(2) {
    left: 88px;
  }

  .case-body span:nth-child(3) {
    right: 24px;
  }

  .coin-stack {
    width: 58px;
    height: 50px;
  }

  .coin-stack::before {
    height: 18px;
  }

  .coin-stack.one {
    right: 34px;
    bottom: 34px;
  }

  .coin-stack.two {
    right: 96px;
    bottom: 18px;
  }

  .wheel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .wheel-shell {
    width: 100%;
  }

  .spin-button {
    min-width: 108px;
  }

  .spin-button span {
    font-size: 1rem;
  }

  .spin-button strong {
    font-size: 1.72rem;
  }

  #historyList {
    min-height: 150px;
    max-height: 150px;
  }
}

@media (max-width: 430px) {
  .brand strong {
    font-size: 1.12rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .offer-item {
    min-height: auto;
  }

  .draw-meter {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-input-row {
    grid-template-columns: 1fr;
  }
}
