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

:root {
  --gold: #ffd700;
  --gold-light: #fff4b0;
  --gold-dark: #b8860b;
  --red: #e01e37;
  --green: #0e7a52;
  --purple: #6a0dad;
  --wa: #25d366;
}

body {
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 50% 20%, #1a0a2e 0%, #050510 60%, #000 100%);
  color: #eee;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(255,215,0,0.07), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(224,30,55,0.07), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(106,13,173,0.1), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==== NAVBAR ==== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 6%;
  border-bottom: 1px solid rgba(255,215,0,0.2);
  position: relative;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(10,10,15,0.6);
  gap: 14px;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
}
.logo .coin {
  -webkit-text-fill-color: initial;
  animation: coinSpin 3s linear infinite;
  display: inline-block;
  font-size: 0.8em;
}
@keyframes coinSpin {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

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

.balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
  border: 1px solid var(--gold);
  padding: 9px 18px;
  border-radius: 50px;
  font-weight: 600;
  color: var(--gold);
  box-shadow: 0 0 20px rgba(255,215,0,0.15);
  font-size: 0.9rem;
}
.balance .num { color: #fff; font-weight: 800; }

.mute-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.4);
  color: var(--gold);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mute-btn:hover { background: rgba(255,215,0,0.15); }

.topup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(37,211,102,0.4);
  transition: all 0.2s;
  white-space: nowrap;
}
.topup-btn:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(37,211,102,0.7); }
.topup-btn:active { transform: translateY(0); }

/* ==== HERO ==== */
.hero {
  text-align: center;
  padding: 46px 6% 10px;
  position: relative;
  z-index: 5;
}
.hero .kicker {
  font-size: 0.72rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: 3px;
  color: #fff;
  text-transform: uppercase;
  text-shadow:
    0 0 1px #fff,
    0 4px 0 var(--gold-dark),
    0 0 30px rgba(255,215,0,0.4);
}
.hero h1 .strike {
  color: #666;
  text-decoration: line-through;
  text-decoration-color: var(--red);
  text-decoration-thickness: 4px;
}
.hero h1 .accent { color: var(--gold); }
.hero .sub {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  letter-spacing: 6px;
  color: var(--gold-light);
  margin-top: 6px;
}
.hero p {
  max-width: 560px;
  margin: 18px auto 0;
  color: #999;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==== JACKPOT ==== */
.jackpot {
  max-width: 700px;
  margin: 26px auto 0;
  background: linear-gradient(90deg, #1a1a1a, #2a1a0a, #1a1a1a);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 16px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255,215,0,0.25), inset 0 0 30px rgba(255,215,0,0.05);
}
.jackpot::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.25), transparent);
  animation: shimmer 3s infinite;
}
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}
.jackpot .label {
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
}
.jackpot .amount {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ==== SLOT MACHINE ==== */
.machine-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 6% 50px;
  position: relative;
  z-index: 5;
}
.machine {
  background: linear-gradient(180deg, #2a1a0a 0%, #1a0f05 40%, #0d0703 100%);
  border: 5px solid var(--gold-dark);
  border-radius: 40px;
  padding: 28px;
  position: relative;
  box-shadow:
    0 0 0 4px #0a0a0f,
    0 0 60px rgba(255,215,0,0.3),
    inset 0 0 40px rgba(0,0,0,0.8);
  transition: box-shadow 0.3s;
}
.machine.free-spin {
  box-shadow:
    0 0 0 4px #0a0a0f,
    0 0 80px rgba(106,13,173,0.8),
    0 0 120px rgba(255,215,0,0.4),
    inset 0 0 40px rgba(0,0,0,0.8);
}
.machine::before,
.machine::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  background: var(--gold);
  border-radius: 50%;
  top: 16px;
  box-shadow: 0 0 12px var(--gold), inset 0 -2px 4px rgba(0,0,0,0.5);
}
.machine::before { left: 16px; }
.machine::after { right: 16px; }

.lights {
  display: flex;
  justify-content: space-between;
  padding: 0 8px 16px;
}
.light {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 0.8s infinite alternate;
}
.light:nth-child(even) { animation-delay: 0.4s; }
.machine.free-spin .light {
  background: var(--purple);
  box-shadow: 0 0 14px var(--purple);
}
@keyframes blink {
  from { opacity: 0.25; }
  to { opacity: 1; box-shadow: 0 0 18px var(--gold); }
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #050510;
  padding: 14px;
  border-radius: 24px;
  border: 3px solid #000;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.9), inset 0 0 0 2px rgba(255,215,0,0.15);
  position: relative;
}
.reel-window {
  width: 108px;
  height: 130px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff8e7 0%, #f4e5b1 50%, #d4af37 100%);
  border-radius: 16px;
  position: relative;
  box-shadow: inset 0 8px 20px rgba(0,0,0,0.4), inset 0 -8px 20px rgba(0,0,0,0.4);
}
.reel-window::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), transparent);
  z-index: 3;
  pointer-events: none;
  border-radius: 16px 16px 0 0;
}
.reel-window::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(0deg, rgba(0,0,0,0.35), transparent);
  z-index: 3;
  pointer-events: none;
  border-radius: 0 0 16px 16px;
}
.reel-strip {
  display: flex;
  flex-direction: column;
}
.symbol {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.free-spin-badge {
  position: absolute;
  top: -18px;
  right: 24px;
  background: linear-gradient(135deg, var(--purple), #9b30ff);
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 0 25px rgba(155,48,255,0.8);
  display: none;
  animation: badgePulse 1s infinite alternate;
  z-index: 20;
}
.free-spin-badge.show { display: block; }
@keyframes badgePulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* ==== CONTROLS ==== */
.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.bet-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #050510;
  border: 2px solid var(--gold-dark);
  padding: 7px;
  border-radius: 50px;
}
.bet-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #111;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bet-btn:hover { transform: scale(1.1); }
.bet-btn:active { transform: scale(0.95); }
.bet-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.bet-display {
  min-width: 100px;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bet-display small { display: block; color: #888; font-size: 0.6rem; font-weight: 400; letter-spacing: 1px; }
.bet-input {
  width: 90px;
  background: transparent;
  border: 1px dashed rgba(255,215,0,0.4);
  border-radius: 8px;
  color: var(--gold);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  padding: 2px 4px;
  margin-top: 2px;
  outline: none;
  -moz-appearance: textfield;
}
.bet-input::-webkit-outer-spin-button,
.bet-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-input:focus { border-color: var(--gold); border-style: solid; background: rgba(255,215,0,0.05); }
.bet-input:disabled { opacity: 0.5; }

.spin-btn {
  padding: 17px 50px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #ff3d6e, var(--red));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(224,30,55,0.6), inset 0 -4px 0 rgba(0,0,0,0.3);
  transition: all 0.2s;
  text-transform: uppercase;
}
.spin-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 45px rgba(224,30,55,0.9), inset 0 -4px 0 rgba(0,0,0,0.3);
}
.spin-btn:active:not(:disabled) { transform: translateY(2px); }
.spin-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.5); }

/* ==== RESULT ==== */
.result {
  margin-top: 20px;
  min-height: 44px;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s;
}
.result.win { color: var(--gold); text-shadow: 0 0 25px var(--gold); animation: pop 0.5s ease; }
.result.big-win {
  color: #fff;
  text-shadow: 0 0 30px var(--gold), 0 0 60px var(--red);
  font-size: 1.5rem;
  animation: pop 0.5s ease;
}
.result.free-spin-msg { color: #c77dff; text-shadow: 0 0 25px var(--purple); animation: pop 0.5s ease; }
.result.lose { color: #888; }
.result.info { color: #aaa; font-weight: 400; font-size: 0.95rem; }
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==== WIN FX ==== */
.win-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255,215,0,0.4), transparent 60%);
  pointer-events: none;
  z-index: 100;
  animation: flashFade 1s ease-out forwards;
}
@keyframes flashFade {
  from { opacity: 1; }
  to { opacity: 0; }
}
.confetti {
  position: fixed;
  width: 10px; height: 16px;
  z-index: 101;
  pointer-events: none;
  animation: confettiFall 2.5s ease-in forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ==== PANELS ==== */
.panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 26px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 6% 60px;
  position: relative;
  z-index: 5;
}
.panel {
  background: rgba(20,20,30,0.6);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(10px);
}
.panel h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.payout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.payout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  font-size: 0.88rem;
}
.payout-item .syms { font-size: 1.25rem; letter-spacing: 3px; }
.payout-item .mult { color: var(--gold); font-weight: 800; }
.payout-item.jackpot-row {
  border: 1px solid var(--gold);
  background: rgba(255,215,0,0.08);
}

.lb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lb-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 10px;
  font-size: 0.88rem;
}
.lb-item .rank { color: var(--gold); font-weight: 800; margin-right: 8px; }
.lb-item .score { color: var(--gold-light); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-item.top { border: 1px solid var(--gold); background: rgba(255,215,0,0.08); }
.lb-empty { color: #666; font-size: 0.85rem; text-align: center; padding: 20px 0; font-weight: 300; }

.reset-btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(224,30,55,0.5);
  background: rgba(224,30,55,0.1);
  color: #ff6b81;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.reset-btn:hover { background: rgba(224,30,55,0.25); }

/* ==== TOP UP PANEL ==== */
.topup-panel {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 6%;
  position: relative;
  z-index: 5;
}
.topup-card {
  background: linear-gradient(135deg, rgba(37,211,102,0.12), rgba(18,140,126,0.06));
  border: 1px solid rgba(37,211,102,0.4);
  border-radius: 18px;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.topup-card .info h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--wa);
  margin-bottom: 6px;
}
.topup-card .info p { color: #aaa; font-size: 0.9rem; line-height: 1.5; }
.topup-card .info p b { color: #fff; }
.wa-big-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  border: 0;
  padding: 15px 30px;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(37,211,102,0.5);
  transition: all 0.2s;
  white-space: nowrap;
}
.wa-big-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 0 45px rgba(37,211,102,0.8); }
.wa-big-btn .wa-ico { font-size: 1.3rem; }

/* ==== FOOTER ==== */
footer {
  text-align: center;
  padding: 30px 6%;
  border-top: 1px solid rgba(255,215,0,0.15);
  position: relative;
  z-index: 5;
}
footer p { color: #555; font-size: 0.78rem; font-weight: 300; }
footer .disclaimer {
  font-size: 0.68rem;
  color: #444;
  margin-top: 12px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ==== BACKSOUND PANEL ==== */
#bgm-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,10,15,0.85);
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.5);
  font-size: 12px;
}
#bgm-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #111;
  display: grid;
  place-items: center;
  font-size: 1rem;
  cursor: pointer;
  flex: none;
  transition: transform 0.2s;
}
#bgm-toggle:hover { transform: scale(1.08); }
#bgm-vol {
  width: 70px;
  accent-color: var(--gold);
  cursor: pointer;
}
#bgm-panel .lbl {
  color: var(--gold);
  font: 600 10px 'Poppins', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ==== START POPUP ==== */
#startPopup {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(26,10,46,0.95), rgba(5,5,16,0.98));
  backdrop-filter: blur(8px);
  padding: 24px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}
#startPopup.hide { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.start-card {
  max-width: 420px;
  width: 100%;
  background: linear-gradient(180deg, rgba(42,26,10,0.95), rgba(13,7,3,0.98));
  border: 3px solid var(--gold-dark);
  border-radius: 28px;
  padding: 40px 28px 36px;
  box-shadow:
    0 0 0 4px #0a0a0f,
    0 0 80px rgba(255,215,0,0.35),
    inset 0 0 40px rgba(0,0,0,0.6);
  position: relative;
}
.start-card::before,
.start-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  top: 14px;
  box-shadow: 0 0 12px var(--gold);
}
.start-card::before { left: 14px; }
.start-card::after { right: 14px; }

.start-card .coin-big {
  font-size: 3.5rem;
  display: inline-block;
  animation: coinSpin 3s linear infinite;
  margin-bottom: 10px;
}

.start-card h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}

.start-card .tag {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 5px;
  color: var(--gold-light);
  margin-bottom: 24px;
}

.start-card p {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 26px;
  font-weight: 300;
}
.start-card p b { color: var(--gold); }

.play-big-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 52px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff3d6e, var(--red));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 3px;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(224,30,55,0.7), inset 0 -5px 0 rgba(0,0,0,0.3);
  transition: all 0.2s;
  text-transform: uppercase;
  width: 100%;
}
.play-big-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 60px rgba(224,30,55,1), inset 0 -5px 0 rgba(0,0,0,0.3);
}
.play-big-btn:active { transform: translateY(2px); }

.start-card .mini-note {
  margin-top: 18px;
  font-size: 0.72rem;
  color: #666;
  letter-spacing: 0.5px;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 760px) {
  .panels { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  #bgm-vol { width: 48px; }
  #bgm-panel .lbl { display: none; }
}

@media (max-width: 520px) {
  .reel-window { width: 78px; height: 100px; }
  .symbol { height: 100px; font-size: 2.4rem; }
  .machine { padding: 18px; }
  .spin-btn { padding: 14px 36px; font-size: 0.9rem; }
  .logo { font-size: 1.8rem; }
  .bet-input { width: 70px; font-size: 0.85rem; }
  .topup-card { flex-direction: column; text-align: center; }
  .wa-big-btn { width: 100%; justify-content: center; }
}