:root {
  color-scheme: dark;
  --ink: #f7f1e4;
  --muted: #aeb9ac;
  --line: rgba(247, 241, 228, 0.18);
  --panel: rgba(8, 31, 26, 0.86);
  --panel-strong: #0d2b24;
  --field: #123f32;
  --field-deep: #071b17;
  --chalk: #f8f3e8;
  --red: #c83a32;
  --gold: #d4a642;
  --sky: #7bb6d8;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  font-family: "Avenir Next", "Bahnschrift", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--field-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 10vw 100%,
    radial-gradient(circle at 18% 14%, rgba(212, 166, 66, 0.2), transparent 26rem),
    radial-gradient(circle at 82% 8%, rgba(123, 182, 216, 0.18), transparent 26rem),
    linear-gradient(160deg, #071b17 0%, #123f32 48%, #071b17 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(90deg, transparent 0 9.7vw, rgba(248, 243, 232, 0.08) 9.7vw 10vw),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 35%, rgba(0, 0, 0, 0.35));
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--chalk);
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(200, 58, 50, 0.22);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.top-nav a {
  min-height: 2.2rem;
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-color: var(--chalk);
  color: var(--chalk);
}

.app-root {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.wheel-stage,
.control-stage {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 43, 36, 0.94), rgba(4, 18, 16, 0.9));
  box-shadow: var(--shadow);
}

.wheel-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 560px;
  padding: clamp(16px, 2vw, 24px);
  overflow: hidden;
  border-radius: 8px;
}

.wheel-stage::after {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  content: "";
  border: 1px dashed rgba(248, 243, 232, 0.18);
}

.tool-title {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 10ch;
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", sans-serif;
  font-size: clamp(2.7rem, 8vw, 6rem);
  line-height: 0.88;
  text-transform: uppercase;
}

.tool-subtitle {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  margin: 18px 0;
}

.wheel-pointer {
  position: absolute;
  top: 2%;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  border-top: 34px solid var(--gold);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

#wheel-canvas {
  width: min(100%, 440px);
  aspect-ratio: 1;
  max-height: 440px;
  border-radius: 50%;
}

.pool-line {
  display: flex;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  color: var(--muted);
}

.pool-line strong {
  color: var(--ink);
}

.control-stage {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2vw, 24px);
  border-radius: 8px;
}

.result-panel {
  display: grid;
  gap: 0.7rem;
  min-height: 180px;
  padding: 18px;
  border: 1px solid rgba(248, 243, 232, 0.22);
  background:
    linear-gradient(90deg, rgba(248, 243, 232, 0.07) 1px, transparent 1px) 0 0 / 32px 100%,
    rgba(0, 0, 0, 0.16);
  border-radius: 8px;
}

.result-kicker,
.eyebrow,
.field-label {
  margin: 0;
  color: var(--gold);
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-title {
  margin: 0;
  color: var(--chalk);
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.94;
  text-transform: uppercase;
}

.result-meta,
.proof-line,
.history-list,
.field-help {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.result-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field.wide {
  grid-column: 1 / -1;
}

.select,
.input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.22);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.8rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.14);
}

.toggle-row input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--gold);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-button {
  border: 1px solid #efc261;
  color: #190e08;
  background: linear-gradient(180deg, #f6d47b, var(--gold));
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.06);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(248, 243, 232, 0.08);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--chalk);
}

.inline-action {
  width: fit-content;
}

.history-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.history-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  text-transform: uppercase;
}

.history-list {
  display: grid;
  gap: 0.45rem;
  max-height: 145px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(247, 241, 228, 0.1);
}

.content-band {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.content-grid,
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: start;
}

.content-band h1,
.content-band h2 {
  margin: 0 0 0.8rem;
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", sans-serif;
  text-transform: uppercase;
}

.content-band h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.content-band h2 {
  font-size: clamp(1.45rem, 3vw, 2.3rem);
}

.content-band p,
.plain-list {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.plain-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.2rem;
}

.tool-index-list {
  padding-left: 0;
  list-style: none;
}

.tool-index-list li {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.tool-index-list a {
  color: var(--chalk);
  font-weight: 800;
  text-decoration: none;
}

.tool-index-list a:hover,
.tool-index-list a:focus-visible {
  color: var(--gold);
}

.tool-index-list span {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.data-table th,
.data-table td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--chalk);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.stat-panel {
  display: grid;
  gap: 0.45rem;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.stat-panel strong {
  color: var(--gold);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1;
}

.stat-panel span {
  color: var(--muted);
  line-height: 1.5;
}

.faq {
  display: grid;
  gap: 0.7rem;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.faq summary {
  cursor: pointer;
  padding: 1rem;
  font-weight: 800;
}

.faq details p {
  margin: 0;
  padding: 0 1rem 1rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
  max-width: 44rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.footer-links a {
  color: var(--chalk);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--gold);
}

.generated-page .content-band:first-of-type {
  padding-top: 10px;
}

.revenue-slot {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px dashed rgba(248, 243, 232, 0.24);
  border-radius: 6px;
  color: rgba(248, 243, 232, 0.48);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.sponsor-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sponsor-callout h2 {
  margin-bottom: 0.55rem;
}

.sponsor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

@media (max-width: 880px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .tool-shell,
  .content-grid,
  .columns,
  .sponsor-callout {
    grid-template-columns: 1fr;
  }

  .sponsor-actions {
    justify-content: flex-start;
  }

  .wheel-stage {
    min-height: auto;
  }

  .tool-title {
    max-width: 12ch;
  }
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at 18% 14%, rgba(212, 166, 66, 0.18), transparent 18rem),
      linear-gradient(160deg, #071b17 0%, #123f32 54%, #071b17 100%);
  }

  .site-header,
  .app-root,
  .content-band,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .top-nav a {
    font-size: 0.9rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .result-list li,
  .history-list li {
    flex-direction: column;
    gap: 0.2rem;
  }

  .primary-button,
  .secondary-button {
    flex: 1 1 100%;
  }

  .inline-action {
    width: 100%;
  }
}
