/* ═══════════════════════════════════════════
   LUCKY SLOTS — style.css
   Layout mirrors the reference screenshot
═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:        #FFD700;
  --gold2:       #FFA500;
  --gold-dark:   #8B6914;
  --gold-border: #C8960C;
  --purple-bg:   #1e0a3c;
  --purple-mid:  #2d1060;
  --purple-light:#4a1a8a;
  --blue-glow:   #4488ff;
  --green-spin:  #22bb44;
  --green-dark:  #157730;
  --reel-bg:     #1a0840;
  --reel-sep:    rgba(160,120,255,0.6);
  --text-gold:   #FFE066;
  --text-white:  #ffffff;
  --shadow-gold: 0 0 18px rgba(255,200,0,0.7);
  --shadow-blue: 0 0 20px rgba(80,160,255,0.6);
}

html, body {
  width: 100%; height: 100%;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Arial Black', Arial, sans-serif;
  overflow: hidden;
}

/* ── LOBBY BACK BUTTON ── */
.lobby-back-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  color: rgba(255,200,0,0.6);
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 2px;
  border: 1px solid rgba(255,200,0,0.2);
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
  transition: all 0.2s;
  font-family: 'Arial Black', Arial, sans-serif;
}
.lobby-back-btn:hover { color: var(--gold); border-color: var(--gold); }

/* ── GAME SCREEN ── */
.game-screen {
  width: min(100vw, 680px);
  height: min(100vh, 520px);
  background: radial-gradient(ellipse 120% 100% at 50% 40%, #3a1278 0%, #1e0a3c 55%, #0a0020 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--gold-border);
  box-shadow: 0 0 60px rgba(255,180,0,0.3), inset 0 0 40px rgba(0,0,30,0.6);
}

/* ── TOP BAR ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: linear-gradient(to bottom, #0a0020 0%, #1a0840 100%);
  border-bottom: 2px solid var(--gold-border);
  flex-shrink: 0;
  gap: 6px;
  z-index: 10;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold-border);
  background: linear-gradient(135deg, #2a1060, #0a0020);
  color: var(--gold);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px rgba(255,200,0,0.3);
  transition: all 0.15s;
}
.top-icon-btn:hover { box-shadow: var(--shadow-gold); }

.coin-display {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(to right, #1a0840, #2d1060);
  border: 2px solid var(--gold-border);
  border-radius: 20px;
  padding: 4px 10px 4px 6px;
}

.coin-circle {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 4px gold);
}

.coin-amount {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px gold;
}

.add-coin-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #44ff88;
  background: #00aa44;
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px rgba(0,200,80,0.6);
  transition: all 0.15s;
}
.add-coin-btn:hover { background: #00cc55; box-shadow: 0 0 14px rgba(0,255,100,0.7); }

.top-center {
  display: flex;
  gap: 6px;
}

.top-action-btn {
  padding: 6px 18px;
  border-radius: 20px;
  border: none;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}

.buy-btn {
  background: linear-gradient(to bottom, #44dd44, #228822);
  color: #fff;
  box-shadow: 0 0 10px rgba(0,200,0,0.5);
}
.buy-btn:hover { box-shadow: 0 0 18px rgba(0,255,0,0.7); }

.deal-btn {
  background: linear-gradient(to bottom, #ee4444, #aa1111);
  color: #fff;
  box-shadow: 0 0 10px rgba(200,0,0,0.5);
}
.deal-btn:hover { box-shadow: 0 0 18px rgba(255,0,0,0.7); }

.level-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(to right, #1a0840, #2d1060);
  border: 2px solid var(--gold-border);
  border-radius: 20px;
  padding: 4px 12px;
}

.level-star {
  color: #4488ff;
  font-size: 1rem;
  filter: drop-shadow(0 0 4px #4488ff);
}

.level-text {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 1px;
}

/* ── MACHINE BODY ── */
.machine-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}

/* ── GOLD PILLARS ── */
.pillar {
  width: 52px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.pillar-left {
  background: linear-gradient(to right,
    #8B6914 0%, #FFD700 15%, #FFA500 30%,
    #8B6914 45%, #FFD700 55%, #FFA500 70%,
    #8B6914 85%, #C8960C 100%
  );
  box-shadow: inset -4px 0 12px rgba(0,0,0,0.5), 4px 0 20px rgba(255,180,0,0.4);
}

.pillar-right {
  background: linear-gradient(to left,
    #8B6914 0%, #FFD700 15%, #FFA500 30%,
    #8B6914 45%, #FFD700 55%, #FFA500 70%,
    #8B6914 85%, #C8960C 100%
  );
  box-shadow: inset 4px 0 12px rgba(0,0,0,0.5), -4px 0 20px rgba(255,180,0,0.4);
}

.pillar-inner {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.08) 0px,
    rgba(255,255,255,0.08) 3px,
    transparent 3px,
    transparent 12px
  );
}

/* ── SLOT AREA ── */
.slot-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(160deg, #2d1060 0%, #1a0840 50%, #2d1060 100%);
  border-left: 3px solid var(--gold-border);
  border-right: 3px solid var(--gold-border);
}

/* ── REELS WRAPPER ── */
.reels-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.reels-grid {
  display: flex;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* ── SINGLE REEL ── */
.reel-col {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* ── SYMBOL CELL ── */
.sym-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  font-size: 3.2rem;
  flex-shrink: 0;
  position: relative;
  user-select: none;
  transition: filter 0.2s;
}

.sym-cell .sym-img {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
  transition: all 0.2s;
}

.sym-cell.highlight .sym-img {
  filter:
    drop-shadow(0 0 10px gold)
    drop-shadow(0 0 20px gold)
    brightness(1.3);
  animation: symPulse 0.5s ease-in-out infinite alternate;
}

@keyframes symPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

/* ── REEL DIVIDERS (glow lines) ── */
.reel-dividers {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
  z-index: 3;
}

.rdiv {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--reel-sep) 20%,
    rgba(200,160,255,0.9) 50%,
    var(--reel-sep) 80%,
    transparent 100%
  );
  box-shadow: 0 0 8px rgba(180,120,255,0.8);
}

/* Top/bottom fade */
.reels-wrapper::before,
.reels-wrapper::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 55px;
  z-index: 5;
  pointer-events: none;
}
.reels-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(26,8,64,0.95), transparent);
}
.reels-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(26,8,64,0.95), transparent);
}

/* Center row highlight */
.reels-wrapper .center-highlight {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 110px;
  border-top: 1px solid rgba(255,215,0,0.25);
  border-bottom: 1px solid rgba(255,215,0,0.25);
  background: rgba(255,215,0,0.03);
  z-index: 4;
  pointer-events: none;
}

/* ── WIN LINE OVERLAY ── */
.win-line-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.win-line-overlay.show {
  opacity: 1;
}

.win-line-overlay .wl {
  position: absolute;
  left: 0; right: 0;
  height: 110px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,215,0,0.18) 20%,
    rgba(255,215,0,0.35) 50%,
    rgba(255,215,0,0.18) 80%,
    transparent 100%
  );
  animation: wlPulse 0.5s ease-in-out infinite alternate;
}

@keyframes wlPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ── WIN BANNER ── */
.win-banner {
  position: absolute;
  bottom: 4px;
  left: 0; right: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 10px gold, 0 0 20px orange;
  letter-spacing: 3px;
  z-index: 10;
  min-height: 24px;
  pointer-events: none;
}

.win-banner.pop {
  animation: bannerPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes bannerPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── BOTTOM BAR ── */
.bottom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(to top, #0a0020 0%, #1a0840 100%);
  border-top: 3px solid var(--gold-border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* Info button */
.info-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid #cc2244;
  background: radial-gradient(circle, #ee3355, #aa1133);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(200,0,60,0.6), 0 3px 0 #660022;
  transition: all 0.15s;
}
.info-btn:hover { box-shadow: 0 0 18px rgba(255,0,80,0.8), 0 3px 0 #660022; }
.info-btn:active { transform: translateY(2px); box-shadow: 0 0 10px rgba(200,0,60,0.6), 0 1px 0 #660022; }

/* Bet group */
.bet-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
}

.ctrl-label {
  font-size: 0.6rem;
  color: rgba(255,220,100,0.7);
  letter-spacing: 1.5px;
  font-weight: bold;
}

.bet-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bet-val {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 0 8px gold;
  letter-spacing: 0.5px;
}

.bet-plus-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #4488ff;
  background: radial-gradient(circle, #3366dd, #1133aa);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px rgba(60,120,255,0.6), 0 2px 0 #0a1a66;
  transition: all 0.15s;
}
.bet-plus-btn:hover { box-shadow: 0 0 14px rgba(80,160,255,0.9), 0 2px 0 #0a1a66; }
.bet-plus-btn:active { transform: translateY(1px); }

/* Win group */
.win-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1.2;
}

.win-val {
  background: linear-gradient(to bottom, #0a2060, #0a1040);
  border: 2px solid #3366cc;
  border-radius: 8px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 0 8px gold;
  padding: 4px 14px;
  min-width: 90px;
  text-align: center;
  box-shadow: inset 0 0 10px rgba(0,0,60,0.5), 0 0 8px rgba(50,100,255,0.3);
  letter-spacing: 0.5px;
}

/* Max Bet */
.maxbet-btn {
  padding: 8px 12px;
  border-radius: 20px;
  border: 2px solid var(--gold-border);
  background: radial-gradient(circle, #8855cc, #4422aa);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 0 10px rgba(150,80,255,0.5), 0 3px 0 #220066;
  transition: all 0.15s;
  flex-shrink: 0;
}
.maxbet-btn:hover { box-shadow: 0 0 18px rgba(180,100,255,0.8), 0 3px 0 #220066; }
.maxbet-btn:active { transform: translateY(2px); box-shadow: 0 0 10px rgba(150,80,255,0.5), 0 1px 0 #220066; }

/* Spin button */
.spin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px; height: 70px;
  border-radius: 14px;
  border: 3px solid #44ff88;
  background: radial-gradient(circle at 40% 35%, #44ee66, #22aa44 60%, #157730);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    0 0 20px rgba(0,220,80,0.6),
    0 4px 0 #0a4420,
    inset 0 2px 4px rgba(255,255,255,0.25);
  transition: all 0.12s;
  position: relative;
  top: 0;
}

.spin-btn:hover:not(:disabled) {
  box-shadow:
    0 0 30px rgba(0,255,100,0.8),
    0 4px 0 #0a4420,
    inset 0 2px 4px rgba(255,255,255,0.25);
}

.spin-btn:active:not(:disabled) {
  top: 3px;
  box-shadow:
    0 0 20px rgba(0,220,80,0.6),
    0 1px 0 #0a4420,
    inset 0 2px 4px rgba(0,0,0,0.2);
}

.spin-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spin-text {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
}

.spin-sub {
  font-size: 0.42rem;
  letter-spacing: 0.5px;
  opacity: 0.85;
  margin-top: 3px;
  text-align: center;
  line-height: 1.2;
}

.spin-btn.spinning .spin-text {
  animation: spinTextAnim 0.3s linear infinite;
}

@keyframes spinTextAnim {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

/* ══ MODALS ══ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: linear-gradient(160deg, #2d1060, #1a0840);
  border: 3px solid var(--gold-border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255,200,0,0.35);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes modalIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  color: var(--gold);
  font-size: 1.2rem;
  text-shadow: 0 0 10px gold;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

.modal-note {
  color: rgba(255,220,100,0.6);
  font-size: 0.7rem;
  text-align: center;
  margin-top: 14px;
}

/* Paytable list */
.paytable-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,200,0,0.25);
  border-radius: 8px;
  padding: 7px 10px;
}

.pt-sym { font-size: 1.3rem; }
.pt-name { color: #ccc; font-size: 0.65rem; flex: 1; }
.pt-mult { color: var(--gold); font-size: 0.75rem; font-weight: bold; text-align: right; }

/* Big Win */
.bigwin-box {
  text-align: center;
  background: radial-gradient(ellipse, #3d1080, #1a0840);
}

.bigwin-label {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px gold, 0 0 40px orange;
  letter-spacing: 4px;
  animation: bigwinPulse 0.6s ease-in-out infinite alternate;
}

@keyframes bigwinPulse {
  from { transform: scale(1); text-shadow: 0 0 20px gold, 0 0 40px orange; }
  to   { transform: scale(1.06); text-shadow: 0 0 30px gold, 0 0 60px #ff8800; }
}

.bigwin-amount {
  font-size: 2rem;
  color: #00ff88;
  text-shadow: 0 0 20px #00ff88;
  margin: 12px 0 20px;
  font-weight: 900;
}

.collect-btn {
  padding: 12px 36px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-dark));
  border: none;
  border-radius: 30px;
  color: #000;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 16px gold;
  transition: all 0.15s;
}
.collect-btn:hover { box-shadow: 0 0 28px gold; transform: scale(1.04); }

/* ══ COIN PARTICLES ══ */
.coin-particle {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 300;
  animation: coinDrop 1.1s ease-in forwards;
}

@keyframes coinDrop {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(280px) rotate(540deg) scale(0.5); opacity: 0; }
}

/* ══ RESPONSIVE ══ */
@media (max-width: 480px) {
  .game-screen { border: none; }
  .sym-cell { height: 90px; }
  .sym-cell .sym-img { font-size: 2.4rem; width: 64px; height: 64px; }
  .reels-wrapper::before,
  .reels-wrapper::after { height: 40px; }
  .spin-btn { width: 78px; height: 62px; }
  .spin-text { font-size: 0.95rem; }
  .pillar { width: 36px; }
  .top-action-btn { padding: 5px 12px; font-size: 0.72rem; }
}
