:root {
  --cb-bg: #0a0e1a;
  --cb-panel: #10151f;
  --cb-panel-2: #161c28;
  --cb-side: #0c1019;
  --cb-blue: #2f80ed;
  --cb-blue-2: #4a9bff;
  --cb-gold: #ffb020;
  --cb-green: #35d07f;
  --cb-text: #eef2fa;
  --cb-muted: #8b95a9;
  --cb-border: rgba(255,255,255,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; max-width: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--cb-bg); color: var(--cb-text); overflow-x: hidden; max-width: 100%; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 68px 1fr; min-height: 100vh; }
#app-shell { display: contents; }
.topbar { grid-column: 1 / -1; }
.sidebar { grid-column: 1; }
.main { grid-column: 2; overflow-x: hidden; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--cb-bg); border-bottom: 1px solid var(--cb-border);
  position: sticky; top: 0; z-index: 30;
}
.burger { background: none; border: none; color: var(--cb-blue); font-size: 22px; display: none; }
.tb-logo img { height: 30px; }
.tb-spacer { flex: 1; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px;
  border: 1.5px solid var(--cb-gold); border-radius: 24px; font-weight: 800; font-size: 16px;
  background: rgba(255,176,32,.06);
}
.coin-pill img { width: 22px; height: 22px; }
.coin-pill .updown { display: flex; flex-direction: column; line-height: .7; color: var(--cb-muted); font-size: 11px; }
.shop-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 10px;
  background: var(--cb-panel-2); border: 1px solid var(--cb-border); color: var(--cb-blue-2); font-weight: 800; font-size: 14px;
}
.user-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 22px;
  background: var(--cb-panel-2); border: 1px solid var(--cb-border); font-weight: 700; font-size: 14px;
}
.user-pill .uic { color: var(--cb-blue-2); font-size: 16px; }
.bell { background: none; border: none; color: var(--cb-muted); font-size: 20px; }

/* ---------- Sidebar ---------- */
.sidebar { background: var(--cb-side); border-right: 1px solid var(--cb-border); padding: 16px 14px; position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 10px;
  color: var(--cb-muted); font-weight: 700; font-size: 15px; width: 100%; background: none; border: none; text-align: left;
}
.nav-item .ic { width: 22px; text-align: center; font-size: 17px; }
.nav-item:hover { background: var(--cb-panel); color: var(--cb-text); }
.nav-item.active { background: var(--cb-panel-2); color: var(--cb-text); }
.nav-sep { height: 1px; background: var(--cb-border); margin: 12px 8px; }

/* ---------- Main ---------- */
.main { padding: 24px 28px 60px; }

/* Banner */
.banner {
  position: relative; border-radius: 16px; overflow: hidden; padding: 40px 44px; min-height: 200px;
  background: linear-gradient(120deg, #0f1830, #12224a 40%, #3a1f52 80%, #6a2b3f);
  display: flex; flex-direction: column; justify-content: center;
}
.banner h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; }
.banner p { color: #c9d4ea; margin: 6px 0 20px; font-weight: 600; }
.banner .gold { color: var(--cb-gold); }
.banner .btn-primary {
  align-self: flex-start; background: var(--cb-blue); color: #fff; border: none; border-radius: 10px;
  padding: 12px 34px; font-weight: 800; font-size: 15px; letter-spacing: .3px;
}
.banner .banner-art { position: absolute; right: 30px; bottom: -10px; width: 260px; opacity: .95; }
.banner .banner-art .stack { font-size: 120px; }

.dots { display: flex; gap: 8px; justify-content: center; margin: 16px 0 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3346; }
.dots i.on { background: var(--cb-blue); }

/* Category tabs */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 20px 0 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 20px; border-radius: 12px; background: transparent; border: none; color: var(--cb-muted); font-weight: 700; font-size: 13px;
}
.cat .ic { font-size: 18px; }
.cat:hover { color: var(--cb-text); }
.cat.active { background: var(--cb-panel-2); color: var(--cb-text); }

/* Section rows */
.row-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.row-head h3 { font-size: 20px; font-weight: 800; }
.row-arrows { display: flex; gap: 10px; }
.arrow { width: 42px; height: 42px; border-radius: 50%; background: var(--cb-panel-2); border: 1px solid var(--cb-border); color: var(--cb-text); font-size: 18px; }
.arrow:hover { background: var(--cb-panel); }

.strip { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-behavior: smooth; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.gcard {
  flex: 0 0 220px; position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 3/4;
  cursor: pointer; border: 1px solid var(--cb-border); background: var(--cb-panel); transition: transform .15s ease;
}
.gcard:hover { transform: translateY(-5px); }
.gcard img { width: 100%; height: 100%; object-fit: cover; }
.gcard .tag { position: absolute; top: 0; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 5px; background: linear-gradient(180deg, rgba(47,128,237,.95), rgba(47,128,237,0)); text-transform: uppercase; }
.gcard .tag.early { background: linear-gradient(180deg, rgba(53,208,127,.95), rgba(53,208,127,0)); }
.gcard .play-ov {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(6,10,20,.55); opacity: 0; transition: opacity .15s;
}
.gcard:hover .play-ov { opacity: 1; }
.gcard .play-btn { background: var(--cb-green); color: #04250f; font-weight: 800; padding: 10px 20px; border-radius: 10px; font-size: 14px; }
.gcard .gtitle {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 12px;
  font-size: 15px; font-weight: 800; text-align: center; line-height: 1.15;
  background: linear-gradient(180deg, rgba(6,10,20,0), rgba(6,10,20,.92));
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

/* Providers */
.prov-strip { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; padding: 10px 0; }
.prov-strip img { height: 42px; opacity: .8; }

/* Shop */
.shop-strip { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.shop-strip::-webkit-scrollbar { display: none; }
.pack {
  flex: 0 0 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--cb-border);
  background: var(--cb-panel); text-align: center; padding-bottom: 14px;
}
.pack.special { border-color: var(--cb-green); box-shadow: 0 0 0 1px var(--cb-green); }
.pack .pack-top { background: var(--cb-panel-2); padding: 8px; font-size: 13px; font-weight: 800; color: var(--cb-green); }
.pack .pack-top .special-lbl { display: block; font-size: 10px; color: var(--cb-muted); }
.pack .pack-coin { font-size: 56px; margin: 18px 0 6px; }
.pack h4 { font-size: 22px; font-weight: 900; }
.pack .sub { color: var(--cb-muted); font-size: 12px; font-weight: 700; letter-spacing: .5px; margin-bottom: 14px; }
.pack .buy { width: calc(100% - 28px); margin: 0 14px; padding: 12px; border-radius: 8px; border: none; background: var(--cb-blue); color: #fff; font-weight: 800; }
.pack.special .buy { background: var(--cb-green); color: #04250f; }
.pack .buy .old { text-decoration: line-through; opacity: .6; margin-right: 6px; }

/* Recent wins */
.wins { margin-top: 10px; border-radius: 12px; overflow: hidden; }
.wins table { width: 100%; border-collapse: collapse; }
.wins th { text-align: left; color: var(--cb-muted); font-size: 13px; font-weight: 700; padding: 12px 16px; }
.wins td { padding: 14px 16px; font-size: 14px; font-weight: 600; }
.wins tbody tr { background: var(--cb-panel); border-left: 3px solid var(--cb-green); }
.wins tbody tr:nth-child(odd) { background: var(--cb-panel-2); }
.wins tbody tr.gold { border-left-color: var(--cb-gold); }
.wins .amt { display: inline-flex; align-items: center; gap: 8px; }
.wins .amt img { width: 18px; height: 18px; }

/* Filtered category grid */
#filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
#filter-grid .gcard { flex: 0 0 auto; width: 100%; }
@media (max-width: 600px) {
  #filter-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* Page heading */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.page-head .ic { font-size: 26px; }
.page-head h1 { font-size: 28px; font-weight: 900; }

/* Promotions */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 22px; }
.promo {
  position: relative; overflow: hidden; border-radius: 16px; padding: 34px; min-height: 210px;
  border: 1px solid var(--cb-border); background: var(--cb-panel-2);
  display: flex; flex-direction: column; justify-content: center;
}
.promo.featured { background: linear-gradient(120deg, #10203f, #241640 70%, #3a1030); }
.promo h3 { font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.promo p { color: #c2cde3; font-weight: 600; max-width: 62%; margin-bottom: 20px; }
.promo p .gold { color: var(--cb-gold); font-weight: 800; }
.promo p .green { color: var(--cb-green); font-weight: 800; }
.promo .claim { align-self: flex-start; background: var(--cb-blue); color: #fff; border: none; border-radius: 9px; padding: 12px 30px; font-weight: 800; letter-spacing: .3px; }
.promo .promo-art { position: absolute; right: 24px; bottom: 20px; font-size: 90px; line-height: 1; opacity: .95; }

/* Affiliate */
.aff-hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 34px; margin-bottom: 24px;
  background: linear-gradient(120deg, #0e1c3c, #16326e); border: 1px solid var(--cb-border);
}
.aff-hero p { color: #d3ddef; font-weight: 600; max-width: 70%; line-height: 1.6; margin-bottom: 6px; }
.aff-hero .note { color: var(--cb-muted); font-size: 13px; margin: 14px 0 22px; }
.aff-hero .art { position: absolute; right: 30px; top: 30px; font-size: 90px; opacity: .9; }
.ref-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ref-box { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--cb-border); padding-bottom: 10px; }
.ref-box .lbl { color: var(--cb-muted); font-size: 13px; }
.ref-box code { font-size: 17px; font-weight: 700; }
.aff-hero .share { background: var(--cb-blue); color: #fff; border: none; border-radius: 9px; padding: 12px 28px; font-weight: 800; }
.aff-body { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.aff-tabs { display: flex; flex-direction: column; gap: 6px; background: var(--cb-panel-2); border: 1px solid var(--cb-border); border-radius: 12px; padding: 10px; height: fit-content; }
.aff-tab { text-align: left; background: none; border: none; color: var(--cb-muted); font-weight: 700; font-size: 15px; padding: 13px 16px; border-radius: 8px; }
.aff-tab:hover { background: var(--cb-panel); color: var(--cb-text); }
.aff-tab.active { background: var(--cb-blue); color: #fff; }
.aff-content { background: var(--cb-panel-2); border: 1px solid var(--cb-border); border-radius: 12px; padding: 28px; }
.aff-content h3 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.aff-content h4 { font-size: 16px; font-weight: 800; margin: 18px 0 8px; }
.aff-content p { color: #c2cde3; line-height: 1.7; margin-bottom: 12px; }
.aff-content ul { padding-left: 22px; }
.aff-content li { color: #c2cde3; line-height: 1.7; margin-bottom: 10px; }
@media (max-width: 760px) {
  .aff-body { grid-template-columns: 1fr; }
  .promo p, .aff-hero p { max-width: 100%; }
}

/* Footer */
.cb-footer { border-top: 1px solid var(--cb-border); margin-top: 44px; padding: 30px 0 10px; }
.cb-footer .top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.cb-footer .top img.logo { height: 28px; }
.cb-footer .socials { display: flex; gap: 14px; }
.cb-footer .socials img { width: 20px; height: 20px; opacity: .8; }
.cb-footer .cols { display: flex; gap: 60px; flex-wrap: wrap; margin: 26px 0; }
.cb-footer h5 { font-size: 13px; text-transform: uppercase; color: var(--cb-blue-2); margin-bottom: 10px; }
.cb-footer .cols a, .cb-footer .cols span { display: block; color: var(--cb-muted); font-size: 13px; margin: 6px 0; }
.cb-footer .legal { display: flex; align-items: flex-start; gap: 16px; color: #6b7488; font-size: 12px; line-height: 1.6; border-top: 1px solid var(--cb-border); padding-top: 18px; }
.cb-footer .legal img { width: 34px; flex-shrink: 0; }

/* ---------- Balance pulse + toasts ---------- */
.coin-pill.pulse { animation: coinPulse .6s ease; }
@keyframes coinPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(255,176,32,.35); }
  100% { transform: scale(1); }
}

#jx-toasts { position: fixed; top: 82px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.jx-toast {
  background: var(--cb-panel-2); border: 1px solid var(--cb-border); color: var(--cb-text);
  padding: 13px 18px; border-radius: 10px; font-weight: 700; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); border-left: 4px solid var(--cb-green);
  animation: toastIn .3s ease; max-width: 300px;
}
.jx-toast.warn { border-left-color: var(--cb-gold); }
.jx-toast.hide { opacity: 0; transform: translateX(20px); transition: all .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@media (max-width: 600px) { #jx-toasts { top: 76px; right: 10px; left: 10px; } .jx-toast { max-width: none; } }

/* ---------- Live Support chat ---------- */
#jx-chat { position: fixed; right: 22px; bottom: 22px; z-index: 60; }
.jx-chat-fab {
  width: 58px; height: 58px; border-radius: 50%; border: none; font-size: 24px;
  background: var(--cb-blue); color: #fff; box-shadow: 0 10px 26px rgba(47,128,237,.45);
  transition: transform .12s ease;
}
.jx-chat-fab:hover { transform: scale(1.06); }
.jx-chat-box {
  position: absolute; right: 0; bottom: 74px; width: 340px; max-width: calc(100vw - 44px);
  height: 460px; max-height: calc(100vh - 120px); display: none; flex-direction: column;
  background: var(--cb-panel); border: 1px solid var(--cb-border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
#jx-chat.open .jx-chat-box { display: flex; }
#jx-chat.open .jx-chat-fab { transform: rotate(0); }
.jx-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: linear-gradient(120deg, #123a7a, #2f80ed); }
.jx-chat-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.jx-chat-title .dot { width: 9px; height: 9px; border-radius: 50%; background: #35d07f; box-shadow: 0 0 0 3px rgba(53,208,127,.25); }
.jx-chat-x { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.jx-chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cb-bg); }
.jx-msg { max-width: 82%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.jx-msg.bot { align-self: flex-start; background: var(--cb-panel-2); border: 1px solid var(--cb-border); border-bottom-left-radius: 4px; }
.jx-msg.me { align-self: flex-end; background: var(--cb-blue); color: #fff; border-bottom-right-radius: 4px; }
.jx-msg.typing { opacity: .6; letter-spacing: 3px; }
.jx-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--cb-border); background: var(--cb-panel); }
.jx-chat-form input { flex: 1; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--cb-border); background: var(--cb-bg); color: var(--cb-text); outline: none; font-size: 14px; }
.jx-chat-form input:focus { border-color: var(--cb-blue); }
.jx-chat-form button { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--cb-blue); color: #fff; font-size: 16px; flex-shrink: 0; }

/* Mobile drawer */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 68px; left: 0; width: 260px; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { grid-column: 1; }
  .burger { display: block; }
  .tb-logo img { height: 26px; }
  .coin-pill { font-size: 14px; padding: 6px 10px; }
  .shop-btn span, .user-pill .uname { display: none; }
  /* dim backdrop when the drawer is open */
  .sidebar.open::after {
    content: ''; position: fixed; top: 68px; left: 260px; right: 0; bottom: 0;
    background: rgba(0,0,0,.5); z-index: -1;
  }
}

@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .main { padding: 18px 14px 46px; }

  .banner { padding: 24px 20px; min-height: 150px; border-radius: 14px; }
  .banner h2 { font-size: 22px; }
  .banner p { font-size: 14px; }
  .banner .banner-art { display: none; }

  .page-head h1 { font-size: 22px; }

  .cat { padding: 10px 14px; font-size: 12px; }
  .row-head h3 { font-size: 18px; }
  .arrow { width: 36px; height: 36px; font-size: 16px; }
  .gcard { flex-basis: 150px; }

  /* Promotions */
  .promo { padding: 24px 20px; min-height: 170px; }
  .promo h3 { font-size: 20px; }
  .promo p { max-width: 100%; font-size: 14px; }
  .promo .promo-art { font-size: 60px; right: 14px; bottom: 12px; opacity: .5; }

  /* Affiliate */
  .aff-hero { padding: 24px 20px; }
  .aff-hero p { max-width: 100%; }
  .aff-hero .art { display: none; }
  .ref-box code { font-size: 14px; word-break: break-all; }
  .aff-content { padding: 20px 16px; }

  /* Shop packs */
  .pack { flex-basis: 170px; }
  .prov-strip img { height: 34px; }

  /* Recent wins: keep the table on one row set, allow horizontal scroll */
  .wins { overflow-x: auto; }
  .wins table { min-width: 460px; }

  .cb-footer .cols { gap: 30px; }
}
