:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --gold: #fbbf24;
  --red: #ef4444;
  --black: #0f172a;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
  line-height: 1.6;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--surface);
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.75rem;
  border: 1px solid #334155;
}
nav .brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}
nav .links { display: flex; gap: 0.5rem; }
nav .links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
}
nav .links a:hover { color: var(--text); background: #334155; }
nav .links a.active { background: var(--accent); color: #0f172a; }

/* Callouts & Banners */
.reality-callout {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.hero-box {
  background: var(--surface);
  border-left: 4px solid var(--gold);
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
}
.status-banner {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.status-banner.first-ever {
  border-left-color: var(--gold);
  background: rgba(251, 191, 36, 0.08);
}
.status-banner.cooldown { border-left-color: #f97316; }
.status-banner .sub {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Controls & Inputs */
.controls {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}
textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  color: var(--accent);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: monospace;
  font-size: 1rem;
  resize: vertical;
  margin: 0.5rem 0 1rem;
}
.buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
button {
  background: #334155;
  color: var(--text);
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: #475569; }
button.primary { background: var(--accent); color: #0f172a; }
button.secondary { background: #0284c7; color: #ffffff; }
.error { color: #f87171; font-size: 0.9rem; margin-top: 0.5rem; }

/* Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.card {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.6rem 0.4rem;
  text-align: center;
  font-weight: bold;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  user-select: none;
}
.card.red { color: var(--red); }
.card.black { color: var(--black); }
.card span {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
  font-weight: normal;
  margin-top: 2px;
}

/* Stats & Article Elements */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.stat-box {
  background: var(--surface);
  border-radius: 10px;
  padding: 1.2rem;
}
.stat-box h3 { margin: 0 0 0.4rem; color: var(--accent); font-size: 1.05rem; }
.stat-box p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.stat-box a { color: var(--accent); text-decoration: none; font-weight: 600; }
.stat-box a:hover { text-decoration: underline; }

.article h2 { color: var(--accent); margin-top: 2.25rem; font-size: 1.3rem; }
.article p { color: #cbd5e1; }
.math-block {
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-family: monospace;
  color: var(--accent);
  font-size: 0.95rem;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
}
th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #334155;
  font-size: 0.95rem;
}
th { background: #0b1120; color: var(--accent); }
tr:last-child td { border-bottom: none; }
