/* =========================================================
   Lucky 7s — 拉斯维加斯式老虎机
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #060509;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e8e0d0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* =========================================================
   舞台背景
   ========================================================= */
.stage {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 22%, #1c1430 0%, #0b0814 45%, #040308 100%);
  overflow: hidden;
}
.stage::before {
  content: '';
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(255,180,40,.07) 0%, transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(255,60,60,.07) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(140,80,255,.05) 0%, transparent 55%);
  animation: ambientShift 12s ease-in-out infinite alternate;
}
@keyframes ambientShift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(2%, -2%) scale(1.06); }
}
.stage::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 90%; height: 40%;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(255,170,40,.10) 0%, transparent 70%);
  pointer-events: none;
}

/* =========================================================
   机身
   ========================================================= */
.machine {
  position: relative;
  width: 460px;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, #221c34 0%, #161222 35%, #0e0b16 100%);
  border: 2px solid #3d3256;
  transform-origin: center center;
  box-shadow:
    0 0 0 1px rgba(255,200,80,.12),
    0 0 70px rgba(255,170,40,.16),
    0 34px 90px rgba(0,0,0,.92),
    inset 0 2px 0 rgba(255,255,255,.07),
    inset 0 -6px 28px rgba(0,0,0,.85);
  z-index: 2;
  transition: box-shadow .3s;
}
.machine::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  pointer-events: none;
  background: linear-gradient(115deg,
    rgba(255,255,255,.06) 0%,
    transparent 22%,
    transparent 78%,
    rgba(255,255,255,.03) 100%);
}

/* 免费旋转状态：整机泛紫光 */
.machine.free-spin {
  animation: freeGlow 1.4s ease-in-out infinite alternate;
}
@keyframes freeGlow {
  from {
    box-shadow:
      0 0 0 1px rgba(160,100,255,.35),
      0 0 60px rgba(140,80,255,.35),
      0 34px 90px rgba(0,0,0,.92),
      inset 0 2px 0 rgba(255,255,255,.07),
      inset 0 -6px 28px rgba(0,0,0,.85);
  }
  to {
    box-shadow:
      0 0 0 1px rgba(210,150,255,.55),
      0 0 110px rgba(170,110,255,.7),
      0 34px 90px rgba(0,0,0,.92),
      inset 0 2px 0 rgba(255,255,255,.07),
      inset 0 -6px 28px rgba(0,0,0,.85);
  }
}

/* =========================================================
   顶部灯牌
   ========================================================= */
.marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0a0812 0%, #050408 100%);
  box-shadow:
    inset 0 0 24px rgba(0,0,0,.95),
    0 0 0 1px #2b2340,
    0 0 30px rgba(255,170,40,.10);
}
.logo {
  flex: 1;
  text-align: center;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffd54a;
  text-shadow:
    0 0 8px rgba(255,200,60,.95),
    0 0 22px rgba(255,160,20,.7),
    0 0 44px rgba(255,120,0,.45),
    0 2px 0 #7a5010;
  animation: logoPulse 2.6s ease-in-out infinite alternate;
}
@keyframes logoPulse {
  from { text-shadow: 0 0 8px rgba(255,200,60,.85), 0 0 22px rgba(255,160,20,.6), 0 0 44px rgba(255,120,0,.35), 0 2px 0 #7a5010; }
  to   { text-shadow: 0 0 12px rgba(255,220,90,1), 0 0 32px rgba(255,180,40,.85), 0 0 60px rgba(255,130,0,.6), 0 2px 0 #7a5010; }
}
.bulbs { display: flex; gap: 5px; }
.bulbs i {
  display: block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4a3810;
  box-shadow: inset 0 0 3px rgba(0,0,0,.9);
}
.bulbs i.on {
  background: #ffd24a;
  box-shadow: 0 0 6px #ffd24a, 0 0 14px rgba(255,180,40,.9), inset 0 0 2px #fff;
}

/* =========================================================
   卷轴区（3 × 3）
   ========================================================= */
.reels-frame {
  position: relative;
  padding: 8px;
  border-radius: 16px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #07060b 0%, #0d0b14 100%);
  box-shadow:
    inset 0 0 36px rgba(0,0,0,.95),
    inset 0 2px 0 rgba(255,255,255,.035),
    0 0 0 1px #2b2340,
    0 0 34px rgba(255,170,40,.08);
  transition: box-shadow .3s;
}
.machine.free-spin .reels-frame {
  box-shadow:
    inset 0 0 36px rgba(0,0,0,.95),
    inset 0 2px 0 rgba(255,255,255,.035),
    0 0 0 1px #6a4aa0,
    0 0 44px rgba(160,100,255,.4);
}

.reels {
  display: flex;
  gap: 6px;
  border-radius: 10px;
  overflow: hidden;
}
.reel {
  position: relative;
  flex: 1;
  height: 270px;   /* 3 × 90 */
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #0a0812 0%, #131020 48%, #0a0812 100%);
  box-shadow: inset 0 0 22px rgba(0,0,0,.9);
}
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(to bottom,
    rgba(7,6,11,.96) 0%,
    rgba(7,6,11,.55) 10%,
    rgba(7,6,11,.12) 24%,
    transparent 38%,
    transparent 62%,
    rgba(7,6,11,.12) 76%,
    rgba(7,6,11,.55) 90%,
    rgba(7,6,11,.96) 100%);
}
.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.symbol {
  flex: 0 0 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.85));
  transition: filter .25s, transform .25s;
  position: relative;
}
/* 数字 7 */
.symbol[data-sym="seven"] {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 56px;
  font-weight: 900;
  color: #ffcf40;
  text-shadow: 0 0 10px rgba(255,200,60,.9), 0 0 26px rgba(255,140,0,.7), 0 3px 0 #6a3a00;
}
/* 百搭 Wild 特殊底色 */
.symbol[data-sym="wild"] {
  background: radial-gradient(circle at 50% 45%, rgba(180,120,255,.22) 0%, transparent 62%);
}
/* 散点 Scatter 特殊底色 */
.symbol[data-sym="scatter"] {
  background: radial-gradient(circle at 50% 45%, rgba(255,200,60,.22) 0%, transparent 62%);
}
/* 骷髅 Curse 特殊底色 */
.symbol[data-sym="curse"] {
  background: radial-gradient(circle at 50% 45%, rgba(255,40,40,.18) 0%, transparent 62%);
}

/* 中奖脉冲 — 金色 */
.symbol.winning {
  animation: symbolPulse .55s ease-in-out infinite alternate;
  z-index: 2;
}
@keyframes symbolPulse {
  from {
    filter: drop-shadow(0 0 5px rgba(255,220,80,.8)) drop-shadow(0 0 12px rgba(255,180,40,.5));
    transform: scale(1);
  }
  to {
    filter: drop-shadow(0 0 18px rgba(255,230,120,1)) drop-shadow(0 0 44px rgba(255,180,40,.9));
    transform: scale(1.08);
  }
}
.symbol[data-sym="seven"].winning {
  animation: symbolPulse7 .55s ease-in-out infinite alternate;
}
@keyframes symbolPulse7 {
  from { transform: scale(1); }
  to   { transform: scale(1.14); }
}

/* 散点触发 — 紫色 */
.symbol.scatter-hit {
  animation: scatterPulse .5s ease-in-out infinite alternate;
  z-index: 3;
}
@keyframes scatterPulse {
  from {
    filter: drop-shadow(0 0 6px rgba(200,140,255,.9)) drop-shadow(0 0 14px rgba(150,80,255,.6));
    transform: scale(1);
  }
  to {
    filter: drop-shadow(0 0 22px rgba(220,160,255,1)) drop-shadow(0 0 50px rgba(170,100,255,1));
    transform: scale(1.13);
  }
}

/* 骷髅惩罚 — 红色闪烁 */
.symbol.curse-hit {
  animation: curseFlash .38s steps(1) infinite;
  z-index: 3;
}
@keyframes curseFlash {
  0%   { filter: drop-shadow(0 0 8px rgba(255,40,40,1)) brightness(1.2); transform: scale(1.05); }
  50%  { filter: drop-shadow(0 0 20px rgba(255,0,0,1)) brightness(1.8); transform: scale(1.12); }
  100% { filter: drop-shadow(0 0 8px rgba(255,40,40,1)) brightness(1.2); transform: scale(1.05); }
}

/* 玻璃反光 */
.glass {
  position: absolute;
  inset: 8px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(118deg,
    transparent 28%,
    rgba(255,255,255,.07) 42%,
    rgba(255,255,255,.025) 48%,
    transparent 58%,
    transparent 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,.4);
}

/* 中奖文字覆盖层 */
.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffe066;
  text-shadow:
    0 0 18px rgba(255,210,70,1),
    0 0 44px rgba(255,160,20,.85),
    0 5px 0 #7a4a00;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .28s ease, transform .28s ease;
  padding: 0 16px;
  text-align: center;
  line-height: 1.2;
}
.win-overlay.show {
  opacity: 1;
  transform: scale(1);
  animation: winPop .55s cubic-bezier(.2,1.4,.5,1);
}
.win-overlay.curse {
  color: #ff6060;
  text-shadow:
    0 0 18px rgba(255,60,60,1),
    0 0 44px rgba(255,0,0,.85),
    0 5px 0 #6a0000;
}
.win-overlay.scatter {
  color: #d0a0ff;
  text-shadow:
    0 0 18px rgba(200,140,255,1),
    0 0 44px rgba(150,80,255,.85),
    0 5px 0 #4a1a7a;
}
.win-overlay.big {
  font-size: 46px;
}
@keyframes winPop {
  0%   { transform: scale(.4); opacity: 0; }
  55%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* =========================================================
   数据面板
   ========================================================= */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  flex: 1;
  padding: 9px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #0a0812 0%, #060509 100%);
  box-shadow:
    inset 0 0 18px rgba(0,0,0,.95),
    0 0 0 1px #2b2340;
}
.stat-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #665c82;
  margin-bottom: 3px;
}
.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #ffd54a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(255,200,60,.55);
  letter-spacing: 1px;
  transition: color .2s, text-shadow .2s;
}
.bet-stat .stat-value {
  color: #7fe3ff;
  text-shadow: 0 0 12px rgba(100,210,255,.55);
}
.free-stat .stat-value {
  color: #b78aff;
  text-shadow: 0 0 12px rgba(180,120,255,.55);
}
.free-stat.active {
  box-shadow:
    inset 0 0 18px rgba(0,0,0,.95),
    0 0 0 1px #6a4aa0,
    0 0 24px rgba(160,100,255,.5);
  animation: freeStatPulse 1s ease-in-out infinite alternate;
}
@keyframes freeStatPulse {
  from { box-shadow: inset 0 0 18px rgba(0,0,0,.95), 0 0 0 1px #6a4aa0, 0 0 20px rgba(160,100,255,.4); }
  to   { box-shadow: inset 0 0 18px rgba(0,0,0,.95), 0 0 0 1px #9a6ae0, 0 0 38px rgba(180,120,255,.8); }
}

.stat-value.flash { animation: valueFlash .45s ease-out; }
@keyframes valueFlash {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* =========================================================
   操作区
   ========================================================= */
.action-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
.round-btn {
  flex: 0 0 58px;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 700;
  color: #cbb8ff;
  background: linear-gradient(180deg, #241d38 0%, #171226 100%);
  border: 1px solid #3d3256;
  cursor: pointer;
  box-shadow:
    0 4px 0 #0e0a18,
    0 8px 18px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.08);
  transition: all .1s;
  line-height: 1;
}
.round-btn:hover { color: #e8ddff; border-color: #5a4a80; }
.round-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0e0a18, 0 4px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
}
.round-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.spin-btn {
  flex: 1;
  padding: 16px 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #2a1400;
  background: linear-gradient(180deg, #ffe066 0%, #f0b429 45%, #c08410 100%);
  border: none;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
  box-shadow:
    0 5px 0 #7a5010,
    0 10px 26px rgba(255,160,20,.35),
    inset 0 1px 0 rgba(255,255,255,.55);
  transition: all .1s;
}
.spin-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff09a 0%, #ffc63d 45%, #d09018 100%);
  box-shadow:
    0 5px 0 #7a5010,
    0 12px 34px rgba(255,180,40,.55),
    inset 0 1px 0 rgba(255,255,255,.6);
}
.spin-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #7a5010, 0 4px 12px rgba(255,160,20,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
.spin-btn:disabled {
  filter: grayscale(.85) brightness(.55);
  cursor: not-allowed;
  box-shadow: 0 3px 0 #4a3010, 0 6px 14px rgba(0,0,0,.5);
  transform: translateY(2px);
}
.spin-btn.spinning { animation: spinBreath .8s ease-in-out infinite alternate; }
@keyframes spinBreath {
  from { box-shadow: 0 5px 0 #7a5010, 0 10px 26px rgba(255,160,20,.35), inset 0 1px 0 rgba(255,255,255,.55); }
  to   { box-shadow: 0 5px 0 #7a5010, 0 10px 46px rgba(255,200,60,.85), inset 0 1px 0 rgba(255,255,255,.55); }
}
/* 免费旋转时按钮变紫 */
.spin-btn.free {
  background: linear-gradient(180deg, #d8b0ff 0%, #a870f0 45%, #7038c0 100%);
  color: #1a0a30;
  box-shadow:
    0 5px 0 #4a1a7a,
    0 10px 30px rgba(160,100,255,.5),
    inset 0 1px 0 rgba(255,255,255,.6);
}

.info-btn {
  display: block;
  width: 100%;
  padding: 9px 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 3px;
  color: #6f6490;
  background: transparent;
  border: 1px solid #2b2340;
  cursor: pointer;
  transition: all .15s;
}
.info-btn:hover {
  color: #a898d0;
  border-color: #4a3f6a;
  background: rgba(255,255,255,.02);
}

/* =========================================================
   弹窗
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 1, 5, .88);
  backdrop-filter: blur(6px);
  animation: modalIn .2s ease-out;
  padding: 16px;
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  width: min(94vw, 440px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1a1528 0%, #0e0b16 100%);
  border: 1px solid #3d3256;
  box-shadow: 0 0 60px rgba(255,170,40,.12), 0 30px 80px rgba(0,0,0,.9);
  animation: boxIn .28s cubic-bezier(.2,1.2,.5,1);
}
@keyframes boxIn {
  from { transform: scale(.9) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-box h2 {
  font-size: 17px;
  letter-spacing: 5px;
  text-align: center;
  color: #ffd54a;
  text-shadow: 0 0 14px rgba(255,200,60,.6);
  margin-bottom: 18px;
}

/* 规则说明块 */
.rule-block {
  margin: 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  border-left: 3px solid #3d3256;
}
.rule-block.scatter-rule { border-left-color: #b78aff; }
.rule-block.curse-rule   { border-left-color: #e05050; }
.rule-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #d8c8a8;
  margin-bottom: 5px;
}
.scatter-rule .rule-title { color: #c8a0ff; }
.curse-rule .rule-title   { color: #ff8080; }
.rule-block p {
  font-size: 11.5px;
  line-height: 1.75;
  color: #8a7ea8;
}
.rule-block b { color: #ffd54a; }
.scatter-rule b { color: #d0a0ff; }
.curse-rule b   { color: #ff6060; }

/* 赔付表 */
.pay-table {
  margin: 14px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #2b2340;
}
.pay-row {
  display: grid;
  grid-template-columns: 40px 1fr repeat(5, 42px);
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  font-size: 11px;
  background: rgba(255,255,255,.015);
}
.pay-row.head {
  background: rgba(255,200,80,.08);
  color: #c8b890;
  font-weight: 700;
  letter-spacing: .5px;
  font-size: 10px;
}
.pay-row:nth-child(even):not(.head) { background: rgba(255,255,255,.03); }
.pay-icon {
  text-align: center;
  font-size: 20px;
  line-height: 1;
}
.pay-icon.seven {
  font-family: "Arial Black", Impact, sans-serif;
  font-weight: 900;
  color: #ffcf40;
  text-shadow: 0 0 6px rgba(255,200,60,.9);
}
.pay-name {
  color: #9a8ec0;
  letter-spacing: .5px;
  white-space: nowrap;
}
.pay-mult {
  text-align: center;
  color: #ffd54a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pay-mult.zero { color: #3a3450; }

.modal-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 13px 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #2a1400;
  background: linear-gradient(180deg, #ffe066 0%, #f0b429 50%, #c08410 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #7a5010, 0 8px 20px rgba(255,160,20,.3);
  transition: all .1s;
}
.modal-close:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #7a5010, 0 4px 10px rgba(255,160,20,.25);
}

/* =========================================================
   小屏适配
   ========================================================= */
@media (max-height: 720px) {
  .reel { height: 234px; }
  .symbol { flex: 0 0 78px; height: 78px; font-size: 42px; }
  .symbol[data-sym="seven"] { font-size: 48px; }
  .logo { font-size: 21px; letter-spacing: 4px; }
  .stat-value { font-size: 17px; }
  .spin-btn { font-size: 17px; padding: 13px 0; }
}
