@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Exo+2:wght@400;600;700;900&display=swap');

:root {
  --gold: #f5c518;
  --gold-dark: #c9a000;
  --blue: #1565c0;
  --blue-light: #1e88e5;
  --dark: #0a0d1a;
  --dark2: #0f1429;
  --dark3: #141a35;
  --card: #161d38;
  --text: #e8eaf6;
  --text-dim: #9fa8da;
  --green: #00e676;
  --red: #ff5252;
}

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

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(21,101,192,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(245,197,24,0.08) 0%, transparent 60%);
}

/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 28px;
  background: rgba(10,13,26,0.92);
  border-bottom: 1px solid rgba(245,197,24,0.18);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-wrap img {
  height: 90px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(30,136,229,0.7));
}
.header-title {
  font-family: 'Black Ops One', cursive;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 2px;
  background: linear-gradient(135deg, #f5c518, #ffe082, #f5c518);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}
.timer-box {
  background: rgba(21,101,192,0.25);
  border: 1px solid rgba(30,136,229,0.4);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
  min-width: 110px;
}
.timer-label { font-size: 0.65rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.timer-value { font-family: 'Black Ops One', cursive; font-size: 1.3rem; color: var(--gold); letter-spacing: 2px; }

/* ── JACKPOT BANNER ── */
.jackpot-banner {
  background: linear-gradient(135deg, #0a1628 0%, #0d1f3e 50%, #0a1628 100%);
  border: 1px solid rgba(245,197,24,0.3);
  border-left: none; border-right: none;
  padding: 14px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.jackpot-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 40px, rgba(245,197,24,0.03) 40px, rgba(245,197,24,0.03) 41px);
}
.jackpot-text {
  font-family: 'Black Ops One', cursive;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  letter-spacing: 3px;
  color: var(--gold);
  animation: pulse-gold 2.5s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ── MAIN LAYOUT ── */
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 60px; }

/* ── STEP INDICATOR ── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
}
.step.active {
  background: rgba(21,101,192,0.3);
  border-color: var(--blue-light);
  color: #fff;
}
.step.done {
  background: rgba(0,230,118,0.12);
  border-color: var(--green);
  color: var(--green);
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 900;
  background: rgba(255,255,255,0.1);
}
.step.active .step-num { background: var(--blue-light); color: #fff; }
.step.done .step-num { background: var(--green); color: #000; }
.step-divider {
  width: 32px; height: 2px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* ── SECTION CARD ── */
.section-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light), var(--gold));
}
.section-title {
  font-family: 'Black Ops One', cursive;
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title svg { flex-shrink: 0; }

/* ── POOL BALLS GRID ── */
.balls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 12px;
}

.ball-btn {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  font-family: 'Black Ops One', cursive;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
  outline: none;
}
.ball-btn:hover { transform: scale(1.12); }
.ball-btn.selected {
  transform: scale(1.18);
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 24px rgba(255,255,255,0.5) !important;
  animation: ball-bounce 0.35s ease;
}
@keyframes ball-bounce {
  0% { transform: scale(1.18); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1.18); }
}

/* Pool ball top shine only — no white stripe */
.ball-btn::after {
  content: '';
  position: absolute;
  top: 10%; left: 18%;
  width: 36%; height: 26%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.45) 0%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
}
.ball-btn span { position: relative; z-index: 2; }

/* ── BET SECTION ── */
.bet-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 560px) { .bet-form { grid-template-columns: 1fr; } }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}
.field-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field-input:focus {
  border-color: var(--blue-light);
  background: rgba(30,136,229,0.08);
}
.field-input::placeholder { color: rgba(255,255,255,0.25); }

/* ── SELECTED BALL PREVIEW ── */
.selection-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(21,101,192,0.12);
  border: 1px solid rgba(30,136,229,0.3);
  border-radius: 12px;
  margin-bottom: 20px;
  min-height: 68px;
}
.preview-ball {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Black Ops One', cursive;
  font-size: 1.1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 2px dashed rgba(255,255,255,0.2);
  transition: all 0.3s;
}
.preview-ball::after {
  content: '';
  position: absolute;
  top: 10%; left: 18%;
  width: 38%; height: 28%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.55) 0%, transparent 80%);
  border-radius: 50%;
  pointer-events: none;
}
.preview-text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.preview-text strong { color: var(--text); font-size: 1rem; }

/* ── PAY BUTTON ── */
.pay-btn {
  width: 100%;
  padding: 18px;
  margin-top: 18px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-family: 'Black Ops One', cursive;
  font-size: 1.1rem;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 6px 24px rgba(21,101,192,0.4);
}
.pay-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}
.pay-btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(21,101,192,0.55); }
.pay-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.pay-btn:not(:disabled):hover::before { transform: translateX(100%); }
.pay-btn .pp-icon { margin-right: 8px; vertical-align: middle; }

/* ── PAYOUT CALC ── */
.payout-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.payout-pill {
  flex: 1;
  min-width: 120px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}
.payout-pill .pp-label { font-size: 0.68rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.payout-pill .pp-val { font-family: 'Black Ops One', cursive; font-size: 1.15rem; color: var(--green); }
.payout-pill .pp-val.red { color: var(--red); }
.payout-pill .pp-val.gold { color: var(--gold); }

/* ── RULES SECTION ── */
.rules-list { display: flex; flex-direction: column; gap: 12px; }
.rule-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid var(--blue-light);
}
.rule-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.rule-text { font-size: 0.88rem; color: var(--text-dim); line-height: 1.6; }
.rule-text strong { color: var(--text); }
.rule-item.highlight { border-left-color: var(--gold); background: rgba(245,197,24,0.05); }

/* ── HOW TO PLAY ── */
.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.how-step {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  text-align: center;
}
.how-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Black Ops One', cursive;
  font-size: 1.1rem;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(21,101,192,0.4);
}
.how-step-text { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }
.how-step-text strong { color: var(--text); display: block; margin-bottom: 2px; font-size: 0.9rem; }

/* ── OVERFLOW NOTICE ── */
.overflow-notice {
  display: none;
  background: rgba(255,82,82,0.1);
  border: 1px solid rgba(255,82,82,0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #ff8a80;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── PAYMENT SUCCESS ── */
.payment-success-box {
  background: rgba(0,230,118,0.08);
  border: 1px solid rgba(0,230,118,0.3);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-top: 18px;
}
.payment-success-icon { font-size: 3rem; margin-bottom: 10px; }
.payment-success-title {
  font-family: 'Black Ops One', cursive;
  font-size: 1.2rem;
  color: var(--green);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.payment-success-msg { font-size: 0.88rem; color: var(--text-dim); line-height: 1.7; }
.payment-success-msg strong { color: var(--text); }

/* ── WINNER ANNOUNCEMENT ── */
.winner-box {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px;
  background: rgba(245,197,24,0.07);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: 14px;
  flex-wrap: wrap;
}
.winner-ball {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  animation: ball-bounce 0.5s ease;
}
.winner-ball::after {
  content: '';
  position: absolute;
  top: 10%; left: 18%;
  width: 36%; height: 26%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.45) 0%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
}
.winner-number {
  font-family: 'Black Ops One', cursive;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.winner-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── DRAW HISTORY ── */
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 10px;
  transition: background 0.2s;
}
.history-item.latest {
  background: rgba(245,197,24,0.06);
  border-color: rgba(245,197,24,0.25);
}
.history-ball {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Black Ops One', cursive;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.history-ball::after {
  content: '';
  position: absolute;
  top: 10%; left: 18%;
  width: 36%; height: 26%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 75%);
  border-radius: 50%;
}
.history-ball span { position: relative; z-index: 2; }
.history-num { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.history-time { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.no-history { font-size: 0.85rem; color: var(--text-dim); text-align: center; padding: 20px; font-style: italic; }

/* ── LIVE DRAW SECTION ── */
.live-draw-box {
  background: rgba(255,50,50,0.06);
  border: 1px solid rgba(255,80,80,0.25);
  border-radius: 14px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
}
.live-pulse {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ff3b3b;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255,59,59,0.6);
  animation: pulse-red 1.5s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255,59,59,0.6); }
  70% { box-shadow: 0 0 0 14px rgba(255,59,59,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); }
}
.live-draw-title {
  font-family: 'Black Ops One', cursive;
  font-size: 1rem;
  color: #ff6b6b;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.live-draw-desc {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 14px;
}
.zoom-btn {
  display: inline-block;
  padding: 13px 28px;
  background: linear-gradient(135deg, #ff3b3b, #c62828);
  color: #fff;
  border-radius: 12px;
  font-family: 'Black Ops One', cursive;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(255,59,59,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: pulse-gold 1.5s ease-in-out infinite;
}
.zoom-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,59,59,0.55); }
.no-zoom-msg {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 20px;
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--dark3);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-title { font-family: 'Black Ops One', cursive; font-size: 1.5rem; color: var(--gold); margin-bottom: 14px; }
.modal-body { font-size: 0.9rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 22px; }
.modal-body strong { color: var(--text); }
.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}
.modal-confirm {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-family: 'Black Ops One', cursive;
  font-size: 1rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(21,101,192,0.4);
  width: 100%;
}
.modal-cancel {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 11px 32px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}

/* ── CONFETTI ── */
.confetti-piece {
  position: fixed;
  width: 8px; height: 8px;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  header { padding: 12px 16px; }
  .header-title { display: none; }
  main { padding: 16px 12px 40px; }
  .balls-grid { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .section-card { padding: 20px 16px; }
  .steps { gap: 0; font-size: 0.7rem; }
  .step { padding: 6px 10px; }
  .step-divider { width: 18px; }
}
