:root {
  --bg: #080d1a;
  --surface: #111a2e;
  --surface-2: #18233d;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --gold: #fbbf24;
  --gold-strong: #f59e0b;
  --emerald: #10b981;
  --sky: #38bdf8;
  --danger: #f43f5e;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 0%, #172554 0%, var(--bg) 52%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px 48px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f172a;
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.28);
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pill-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pill-btn:hover { border-color: var(--gold); }

/* Ticker gagnants */
.winners-strip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
.winners-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cards */
.card {
  background: rgba(17, 26, 46, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(10px);
}
.card-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Hero Slot */
.hero-card {
  background: linear-gradient(160deg, #162241 0%, #0f172a 100%);
  border-color: rgba(251, 191, 36, 0.32);
}
.slot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-gold { background: rgba(251, 191, 36, 0.16); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.35); }
.badge-green { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-sky { background: rgba(56, 189, 248, 0.14); color: var(--sky); border: 1px solid rgba(56, 189, 248, 0.3); }

.countdown-box {
  text-align: center;
  padding: 12px;
  background: rgba(8, 13, 26, 0.55);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.countdown-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.countdown-value { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: #fff; margin-top: 2px; }
.countdown-sub { font-size: 12px; color: var(--gold); margin-top: 2px; }

/* Collective Gauge */
.gauge-block { margin-top: 6px; }
.gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}
.progress-track {
  height: 11px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 999px;
  transition: width 0.45s ease;
  width: 0%;
}
.gauge-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Sponsor Banner */
.sponsor-banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.stat-tile .val { font-size: 19px; font-weight: 800; color: #fff; }
.stat-tile .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Forms & Buttons */
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1222;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.input:focus { border-color: var(--gold); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0;
  line-height: 1.4;
}
.checkbox-row input { margin-top: 3px; accent-color: var(--gold); }

.btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  border: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0b1120;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.28);
}
.btn-emerald {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #052e16;
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Scratch Card Banner */
.scratch-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Referral Box */
.ref-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.ref-box input { flex: 1; font-size: 13px; padding: 10px 12px; }
.ref-box button { width: auto; padding: 10px 14px; font-size: 13px; }

/* Advent 24-day Streak Grid */
.streak-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.day-cell {
  background: #0b1222;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.day-cell.partial {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--sky);
}
.day-cell.gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.15));
  border-color: var(--gold);
  color: var(--gold);
}
.day-cell small { display: block; font-size: 9.5px; font-weight: 600; opacity: 0.85; }

/* Affiliate Deals */
.deal-list { display: grid; gap: 8px; }
.deal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.deal-item:hover { border-color: var(--gold); text-decoration: none; }
.deal-price { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Ad Video Box */
.ad-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b, #0f172a, #064e3b);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 28px 18px;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}
.ad-timer-ring {
  font-size: 38px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* Scratch Card Canvas */
.scratch-wrap {
  position: relative;
  width: 280px;
  height: 140px;
  margin: 16px auto;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--gold);
  user-select: none;
  touch-action: none;
}
.scratch-underneath {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #064e3b, #0f172a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--gold);
}
.scratch-canvas {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--gold);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 200;
  max-width: 92vw;
  text-align: center;
  display: none;
}
.toast.show { display: block; }

.footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 20px;
  padding: 0 6px;
}
.hidden { display: none !important; }


/* AppLixir overlay & Sponsor MP4 fallback player */
#applixir_vanishing_div {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.ad-error-box {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.sponsor-video-wrap {
  width: 100%;
  display: grid;
  gap: 8px;
}
.sponsor-video-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sponsor-video-el {
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.sponsor-video-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}


/* Offerwall CPX Research Modal & Unified Footer */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 8px;
}
.footer-links a {
  color: var(--muted);
  font-size: 12px;
}
.footer-links a:hover {
  color: var(--gold);
}
.cpx-pending-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}
.cpx-modal {
  max-width: 780px;
  width: 96vw;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}
.cpx-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cpx-info-strip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #bae6fd;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}
.cpx-iframe-wrap {
  flex: 1;
  min-height: 360px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
}
.cpx-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.sql-warning-box {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.5;
}
