/* ============================================================
   Serengeti Safari Gold (非洲草原黃金傳奇) — 3D 經典老虎機樣式
   ============================================================ */

:root {
  --bg-dark: #0f0703;
  --bg-savanna-sky: radial-gradient(circle at 50% 30%, #522208 0%, #2e1204 55%, #120702 100%);
  --gold-primary: #f1c40f;
  --gold-glow: rgba(241, 196, 15, 0.6);
  --gold-dark: #b78a02;
  --amber-accent: #e67e22;
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --frame-gold: linear-gradient(135deg, #ffd700 0%, #b8860b 35%, #fff6a6 50%, #d4af37 70%, #8a6405 100%);

  --text-light: #fdfefe;
  --text-muted: #bdc3c7;
  --text-dim: #7f8c8d;

  --font-serif: 'Cinzel', serif;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --cell-height: 120px;
}

@media (max-width: 650px) {
  :root {
    --cell-height: 80px;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(180deg, rgba(8, 4, 2, 0.86) 0%, rgba(14, 7, 3, 0.9) 50%, rgba(6, 3, 1, 0.96) 100%),
              radial-gradient(circle at 50% 25%, rgba(18, 9, 4, 0.4) 0%, rgba(8, 4, 2, 0.8) 100%),
              url('/assets/casino_bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-light);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* ==================== 頂部通用導航 ==================== */
.app-header {
  height: 56px;
  background: rgba(15, 7, 3, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.game-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 2px;
  gap: 3px;
}

.switch-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.25s;
}

.switch-tab:hover {
  color: #fff;
}

.switch-tab.active {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  box-shadow: 0 2px 10px rgba(230, 126, 34, 0.4);
}

.badge-hot {
  background: #ff4757;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-pill {
  background: linear-gradient(145deg, #2b170a, #1a0e06);
  border: 1px solid rgba(241, 196, 15, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  padding: 5px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wallet-label {
  font-size: 11px;
  color: #e0a96d;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-amount {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 15px;
  color: #f1c40f;
}

.wallet-currency {
  font-size: 11px;
  font-weight: 700;
  color: #e0a96d;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: scale(1.05);
}

.user-avatar {
  font-size: 18px;
}

/* ==================== 遊戲主舞台 ==================== */
.slot-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-savanna-sky);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

/* 頂部 LOGO 牌匾 */
.slot-top-banner {
  text-align: center;
  margin-bottom: 6px;
  z-index: 2;
}

.logo-crest {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 4px;
  color: #f39c12;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.8);
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #ffffff 0%, #ffd32a 45%, #d4af37 75%, #8a6405 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.9));
}

.logo-sub {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #e0a96d;
  opacity: 0.9;
}

/* 免費旋轉指示條 */
.freespins-banner {
  background: linear-gradient(90deg, #c0392b, #d35400, #f39c12, #c0392b);
  border: 2px solid #ffd32a;
  border-radius: 20px;
  padding: 5px 18px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 0 25px rgba(243, 156, 18, 0.9);
  animation: bannerGlow 0.8s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.02); filter: brightness(1.2); }
}

.fs-badge {
  font-weight: 900;
  font-size: 13px;
  color: #fff;
}

.fs-count b, .fs-win b {
  color: #fff;
  font-family: var(--font-mono);
}

/* ==================== 實體機台外框 (Cabinet & Pegs) ==================== */
.cabinet-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 890px;
  z-index: 5;
}

/* 兩側賠付線標記號碼小球 */
.payline-pegs {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(var(--cell-height) * 3);
  padding: 4px 0;
}

@media (max-width: 700px) {
  .payline-pegs {
    display: none;
  }
}

.peg {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #333;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.peg-1 { background: #e74c3c; }
.peg-2 { background: #3498db; }
.peg-3 { background: #2ecc71; }
.peg-4 { background: #f39c12; }
.peg-5 { background: #9b59b6; }
.peg-6 { background: #1abc9c; }
.peg-7 { background: #e67e22; }
.peg-8 { background: #e84393; }
.peg-9 { background: #00cec9; }
.peg-10 { background: #fdcb6e; color: #000; }
.peg-11 { background: #6c5ce7; }
.peg-12 { background: #d63031; }
.peg-13 { background: #0984e3; }
.peg-14 { background: #00b894; }
.peg-15 { background: #fd79a8; }
.peg-16 { background: #e17055; }
.peg-17 { background: #a29bfe; }
.peg-18 { background: #ffeaa7; color: #000; }

/* ==================== 5x3 滾輪主框 (3D 實體機械滾輪艙) ==================== */
.reels-frame {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #150a04 0%, #080301 100%);
  border: 6px solid #d4af37;
  border-image: linear-gradient(135deg, #ffd700 0%, #b8860b 25%, #fff494 50%, #d4af37 75%, #594002 100%) 1;
  border-radius: 12px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.98), 0 15px 50px rgba(0, 0, 0, 0.95), 0 0 20px rgba(212, 175, 55, 0.3);
  padding: 8px;
  width: 100%;
  max-width: 830px;
  overflow: hidden;
}

/* 3D 圓柱體機械陰影遮罩（營造深邃鼓輪弧度感） */
.drum-shadow-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 12;
}

.drum-shadow-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 12;
}

/* 弧形防眩光玻璃高光 (Glass Cylinder Sheen) */
.drum-glass-sheen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 28%, rgba(0, 0, 0, 0) 45%, rgba(255, 255, 255, 0.04) 80%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 14;
}

.reels-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  background: #060201;
  border-radius: 8px;
  padding: 5px;
}

/* 每一軸的固定可視高度視窗 */
.reel-viewport {
  height: calc(var(--cell-height) * 3);
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #1c0c04 0%, #0d0502 50%, #1c0c04 100%);
  border-radius: 6px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  perspective: 420px;
  perspective-origin: 50% 50%;
}

/* 真正進行垂直捲動的長條輪帶 */
.reel-strip {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(0px);
  will-change: transform;
  transform-style: preserve-3d;
}

/* 物理回彈緩停曲線 (Elastic Overshoot Bounce-Back) */
.reel-strip.bounce-stop {
  transition: transform 0.65s cubic-bezier(0.12, 0.82, 0.28, 1.28);
}

/* 起跑預備回縮 (Pre-spin Wind-up) */
.reel-strip.wind-up {
  transition: transform 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(26px) !important;
}

/* 高速轉動模糊與金屬輪帶垂直動態 */
.reel-strip.fast-spin {
  filter: blur(4px) contrast(1.15) brightness(1.08);
}

/* ==================== 實體機台符號 (Casino Physical Assets) ==================== */
.symbol-cell {
  height: var(--cell-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
  /* 實體印刷金屬輪帶的分隔接縫線 */
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28), filter 0.25s ease;
}

/* 3D 圓柱體立體透視 (停下時呈現自然圓弧滾筒) */
.reel-strip.settled .symbol-cell:nth-child(1) {
  transform: rotateX(24deg) scaleY(0.88) translateZ(-15px);
  filter: brightness(0.68) contrast(1.1);
}

.reel-strip.settled .symbol-cell:nth-child(2) {
  transform: rotateX(0deg) scale(1.03) translateZ(8px);
  filter: brightness(1.12);
  z-index: 5;
}

.reel-strip.settled .symbol-cell:nth-child(3) {
  transform: rotateX(-24deg) scaleY(0.88) translateZ(-15px);
  filter: brightness(0.68) contrast(1.1);
}

/* 真正高清實體金框浮雕圖片符號 (獅王、WILD寶箱、SCATTER日落、大象、獵豹、斑馬) */
.sym-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 6px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8), 0 3px 8px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.45);
  filter: contrast(1.06) brightness(1.02);
  transition: transform 0.2s, filter 0.2s;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #201005 0%, #0c0501 100%);
}

/* 實體經典撲克牌皇家卡牌 (A, K, Q, J, 10) 3D 立體金屬寶石浮雕樣式 */
.sym-royal {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 35%, #2a1306 0%, #150903 65%, #0a0401 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.95), 0 3px 6px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}

.sym-royal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.royal-letter {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.royal-A {
  background: linear-gradient(180deg, #ff7675 0%, #d63031 60%, #800c0c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(214, 48, 49, 0.5));
}

.royal-K {
  background: linear-gradient(180deg, #ffeaa7 0%, #fdcb6e 50%, #b27a00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(253, 203, 110, 0.5));
}

.royal-Q {
  background: linear-gradient(180deg, #55efc4 0%, #00b894 50%, #004d3d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(0, 184, 148, 0.5));
}

.royal-J {
  background: linear-gradient(180deg, #74b9ff 0%, #0984e3 50%, #033c69 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(9, 132, 227, 0.5));
}

.royal-10 {
  font-size: 36px;
  background: linear-gradient(180deg, #a29bfe 0%, #6c5ce7 50%, #2f2382 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(108, 92, 231, 0.5));
}

.royal-crown {
  font-size: 11px;
  margin-top: 1px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

@media (max-width: 650px) {
  .royal-letter { font-size: 32px; }
  .royal-10 { font-size: 26px; }
}

/* 中獎高亮閃爍動畫 (Winning Line Golden Aura) */
.symbol-cell.winning-cell .sym-img,
.symbol-cell.winning-cell .sym-royal {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.95), inset 0 0 15px rgba(255, 215, 0, 0.7);
  animation: winCardPulse 0.65s ease-in-out infinite alternate;
  transform: scale(1.05);
  z-index: 20;
}

@keyframes winCardPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.06); filter: brightness(1.35) drop-shadow(0 0 12px #ffd700); }
}

/* 賠付線畫布層 */
.paylines-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* ==================== 狀態公告列 ==================== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 810px;
  background: rgba(18, 9, 4, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  margin: 6px 0;
  z-index: 10;
}

.status-message {
  font-size: 13px;
  font-weight: 700;
  color: #fce4b8;
}

.win-display {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-label {
  font-size: 12px;
  font-weight: 900;
  color: #2ecc71;
}

.win-amount {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  color: #2ecc71;
}

.win-unit {
  font-size: 11px;
  font-weight: 700;
  color: #bdc3c7;
}

/* ==================== 底部控制儀表板 ==================== */
.slot-controls {
  width: 100%;
  max-width: 810px;
  background: linear-gradient(180deg, #241207 0%, #140903 100%);
  border: 2px solid #b78a02;
  border-radius: 14px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

@media (max-width: 768px) {
  .slot-controls {
    flex-direction: column;
    padding: 10px;
    gap: 8px;
  }
}

.bet-adjust-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label {
  font-size: 10px;
  font-weight: 700;
  color: #e0a96d;
  text-transform: uppercase;
}

.stepper-row {
  display: flex;
  align-items: center;
  background: #0d0603;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #ffd32a;
  cursor: pointer;
  font-weight: 900;
  transition: all 0.15s;
}

.btn-step {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

.btn-step:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bet-val-display {
  width: 85px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.quick-bets {
  display: flex;
  gap: 4px;
}

.btn-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: #e0a96d;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-chip:hover {
  background: rgba(212, 175, 55, 0.25);
  color: #fff;
}

/* 核心 SPIN 按鈕與特徵控制 */
.spin-action-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-feature-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  width: 54px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-feature-toggle .icon {
  font-size: 17px;
}

.btn-feature-toggle .text {
  font-size: 10px;
  font-weight: 900;
}

.btn-feature-toggle.active {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  border-color: #ffd32a;
  box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
}

.spin-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd32a 0%, #e67e22 70%, #8a4b08 100%);
  border: 3px solid #fff6a6;
  box-shadow: 0 0 25px rgba(241, 196, 15, 0.8), inset 0 2px 6px rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spin-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(241, 196, 15, 1);
}

.spin-btn:active {
  transform: scale(0.95);
}

.spin-btn:disabled {
  opacity: 0.6;
  filter: grayscale(0.5);
  cursor: not-allowed;
}

.spin-icon {
  font-size: 24px;
  line-height: 1;
}

.spin-text {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.extra-controls {
  display: flex;
  align-items: center;
}

.btn-max {
  background: linear-gradient(135deg, #8e44ad, #2980b9);
  border: 1px solid #9b59b6;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
}

.btn-max:hover {
  filter: brightness(1.2);
}

/* ==================== 中大獎全螢幕金幣慶祝 ==================== */
.win-celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.celebration-box {
  text-align: center;
  animation: celebPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 105;
}

@keyframes celebPop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.celebration-title {
  font-family: var(--font-serif);
  font-size: 58px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #ffd32a 50%, #e67e22 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(241, 196, 15, 0.9));
  animation: titlePulse 0.6s ease-in-out infinite alternate;
}

@keyframes titlePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.celebration-amount {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 900;
  color: #2ecc71;
  text-shadow: 0 0 35px rgba(46, 204, 113, 0.8);
  margin: 10px 0;
}

.celebration-currency {
  font-size: 20px;
  font-weight: 800;
  color: #ffd32a;
}

.celebration-tip {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-dim);
}

.coin-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 102;
}

/* ==================== 賠率表彈窗 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #180d05;
  border: 2px solid #d4af37;
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: #ffd32a;
}

.btn-close {
  background: transparent;
  border: none;
  color: #bdc3c7;
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rules-summary {
  font-size: 13px;
  color: #fce4b8;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
}

.paytable-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #d4af37;
  font-size: 13px;
}

.pay-card.card-lion {
  border-left-color: #ffd32a;
  background: rgba(255, 211, 42, 0.1);
  font-weight: 700;
}

.pay-card.card-low {
  border-left-color: #7f8c8d;
}

.pay-card .sym {
  font-weight: 700;
}

.pay-card .payouts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e0a96d;
}

/* ==================== 吐司通知 ==================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(24, 13, 5, 0.95);
  border: 1px solid #d4af37;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.toast-success { border-left: 4px solid #2ecc71; }
.toast-error { border-left: 4px solid #e74c3c; }
.toast-info { border-left: 4px solid #f39c12; }

/* ============================================================
   行動端極限適配 (Mobile Responsive Layout: max-width <= 650px)
   ============================================================ */
@media (max-width: 650px) {
  :root {
    --cell-height: min(9.5vh, 66px);
  }

  body {
    overflow: hidden;
    height: 100dvh;
  }

  .slot-stage {
    padding: 2px 4px 6px;
    gap: 4px;
    height: calc(100dvh - 54px);
    max-height: calc(100dvh - 54px);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .slot-header-marquee {
    margin-bottom: 2px;
  }

  .title-h1 {
    font-size: 18px;
    letter-spacing: 1.5px;
  }

  .title-sub {
    font-size: 7.5px;
  }

  .cabinet-wrapper {
    width: 100%;
    padding: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .reels-frame {
    border-width: 2.5px;
    padding: 3px;
    border-radius: 8px;
    width: 100%;
  }

  .reels-inner {
    gap: 2px;
    padding: 1px;
  }

  .symbol-cell {
    padding: 1px;
    border-bottom-width: 1px;
  }

  .sym-img {
    max-height: 85%;
  }

  .royal-letter {
    font-size: 22px;
  }

  .royal-10 {
    font-size: 18px;
  }

  .royal-crown {
    display: none;
  }

  .slot-controls {
    padding: 6px 6px;
    gap: 6px;
    width: 100%;
    border-radius: 8px;
    flex: 0 0 auto;
  }

  .stepper-row {
    height: 32px;
  }

  .btn-step {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .bet-val-display {
    width: 70px;
    font-size: 13px;
  }

  .btn-chip {
    padding: 3px 0;
    font-size: 9.5px;
  }

  .spin-action-box {
    gap: 6px;
  }

  .btn-spin {
    width: 54px;
    height: 54px;
  }

  .btn-spin-text {
    font-size: 11px;
    letter-spacing: 0.5px;
  }

  .btn-feature {
    width: 38px;
    height: 38px;
    font-size: 8px;
  }

  .btn-feature .f-icon {
    font-size: 12px;
  }

  .btn-max-bet {
    padding: 5px;
    font-size: 10px;
  }
}
