/* ============================================
   Coinlyft Design System
   ============================================ */

/* NOTE: the Google Fonts are loaded from a <link> tag in each page's
   <head> now (not @import). @import inside a stylesheet blocks the
   browser from rendering ANYTHING until that imported file has been
   fetched — a real cause of slow page loads. A <link rel="stylesheet">
   in the HTML is discovered immediately by the browser's preload
   scanner and fetched in parallel with this file instead of after it. */

:root{
  /* Core palette */
  --ink: #10123B;
  --ink-2: #201F6B;
  --ink-3: #2E2E8C;
  --cloud: #F5F6FB;
  --card: #FFFFFF;
  --gold: #FFB800;
  --gold-dark: #E6A500;
  --mint: #00C9A7;
  --mint-dark: #00A88A;
  --coral: #FF5D73;
  --slate: #2B2E52;
  --slate-soft: #767B9E;
  --line: #E7E8F4;

  /* Category accents */
  --cat-install: #5B8DEF;
  --cat-install-bg: #EAF0FE;
  --cat-registration: #17B897;
  --cat-registration-bg: #E3FBF4;
  --cat-ftd: #E11D48;
  --cat-ftd-bg: #FDE8ED;
  --cat-trading: #4C51E6;
  --cat-trading-bg: #ECEBFE;
  --cat-shopping: #F0609B;
  --cat-shopping-bg: #FDEAF1;
  --cat-survey: #FF9F43;
  --cat-survey-bg: #FFF1E3;
  --cat-game: #A66DF0;
  --cat-game-bg: #F3EBFE;

  /* Type */
  --font-display: 'Baloo 2', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Grotesk', sans-serif;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 4px 20px rgba(16, 18, 59, 0.06);
  --shadow-card-hover: 0 10px 30px rgba(16, 18, 59, 0.12);
}

*{ box-sizing: border-box; }

body{
  font-family: var(--font-body);
  margin: 0;
  background: var(--cloud);
  color: var(--slate);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3{
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
}

a{ color: inherit; }

/* ============================================
   Header / Top bar
   ============================================ */

header.topbar{
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
  color: white;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 16px rgba(16,18,59,0.15);
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-decoration: none;
}

.brand .coin-mark{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFE07A, var(--gold) 60%, var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25), 0 0 0 0 rgba(255,184,0,0.5);
  animation: coin-pulse 2.4s ease-in-out infinite;
}

.brand-logo{
  height: 34px;
  width: auto;
  display: block;
}

@keyframes coin-pulse{
  0%, 100%{ box-shadow: 0 2px 6px rgba(0,0,0,0.25), 0 0 0 0 rgba(255,184,0,0.4); }
  50%{ box-shadow: 0 2px 6px rgba(0,0,0,0.25), 0 0 0 6px rgba(255,184,0,0); }
}

nav.topnav{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav.topnav a{
  flex-shrink: 0;
}

nav.topnav a{
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

nav.topnav a:hover{
  background: rgba(255,255,255,0.12);
  color: white;
}

nav.topnav a.cta{
  background: var(--mint);
  color: var(--ink);
}

nav.topnav a.cta:hover{
  background: var(--mint-dark);
  color: white;
}

/* Profile avatar + dropdown */

.profile-menu{
  position: relative;
  flex-shrink: 0;
}

.avatar-btn{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--ink);
  border: 2px solid rgba(255,255,255,0.25);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.avatar-btn:hover{
  transform: none;
  box-shadow: 0 0 0 3px rgba(255,184,0,0.25);
}

.profile-dropdown{
  position: absolute;
  top: 48px;
  right: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(16,18,59,0.25);
  min-width: 180px;
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 100;
}

.profile-dropdown.open{ display: flex; }

.profile-dropdown a{
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--slate);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav-link-mobile-only{ display: none; }

nav.topnav .profile-dropdown a{
  color: var(--slate);
}

.profile-dropdown a:hover{
  background: var(--cloud);
}

nav.topnav .profile-dropdown a.danger{ color: var(--coral); }

/* ============================================
   Buttons (base)
   ============================================ */

button{
  font-family: var(--font-body);
  background: var(--mint);
  color: var(--ink);
  border: none;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

button:hover{
  background: var(--mint-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,201,167,0.3);
}

button:active{ transform: translateY(0); }

button:disabled{
  background: #D8DAEE;
  color: var(--slate-soft);
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* ============================================
   Hero (index.html)
   ============================================ */

.hero{
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  color: white;
  text-align: left;
  padding: 80px 32px;
  position: relative;
  overflow: hidden;
}

.hero::after{
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,0,0.25), transparent 70%);
}

.hero-inner{
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.hero h1{
  color: white;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero p{
  font-size: 17px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero button{
  background: var(--gold);
  color: var(--ink);
  font-size: 15px;
  padding: 15px 32px;
}

.hero button:hover{
  background: #FFC633;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(255,184,0,0.35);
}

/* ============================================
   Stats strip (trust signals, homepage)
   ============================================ */

.stats-strip{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  max-width: 900px;
  margin: -34px auto 0;
  position: relative;
  z-index: 2;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.stat-item{
  background: var(--card);
  padding: 20px 16px;
  text-align: center;
}

.stat-item .stat-value{
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  min-height: 32px;
}

.stat-item .stat-label{
  display: block;
  font-size: 12.5px;
  color: var(--slate-soft);
  margin-top: 4px;
}

@media (max-width: 640px){
  .stats-strip{
    grid-template-columns: 1fr;
    margin: -24px 16px 0;
  }
}

/* ============================================
   How it works (homepage)
   ============================================ */

.how-it-works{
  padding: 56px 32px 8px;
  max-width: 1000px;
  margin: 0 auto;
}

.how-it-works .section-head{
  padding: 0;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.how-steps{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.how-step{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
}

.how-step .how-step-num{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.how-step .how-step-icon{
  font-size: 28px;
  margin-bottom: 10px;
}

.how-step h4{
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 6px;
}

.how-step p{
  font-size: 13.5px;
  color: var(--slate-soft);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 700px){
  .how-steps{ grid-template-columns: 1fr; }
}

/* ============================================
   Section headings
   ============================================ */

.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 32px;
  margin: 40px 0 18px;
}

.section-head h2{
  font-size: 22px;
  font-weight: 700;
}

.section-head .eyebrow{
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint-dark);
  margin-bottom: 4px;
}

/* Small pulsing dot next to "Live Now" - a cheap, effective signal
   that this section is actively updated, not static marketing copy. */
.live-dot{
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.6);
  animation: live-dot-pulse 1.8s ease-out infinite;
}

@keyframes live-dot-pulse{
  0%   { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 201, 167, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0); }
}

.offers-count-badge{
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--mint-dark);
  background: var(--mint-bg, rgba(0, 201, 167, 0.12));
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Offer cards fade/slide in on load, staggered via inline
   animation-delay set per-card in index.js/offers-render.js. Purely
   cosmetic - falls back to instant display if motion is reduced. */
@keyframes reveal-card-in{
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal-card{
  animation: reveal-card-in 0.5s ease both;
}

@media (prefers-reduced-motion: reduce){
  .live-dot{ animation: none; }
  .reveal-card{ animation: none; }
}

/* ============================================
   Offer cards (shared: index + dashboard)
   ============================================ */

.offers, .offer-grid{
  padding: 0 32px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card{
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  height: 100%;
}

.card .card-banner{
  width: calc(100% + 44px);
  margin: -22px -22px 0;
  height: 130px;
  object-fit: cover;
  display: block;
}

.slide-card .slide-banner{
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
  display: block;
}

.card:hover{
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.card .cat-badge{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card[data-category="install"] .cat-badge{ background: var(--cat-install-bg); }
.card[data-category="registration"] .cat-badge{ background: var(--cat-registration-bg); }
.card[data-category="ftd"] .cat-badge{ background: var(--cat-ftd-bg); }
.card[data-category="trading"] .cat-badge{ background: var(--cat-trading-bg); }
.card[data-category="shopping"] .cat-badge{ background: var(--cat-shopping-bg); }
.card[data-category="survey"] .cat-badge{ background: var(--cat-survey-bg); }
.card[data-category="game"] .cat-badge{ background: var(--cat-game-bg); }

.card[data-category="ftd"] .payout{ background: var(--cat-ftd-bg); color: var(--cat-ftd); }

.card h3{
  font-size: 17px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 2);
}

.card .payout{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold-dark);
  background: #FFF7E3;
  padding: 6px 12px;
  border-radius: 999px;
  width: fit-content;
}

.card p{
  margin: 0;
  font-size: 14px;
  color: var(--slate-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.4em * 3);
}

/* Pushes "View Details" + the Apply/Pending/Complete button to the
   bottom of every card, regardless of how short/long the title,
   description, or banner presence made the rest of the card. This is
   what keeps every button lined up along the same row. */
.card .view-details{
  margin-top: auto;
}

.card button{ margin-top: 0; }

/* ============================================
   Tabs (dashboard offer categories)
   ============================================ */

.tabs{
  display: flex;
  gap: 10px;
  padding: 0 32px;
  margin-bottom: 26px;
  overflow-x: auto;
}

.tab-btn{
  background: white;
  border: 1px solid var(--line);
  color: var(--slate);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover{
  background: var(--cloud);
  transform: none;
  box-shadow: none;
  color: var(--slate);
}

.tab-btn.active{
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

/* ============================================
   Search + sort controls
   ============================================ */

.offer-controls{
  display: flex;
  gap: 12px;
  padding: 0 32px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.offer-controls input[type="text"]{
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  background: white;
}

.offer-controls input[type="text"]:focus{
  outline: none;
  border-color: var(--mint);
}

.offer-controls select{
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  background: white;
  color: var(--slate);
  cursor: pointer;
}

/* ============================================
   Offer detail modal
   ============================================ */

.view-details{
  font-size: 13px;
  font-weight: 600;
  color: var(--mint-dark);
  text-decoration: none;
  margin-top: -6px;
}

.view-details:hover{ text-decoration: underline; }

.modal-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16,18,59,0.55);
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.open{ display: flex; }

.modal-box{
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  margin: auto;
  position: relative;
  text-align: center;
  overflow-y: auto;
}

.modal-close{
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--cloud);
  color: var(--slate);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.modal-close:hover{
  background: var(--line);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.modal-icon{
  font-size: 48px;
  margin-bottom: 8px;
}

.modal-box h3{
  font-size: 20px;
  margin-bottom: 12px;
}

.modal-meta{
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.time-pill{
  background: var(--cloud);
  color: var(--slate-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

.modal-box p{
  color: var(--slate-soft);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.modal-box button{
  width: 100%;
}

.modal-approved-extra{
  text-align: left;
  background: var(--cloud);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.modal-approved-extra p{
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--slate);
}

.modal-approved-extra p:last-child{ margin-bottom: 0; }

.modal-approved-extra a{
  color: var(--mint-dark);
  font-weight: 700;
  text-decoration: none;
}

.modal-approved-extra a:hover{ text-decoration: underline; }

.apply-modal-sub{
  color: var(--slate-soft);
  font-size: 13px;
  margin-top: -8px;
}

.traffic-type-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  text-align: left;
}

.traffic-option{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.traffic-option:has(input:checked){
  border-color: var(--mint);
  background: rgba(0,201,167,0.08);
  color: var(--ink);
}

.traffic-option input{
  width: 16px;
  height: 16px;
  accent-color: var(--mint-dark);
  margin: 0;
}

button.pending-btn{
  background: #D8DAEE !important;
  color: var(--slate-soft) !important;
  cursor: default !important;
}

button.pending-btn:hover{
  background: #D8DAEE !important;
  color: var(--slate-soft) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================
   Trending slider
   ============================================ */

.slider-wrap{
  padding: 0 32px 10px;
  position: relative;
}

.slider{
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.slider::-webkit-scrollbar{ height: 6px; }
.slider::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 999px; }

.slide-card{
  scroll-snap-align: start;
  min-width: 220px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  color: white;
  border-radius: var(--radius-md);
  padding: 18px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.slide-card .hot-tag{
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--coral);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.slide-card h4{
  font-family: var(--font-display);
  font-size: 16px;
  margin: 6px 0 6px;
}

.slide-card .payout{
  background: rgba(255,184,0,0.18);
  color: var(--gold);
}

.slider-arrows{
  display: flex;
  gap: 8px;
}

.slider-arrows button{
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
}

.slider-arrows button:hover{
  background: var(--cloud);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

/* ============================================
   Reward card (dashboard hero)
   ============================================ */

.leaderboard-ticker{
  margin: 0 32px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  padding: 10px 0;
  white-space: nowrap;
  position: relative;
}

.leaderboard-ticker-track{
  display: inline-flex;
  align-items: center;
  gap: 40px;
  animation: rh-ticker-scroll 22s linear infinite;
}

.leaderboard-ticker:hover .leaderboard-ticker-track{
  animation-play-state: paused;
}

.ticker-item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate);
}

.ticker-item .ticker-rank{
  font-size: 15px;
}

.ticker-item .ticker-points{
  color: var(--mint-dark);
  font-weight: 700;
}

.ticker-loading{
  padding-left: 20px;
  color: var(--slate-soft);
  font-size: 13px;
}

@keyframes rh-ticker-scroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

.reward-card-section{
  padding: 28px 32px 8px;
}

.reward-card{
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 60%, var(--ink-2) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,18,59,0.25);
}

.reward-card::before{
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,0,0.22), transparent 70%);
}

.reward-card::after{
  content: "";
  position: absolute;
  bottom: -70px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,201,167,0.18), transparent 70%);
}

.reward-card-top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.reward-card-top .member-label{
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
}

#welcomeMsg{
  color: white;
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.chip-icon{
  width: 40px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #FFE07A, var(--gold) 60%, var(--gold-dark));
  position: relative;
  z-index: 1;
}

.balance-block{
  margin-top: 26px;
  position: relative;
  z-index: 1;
}

.balance-block h3{
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

#balanceText{
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.01em;
}

.card-footer-row{
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.masked-number{
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
}

.redeem-cta{
  background: var(--gold);
  color: var(--ink);
  padding: 9px 18px;
  font-size: 13px;
}

.redeem-cta:hover{
  background: #FFC633;
  color: var(--ink);
}

/* legacy .balance kept for compatibility, unused visually now */
.balance{ display: none; }

/* ============================================
   Daily bonus banner
   ============================================ */

.daily-bonus-banner{
  margin: 0 32px 8px;
  background: linear-gradient(135deg, #FFB800, #FF8A3D);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(255,138,61,0.3);
}

.daily-bonus-left{
  display: flex;
  align-items: center;
  gap: 14px;
}

.daily-bonus-emoji{
  font-size: 30px;
}

.daily-bonus-banner h3{
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 2px;
}

.daily-bonus-banner p{
  color: rgba(16,18,59,0.75);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.daily-bonus-banner button{
  background: var(--ink);
  color: white;
  flex-shrink: 0;
}

.daily-bonus-banner button:hover{
  background: var(--ink-2);
  color: white;
  box-shadow: 0 6px 16px rgba(16,18,59,0.35);
}

.daily-bonus-banner.referral-banner{
  background: linear-gradient(135deg, var(--mint), var(--mint-dark));
  box-shadow: 0 8px 24px rgba(0,201,167,0.3);
}

.daily-bonus-banner.referral-banner h3,
.daily-bonus-banner.referral-banner p{
  color: white;
}

.streak-dots{
  display: flex;
  gap: 6px;
  margin: 10px 32px 0;
}

.streak-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(16,18,59,0.15);
}

.streak-dot.filled{
  background: var(--ink);
}

/* ============================================
   History page
   ============================================ */

body.page-body{
  display: block;
  min-height: auto;
}

.history-wrap{
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px 40px;
}

.history-wrap .sub{
  color: var(--slate-soft);
  font-size: 14px;
}

.history-tabs{
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.txn-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.txn-row{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.txn-icon{
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cloud);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.txn-info{
  flex: 1;
  min-width: 0;
}

.txn-info h4{
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.txn-info p{
  font-size: 12px;
  color: var(--slate-soft);
  margin: 2px 0 0;
}

.badge{
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-completed{
  background: #E3FBF4;
  color: var(--mint-dark);
}

.badge-pending{
  background: #FFF1E3;
  color: var(--cat-survey);
}

.txn-amount{
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-dark);
  white-space: nowrap;
}

.empty-state{
  text-align: center;
  color: var(--slate-soft);
  font-size: 14px;
  padding: 40px 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
}

/* ============================================
   Rewards store
   ============================================ */

.reward-store-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.reward-item .redeem-btn{
  width: 100%;
}

.reward-item .redeem-btn:disabled{
  font-size: 12px;
}

/* ============================================
   Referral page
   ============================================ */

.referral-card{
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: white;
}

.referral-label{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
  margin: 0 0 8px;
}

.referral-copy-row{
  display: flex;
  gap: 10px;
}

.referral-copy-row input{
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-family: var(--font-mono);
  font-size: 13px;
}

.referral-copy-row button{
  background: var(--gold);
  color: var(--ink);
  flex-shrink: 0;
  padding: 12px 20px;
}

.referral-copy-row button:hover{
  background: #FFC633;
  color: var(--ink);
}

.referral-stats{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.stat-box{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.stat-box h3{
  font-family: var(--font-mono);
  font-size: 30px;
  color: var(--ink);
  margin-bottom: 4px;
}

.stat-box p{
  font-size: 13px;
  color: var(--slate-soft);
  margin: 0;
}

/* ============================================
   Leaderboard
   ============================================ */

.leaderboard-row{
  transition: transform 0.15s ease;
}

.leaderboard-row:hover{
  transform: translateX(2px);
}

.rank-icon{
  font-size: 18px;
  font-weight: 700;
  color: var(--slate);
  background: var(--cloud);
}

.leaderboard-row-me{
  border-color: var(--mint);
  background: #F0FDFA;
}

.leaderboard-row-me .txn-amount{
  color: var(--mint-dark);
}

/* ============================================
   Forms (login / register)
   ============================================ */

body:has(.form-box), body:has(.profile-box){
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
}

.form-box{
  background: var(--card);
  width: 380px;
  margin: 0;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.form-box h2{
  font-size: 24px;
  margin-bottom: 22px;
}

.form-box input{
  width: 100%;
  padding: 13px 14px;
  margin: 8px 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.form-box input:focus{
  outline: none;
  border-color: var(--mint);
}

.form-box button{
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font-size: 15px;
}

.form-box p{
  font-size: 14px;
  color: var(--slate-soft);
  margin-top: 18px;
}

.form-box p a{
  color: var(--mint-dark);
  font-weight: 600;
  text-decoration: none;
}

.error{
  color: var(--coral);
  font-size: 13px;
  min-height: 18px;
  font-weight: 500;
}

.success-msg{
  color: var(--mint-dark);
  font-size: 13px;
  min-height: 18px;
  font-weight: 500;
}

/* ============================================
   Profile page
   ============================================ */

.profile-box{
  background: var(--card);
  width: 460px;
  max-width: 92vw;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  text-align: left;
}

.profile-box > a.back-link{
  display: inline-block;
  color: var(--slate-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.profile-box h2{
  font-size: 24px;
  margin-bottom: 6px;
}

.profile-box .sub{
  color: var(--slate-soft);
  font-size: 13px;
  margin-bottom: 24px;
}

.profile-section{
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.profile-section:first-of-type{ border-top: none; padding-top: 0; }

.profile-section h3{
  font-size: 15px;
  margin-bottom: 4px;
}

.profile-section .hint{
  font-size: 12px;
  color: var(--slate-soft);
  margin-bottom: 12px;
}

.profile-section input{
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
}

.profile-section input:focus{
  outline: none;
  border-color: var(--mint);
}

.profile-section button{
  padding: 10px 22px;
  font-size: 13px;
}

/* ============================================
   Footer
   ============================================ */

footer{
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 26px;
  text-align: center;
  font-size: 13px;
  margin-top: 20px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px){
  header.topbar{
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .brand{ font-size: 18px; }
  .brand .coin-mark{ width: 26px; height: 26px; }
  .brand-logo{ height: 28px; }

  nav.topnav{ gap: 4px; }
  nav.topnav a{
    padding: 7px 10px;
    font-size: 13px;
  }

  .hero{ padding: 44px 18px; }
  .hero h1{ font-size: 26px; }
  .hero p{ font-size: 14px; }

  .section-head, .offers, .offer-grid, .tabs, .slider-wrap, .reward-card-section{
    padding-left: 16px;
    padding-right: 16px;
  }

  .section-head{ margin: 28px 0 14px; }
  .section-head h2{ font-size: 18px; }

  .reward-card{ padding: 20px; }
  #balanceText{ font-size: 28px; }

  .card-footer-row{
    flex-wrap: wrap;
    gap: 10px;
  }

  .masked-number{ display: none; }

  .redeem-cta{ width: 100%; }

  /* Search + sort stack vertically */
  .offer-controls{
    flex-direction: column;
    padding-left: 16px;
    padding-right: 16px;
  }
  .offer-controls input[type="text"],
  .offer-controls select{
    width: 100%;
  }

  /* Daily bonus / referral banner stack vertically */
  .daily-bonus-banner{
    margin: 0 16px 8px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 12px;
  }
  .daily-bonus-left{
    justify-content: center;
  }
  .daily-bonus-banner button{
    width: 100%;
  }

  /* Offer/reward cards */
  .offer-grid, .offers, .reward-store-grid{
    grid-template-columns: 1fr;
  }

  /* Modal */
  .modal-box{
    padding: 26px 18px 22px;
    max-height: 85vh;
    border-radius: 20px;
  }
  .modal-icon svg{ width: 36px; height: 36px; }
  .modal-close{
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
  }
  .modal-box p{ margin-bottom: 18px; }
  .modal-box button{ margin-top: 4px; }

  /* Notification bell - a little tighter on small screens */
  #rhNotifBell{ width: 34px !important; height: 34px !important; font-size: 14px !important; }

  /* Consolidate Home/Leaderboard into the profile dropdown on mobile only,
     so the header isn't crowded with logo + links + bell + avatar all at once */
  nav.topnav a.nav-link-desktop{ display: none; }
  .nav-link-mobile-only{ display: block; }

  /* History / profile / referral / leaderboard wrapper pages */
  .history-wrap{ padding: 0 16px 30px; }
  .profile-box{ padding: 28px 22px; }

  .txn-row{
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .txn-info{
    flex-basis: 100%;
    order: 3;
  }
  .badge{ order: 1; }
  .txn-amount{ order: 2; margin-left: auto; }

  .referral-stats{
    grid-template-columns: 1fr;
  }

  .referral-copy-row{
    flex-direction: column;
  }
  .referral-copy-row button{ width: 100%; }

  /* Profile dropdown shouldn't overflow the viewport edge */
  .profile-dropdown{
    right: -8px;
    min-width: 170px;
  }
}

@media (max-width: 400px){
  nav.topnav a:not(.profile-menu a){
    font-size: 12px;
    padding: 6px 8px;
  }
  .hero h1{ font-size: 22px; }
  #balanceText{ font-size: 24px; }
}

@media (prefers-reduced-motion: reduce){
  .brand .coin-mark{ animation: none; }
}

/* ============================================
   Ad Placements
   ============================================ */

/* Fixed, responsive box for every ad slot — no matter how big the
   source image is, it's constrained (and centered) inside this box,
   and the box itself keeps a stable size so the page doesn't jump
   around while the ad loads. Banner shape by default; slots that
   should be a rectangle instead are overridden below. */
.ad-slot{
  position: relative;
  width: 100%;
  max-width: 728px;
  aspect-ratio: 728 / 90;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
  background: var(--cloud);
  border: 1px solid var(--line);
}

/* Nothing to show for this slot (no ad configured, or none approved
   yet) — collapse instead of leaving an empty grey box on the page. */
.ad-slot:empty{ display: none; }

/* An ad failed to load its image — hide the box instead of showing
   a broken-image icon with the ad's name as text. */
.ad-slot.ad-broken{ display: none; }

.ad-frame{
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .35s ease;
}
.ad-frame-in{ opacity: 1; }

.ad-slot .ad-link,
.ad-slot ins.adsbygoogle{
  display: block;
  width: 100%;
  height: 100%;
}

.ad-slot img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* Rectangle-shaped placements (between offers / sidebar) */
.ad-slot[data-ad-slot="dashboard_between_offers"],
.ad-slot[data-ad-slot="dashboard_sidebar"]{
  max-width: 336px;
  aspect-ratio: 336 / 280;
}

@media (max-width: 600px){
  .ad-slot{
    aspect-ratio: 320 / 100;
  }
  .ad-slot[data-ad-slot="dashboard_between_offers"],
  .ad-slot[data-ad-slot="dashboard_sidebar"]{
    max-width: 300px;
    aspect-ratio: 300 / 250;
  }
}


/* ===== Offers: NEW badge, count, skeletons, empty states ===== */
.card{ position: relative; }
.card .new-badge{
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .6px;
  padding: 4px 10px; border-radius: 20px; box-shadow: 0 4px 12px rgba(255,93,115,.35);
}
.offer-count{ padding: 0 32px 12px; font-size: 13px; color: var(--slate-soft); }
.empty-offers{
  grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--slate-soft);
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius-lg);
}
.empty-offers .empty-icon{ font-size: 40px; margin-bottom: 8px; }
.empty-offers h3{ color: var(--slate); margin-bottom: 4px; }
.skeleton-card{ pointer-events: none; }
.skeleton-card .sk{
  border-radius: 10px; background: linear-gradient(90deg, #eceef8 25%, #f6f7fc 37%, #eceef8 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.3s ease infinite;
}
.sk-badge{ width: 44px; height: 44px; } .sk-line{ height: 14px; } .sk-line.short{ width: 60%; } .sk-btn{ height: 38px; margin-top: 8px; }
@keyframes sk-shimmer{ 0%{ background-position: 100% 50%; } 100%{ background-position: 0 50%; } }
@media (max-width: 640px){ .offer-count{ padding: 0 16px 10px; } }


/* Placeholder when an offer has no picture */
.banner-ph{
  display: flex; align-items: center; justify-content: center; font-size: 42px;
  background: linear-gradient(135deg, var(--ink-2), var(--ink-3));
}
.banner-ph[data-category="install"]{ background: linear-gradient(135deg, #5B8DEF, #8FB3FF); }
.banner-ph[data-category="registration"]{ background: linear-gradient(135deg, #17B897, #5EE0C3); }
.banner-ph[data-category="ftd"]{ background: linear-gradient(135deg, #E11D48, #FF7A93); }
.banner-ph[data-category="trading"]{ background: linear-gradient(135deg, #4C51E6, #8B8FFF); }
.banner-ph[data-category="shopping"]{ background: linear-gradient(135deg, #F0609B, #FF9CC2); }
.banner-ph[data-category="survey"]{ background: linear-gradient(135deg, #FF9F43, #FFC987); }
.banner-ph[data-category="game"]{ background: linear-gradient(135deg, #7C4DFF, #B39DFF); }
.banner-ph.banner-logo img{ width: 64px; height: 64px; border-radius: 16px; background: #fff; padding: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.2); object-fit: contain; }
.slide-card .slide-banner.banner-ph{ height: 90px; border-radius: 12px; margin-bottom: 8px; font-size: 32px; }
