:root {
  --ink: #070b12;
  --ink-2: #0b1220;
  --panel: rgba(14, 23, 36, .86);
  --line: rgba(240, 180, 41, .18);
  --line-2: rgba(160, 190, 215, .22);
  --gold: #f0b429;
  --gold-2: #ffd166;
  --cyan: #2bb3e0;
  --text: #eef4fa;
  --muted: #8ea3b6;
  --muted-2: #62788c;
  --red: #e0472d;
  --r: 6px;
  --ease: cubic-bezier(.2, .8, .25, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text); overflow: hidden;
  font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-image:
    radial-gradient(900px 600px at 50% -10%, rgba(43, 179, 224, .16), transparent 62%),
    radial-gradient(700px 520px at 90% 100%, rgba(240, 180, 41, .10), transparent 60%),
    linear-gradient(180deg, #070b12, #05080e);
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }

.stage { height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(14px, 2vw, 28px) clamp(16px, 2.6vw, 40px); gap: clamp(8px, 1.4vw, 18px); }

/* 顶栏 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 6px rgba(240, 180, 41, .14); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(240, 180, 41, 0); } }
.brand h1 { font-size: clamp(1.1rem, 1.7vw, 1.5rem); letter-spacing: .04em; }
.brand p { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 10px; }
.pill { font-size: .78rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 100px; padding: 6px 12px; white-space: nowrap; }
.ghost-btn { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); border-radius: 4px; padding: 7px 13px; font-size: .8rem; text-decoration: none; }
.ghost-btn:hover { color: var(--gold); border-color: var(--gold); }

/* 主体 */
.board { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 380px); gap: clamp(16px, 2.4vw, 40px); min-height: 0; align-items: center; }

.wheel-wrap { position: relative; display: grid; place-items: center; min-height: 0; }
.wheel-glow { position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(240, 180, 41, .20), rgba(43, 179, 224, .10) 45%, transparent 70%); filter: blur(28px); }
#wheel { width: min(100%, calc(100vh - 210px)); height: auto; aspect-ratio: 1; max-height: 100%; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55)); }
.pointer { position: absolute; top: calc(50% - min(50%, (100vh - 210px) / 2) - 8px); left: 50%; transform: translateX(-50%); width: clamp(26px, 3vw, 40px); z-index: 3; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.pointer svg { width: 100%; height: auto; display: block; }

.spin-btn {
  position: absolute; width: clamp(96px, 10vw, 132px); aspect-ratio: 1; border-radius: 50%; z-index: 4;
  border: 3px solid rgba(255, 210, 120, .85);
  background: radial-gradient(circle at 35% 30%, #ffd97a, #f0a91a 45%, #b96f00);
  color: #43290a; font-weight: 800; font-size: clamp(.9rem, 1.15vw, 1.05rem); line-height: 1.25;
  letter-spacing: .06em; display: grid; place-items: center; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 -4px 10px rgba(120, 60, 0, .4);
  transition: transform .18s var(--ease), box-shadow .25s;
}
.spin-btn:hover:not(:disabled) { transform: scale(1.04); }
.spin-btn:active:not(:disabled) { transform: scale(.97); }
.spin-btn:disabled { filter: grayscale(.25) brightness(.86); cursor: default; }
.spin-ring { position: absolute; inset: -9px; border-radius: 50%; border: 2px dashed rgba(255, 214, 130, .45); animation: spinRing 14s linear infinite; }
@keyframes spinRing { to { transform: rotate(360deg); } }

/* 侧栏 */
.side { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; max-height: 100%; }
.records-panel { min-height: 168px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; backdrop-filter: blur(10px); }
.panel-label { font-size: .72rem; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.winner-name { font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; margin: 8px 0 4px; min-height: 1.1em; transition: color .2s; }
.winner-name.flash { color: var(--gold-2); }
.winner-prize { font-size: .9rem; color: var(--muted); min-height: 1.4em; }
.stats-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; padding: 14px; }
.stat b { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.stat span { font-size: .72rem; color: var(--muted-2); }
.records-panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted-2); font-size: .72rem; }
.records { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; max-height: 32vh; }
.records li { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: .82rem; padding: 8px 10px; background: rgba(255, 255, 255, .025); border-left: 2px solid var(--line-2); border-radius: 3px; }
.records li b { font-weight: 600; }
.records li em { font-style: normal; color: var(--muted-2); font-size: .74rem; }
.records li.empty { border: 0; background: none; color: var(--muted-2); justify-content: center; }

.foot { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; color: var(--muted-2); }
kbd { background: rgba(255, 255, 255, .07); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 6px; font-size: .7rem; margin: 0 2px; }

/* 提示 & 彩带 */
.toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); background: rgba(12, 20, 32, .96); border: 1px solid var(--line); color: var(--text); padding: 11px 18px; border-radius: 4px; font-size: .85rem; opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; width: 8px; height: 14px; opacity: .95; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .1; } }

/* 中奖弹层 */
.modal { position: fixed; inset: 0; background: rgba(4, 7, 12, .82); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 70; padding: 20px; }
.modal.on { display: grid; }
.modal-card { width: min(520px, 100%); background: linear-gradient(180deg, #101a28, #0a1220); border: 1px solid var(--line); border-radius: 10px; padding: 30px; text-align: center; box-shadow: 0 40px 90px rgba(0, 0, 0, .6); }
.modal-card .eyebrow { font-size: .72rem; letter-spacing: .3em; color: var(--gold); }
.modal-card h2 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 12px 0 6px; }
.modal-card p { color: var(--muted); margin: 0 0 22px; }
.modal-card .btn-gold { border: 0; border-radius: 4px; padding: 12px 26px; background: linear-gradient(180deg, #ffd166, #e0a013); color: #3b2506; font-weight: 700; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .stage { height: auto; min-height: 100%; }
  .board { grid-template-columns: 1fr; }
  #wheel { width: min(92vw, 520px); }
  .pointer { top: 18px; }
  .side { max-height: none; }
  .records { max-height: 220px; }
  .foot { flex-direction: column; gap: 6px; }
}
