:root {
  --bg: #0F172A;
  --card: #1E293B;
  --mid: #334155;
  --highlight: #64748B;

  --green: #00FF47;
  --pink: #FF00B8;
  --sky-blue: #0ED4FF;
  --yellow: #FFE70E;
  --red: #FF294C;

  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --gradient-cta: linear-gradient(180deg, #EB00FF 0%, #FF53A0 100%);
  --font: 'Poppins', Arial, sans-serif;
  --font-num: 'Roboto Mono', Consolas, 'Courier New', monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

/* Top bar, matching the Bet Right microsite (no Join button) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--card);
}
.topbar-inner {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
.topbar-brand { display: inline-flex; align-items: center; text-decoration: none; }
.topbar-wordmark { height: 24px; width: auto; display: block; }
.topbar-brand:focus-visible { outline: 2px solid var(--sky-blue); outline-offset: 4px; border-radius: 4px; }

.page {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.heading-primary {
  color: var(--green);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.code-title { overflow-wrap: anywhere; }

.intro { color: var(--text-secondary); margin: 0 0 32px; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.controls label { font-weight: 500; }

select {
  font: inherit;
  color: var(--text-primary);
  background: var(--card);
  border: 1px solid var(--mid);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 200px;
}

.btn-primary {
  background: var(--gradient-cta);
  color: #FFFFFF;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

select:focus-visible, .btn-primary:focus-visible, a:focus-visible {
  outline: 2px solid var(--sky-blue);
  outline-offset: 2px;
}

.latest {
  border-left: 4px solid var(--green);
  padding: 4px 0 4px 20px;
  margin-bottom: 32px;
}
.latest p { margin: 0; }
.latest-label { color: var(--text-secondary); font-size: 14px; }
.latest-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.latest-time { color: var(--text-secondary); font-size: 14px; }

.status { margin: 0 0 16px; color: var(--text-secondary); min-height: 1.5em; }
.status.error {
  color: var(--text-primary);
  background: var(--card);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  padding: 12px 16px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: var(--mid);
  font-size: 14px;
  font-weight: 600;
}
tbody tr + tr td { border-top: 1px solid var(--mid); }
tbody tr:first-child td { font-weight: 600; }
.num { text-align: right; }

/* Fixed width digits so prices, changes and times line up exactly */
td.num, .time-cell, .latest-value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums slashed-zero;
}
.date-cell { color: var(--text-secondary); }
.up { color: var(--green); }
.down { color: var(--text-secondary); }
.flat { color: var(--text-muted); }

/* Footer, matching the Bet Right microsite */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--card);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-links a {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-legal {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}
.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* CGM banner: black on white is mandatory */
.cgm {
  background: #FFFFFF;
  color: #000000;
  padding: 20px 24px;
  text-align: center;
  line-height: 1.5;
}
.cgm-tagline { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.cgm-cta { font-size: 15px; }
.cgm-cta strong { font-weight: 700; }
.cgm a { color: #000000; text-decoration: underline; }
/* Message from the CMS */
.cgm-cms p { margin: 0; font-size: 15px; }
.cgm-cms strong { font-size: 18px; font-weight: 700; }

@media (max-width: 560px) {
  .heading-primary { font-size: 28px; }
  .latest-value { font-size: 32px; }
  select { min-width: 0; flex: 1; }
  th, td { padding: 8px 10px; }
  .topbar-inner { height: 56px; padding: 0 16px; }
  .topbar-wordmark { height: 20px; }
  .footer-inner { padding: 28px 16px; }
}
