:root {
  --orange: #ff6528;
  --deep-orange: #d84510;
  --gold: #ffd56a;
  --cream: #fff5e3;
  --line: #d3ab5e;
  --ink: #3f2b1c;
  --muted: #7a6656;
  --green: #207a5a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f7e9bf;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: #fff6da url("./assets/topbar_x.jpg") repeat-x;
  border-bottom: 1px solid rgba(160, 101, 31, 0.22);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1200px, calc(100% - 32px));
  min-height: 56px;
  margin: 0 auto;
}

.brand {
  color: var(--deep-orange);
  font-size: 22px;
  font-weight: 800;
}

.nav {
  display: flex;
  gap: 6px;
  margin-right: auto;
}

.nav a {
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 15px;
}

.nav a:hover {
  color: #fff;
  background: var(--orange);
}

.status {
  padding: 7px 12px;
  color: var(--green);
  border: 1px solid rgba(32, 122, 90, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.status-button {
  font: inherit;
  cursor: pointer;
}

.status-button[hidden] {
  display: none;
}

.page {
  min-height: 100vh;
  padding-bottom: 56px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.64), transparent 28%),
    linear-gradient(180deg, #fff0bd 0%, #f7e9bf 42%, #f4db9b 100%);
}

.hero {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 10px;
}

.hero__copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--deep-orange);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--orange);
  font-size: 42px;
  line-height: 1.15;
}

.hero p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.lottery-shell {
  display: grid;
  grid-template-columns: minmax(600px, 1fr) 520px;
  gap: 36px;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  align-items: start;
}

.wheel-panel {
  min-height: 642px;
  position: relative;
}

.box-lottery {
  position: relative;
  width: 615px;
  height: 615px;
  margin: 0 auto;
  overflow: hidden;
  background: url("./assets/bg_lottery.png") center / contain no-repeat;
  filter: drop-shadow(0 24px 32px rgba(166, 92, 0, 0.22));
}

.lottery-wrap {
  position: absolute;
  inset: 43px;
  border-radius: 50%;
  background:
    conic-gradient(
      from -30deg,
      #fff1b7 0deg 60deg,
      #ffcf5a 60deg 120deg,
      #fff1b7 120deg 180deg,
      #ffcf5a 180deg 240deg,
      #fff1b7 240deg 300deg,
      #ffcf5a 300deg 360deg
    );
  box-shadow: inset 0 0 0 10px rgba(255, 109, 28, 0.14);
  transform: rotate(0deg);
  transition: transform 4.2s cubic-bezier(0.12, 0.78, 0.18, 1);
}

.lottery-wrap::before,
.lottery-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.lottery-wrap::before {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(225, 84, 0, 0.32) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(30deg, transparent calc(50% - 1px), rgba(225, 84, 0, 0.32) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(150deg, transparent calc(50% - 1px), rgba(225, 84, 0, 0.32) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}

.lottery-wrap::after {
  inset: 10px;
  border: 2px solid rgba(255, 255, 255, 0.64);
}

.lottery-wrap span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 138px;
  min-height: 96px;
  margin-left: -69px;
  margin-top: -240px;
  transform-origin: 50% 240px;
  text-align: center;
  z-index: 1;
}

.lottery-wrap i {
  display: block;
  width: 100%;
  min-height: 30px;
  margin: 0 0 8px;
  color: #ed5400;
  font-size: 20px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.lottery-wrap b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 34px;
  padding: 6px 10px;
  color: #7a3400;
  border: 1px solid rgba(237, 84, 0, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 15px;
  font-weight: 700;
}

.wheel-six span {
  width: 138px;
}

.lottery-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 161px;
  height: 161px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.lottery-btn i {
  position: absolute;
  top: -30px;
  left: 50%;
  width: 41px;
  height: 39px;
  margin-left: -20.5px;
  background: url("./assets/icon_point.png") center / contain no-repeat;
  transform-origin: 50% 102.5px;
}

.lottery-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/btn_lottery.png") center / contain no-repeat;
}

.lottery-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lottery-btn:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

.lottery-btn:disabled {
  cursor: wait;
  filter: grayscale(0.25);
}

.side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 28px;
}

.sidebox {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 14px 24px rgba(154, 86, 0, 0.12);
}

.sidebox:nth-last-child(-n + 2) {
  grid-column: 1 / -1;
}

.sidebox__hd {
  min-height: 48px;
  padding: 13px 16px 0;
  background: linear-gradient(135deg, var(--orange), #ff8b2f);
}

.sidebox__hd h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.sidebox__bd {
  min-height: 132px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--cream);
}

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6528, #f4ad30);
  font-size: 22px;
  font-weight: 800;
}

.profile strong {
  color: var(--deep-orange);
  font-size: 17px;
}

.profile p {
  margin: 8px 0 0;
}

.config-state {
  padding: 18px;
}

.config-state p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-link,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

.admin-link,
.btn-primary {
  color: #fff;
  background: var(--orange);
}

.btn-secondary {
  color: var(--deep-orange);
  border: 1px solid rgba(216, 69, 16, 0.34);
  background: #fff7ea;
}

#score {
  color: var(--deep-orange);
  font-weight: 800;
}

.prize-area,
.winner-area {
  height: 262px;
  overflow: hidden;
}

.prize-list {
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.prize-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border-bottom: 1px solid #ded9cf;
  color: #3d2d22;
  font-size: 14px;
}

.prize-list li.empty {
  justify-content: center;
  min-height: 160px;
  color: var(--muted);
}

.prize-list em {
  color: var(--deep-orange);
  font-style: normal;
  white-space: nowrap;
}

.rules {
  width: min(1200px, calc(100% - 32px));
  margin: 28px auto 0;
  padding: 24px 26px;
  border: 1px solid rgba(211, 171, 94, 0.74);
  border-radius: 8px;
  background: rgba(255, 245, 227, 0.8);
}

.rules h2 {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 22px;
}

.rules ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(55, 28, 8, 0.38);
}

.dialog[hidden] {
  display: none;
}

.dialog__panel {
  width: min(520px, 100%);
  padding: 28px;
  text-align: center;
  border: 1px solid rgba(255, 213, 106, 0.55);
  border-radius: 10px;
  background: #fffaf0;
  box-shadow: 0 24px 80px rgba(58, 24, 0, 0.28);
}

.dialog__panel h2 {
  margin: 0 0 10px;
  color: var(--deep-orange);
}

.dialog__panel p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.dialog__media {
  margin: 0 0 18px;
}

.dialog__media:empty {
  display: none;
}

.dialog__media video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 8px;
  background: #000;
}

.dialog__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.admin-page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(211, 171, 94, 0.74);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.95);
  box-shadow: 0 18px 44px rgba(154, 86, 0, 0.14);
}

.login-card h1 {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 30px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.login-card input {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  color: var(--ink);
  border: 1px solid rgba(211, 171, 94, 0.82);
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.login-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
}

.login-error[hidden],
.login-panel[hidden],
.admin-hero[hidden],
.admin-panel[hidden] {
  display: none;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.admin-hero h1 {
  margin: 0 0 8px;
  color: var(--orange);
  font-size: 34px;
}

.admin-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-panel {
  border: 1px solid rgba(211, 171, 94, 0.74);
  border-radius: 8px;
  background: rgba(255, 245, 227, 0.9);
  overflow: hidden;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(211, 171, 94, 0.56);
}

.admin-toolbar__buttons {
  display: flex;
  gap: 10px;
}

.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.prize-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.editor-card {
  border: 1px solid rgba(211, 171, 94, 0.8);
  border-radius: 8px;
  background: #fffaf0;
  overflow: hidden;
}

.editor-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ff8b2f);
}

.editor-card__head h2 {
  margin: 0;
  font-size: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(211, 171, 94, 0.82);
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 12px 18px;
  color: #fff;
  border-radius: 999px;
  background: rgba(63, 43, 28, 0.92);
  box-shadow: 0 12px 30px rgba(58, 24, 0, 0.24);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .lottery-shell {
    grid-template-columns: 1fr;
  }

  .wheel-panel {
    min-height: 615px;
  }

  .side-grid {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .topbar__inner {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 10px 0;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .hero h1 {
    font-size: 34px;
  }

  .wheel-panel {
    min-height: calc(100vw - 32px);
  }

  .box-lottery {
    width: min(615px, calc(100vw - 32px));
    height: min(615px, calc(100vw - 32px));
  }

  .lottery-wrap {
    inset: 7%;
  }

  .lottery-wrap span {
    left: 50%;
    top: 50%;
    width: 24%;
    min-height: 72px;
    margin-left: -12%;
    margin-top: -39%;
    transform-origin: 50% 39vw;
  }

  .lottery-wrap i {
    min-height: 24px;
    height: auto;
    margin-top: 0;
    font-size: clamp(12px, 3.1vw, 22px);
    line-height: 1.2;
  }

  .lottery-wrap b {
    min-width: 54px;
    min-height: 26px;
    padding: 4px 7px;
    font-size: clamp(10px, 2.5vw, 15px);
  }

  .lottery-btn {
    width: 27%;
    height: 27%;
  }

  .lottery-btn i {
    top: -18%;
    width: 25%;
    height: 25%;
    margin-left: -12.5%;
  }

  .side-grid {
    grid-template-columns: 1fr;
  }

  .wheel-six span {
    width: 24%;
  }

  .admin-hero,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .prize-editor,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
