:root {
  --orange: #FF8A3D;
  --gold: #f6c544;
  --gold-deep: #b87a1c;
  --neon-pink: #ff3fb4;
  --neon-blue: #37c8ff;
  --board-purple: #4a166e;
  --led-red: #ff3b30;
  --led-dim: #4a1410;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: #0d0618;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  color: #fff;
}
button { font: inherit; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mp-icon { display: inline-flex; align-items: center; justify-content: center; font-style: normal; }

/* ===== 整机柜：竖屏铺满，星空背景 ===== */
.cabinet {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 10px max(14px, env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(1.5px 1.5px at 12% 8%, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 78% 5%, #ffd6f4 60%, transparent),
    radial-gradient(2px 2px at 40% 12%, #bfe8ff 60%, transparent),
    radial-gradient(1.5px 1.5px at 90% 14%, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 22% 18%, #ffe9a8 60%, transparent),
    radial-gradient(1.5px 1.5px at 62% 20%, #fff 60%, transparent),
    linear-gradient(180deg, #160a2e 0%, #2a0f47 38%, #3a1258 62%, #241033 100%);
}

/* ===== 顶部拱形 LUCKY 灯牌 ===== */
.arch {
  position: relative;
  height: 108px;
  margin-top: max(6px, env(safe-area-inset-top));
  border-radius: 50% 50% 14px 14px / 62% 62% 14px 14px;
  background: linear-gradient(180deg, #2b0a4d 0%, #1c0736 70%, #120425 100%);
  border: 3px solid #caa23a;
  box-shadow: inset 0 0 24px rgba(255, 63, 180, .35), 0 4px 0 #7a5a16;
  overflow: hidden;
}
.arch-neon {
  position: absolute;
  inset: 12px 14px 10px;
  border: 3px solid var(--neon-pink);
  border-radius: 50% 50% 10px 10px / 70% 70% 10px 10px;
  box-shadow: 0 0 10px var(--neon-pink), 0 0 22px rgba(255, 63, 180, .6), inset 0 0 10px rgba(255, 63, 180, .5);
  pointer-events: none;
}
.arch-bulbs { position: absolute; inset: 0; pointer-events: none; }
.arch-bulbs .bulb {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue), 0 0 14px rgba(55, 200, 255, .7);
  animation: bulbBlink 1.1s steps(2, end) infinite;
}
.arch-bulbs .bulb.warm {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold), 0 0 14px rgba(246, 197, 68, .7);
}
.arch-bulbs .bulb:nth-child(2n) { animation-delay: .55s; }
@keyframes bulbBlink { 50% { opacity: .35; } }

.lucky-title {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  margin: 0;
  text-align: center;
  font-size: clamp(44px, 13vw, 62px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  color: #f4ecff;
  background: linear-gradient(180deg, #ffffff 0%, #d9b8ff 45%, #8f5fe0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 12px rgba(180, 120, 255, .55);
  filter: drop-shadow(0 3px 0 #5b2a9e) drop-shadow(0 0 10px rgba(255, 63, 180, .5));
}

/* ===== 计分条 ===== */
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 3px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, #5a2a12, #3a1808);
  box-shadow: inset 0 2px 0 rgba(255, 220, 140, .5), 0 3px 0 #6e4510;
}
.score-cell { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.score-label { color: #ffe9b8; font-size: clamp(11px, 3.4vw, 14px); font-weight: 800; white-space: nowrap; }
.led {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  text-align: right;
  font-family: "Courier New", monospace;
  font-size: clamp(16px, 5.2vw, 22px);
  font-weight: 900;
  color: var(--led-red);
  background: #160406;
  border: 2px solid #2c0a08;
  border-radius: 6px;
  text-shadow: 0 0 6px rgba(255, 59, 48, .85);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
}
.led.bump { animation: ledBump .4s ease; }
@keyframes ledBump { 40% { color: #ffd0a0; text-shadow: 0 0 12px #ff8a3d; } }
.back-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  color: #5a2a12;
  font-size: 14px;
  font-weight: 900;
  background: linear-gradient(180deg, #fff4d0, #e8c477);
  box-shadow: 0 3px 0 #a8772e;
}
.back-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a8772e; }

/* ===== 跑马灯灯圈 ===== */
.ring-board {
  margin-top: 10px;
  padding: 10px;
  border: 3px solid var(--gold);
  border-radius: 18px;
  background: linear-gradient(180deg, #2a0a45, #180628);
  box-shadow: inset 0 0 18px rgba(255, 63, 180, .35), 0 4px 0 #6e4510;
}
.ring-frame {
  position: relative;
  border: 2px solid #ffe98a;
  border-radius: 14px;
  background: #1c0833;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .6);
  padding: 6px;
}
.ring-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  aspect-ratio: 1 / 1;
}
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, .25);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.slot .sym { font-size: clamp(26px, 8vw, 40px); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.slot .mult {
  margin-top: 2px;
  font-size: clamp(11px, 3.4vw, 15px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.slot.bg-apple { background: linear-gradient(160deg, #5fbf3a, #2f7d1c); }
.slot.bg-bell  { background: linear-gradient(160deg, #e86a7a, #a82f43); }
.slot.bg-bar   { background: linear-gradient(160deg, #b04be0, #6a1f96); }
.slot.bg-star  { background: linear-gradient(160deg, #2fb6e0, #146a9c); }
.slot.bg-luck  { background: linear-gradient(160deg, #ff9d3c, #d94f1e); }
.slot.bg-seven { background: linear-gradient(160deg, #d9a63a, #8a5a12); }
.slot .luck-word, .slot .bar-word, .slot .seven-word {
  font-weight: 900;
  font-style: italic;
  color: #fff7d6;
  text-shadow: 0 2px 0 rgba(0,0,0,.4), 0 0 8px rgba(255,220,120,.6);
  letter-spacing: .02em;
}
.slot .luck-word { font-size: clamp(15px, 4.6vw, 22px); }
.slot .bar-word { font-size: clamp(10px, 3vw, 14px); line-height: 1.05; text-align: center; }
.slot .seven-word { font-size: clamp(26px, 8vw, 40px); color: #ff4d3d; -webkit-text-stroke: 1.5px #ffd9a0; }

.slot.lit {
  z-index: 2;
  transform: scale(1.06);
  box-shadow: 0 0 0 3px #fff36b, 0 0 18px 6px rgba(255, 220, 60, .85);
}
.slot.winner {
  animation: winnerFlash .5s ease-in-out infinite alternate;
  box-shadow: 0 0 0 3px #fff, 0 0 22px 8px rgba(255, 235, 100, .95);
}
@keyframes winnerFlash {
  from { transform: scale(1.04); filter: brightness(1); }
  to { transform: scale(1.1); filter: brightness(1.35); }
}

/* 中央区域，占 3x3 */
.ring-center {
  grid-column: 2 / 5;
  grid-row: 2 / 5;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid #ff7ad0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 40%),
    linear-gradient(160deg, #5b1d8c, #3a0f60);
  box-shadow: inset 0 0 18px rgba(0,0,0,.45);
  overflow: hidden;
  padding: 8px;
  text-align: center;
}
.center-stars { position: absolute; inset: 0; pointer-events: none; }
.cs {
  position: absolute;
  width: 26px; height: 26px;
  background: radial-gradient(circle at 35% 30%, #fff6b0, #f6c544 60%, #c98a1c);
  clip-path: polygon(50% 0, 63% 36%, 100% 38%, 70% 60%, 82% 96%, 50% 74%, 18% 96%, 30% 60%, 0 38%, 37% 36%);
  filter: drop-shadow(0 0 6px rgba(246,197,68,.8));
}
.cs-1 { top: 12%; left: 14%; width: 34px; height: 34px; }
.cs-2 { top: 8%; right: 18%; width: 22px; height: 22px; }
.cs-3 { bottom: 16%; left: 20%; width: 20px; height: 20px; }
.cs-4 { top: 22%; right: 10%; width: 28px; height: 28px; }
.center-title {
  position: relative;
  margin: 0;
  font-size: clamp(22px, 6.8vw, 32px);
  font-weight: 900;
  color: #ffd84d;
  -webkit-text-stroke: 1.5px #8a3d00;
  text-shadow: 0 3px 0 #a8541a, 0 0 14px rgba(255, 160, 60, .6);
  letter-spacing: .05em;
}
.center-tip {
  position: relative;
  margin: 10px 6px 0;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 700;
  color: #ffd9f2;
  line-height: 1.4;
}
.win-pop {
  position: absolute;
  top: 42%;
  left: 50%;
  opacity: 0;
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 2px #ff5a2c;
  text-shadow: 0 4px 0 #c43d16, 0 0 18px rgba(255, 180, 60, .8);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.6);
  white-space: nowrap;
}
.win-pop.show { animation: winFloat 1.6s ease-out both; }
@keyframes winFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); }
  25% { opacity: 1; transform: translate(-50%, -55%) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(.95); }
}

/* ===== 控制区 ===== */
.control-deck {
  margin-top: 10px;
  padding: 10px;
  border: 3px solid var(--gold);
  border-radius: 16px;
  background: linear-gradient(180deg, #c9963c 0%, #a87426 55%, #7e5216 100%);
  box-shadow: inset 0 2px 0 rgba(255,240,180,.6), 0 4px 0 #5e3c0e;
}
.bet-buttons { display: flex; gap: 8px; align-items: stretch; }
.deck-btn {
  flex: 1;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 12px;
  font-size: clamp(14px, 4.2vw, 18px);
  font-weight: 900;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.deck-btn small { font-size: .85em; font-weight: 800; }
.deck-btn.blue { background: linear-gradient(180deg, #4fc3ff, #1d7fc4); box-shadow: 0 4px 0 #13558a, inset 0 1px 0 rgba(255,255,255,.5); }
.deck-btn.green { background: linear-gradient(180deg, #8fe04a, #3fa01c); box-shadow: 0 4px 0 #2a6e12, inset 0 1px 0 rgba(255,255,255,.5); }
.deck-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.deck-btn.selected { outline: 3px solid #fff36b; }
.go-btn {
  flex: 0 0 64px;
  height: 64px;
  align-self: center;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff8a7a, #e02a1c 60%, #9c140c);
  border: 4px solid #d8d8d8;
  box-shadow: 0 5px 0 #6e0d07, inset 0 2px 4px rgba(255,255,255,.4);
  text-shadow: 0 2px 0 #8a0f08;
}
.go-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #6e0d07; }
.go-btn:disabled { filter: saturate(.6) brightness(.85); }

/* 下注 LED 行 */
.bet-leds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.bet-led {
  padding: 4px 2px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: clamp(14px, 4.4vw, 19px);
  font-weight: 900;
  color: var(--led-red);
  background: #160406;
  border: 2px solid #3a0e0a;
  border-radius: 6px;
  text-shadow: 0 0 6px rgba(255,59,48,.8);
  font-variant-numeric: tabular-nums;
}

/* 赔率牌 */
.pay-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.pay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-height: 74px;
  padding: 6px 2px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe9a6, #e8b94a);
  border: 2px solid #8a5a12;
  box-shadow: 0 3px 0 #6e4510;
  color: #7a3d08;
}
.pay-card .pc-sym { font-size: clamp(20px, 6vw, 28px); line-height: 1; }
.pay-card .pc-word { font-size: clamp(9px, 2.6vw, 12px); font-weight: 900; font-style: italic; color: #6a3408; line-height: 1.05; text-align: center; }
.pay-card .pc-odds { font-size: clamp(16px, 5vw, 24px); font-weight: 900; color: #c43d16; }

/* ===== 金币槽 ===== */
.coin-tray { margin-top: 12px; }
.tray-glass {
  position: relative;
  height: 96px;
  border-radius: 16px;
  border: 3px solid #8a6a2a;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04) 30%, rgba(60,30,10,.55));
  box-shadow: inset 0 4px 10px rgba(0,0,0,.5), inset 0 -6px 12px rgba(0,0,0,.35);
  overflow: hidden;
}
.coin {
  position: absolute;
  bottom: 6px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2a8, #f6c544 55%, #b87a1c);
  border: 2px solid #a87426;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), 0 2px 3px rgba(0,0,0,.4);
}
.c1 { left: 6%; } .c2 { left: 18%; bottom: 14px; } .c3 { left: 30%; }
.c4 { left: 42%; bottom: 18px; } .c5 { left: 54%; } .c6 { left: 66%; bottom: 12px; }
.c7 { left: 78%; } .c8 { left: 88%; bottom: 16px; }
.c9 { left: 12%; bottom: 30px; width: 24px; height: 24px; }
.c10 { left: 36%; bottom: 34px; width: 22px; height: 22px; }
.c11 { left: 60%; bottom: 32px; width: 24px; height: 24px; }
.c12 { left: 82%; bottom: 30px; width: 22px; height: 22px; }

@media (max-height: 780px) {
  .arch { height: 88px; }
  .lucky-title { bottom: 8px; font-size: clamp(38px, 11vw, 52px); }
  .tray-glass { height: 72px; }
  .pay-card { min-height: 62px; }
}

/* ===== 内联 SVG 图案尺寸 ===== */
.sym-svg {
  width: clamp(26px, 8vw, 40px);
  height: clamp(26px, 8vw, 40px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.sym-svg svg { width: 100%; height: 100%; display: block; }
.pay-card .sym-svg { width: clamp(20px, 6vw, 28px); height: clamp(20px, 6vw, 28px); }
.pc-seven { font-size: clamp(18px, 5.6vw, 26px); color: #d93a26; -webkit-text-stroke: 1px #ffd9a0; }

/* ===== 内联 SVG 图案尺寸 ===== */
.sym-svg {
  width: clamp(26px, 8vw, 40px);
  height: clamp(26px, 8vw, 40px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.sym-svg svg { width: 100%; height: 100%; display: block; }
.pay-card .sym-svg { width: clamp(20px, 6vw, 28px); height: clamp(20px, 6vw, 28px); }
.pc-seven { font-size: clamp(18px, 5.6vw, 26px); color: #d93a26; -webkit-text-stroke: 1px #ffd9a0; }
