/* ==========================================================================
   COUZ2B Syndicate — stylesheet
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.22);
  --text: #1a1a18;
  --text-2: #5f5e5a;
  --text-3: #888780;
  --accent: #534ab7;
  --accent-soft: #eeedfe;
  --accent-text: #3c3489;
  --pos: #3b6d11;
  --pos-bg: #eaf3de;
  --neg: #a32d2d;
  --neg-bg: #fcebeb;
  --gold-bg: #faeeda;
  --gold-text: #854f0b;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f12;
    --surface: #17171b;
    --surface-2: #1f1f24;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f5f4f0;
    --text-2: #a8a7a0;
    --text-3: #7a7974;
    --accent: #afa9ec;
    --accent-soft: #26215c;
    --accent-text: #cecbf6;
    --pos: #97c459;
    --pos-bg: #173404;
    --neg: #f09595;
    --neg-bg: #501313;
    --gold-bg: #412402;
    --gold-text: #fac775;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* ------ Header ------ */
.site-header {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.3px;
}
.site-header h1 .muted { color: var(--text-2); font-weight: 400; }
.site-sub {
  font-size: 12px;
  color: var(--text-2);
  margin: 2px 0 0;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
}
.sync-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #97c459;
  box-shadow: 0 0 0 3px rgba(151, 196, 89, 0.18);
}
.sync-status.error .dot { background: var(--neg); box-shadow: 0 0 0 3px rgba(163, 45, 45, 0.18); }

/* ------ Loader & error ------ */
.loader {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-2);
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-panel {
  background: var(--neg-bg);
  border: 0.5px solid var(--neg);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  color: var(--neg);
}
.error-panel h2 { margin: 0 0 0.5rem; font-size: 16px; font-weight: 600; }
.error-panel p { margin: 0.25rem 0; font-size: 14px; }
.error-help { color: var(--text-2); font-size: 13px !important; margin-top: 0.75rem !important; }
.error-panel code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* ------ Cards ------ */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
}
.card-table { padding: 0; }
.card-table-wrap { padding: 0.5rem 1rem 0.75rem; overflow-x: auto; }

.section-title {
  font-size: 17px;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  letter-spacing: -0.2px;
}

.eyebrow {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 0.5rem;
  font-weight: 500;
}
.eyebrow-sm {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.4rem;
  font-weight: 500;
}

/* ------ Hero ------ */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 0.5rem;
}
.hero-main { padding: 1.4rem 1.5rem; }
.hero-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}
.hero-name {
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.hero-meta {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
}
.hero-side {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto;
}
.hero-side .card { padding: 1rem 1.2rem; }

.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  flex-shrink: 0;
}
.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.form-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 1rem;
}
.form-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}
.form-dot.win { background: var(--pos-bg); color: var(--pos); }
.form-dot.loss { background: var(--neg-bg); color: var(--neg); }
.form-dot.empty { background: var(--surface-2); color: var(--text-3); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mini-stat {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}
.mini-label {
  font-size: 11px;
  color: var(--text-2);
}
.mini-val {
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
}

.big-num {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: -0.5px;
}
.big-sub {
  font-size: 12px;
  margin: 0 0 8px;
}

.split-card {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 8px;
}
.split-card > div { flex: 1; }
.divider-v { width: 0.5px; background: var(--border); }
.split-name {
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 1px;
}
.split-sub {
  font-size: 11px;
  color: var(--text-3);
  margin: 0;
}

/* ------ Stats grid ------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  margin: 0 0 4px;
}
.stat-value {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.3px;
}
.stat-value.small {
  font-size: 17px;
}

/* ------ Awards ------ */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.award {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.award-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.award-label {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.3;
}
.award-name {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}
.award-name .detail {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
  margin-left: 4px;
}

/* ------ Tabs & leaderboard ------ */
.tab-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tab {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
  transition: all 0.15s;
}
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.lb-row {
  display: grid;
  grid-template-columns: 28px 1.4fr 0.7fr 0.7fr 0.9fr 1.1fr;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}
.lb-row:last-child { border-bottom: none; }
.lb-header {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  border-bottom: 0.5px solid var(--border-strong);
}
.rank {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.rank.top {
  color: var(--gold-text);
}
.lb-bettor {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.lb-bettor .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badges {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge-gold { background: var(--gold-bg); color: var(--gold-text); }
.badge-pos { background: var(--pos-bg); color: var(--pos); }
.badge-neg { background: var(--neg-bg); color: var(--neg); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ------ Charts ------ */
.chart-wrap {
  position: relative;
  width: 100%;
}
.chart-spark { height: 72px; }
.chart-tall { height: 260px; }

/* ------ Weekly strip ------ */
.strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.strip-cell {
  width: 16px;
  height: 26px;
  border-radius: 3px;
  cursor: default;
}
.strip-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-2);
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sq {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}
.sq-win { background: #639922; }
.sq-loss { background: #e24b4a; }
.legend-hint { color: var(--text-3); margin-left: auto; }

/* ------ Bets table ------ */
.bets-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 6px;
}
.bets-table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  border-bottom: 0.5px solid var(--border-strong);
}
.bets-table td {
  padding: 9px 10px;
  border-bottom: 0.5px solid var(--border);
}
.bets-table tr:last-child td { border-bottom: none; }

.pill {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  display: inline-block;
  font-weight: 500;
}
.pill-win { background: var(--pos-bg); color: var(--pos); }
.pill-loss { background: var(--neg-bg); color: var(--neg); }

/* ------ Footer ------ */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  color: var(--text-3);
  font-size: 12px;
}
.site-footer a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--border);
}
.site-footer a:hover { color: var(--accent); }

/* ------ Mobile ------ */
@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; }
  .hero-name { font-size: 26px; }
  .site-header h1 { font-size: 20px; }
  .lb-row {
    grid-template-columns: 24px 1.3fr 0.7fr 0.8fr 0.9fr;
    font-size: 12px;
    padding: 10px 12px;
  }
  .lb-row .hide-mob { display: none; }
  .big-num { font-size: 24px; }
  .section-title { font-size: 16px; margin: 1.5rem 0 0.6rem; }
  .award { padding: 10px 12px; }
  .award-icon { width: 32px; height: 32px; font-size: 16px; }
  .award-name { font-size: 13px; }
  .mini-stats { gap: 6px; }
  .mini-stat { padding: 7px 9px; }
  .mini-val { font-size: 14px; }
  .strip-cell { width: 14px; height: 22px; }
}
