/* ============================================================
   myfree.co.in — Dark Minimal Theme
   ============================================================ */

:root {
  --bg:         #0d0d0d;
  --bg2:        #141414;
  --bg3:        #1c1c1c;
  --bg4:        #242424;
  --border:     #2a2a2a;
  --border2:    #333;
  --text:       #e8e8e8;
  --text-muted: #888;
  --text-dim:   #555;
  --orange:     #f7931a;
  --orange-dk:  #d4780e;
  --orange-lt:  #ffa733;
  --green:      #00c853;
  --red:        #e53935;
  --yellow:     #ffb300;
  --blue:       #2196f3;
  --radius:     4px;
  --radius-lg:  8px;
  --shadow:     0 2px 12px rgba(0,0,0,.6);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.8);
  --font:       'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --transition: 150ms ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange-lt); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---- Layout ---- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 520px; }
.container-md { max-width: 800px; }

main { flex: 1; padding: 32px 0; }

/* Outer 3-column wrapper: left banner | content | right banner */
.page-outer {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 0;
  max-width: 1700px;
  margin: 0 auto;
  align-items: start;
}

/* Center column */
.page-center {
  min-width: 0;
}

/* Sticky side banners */
.side-banner {
  width: 160px;
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 4px;
}
.side-banner--left  { justify-self: end;   padding-right: 8px; }
.side-banner--right { justify-self: start; padding-left: 8px;  }

/* Each banner slot */
.side-banner .banner-zone {
  width: 160px;
  min-height: 600px;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  border: 1px dashed var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Empty slot label */
.side-banner .banner-zone:empty::after {
  content: '160 × 600';
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .5px;
  writing-mode: vertical-rl;
}

/* Images fill the slot */
.side-banner .banner-zone img {
  display: block;
  width: 160px;
  height: 600px;
  object-fit: cover;
}

/* Linked banners */
.side-banner .banner-zone a {
  display: block;
  width: 160px;
  line-height: 0;
}
.side-banner .banner-zone a img {
  height: 600px;
}

/* Inner content + sidebar grid */
.page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* Responsive: collapse side banners below 1340px */
@media (max-width: 1340px) {
  .page-outer {
    display: block; /* drop grid entirely — side banners move out of flow */
  }
  .side-banner { display: none; }
}
@media (max-width: 900px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* ---- Header ---- */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  max-width: 1680px;
  margin: 0 auto;
}
.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text) !important;
}
.site-logo span { color: var(--orange); }
.site-logo-img {
  height: 38px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav a:hover, .nav a.active {
  color: var(--text);
  background: var(--bg3);
}
.nav a.nav-btn {
  background: var(--orange);
  color: #000;
  font-weight: 700;
}
.nav a.nav-btn:hover { background: var(--orange-lt); }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: var(--transition); }

@media (max-width: 700px) {
  .hamburger { display: block; }
  .nav { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px; }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 10px 16px; }
}

/* ---- Banner ---- */
.banner-zone { text-align: center; margin: 12px 0; }
.banner-zone img { display: inline-block; }
.banner-header { padding: 8px 0; background: var(--bg2); border-bottom: 1px solid var(--border); }

/* ---- Ad zones: responsive scaling container ---- */
.ad-zone {
  text-align: center;
  overflow: hidden;
  max-width: 100%;
  display: flex;
  justify-content: center;
}
.ad-zone > * { max-width: 100%; }

/* Side banner zones */
.side-banner .banner-zone {
  margin: 0;
  width: 160px;
}
.side-banner .banner-zone > * {
  display: block;
  width: 160px;
}
.side-banner .banner-zone img {
  height: 600px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---- Cards ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-sm { padding: 16px; }

/* ---- Stat Grid ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--orange);
}
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-value.orange { color: var(--orange); }
.stat-sub { font-size: .8rem; color: var(--text-dim); margin-top: 4px; }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 14px;
  font-size: .95rem;
  font-family: var(--font);
  transition: border-color var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--orange); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: .8rem; color: var(--text-dim); margin-top: 4px; }
.form-error { font-size: .82rem; color: var(--red); margin-top: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--orange-lt); color: #000; }
.btn-secondary { background: var(--bg4); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover:not(:disabled) { background: var(--bg3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c62828; color: #fff; }
.btn-success { background: var(--green); color: #000; }
.btn-success:hover:not(:disabled) { background: #00e676; color: #000; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .9rem;
  border-left: 3px solid;
}
.alert-success { background: rgba(0,200,83,.12); border-color: var(--green); color: #a5d6a7; }
.alert-danger  { background: rgba(229,57,53,.12); border-color: var(--red);   color: #ef9a9a; }
.alert-warning { background: rgba(255,179,0,.12); border-color: var(--yellow); color: #ffe082; }
.alert-info    { background: rgba(33,150,243,.12); border-color: var(--blue);  color: #90caf9; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-green  { background: rgba(0,200,83,.15); color: var(--green); }
.badge-red    { background: rgba(229,57,53,.15); color: var(--red); }
.badge-yellow { background: rgba(255,179,0,.15); color: var(--yellow); }
.badge-blue   { background: rgba(33,150,243,.15); color: var(--blue); }
.badge-orange { background: rgba(247,147,26,.15); color: var(--orange); }
.badge-gray   { background: rgba(136,136,136,.15); color: var(--text-muted); }

/* ---- Claim Page ---- */
.claim-stats-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.claim-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  gap: 4px;
}
.claim-stat:last-child { border-right: none; }
.claim-stat__label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.claim-stat__value { font-size: 1rem; font-weight: 800; color: var(--text); }

.claim-wrap {
  width: 100%;
}
.claim-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
}
.claim-step { display: none; }
.claim-step.active { display: block; }

/* Step indicator */
.claim-steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 0;
}
.csi-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border2);
  color: var(--text-dim);
  font-weight: 800;
  font-size: .85rem;
  justify-content: center;
  position: relative;
  transition: all .3s ease;
  flex-shrink: 0;
}
.csi-step span {
  position: absolute;
  bottom: -20px;
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}
.csi-step.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #000;
}
.csi-step.active span { color: var(--orange); }
.csi-step.done {
  background: var(--bg3);
  border-color: var(--green);
  color: var(--green);
}
.csi-line {
  flex: 1;
  height: 2px;
  background: var(--border2);
  max-width: 60px;
}

@media (max-width: 600px) {
  .claim-stats-bar { flex-wrap: wrap; }
  .claim-stat { flex: 1 1 45%; border-bottom: 1px solid var(--border); }
  .claim-box { padding: 24px 20px; }
}

.timer-display {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 16px 0;
}
.timer-label { font-size: .85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; }

.progress-bar-wrap {
  background: var(--bg3);
  border-radius: 20px;
  height: 6px;
  margin: 16px 0;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 20px;
  transition: width .5s linear;
}

.activity-area {
  min-height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
}
.btn-click-me {
  background: var(--orange);
  color: #000;
  font-weight: 900;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  animation: btnPop 0.3s ease;
}
.btn-click-me:hover { background: var(--orange-lt); }

/* Floating variant — appears anywhere on screen */
.btn-floating {
  position: fixed;
  z-index: 9999;
  box-shadow: 0 0 0 4px rgba(247,147,26,.35), var(--shadow-lg);
  animation: btnPop 0.3s ease;
  pointer-events: all;
}
.btn-floating--done {
  background: var(--green) !important;
  color: #000;
  transform: scale(1.15);
  transition: transform .15s ease, background .15s ease;
}

@keyframes btnPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.claim-reward {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--orange);
}

/* ---- Auth Pages ---- */
.auth-page { display: flex; align-items: flex-start; justify-content: center; padding-top: 40px; }
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
}
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }
.auth-divider { text-align: center; color: var(--text-dim); font-size: .85rem; margin: 20px 0; position: relative; }
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: calc(50% - 20px);
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ---- Captcha ---- */
.captcha-box {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Dashboard Account Security */
.dash-security-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}
.dash-security-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: .88rem;
  border-right: 1px solid var(--border);
  padding-right: 32px;
}
@media (max-width: 700px) {
  .dash-security-grid { grid-template-columns: 1fr; }
  .dash-security-status { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 16px; }
}

/* ---- Home Hero ---- */
.hero {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(247,147,26,.15) 0%, transparent 70%);
}
.hero h1 { font-size: 2.5rem; font-weight: 900; line-height: 1.15; margin-bottom: 12px; }
.hero h1 span { color: var(--orange); }
.hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 480px; margin: 0 auto 28px; }
.hero .btn { font-size: 1.1rem; padding: 14px 36px; }

/* ---- Home Stats Bar ---- */
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.home-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
}
.home-stat-value { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.home-stat-label { color: var(--text-muted); font-size: .85rem; }

/* ---- Features ---- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.feature-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-title { font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: .85rem; color: var(--text-muted); }

/* ---- Referral ---- */
/* ---- Coin Selector (Withdraw) ---- */
/* Coin selector grid — flexbox, centres when few coins are active */
.coin-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.coin-card {
  cursor: pointer;
  flex: 0 0 140px;
  width: 140px;
}
.coin-card input[type="radio"] { display: none; }
.coin-card-inner {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 10px 12px;
  text-align: center;
  transition: border-color .15s, background .15s, transform .1s;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}
.coin-card:not(.coin-card--disabled):hover .coin-card-inner {
  border-color: var(--coin-color, var(--orange));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.coin-card input:checked + .coin-card-inner {
  border-color: var(--coin-color, var(--orange));
  background: color-mix(in srgb, var(--coin-color, var(--orange)) 10%, var(--bg3));
}
/* coloured top accent bar */
.coin-card-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--coin-color, var(--border));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: .6;
  transition: opacity .15s;
}
.coin-card input:checked + .coin-card-inner::before,
.coin-card:not(.coin-card--disabled):hover .coin-card-inner::before {
  opacity: 1;
}
.coin-card--disabled { cursor: not-allowed; opacity: .38; }
.coin-card--disabled .coin-card-inner::before { opacity: .2; }

/* coin icon badge */
.coin-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--coin-color, #888) 18%, var(--bg4));
  border: 1px solid color-mix(in srgb, var(--coin-color, #888) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  font-size: .7rem; font-weight: 800; letter-spacing: -.5px;
  color: var(--coin-color, var(--text-muted));
}
.coin-name {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 6px;
  color: var(--text);
}
.coin-amount {
  font-size: .78rem;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.3;
  color: var(--text);
}
.coin-unit { font-size: .65rem; color: var(--text-muted); font-weight: 400; }
.coin-rate { font-size: .68rem; margin-top: 5px; color: var(--text-muted); }
.coin-badge {
  font-size: .62rem;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: .03em;
}
.coin-badge--available { color: var(--green); }
.coin-badge--unavailable { color: var(--red); }
.coin-badge--muted { color: var(--text-muted); }

@media (max-width: 640px) {
  .coin-card { flex: 0 0 120px; width: 120px; }
}
@media (max-width: 420px) {
  .coin-card { flex: 0 0 calc(50% - 5px); width: auto; }
}

/* Pay Rate chart */
.payrate-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 8px 0 0;
  overflow-x: auto;
}
.payrate-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 0 40px;
  min-width: 40px;
  height: 100%;
  cursor: default;
}
.payrate-bar-val {
  font-size: .6rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
}
.payrate-bar-outer {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--bg4);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.payrate-bar-inner {
  width: 100%;
  background: linear-gradient(to top, var(--orange-dk), var(--orange-lt));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: opacity .15s;
}
.payrate-bar-wrap:hover .payrate-bar-inner { opacity: .8; }
.payrate-bar-label {
  font-size: .62rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 5px;
  line-height: 1.2;
}
.payrate-bar-label span { color: var(--text-dim); }

.referral-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.referral-link-box input {
  flex: 1;
  font-family: var(--mono);
  font-size: .85rem;
}

/* ---- Pagination ---- */
.pagination { display: flex; gap: 4px; margin-top: 16px; }
.page-link {
  padding: 6px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .85rem;
  cursor: pointer;
}
.page-link:hover, .page-link.active { background: var(--orange); color: #000; border-color: var(--orange); }

/* ---- Utility ---- */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-orange  { color: var(--orange); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-small   { font-size: .85rem; }
.text-mono    { font-family: var(--mono); }
.font-bold    { font-weight: 700; }
.font-heavy   { font-weight: 900; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8        { gap: 8px; }
.gap-16       { gap: 16px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.p-0          { padding: 0; }
.hidden       { display: none !important; }
.w-full       { width: 100%; }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--orange); }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 8px; flex-wrap: wrap; }

/* ---- Admin ---- */
/* Layout (grid columns, sidebar positioning) is defined in admin/index.php <style> to avoid mobile-CSS cascade conflicts */
.admin-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 1rem;
}
.admin-logo span { color: var(--orange); }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: .88rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
  color: var(--text);
  background: var(--bg3);
  border-left-color: var(--orange);
}
.admin-nav .nav-section {
  padding: 16px 20px 6px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-dim);
}
.admin-content { padding: 28px 32px; background: var(--bg); }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.admin-topbar h1 { font-size: 1.4rem; font-weight: 800; }

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================================================
   Responsive — Mobile-first improvements
   ============================================================ */

/* Tables: always scrollable on small screens */
@media (max-width: 900px) {
  .table-wrap, .card table, .card > table { overflow-x: auto; display: block; }
}

/* ── 768px and below ── */
@media (max-width: 768px) {
  main { padding: 20px 0; }

  /* Hero */
  .hero { padding: 32px 20px; margin-bottom: 16px; }
  .hero h1 { font-size: 2rem; }
  .hero p  { font-size: .95rem; }
  .hero .btn { width: 100%; }

  /* Home stats: 2 columns */
  .home-stats { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Stat grid: 2 columns */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 1.4rem; }
  .stat-card  { padding: 16px; }

  /* Cards */
  .card { padding: 16px; }
  .auth-card { padding: 20px 16px; }

  /* Claim box */
  .claim-box { padding: 24px 16px; }
  .timer-display { font-size: 2.6rem; }

  /* Referral link: stack vertically */
  .referral-link-box { flex-direction: column; }
  .referral-link-box .btn { width: 100%; }

  /* Step indicator: smaller */
  .csi-step { width: 32px; height: 32px; font-size: .75rem; }
  .csi-step span { font-size: .6rem; }
  .csi-line { max-width: 32px; }

  /* Page grid already collapses at 900px */

  /* Dashboard security grid */
  .dash-security-grid { grid-template-columns: 1fr; }
  .dash-security-status { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 16px; }

  /* Tables inside cards: wrap in scroll container */
  .card { overflow: hidden; }
  .card .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Pagination: wrap */
  .pagination { flex-wrap: wrap; }
}

/* ── 600px and below ── */
@media (max-width: 600px) {
  html { font-size: 15px; }

  .hero h1 { font-size: 1.7rem; }

  /* Home stats: stack */
  .home-stats { grid-template-columns: 1fr; }

  /* Claim stats bar */
  .claim-stats-bar { flex-wrap: wrap; }
  .claim-stat { flex: 1 1 45%; border-bottom: 1px solid var(--border); }

  /* Buttons: full-width in auth forms */
  .auth-page .btn-full { font-size: .9rem; }

  /* Features: single column */
  .features { grid-template-columns: 1fr; }

  /* Coin cards: 2 per row */
  .coin-card { flex: 0 0 calc(50% - 5px); width: auto; }

  /* Stat cards: 2 cols in admin */
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
  .admin-topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-topbar h1 { font-size: 1.2rem; }
}

/* ── 420px and below ── */
@media (max-width: 420px) {
  .home-stats { grid-template-columns: 1fr; }
  .stat-grid  { grid-template-columns: 1fr; }
  .hero .btn  { font-size: .95rem; padding: 12px 20px; }
  .claim-stat { flex: 1 1 100%; }
  .admin-stat-grid { grid-template-columns: 1fr; }
}
