/* ============ 基础 ============ */
:root {
  --bg-0: #0d0407;
  --bg-1: #1a0710;
  --red-0: #6d0c1a;
  --red-1: #9c1223;
  --red-2: #c2182c;
  --gold-0: #7a5a1c;
  --gold-1: #c99a3b;
  --gold-2: #f2cc69;
  --gold-3: #fff0b8;
  --cream: #fff6e2;
  --ink: #1a0a0e;
  --green: #2ee6a8;
  --font-ui: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --cell: clamp(100px, 13.4vh, 142px);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  color: var(--cream);
  background: #0b0306;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 背景：深色绒布 + 光晕 */
.bg-felt {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 50% 12%, #5d0a17 0%, #2a050c 45%, #0b0306 78%),
    radial-gradient(900px 600px at 50% 110%, #3a0710 0%, transparent 60%);
  z-index: -2;
}
.bg-felt::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.09) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}
.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(0,0,0,.65) 100%);
}

/* ============ 顶栏 ============ */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 3vw, 42px) 4px;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand-en {
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .42em;
  color: var(--gold-1);
  opacity: .85;
  text-transform: uppercase;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: .18em;
  font-weight: 800;
  background: linear-gradient(180deg, #fff6d8 10%, var(--gold-2) 45%, #b5812b 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.55));
}
.tools { display: flex; gap: 10px; }
.tool {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(242,204,105,.28);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.28));
  color: var(--gold-2);
  font-size: 18px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .16s, border-color .16s, box-shadow .16s, background .16s;
}
.tool:hover { transform: translateY(-2px); border-color: rgba(242,204,105,.65); box-shadow: 0 8px 20px rgba(0,0,0,.4), 0 0 18px rgba(242,204,105,.18); }
.tool:active { transform: translateY(0) scale(.96); }
.tool.off { opacity: .45; }
.tool-gear { opacity: .5; }
.tool-gear:hover { opacity: 1; }

/* ============ 舞台 ============ */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px 0;
}

.machine-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  transform-origin: 50% 55%;
}
.machine-wrap.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* ============ 机身 ============ */
.cabinet {
  position: relative;
  width: min(850px, 78vw);
  padding: 20px 20px 18px;
  border-radius: 46px;
  background:
    linear-gradient(180deg, #8f1122 0%, #8f1122 3%, #5e0a17 38%, #430611 72%, #2b040b 100%);
  border: 2px solid rgba(255, 236, 180, .28);
  box-shadow:
    0 0 0 8px rgba(0,0,0,.55),
    0 0 0 10px rgba(201,154,59,.35),
    0 40px 90px rgba(0,0,0,.75),
    inset 0 2px 0 rgba(255,255,255,.16),
    inset 0 -3px 0 rgba(0,0,0,.5);
}
.cabinet::before {
  /* 金色描边内框 */
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 38px;
  border: 2px solid rgba(242,204,105,.55);
  box-shadow: inset 0 0 24px rgba(0,0,0,.6), 0 0 18px rgba(242,204,105,.14);
  pointer-events: none;
}
.cabinet::after {
  /* 玻璃高光 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 46px;
  background: linear-gradient(112deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.03) 26%, transparent 42%);
  pointer-events: none;
}

.cabinet-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 跑马灯灯泡 */
.bulbs { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bulb {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9dd, var(--gold-2) 42%, #8a5f18 100%);
  box-shadow: 0 0 10px rgba(255,220,130,.8), 0 0 20px rgba(255,180,60,.4);
  transform: translate(-50%, -50%);
  animation: bulbChase 2.4s linear infinite;
}
@keyframes bulbChase {
  0%, 100% { opacity: .45; box-shadow: 0 0 5px rgba(255,200,110,.3); }
  8% { opacity: 1; box-shadow: 0 0 12px rgba(255,235,170,1), 0 0 26px rgba(255,180,60,.65); }
  20% { opacity: .45; }
}
.cabinet.spinning .bulb { animation-duration: .5s; }
.cabinet.win .bulb { animation-duration: .45s; }

/* 顶部牌匾 */
.marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, #2a0509, #14030a);
  border: 1px solid rgba(242,204,105,.35);
  box-shadow: inset 0 3px 10px rgba(0,0,0,.85), 0 0 22px rgba(194,24,44,.25);
}
.marquee-text {
  font-size: 17px;
  letter-spacing: .5em;
  text-indent: .5em;
  font-weight: 700;
  color: #ffdf9b;
  text-shadow: 0 0 12px rgba(255,170,60,.7), 0 0 26px rgba(255,120,0,.35);
}
.marquee-star { color: var(--gold-1); font-size: 12px; opacity: .8; }

/* ============ 转轮 ============ */
.reels-frame {
  position: relative;
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #17040a, #0b0206);
  border: 1px solid rgba(242,204,105,.45);
  box-shadow:
    inset 0 0 0 3px rgba(201,154,59,.18),
    inset 0 10px 28px rgba(0,0,0,.9),
    0 6px 0 rgba(0,0,0,.35);
}
.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.reel {
  position: relative;
  height: calc(var(--cell) * 3);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #1b1b22 0%, #0e0e14 42%, #08080c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.08),
    inset 0 18px 28px rgba(0,0,0,.85),
    inset 0 -18px 28px rgba(0,0,0,.85);
}
.reel::before {
  /* 上下两行的压暗，让中间一行成为焦点 */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0,0,0,.9) 0%, rgba(0,0,0,.8) 12%, rgba(0,0,0,.5) 24%, rgba(0,0,0,.06) 33%,
    rgba(0,0,0,.06) 67%, rgba(0,0,0,.5) 76%, rgba(0,0,0,.8) 88%, rgba(0,0,0,.9) 100%);
}
.reel::after {
  /* 玻璃反光 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 26%, rgba(255,255,255,0) 72%, rgba(0,0,0,.35) 100%);
  pointer-events: none;
  z-index: 4;
}
.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
.cell {
  height: var(--cell);
  flex: 0 0 var(--cell);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 8px;
  text-align: center;
}
.cell-emoji {
  font-size: clamp(32px, 4.8vh, 50px);
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.6));
}
.cell-name {
  font-size: clamp(12px, 1.85vh, 17px);
  font-weight: 700;
  letter-spacing: .04em;
  color: #ffeecd;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}
.cell-empty .cell-name { color: #b99a8e; font-size: 15px; font-weight: 500; }

.reel.hit { animation: reelHit .45s ease-out; }
@keyframes reelHit {
  0% { box-shadow: inset 0 0 0 2px rgba(255,225,150,.95), 0 0 30px rgba(255,190,80,.75); }
  100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
}
/* 中奖高亮 */
.reel.winner {
  box-shadow:
    inset 0 0 0 2px rgba(255,226,150,.9),
    0 0 26px rgba(255,180,60,.55),
    inset 0 18px 28px rgba(0,0,0,.6);
}
.reel.winner .cell-name { color: #fff7dc; text-shadow: 0 0 14px rgba(255,190,80,.9); }

.win-band {
  position: absolute;
  left: 12px; right: 12px;
  top: 50%;
  height: calc(var(--cell) + 10px);
  transform: translateY(-50%);
  border-radius: 12px;
  background: linear-gradient(90deg,
    rgba(255,210,120,0) 0%, rgba(255,210,120,.10) 14%,
    rgba(255,228,165,.24) 50%, rgba(255,210,120,.10) 86%, rgba(255,210,120,0) 100%);
  border-top: 1px solid rgba(255,226,160,.5);
  border-bottom: 1px solid rgba(255,226,160,.5);
  box-shadow: 0 0 30px rgba(255,190,80,.4), inset 0 0 26px rgba(255,190,80,.16);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 2;
}
.win-band.show { opacity: 1; animation: bandPulse 1.8s ease-in-out infinite; }
@keyframes bandPulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }

/* 中奖线 */
.payline {
  position: absolute;
  left: 8px; right: 8px;
  top: 50%;
  height: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.payline.show { opacity: 1; }
.pl-line {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,220,140,.75) 12%, rgba(255,220,140,.75) 88%, transparent);
  box-shadow: 0 0 12px rgba(255,180,60,.8);
}
.pl-arrow {
  position: absolute;
  top: -7px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.pl-arrow.left { left: -12px; border-left: 10px solid var(--gold-2); filter: drop-shadow(0 0 8px rgba(255,190,80,.9)); }
.pl-arrow.right { right: -12px; border-right: 10px solid var(--gold-2); filter: drop-shadow(0 0 8px rgba(255,190,80,.9)); }

/* 底部操作区 */
.base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 10px 4px;
}
.coin-slot, .bet-plate {
  width: 86px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2b060d, #150207);
  border: 1px solid rgba(242,204,105,.35);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.coin-slit { width: 40px; height: 5px; border-radius: 3px; background: #050102; box-shadow: 0 0 8px rgba(255,190,80,.25), inset 0 0 4px #000; }
.coin-label, .bet-label { font-family: var(--font-num); font-size: 8px; letter-spacing: .3em; color: var(--gold-1); opacity: .8; }
.bet-value { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--gold-2); line-height: .8; }

.spin-btn {
  position: relative;
  width: 112px; height: 112px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff8e2;
  background:
    radial-gradient(circle at 50% 24%, #ff5b66 0%, #d1142b 34%, #8d0a1b 62%, #4d0410 100%);
  box-shadow:
    0 0 0 4px #2a0509,
    0 0 0 6px rgba(242,204,105,.6),
    0 10px 0 #35030a,
    0 16px 30px rgba(0,0,0,.7),
    inset 0 3px 12px rgba(255,255,255,.35),
    inset 0 -10px 20px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.spin-btn .spin-text { font-size: 25px; font-weight: 800; letter-spacing: .12em; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.spin-btn .spin-sub { font-family: var(--font-num); font-size: 8px; letter-spacing: .28em; opacity: .65; }
.spin-btn .spin-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(255,230,170,.35);
  animation: ringSpin 14s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
.spin-btn:hover { filter: brightness(1.08); }
.spin-btn:active, .spin-btn.pressed { transform: translateY(6px); box-shadow: 0 0 0 4px #2a0509, 0 0 0 6px rgba(242,204,105,.6), 0 4px 0 #35030a, 0 8px 18px rgba(0,0,0,.7), inset 0 3px 12px rgba(255,255,255,.25), inset 0 -8px 18px rgba(0,0,0,.6); }
.spin-btn:disabled { cursor: default; filter: saturate(.5) brightness(.75); }
.spin-btn:disabled .spin-ring { animation-play-state: paused; }

/* ============ 摇杆 ============ */
.lever {
  position: absolute;
  right: -70px;
  top: 34px;
  bottom: 26px;
  width: 78px;
  z-index: 1;
  cursor: pointer;
}
.lever-arm {
  position: absolute;
  left: 50%; bottom: 22px;
  width: 46px;
  height: calc(100% - 26px);
  transform: translateX(-50%) rotate(-3.5deg);
  transform-origin: 50% 100%;
  transition: transform .3s cubic-bezier(.34,1.45,.64,1);
}
.lever-rod {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 12px;
  transform: translateX(-50%);
  border-radius: 8px;
  background: linear-gradient(90deg, #6b6b74 0%, #d8d8de 28%, #f6f6fa 48%, #b8b8c2 66%, #5c5c66 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,.55), inset 0 0 6px rgba(255,255,255,.4);
}
.lever-knob {
  position: absolute;
  left: 50%; top: -46px;
  transform: translateX(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ff8b8b 0%, #e01f36 30%, #9d0c1e 62%, #4d0410 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.7), inset -4px -6px 14px rgba(0,0,0,.45), inset 3px 3px 10px rgba(255,255,255,.3);
}
.knob-shine {
  position: absolute;
  left: 22%; top: 16%;
  width: 16px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  filter: blur(2px);
  transform: rotate(-24deg);
}
.lever-base {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 66px; height: 28px;
  border-radius: 9px;
  background: linear-gradient(180deg, #a5162a, #3a050d);
  border: 1px solid rgba(242,204,105,.45);
  box-shadow: 0 8px 16px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.2);
  z-index: 2;
}
.lever-rod::after {
  /* 杆身插入底座的阴影 */
  content: "";
  position: absolute;
  left: -1px; right: -1px;
  bottom: 0; height: 26px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.55));
}
.lever.pulled .lever-arm { transform: translateX(-50%) rotate(13deg); }
.lever:hover .lever-knob { box-shadow: 0 8px 22px rgba(0,0,0,.7), 0 0 24px rgba(255,60,80,.45), inset -4px -6px 14px rgba(0,0,0,.45); }

.machine-shadow {
  position: absolute;
  left: 4%; right: 4%;
  bottom: -46px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.75), transparent 70%);
  filter: blur(14px);
  z-index: -1;
}

/* ============ 历史 ============ */
.history-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(18px, 3vw, 42px) 18px;
  min-height: 46px;
}
.hist-label {
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--gold-1);
  opacity: .85;
  white-space: nowrap;
}
.hist-list {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  flex-wrap: nowrap;
}
.hist-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(0,0,0,.25));
  border: 1px solid rgba(242,204,105,.22);
  font-size: 12.5px;
  color: #f7e7cd;
  white-space: nowrap;
  animation: chipIn .3s ease-out;
}
.hist-chip .he { font-size: 14px; }
.hist-chip.new { border-color: rgba(255,214,120,.75); box-shadow: 0 0 16px rgba(255,180,60,.3); }
.hist-empty, .muted { color: #a4888c; font-size: 12.5px; }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }

/* ============ 遮罩 / 弹层 ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6,2,4,.72);
  backdrop-filter: blur(6px);
  animation: fadeIn .22s ease-out;
}
.overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: min(720px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(180deg, #23050d, #14030a 60%, #0d0207);
  border: 1px solid rgba(242,204,105,.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 40px 80px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
  animation: cardIn .26s cubic-bezier(.2,1.4,.4,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(242,204,105,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: .16em; color: #ffe6b0; font-weight: 700; }
.panel-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #e8cfc2;
  cursor: pointer;
  font-size: 14px;
  transition: .15s;
}
.panel-close:hover { background: rgba(255,80,90,.18); border-color: rgba(255,90,100,.5); color: #fff; }
.panel-body { flex: 1 1 auto; min-height: 0; padding: 20px 22px; overflow-y: auto; }
.panel-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid rgba(242,204,105,.16);
  background: rgba(0,0,0,.25);
}
.foot-spacer { flex: 1; }
.save-hint { font-size: 12px; color: #a4888c; }
.save-hint.dirty { color: #ffb35c; }

/* 按钮 */
.btn {
  border-radius: 11px;
  padding: 11px 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s, filter .16s, background .16s, border-color .16s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #2a0508;
  background: linear-gradient(180deg, #ffe8ad 0%, #e9bb52 48%, #b2801f 100%);
  border-color: rgba(255,240,190,.8);
  box-shadow: 0 6px 16px rgba(180,120,20,.35), inset 0 1px 0 rgba(255,255,255,.7);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost {
  color: #f0dcc0;
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.15);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(242,204,105,.45); }
.btn-ghost.danger { color: #ff9a9a; border-color: rgba(255,90,90,.28); }
.btn-ghost.danger:hover { background: rgba(255,60,60,.14); }

/* 输入 */
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input::placeholder { color: #8a6f74; }
.input:focus { border-color: rgba(242,204,105,.7); box-shadow: 0 0 0 3px rgba(242,204,105,.14); }

/* 结果卡 */
.result-card {
  position: relative;
  width: min(520px, 90vw);
  padding: 38px 34px 30px;
  border-radius: 26px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #7d1020 0%, #3d0712 48%, #1a0309 100%);
  border: 2px solid rgba(242,204,105,.65);
  box-shadow: 0 0 0 6px rgba(0,0,0,.5), 0 0 70px rgba(255,150,40,.28), 0 40px 90px rgba(0,0,0,.8);
  overflow: hidden;
  animation: cardIn .34s cubic-bezier(.2,1.5,.4,1);
}
.result-rays {
  position: absolute;
  left: 50%; top: 40%;
  width: 260%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg,
    rgba(255,205,110,.16) 0deg 8deg, transparent 8deg 20deg,
    rgba(255,205,110,.16) 20deg 28deg, transparent 28deg 40deg);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 8%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 8%, transparent 62%);
  opacity: .8;
  animation: raysSpin 26s linear infinite;
  pointer-events: none;
}
@keyframes raysSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.result-kicker {
  position: relative;
  font-size: 12px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: var(--gold-2);
  opacity: .95;
}
.result-emoji {
  position: relative;
  font-size: 122px;
  line-height: 1.1;
  margin: 4px 0 0;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.65));
  animation: pop .55s cubic-bezier(.2,1.8,.4,1) both .06s;
}
@keyframes pop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(3deg); opacity: 1; } 100% { transform: scale(1); } }
.result-name {
  position: relative;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: .06em;
  margin-top: 2px;
  background: linear-gradient(180deg, #fffdf2 8%, #ffe09a 42%, #e0a53c 76%, #a3701b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.55));
}
.result-sub { position: relative; margin-top: 10px; font-size: 13.5px; color: #f0c4b4; opacity: .9; letter-spacing: .06em; }
.result-actions { position: relative; display: flex; gap: 12px; justify-content: center; margin-top: 26px; }

/* 后台 */
.admin-panel { width: min(760px, 94vw); }
.lock-icon { font-size: 40px; text-align: center; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.lock-tip { text-align: center; color: #f0d3c4; font-size: 14px; margin: 10px 0 16px; }
.pwd-input { max-width: 320px; margin: 0 auto 10px; display: block; text-align: center; letter-spacing: .3em; }
#lockView .btn-primary { display: block; margin: 12px auto 0; min-width: 160px; }
.lock-hint { text-align: center; font-size: 12px; color: #9a7d82; margin-top: 18px; }
.lock-hint b { color: var(--gold-2); }
.lock-error { min-height: 18px; text-align: center; font-size: 12.5px; color: #ff8b8b; }
.lock-error.shake { animation: shake .4s; }

.admin-add { display: flex; gap: 10px; }
.emoji-input { width: 74px; text-align: center; font-size: 20px; padding-left: 4px; padding-right: 4px; }
.name-input { flex: 1; }
.emoji-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.eq {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: .14s;
}
.eq:hover { background: rgba(242,204,105,.16); border-color: rgba(242,204,105,.5); transform: translateY(-1px); }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
  font-size: 12.5px;
  letter-spacing: .14em;
  color: var(--gold-1);
}
.list-count { color: #8f7277; letter-spacing: 0; }
.food-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.food-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
}
.food-row:hover { border-color: rgba(242,204,105,.35); }
.food-row .input { padding: 7px 10px; font-size: 13.5px; background: rgba(0,0,0,.25); }
.food-row .row-emoji { width: 52px; text-align: center; font-size: 17px; padding-left: 2px; padding-right: 2px; }
.food-row .row-name { flex: 1; }
.food-row .row-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: #a4888c; white-space: nowrap; cursor: pointer;
}
.food-row .row-toggle input { accent-color: #d8a33c; cursor: pointer; }
.row-del {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: transparent;
  color: #d38a8a;
  cursor: pointer;
  font-size: 14px;
}
.row-del:hover { background: rgba(255,60,60,.18); border-color: rgba(255,80,80,.5); color: #fff; }
.food-row.disabled { opacity: .45; }

.bulk { margin-top: 16px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.bulk summary { cursor: pointer; font-size: 13px; color: #e6cdb6; letter-spacing: .05em; }
.bulk summary:hover { color: var(--gold-2); }
.bulk .small { font-size: 11.5px; margin: 8px 0; }
.bulk code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.bulk-text { min-height: 92px; margin-top: 8px; resize: vertical; font-size: 13px; line-height: 1.7; }
.bulk-actions { display: flex; gap: 10px; margin-top: 8px; }
.pwd-row { display: flex; gap: 10px; margin-top: 12px; }
.pwd-row .input { flex: 1; }
.pwd-row .btn { white-space: nowrap; }

/* 历史面板 */
.history-panel .panel-body { max-height: 60vh; }
.hist-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.hist-line .he { font-size: 22px; }
.hist-line .hn { flex: 1; font-size: 14px; }
.hist-line .ht { font-size: 11.5px; color: #8f7277; font-family: var(--font-num); }

/* 撒花 */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  display: none;
}
#confetti.on { display: block; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(24,4,9,.94);
  border: 1px solid rgba(242,204,105,.45);
  color: #ffe9c2;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(242,204,105,.22); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(242,204,105,.4); }

/* 响应式 */
@media (max-height: 800px) {
  .result-emoji { font-size: 88px; }
  .cabinet { padding: 16px 16px 14px; }
}
@media (max-height: 700px) {
  .spin-btn { width: 96px; height: 96px; }
  .spin-btn .spin-text { font-size: 21px; }
  .marquee { height: 38px; }
}
@media (max-width: 1080px) {
  .cabinet { width: min(700px, 78vw); }
  .lever { right: -74px; width: 68px; }
}
