:root {
  --background: #0b1411;
  --surface: #111e19;
  --surface-light: #162720;
  --text: #f4efdf;
  --muted: #a8b9ae;
  --gold: #e8be70;
  --mint: #5ceba6;
  --border: #2a3f34;
  --loss: #ff857f;
  --title-font: "Playfair Display", Georgia, serif;
  --body-font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 0%, #14271f 0%, #0b1411 55%, #070d0a 100%);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--title-font); font-weight: 600; }
h1, h2, h3 { line-height: 1.18; }
em { color: var(--gold); font-weight: inherit; }
.mono { font-family: var(--mono-font); font-variant-numeric: tabular-nums; }
.container { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--gold);
  color: #181507;
  transform: translateY(-160%);
  z-index: 10;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { transform: none; }

.site-header {
  border-bottom: 1px solid #ffffff14;
  background: rgba(9, 17, 14, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--title-font);
  font-size: 21px;
  white-space: nowrap;
}
.brand-coin {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: var(--gold);
  border: 1.5px solid #e8be70a8;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2d2410, #121c17);
  box-shadow: inset 0 0 0 2px #d4a6501f;
  font-size: 15px;
  font-weight: 700;
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 140ms ease;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--gold); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  transition: transform 120ms ease, filter 120ms ease, border-color 140ms ease, color 140ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-gold {
  color: #241904;
  background: linear-gradient(160deg, #fce396 0%, #e7b74e 52%, #c9912a 100%);
  border-color: #ffe8a3;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.button-gold:hover { filter: brightness(1.06); }
.button-outline { color: var(--text); border-color: #4d6759; background: rgba(16, 32, 25, 0.7); }
.button-outline:hover { color: var(--gold); border-color: var(--gold); }
.header-play {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px #e8be7070;
}
.text-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Simulator Page */
.simulator { padding-block: 48px 72px; }
.sim-heading h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.3rem, 4.8vw, 4.1rem);
  letter-spacing: -0.04em;
}
.sim-heading > p:last-child { color: var(--muted); font-size: 16px; max-width: 620px; }
.sim-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.58fr) minmax(0, 1.42fr);
  gap: 22px;
  align-items: start;
  margin-top: 28px;
}
.sim-settings, .sim-results {
  min-width: 0;
  padding: 22px;
  border: 1px solid #355243;
  border-radius: 16px;
  background: linear-gradient(170deg, #12231c 0%, #0d1a15 100%);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}
.sim-settings { display: grid; gap: 10px; }
.sim-settings h2, .sim-result-heading h2 { font-size: 24px; }
.sim-settings p, .sim-help p { color: var(--muted); font-size: 14px; }
.sim-settings label { display: flex; justify-content: space-between; padding-top: 4px; font-weight: 600; font-size: 14px; }
.sim-settings input {
  width: 100%;
  min-height: 42px;
  padding: 6px 11px;
  border: 1px solid #486353;
  border-radius: 9px;
  background: #08120e;
  color: var(--text);
  font-family: var(--mono-font);
  font-weight: 600;
}
.sim-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}
.sim-preset-btn {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid #375143;
  background: #091611;
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 700;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.sim-preset-btn:hover,
.sim-preset-btn[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(232, 190, 112, 0.16);
  color: #ffe8a3;
}
.sim-settings button[type="submit"] { margin-top: 8px; }

.sim-result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.sim-result-heading h2 { margin-top: 4px; }
.sim-result-heading [role="status"] {
  color: var(--mint);
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
}
.sim-verdict {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #42614f;
  background: #0a1813;
  font-size: 13.5px;
  color: #dcebe3;
}
.sim-verdict[data-tone="warn"] {
  border-color: rgba(255, 133, 127, 0.45);
  background: rgba(56, 18, 18, 0.42);
  color: #ffd0cd;
}
.sim-verdict[data-tone="good"] {
  border-color: rgba(92, 235, 166, 0.42);
  background: rgba(13, 45, 31, 0.55);
  color: #c2f8dd;
}
.sim-chart-card {
  margin-bottom: 16px;
  padding: 14px 16px 12px;
  border-radius: 12px;
  border: 1px solid #2b4537;
  background: #08130f;
}
.sim-chart-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 14px;
  margin-bottom: 10px;
}
.sim-chart-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.sim-chart-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.sim-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--mono-font);
  font-size: 11.5px;
  color: #dcebe3;
}
.sim-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sim-legend-dot, .sim-row-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sim-row-dot {
  margin-right: 7px;
  vertical-align: middle;
}
.sim-chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.sim-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 300px;
}
.sim-table-wrap { overflow-x: auto; }
.sim-results table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 14px;
  font-family: var(--mono-font);
  font-variant-numeric: tabular-nums;
}
.sim-results th, .sim-results td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.sim-results th:first-child { text-align: left; font-family: var(--body-font); font-weight: 600; }
.sim-results thead { color: var(--muted); font-size: 12px; font-family: var(--body-font); }
.sim-results .median { color: var(--gold); font-weight: 700; }
.sim-results .bust-high { color: var(--loss); font-weight: 700; }
.sim-bar-track {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.sim-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5ceba6, #e8be70);
}
.sim-help { margin-top: 20px; }
.sim-help h3 { margin-bottom: 6px; font-size: 15px; }
.sim-help .text-link { margin-top: 6px; }
.sim-cta-banner {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(232, 190, 112, 0.35);
  background: linear-gradient(135deg, rgba(232, 190, 112, 0.1), rgba(16, 38, 29, 0.85));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sim-cta-banner p { color: #d6e4dc; font-size: 13.5px; max-width: 48ch; }
.sim-cta-banner strong { color: #ffe8a3; }

/* Editorial Guide & Policy Pages */
.policy { padding-block: 48px 76px; max-width: 760px; }
.policy h1 { margin: 10px 0 18px; font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -0.03em; }
.policy h2 { margin: 28px 0 9px; font-size: 24px; }
.policy p { margin-bottom: 13px; color: var(--muted); }
.policy ul { margin: 8px 0 16px; padding-left: 20px; color: var(--muted); }
.policy li { margin-bottom: 6px; }
.policy strong { color: var(--text); }
.policy a { color: var(--gold); }
.policy a.button-gold { color: #241904; }
.policy a.button-outline { color: var(--text); }

.formula-callout {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(232, 190, 112, 0.45);
  background: linear-gradient(155deg, rgba(28, 34, 18, 0.72), rgba(11, 24, 19, 0.92));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}
.formula-callout .formula-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.formula-callout .formula-math {
  margin-top: 8px;
  font-family: var(--mono-font);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: #fff2c6;
}
.formula-callout .formula-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #bdd0c5;
}

.compare-table-wrap {
  margin: 16px 0 18px;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d1a15;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.compare-table th, .compare-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--mono-font);
  font-variant-numeric: tabular-nums;
}
.compare-table th:first-child, .compare-table td:first-child {
  text-align: left;
  font-family: var(--body-font);
  font-weight: 600;
  color: var(--text);
}
.compare-table thead th {
  font-family: var(--body-font);
  font-size: 12px;
  color: var(--muted);
  background: #12241d;
}
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table .highlight-val { color: var(--gold); font-weight: 700; }
.compare-table .loss-val { color: var(--loss); font-weight: 700; }

/* Interactive Example Walkthrough */
.walkthrough-card {
  margin: 18px 0 22px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #355243;
  background: linear-gradient(170deg, #11221b 0%, #0b1612 100%);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}
.walkthrough-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 14px;
}
.walkthrough-bankroll, .walkthrough-actions, .walkthrough-seq-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.walkthrough-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.walkthrough-toggle, .walkthrough-btn {
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid #395546;
  background: #091510;
  color: #dbe8e0;
  font-size: 12.5px;
  font-weight: 700;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.walkthrough-toggle:hover, .walkthrough-btn:hover {
  border-color: var(--gold);
  color: #fff2c6;
}
.walkthrough-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.walkthrough-limit-note {
  margin: 8px 0 0 !important;
  font-size: 12px;
  font-weight: 600;
  color: #fce08b !important;
}
.walkthrough-toggle[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(232, 190, 112, 0.18);
  color: #ffe8a3;
}
.walkthrough-btn-win {
  border-color: rgba(92, 235, 166, 0.55);
  background: rgba(16, 56, 38, 0.8);
  color: #8df7c4;
}
.walkthrough-btn-win:hover {
  border-color: #8df7c4;
  background: rgba(23, 76, 51, 0.9);
  color: #ffffff;
}
.walkthrough-btn-loss {
  border-color: rgba(255, 133, 127, 0.5);
  background: rgba(58, 19, 19, 0.72);
  color: #ffb2ae;
}
.walkthrough-btn-loss:hover {
  border-color: #ffb2ae;
  background: rgba(78, 25, 25, 0.85);
  color: #ffffff;
}
.walkthrough-seq-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #20372c;
}
.walkthrough-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wt-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono-font);
  font-size: 11.5px;
  font-weight: 700;
}
.wt-pill-win {
  border: 1px solid rgba(92, 235, 166, 0.45);
  background: rgba(16, 53, 36, 0.7);
  color: #8df7c4;
}
.wt-pill-loss {
  border: 1px solid rgba(255, 133, 127, 0.45);
  background: rgba(56, 18, 18, 0.65);
  color: #ffb2ae;
}
.walkthrough-empty {
  font-size: 12.5px;
  color: var(--muted);
}
.walkthrough-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.wt-stat-card {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #2a4236;
  background: #08130f;
}
.wt-stat-gold { border-color: rgba(232, 190, 112, 0.45); }
.wt-stat-mint { border-color: rgba(92, 235, 166, 0.35); }
.wt-stat-loss { border-color: rgba(255, 133, 127, 0.38); }
.wt-stat-name { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.wt-stat-val { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--text); }
.wt-stat-gold .wt-stat-val { color: var(--gold); }
.wt-stat-mint .wt-stat-val { color: var(--mint); }
.wt-stat-loss .wt-stat-val { color: var(--loss); }
.wt-stat-sub { margin-top: 2px; font-size: 11.5px; color: #9cb4a8; }
.walkthrough-table-wrap { margin: 14px 0 10px; }
.wt-cell-win { color: #8df7c4 !important; }
.wt-cell-loss { color: #ffb2ae !important; }
.wt-stake-sub { font-size: 11.5px; color: #879e92; }
.walkthrough-footnote { margin: 0 !important; font-size: 12px; color: #8da69a !important; }

@media (max-width: 640px) {
  .walkthrough-summary { grid-template-columns: minmax(0, 1fr); }
  .walkthrough-card { padding: 14px; }
}

.guide-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Extensible Topic Cluster Related Hub (ready for future satellite pages) */
.related-hub {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related-hub-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.related-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.related-hub-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2b4437;
  background: #0d1a15;
  text-decoration: none;
  color: var(--text) !important;
  transition: border-color 140ms ease, transform 140ms ease;
}
.related-hub-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.related-hub-card strong {
  font-size: 14px;
  color: #ffe8a3;
}
.related-hub-card span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* Footer */
.site-footer {
  background: #08100d;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-block: 24px;
}
.footer-inner .brand { font-size: 17px; }
.footer-inner p, .footer-links a { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-links a:hover { color: var(--gold); text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

@media (max-width: 820px) {
  .container { width: calc(100% - 36px); }
  .sim-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 560px) {
  .container { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; gap: 10px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand-coin { flex-basis: 26px; width: 26px; height: 26px; font-size: 13px; }
  .main-nav { gap: 14px; }
  .main-nav a:first-child { display: none; }
  .header-play { padding: 6px 11px; font-size: 12px; min-height: 34px; }
  .simulator { padding-block: 28px 48px; }
  .policy { padding-block: 30px 54px; }
  .sim-settings, .sim-results { padding: 15px; }
  .sim-results th, .sim-results td { padding: 10px 5px; font-size: 12.5px; }
}
