:root {
  --page-plane:      #f9f9f7;
  --surface-1:       #ffffff;
  --surface-2:       #f3f3f1;
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --border:          rgba(11, 11, 11, 0.10);
  --gridline:        #e1e0d9;
  --accent:          #2a78d6;
  --good:            #0ca30c;
  --good-text:       #006300;
  --good-track:      rgba(12, 163, 12, 0.12);
  --critical:        #d03b3b;
  --critical-track:  rgba(208, 59, 59, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Disclaimer bar */
.disclaimer-bar {
  background: #fff2cc;
  color: #4a3a00;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  padding: 11px 16px;
  border-bottom: 2px solid #fab219;
}

.disclaimer-bar strong {
  font-weight: 800;
  color: #0b0b0b;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-dim {
  color: var(--text-muted);
  font-weight: 600;
}

.logo-bold {
  color: var(--text-primary);
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portfolio {
  font-size: 13px;
  color: var(--text-secondary);
}

.portfolio strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.wallet-btn {
  background: var(--text-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.wallet-btn:hover { filter: brightness(1.3); }

/* Subnav (fake category tabs) */
.subnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 22px;
}

.subnav-link {
  display: inline-block;
  padding: 10px 2px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.subnav-link:hover {
  color: var(--text-primary);
}

.subnav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* Page */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Market group */
.market-group {
  margin-bottom: 44px;
}

.group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.group-header h2 {
  font-size: 19px;
  margin: 0;
}

.group-sub {
  color: var(--text-muted);
  font-size: 13px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.04);
}

.card-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 39px;
}

.chart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.odds-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.odds-pct {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.odds-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.odds-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.odds-delta {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.odds-delta.show { opacity: 1; }
.odds-delta.up { color: var(--good-text); }
.odds-delta.down { color: var(--critical); }

.sparkline {
  flex-shrink: 0;
  overflow: visible;
}

.sparkline-area {
  fill: var(--accent);
  opacity: 0.10;
}

.sparkline-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Meter */
.meter {
  display: flex;
  align-items: center;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--gridline);
}

.meter-yes,
.meter-no {
  height: 100%;
  transition: width 0.35s ease;
}

.meter-yes {
  background: var(--good);
  border-radius: 4px 0 0 4px;
}

.meter-no {
  background: var(--critical);
  border-radius: 0 4px 4px 0;
}

.meter-gap {
  width: 2px;
  height: 100%;
  background: var(--surface-1);
  flex-shrink: 0;
}

/* Buy buttons */
.buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buy-btn {
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter 0.15s ease, transform 0.08s ease;
}

.buy-btn:active { transform: scale(0.97); }

.buy-yes {
  background: var(--good-track);
  color: var(--good-text);
}
.buy-yes:hover { filter: brightness(0.95); }

.buy-no {
  background: var(--critical-track);
  color: var(--critical);
}
.buy-no:hover { filter: brightness(0.95); }

.buy-price {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* About page */
.about-page {
  padding-top: 60px;
  padding-bottom: 100px;
}

.about-page h1 {
  font-size: 30px;
  margin: 0 0 14px;
}

.about-copy {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 20px 40px;
}

.site-footer p {
  max-width: 900px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
