:root {
  color-scheme: dark;
  --ink: #f8f6ef;
  --muted: #c9c0ac;
  --line: #6f5d34;
  --surface: #0d0d0c;
  --surface-soft: #171512;
  --field: #1f1d18;
  --primary: #c7a45a;
  --primary-dark: #8d7135;
  --accent: #e5c778;
  --focus: #f3d98b;
  font-family:
    "Aptos", "Inter", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(199, 164, 90, 0.18), transparent 30rem),
    linear-gradient(180deg, #050505 0%, #0c0b09 48%, #020202 100%);
  background-attachment: fixed;
  background-size: cover;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  align-items: center;
  gap: 20px;
  min-height: 190px;
  padding: 10px 0 18px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 6vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #ffffff;
  text-shadow: 0 2px 24px rgba(199, 164, 90, 0.28);
}

.hero p:not(.eyebrow) {
  max-width: 55ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.48;
}

.hero-art {
  width: 100%;
  height: auto;
  border: 1px solid rgba(199, 164, 90, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 380px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 27, 22, 0.96), rgba(10, 10, 9, 0.98)),
    var(--surface);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.form-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.result-panel {
  padding: 18px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
  line-height: 1.15;
  color: #ffffff;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
  max-width: 72ch;
}

.field {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 0;
}

.field > span,
legend {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.2;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.compact-row {
  grid-template-columns: minmax(100px, 1fr) auto;
}

input[type="number"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090909;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

input[type="number"]:focus,
select:focus,
button:focus-visible,
.retailer-links a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090909;
}

.preferences-grid {
  grid-template-rows: repeat(2, minmax(40px, auto));
}

.league-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(40px, auto));
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.segmented input:checked + span {
  background: var(--primary);
  color: #090909;
  box-shadow: 0 8px 18px rgba(199, 164, 90, 0.22);
}

select {
  min-height: 40px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary-dark) 50%),
    linear-gradient(135deg, var(--primary-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 12px) 16px;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metric {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(42, 37, 28, 0.92), rgba(12, 12, 11, 0.98)),
    var(--surface-soft);
  padding: 12px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  max-width: 100%;
  font-size: clamp(0.92rem, 1.4vw, 1.35rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  color: #ffffff;
}

.metric .metric-large {
  font-size: clamp(1.95rem, 4.2vw, 3rem);
  line-height: 0.95;
}

.notes {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.note {
  border-left: 3px solid var(--accent);
  background: rgba(229, 199, 120, 0.08);
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.38;
}

.shopping {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.shopping h3 {
  margin-bottom: 14px;
  color: #ffffff;
  font-size: clamp(1.12rem, 2.2vw, 1.65rem);
  line-height: 1.1;
}

.retailer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.retailer-links a {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #090909;
  color: var(--accent);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.retailer-links a:hover {
  border-color: var(--primary);
  background: rgba(199, 164, 90, 0.12);
}

.affiliate-disclosure {
  margin: 12px 0 0;
  border: 1px solid rgba(229, 199, 120, 0.45);
  border-radius: 6px;
  background: rgba(229, 199, 120, 0.1);
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 8px;
  }

  .hero-art {
    max-width: 260px;
    margin: 0 auto;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .hero {
    gap: 10px;
    padding: 4px 0 12px;
  }

  h1 {
    margin-bottom: 6px;
    font-size: clamp(2rem, 12vw, 3.15rem);
  }

  .hero-art {
    max-width: 190px;
  }

  .form-panel,
  .result-panel {
    padding: 14px;
  }

  .segmented,
  .result-grid,
  .retailer-links {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 84px;
  }

  .hero p:not(.eyebrow) {
    font-size: 0.95rem;
  }
}
