/* Would you insure the half-court shot? An orange event field (the balance chart, the inputs, the run buttons) beside a
   navy panel. Navy text on orange, never white. Base in ../style.css. */
.stage { display: grid; }
.field { position: relative; overflow: hidden; background: var(--orange); color: var(--ink); padding: 0 var(--pad) 22px; display: flex; flex-direction: column; }
.field > * { position: relative; }
.giant { position: absolute; top: 62px; right: calc(-1 * clamp(28px, 5vw, 80px)); width: clamp(120px, 22vw, 300px); aspect-ratio: 1; color: var(--ink); }
.giant svg { width: 100%; height: 100%; display: block; }
@media (max-width: 899px) { .giant { top: 36px; right: -22vw; width: 64vw; color: rgba(20, 33, 61, 0.14); } }
.field h1 { font-size: clamp(36px, 9vw, 68px); margin: 22px 0 20px; max-width: min(7em, calc(100% - clamp(80px, 16vw, 220px))); }

/* The balance chart: a navy line on the field, the zero line dashed, the top and bottom of the scale labelled. */
.chart { position: relative; height: clamp(150px, 26vh, 260px); margin-top: 4px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); max-width: 760px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .zero { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: 0.55; }
.chart .hi, .chart .lo { position: absolute; left: 8px; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hi { top: 4px; }
.chart .lo { bottom: 4px; left: auto; right: 6px; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; }

.status { display: flex; gap: clamp(18px, 4vw, 48px); margin-top: 14px; max-width: 760px; }
.num { font-size: clamp(24px, 5.4vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The inputs: three outlined boxes on the field, navy on orange. */
.inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--ink); max-width: 760px; }
.inputs label { display: grid; gap: 6px; align-content: end; }
.inputs .unit { display: flex; align-items: baseline; gap: 4px; border: 2px solid var(--ink); padding: 8px 10px; font-size: 18px; font-weight: 800; }
.inputs .unit:focus-within { background: #fff; }
.inputs input { width: 100%; min-width: 0; border: 0; padding: 0; background: transparent; color: var(--ink); font: 800 24px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; outline: 0; -moz-appearance: textfield; }
.inputs input::-webkit-inner-spin-button, .inputs input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Send fans to shoot, or start over. */
.runs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; max-width: 760px; }
.go { padding: 14px 4px; border: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: 800 13px var(--font); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.go.primary { background: var(--ink); color: #fff; }
.go.reset { border-style: dashed; }
@media (hover: hover) { .go:hover:not(:disabled) { background: #fff; color: var(--ink); } }
.go:active:not(:disabled) { transform: scale(0.97); }
.go:disabled { opacity: 0.45; cursor: default; }

.panel { background: var(--navy); color: #fff; padding: 24px var(--pad) 28px; }
.soft, .ev.soft { color: var(--navy-soft); }
.panel-title { font-size: clamp(28px, 5vw, 38px); letter-spacing: -0.02em; line-height: 1.05; }
.panel .hook { margin-top: 12px; font-size: 18px; }
.panel .more { display: inline-block; margin-top: 28px; color: #fff; }
/* The read-out from the inputs: the break-even chance and what a shot earns on average. */
.result { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; padding-top: 10px; border-top: 2px solid rgba(255, 255, 255, 0.3); }
.result .val { font-size: clamp(22px, 4.6vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.verdict { margin-top: 14px; font-size: 17px; }
.panel .fine { margin: 12px 0 0; padding: 0; font-size: 14px; color: var(--navy-soft); }
.actions { margin-top: 18px; }
.actions button { padding: 14px 20px; border: 2px solid #fff; border-radius: 0; background: transparent; color: #fff; font: 800 13px var(--font); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
@media (hover: hover) { .actions button:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); } }

/* The math: what each price bets on, the worked real example, and every price's year on a green field. */
.math { padding-top: clamp(40px, 7vw, 72px); }
.math h2 { font-size: clamp(36px, 6vw, 64px); padding-bottom: 14px; border-bottom: var(--rule) solid var(--ink); }
.math .therefore { margin-top: clamp(20px, 3vw, 32px); font-size: clamp(18px, 2vw, 22px); max-width: 36em; color: var(--ink-soft); }
.math .ladder { list-style: none; margin: clamp(20px, 3vw, 32px) 0 0; padding: 0; max-width: 900px; }
.math .ladder li { display: grid; grid-template-columns: 8.5em 6.5em 1fr; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(20, 33, 61, 0.15); font-size: 17px; }
.math .ladder b { font-size: clamp(17px, 2vw, 22px); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.math .ladder i { display: block; height: 14px; min-width: 2px; background: var(--ink); }
.math .ladder .best { border-top: var(--rule) solid var(--ink); border-bottom: var(--rule) solid var(--ink); font-weight: 700; }
.math .ladder .best i { background: var(--orange); }
.math .steps-math { margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; max-width: 40em; }
.math .steps-math li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: clamp(17px, 1.8vw, 20px); color: var(--ink-soft); }
.math .steps-math li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: #fff; font-weight: 800; }
.math .steps-math b { color: var(--ink); }
.math .worked { margin-top: clamp(24px, 4vw, 40px); font-size: clamp(28px, 5.6vw, 72px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.math .worked .hl { background: var(--orange); padding: 0 0.12em; }
.math .worked .eq { display: block; font-size: clamp(16px, 1.6vw, 20px); font-weight: 700; color: var(--ink-soft); letter-spacing: 0; margin-bottom: 0.4em; }
.math .odds { margin-top: clamp(32px, 5vw, 56px); background: var(--green); color: #fff; padding: clamp(20px, 4vw, 40px); }
.math .odds h3 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; }
.math table { width: 100%; border-collapse: collapse; margin: 18px 0 20px; }
.math th, .math td { padding: 10px 0; border-top: 2px solid rgba(255, 255, 255, 0.5); text-align: right; vertical-align: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.math tr:first-child th { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; border-top: 0; white-space: normal; }
.math th:first-child { text-align: left; }
.math tr:not(:first-child) th, .math td { font-size: clamp(16px, 2.6vw, 26px); font-weight: 800; letter-spacing: -0.02em; }
.math .odds p { max-width: 40em; color: rgba(255, 255, 255, 0.92); }
.math .source { margin-top: 32px; font-size: 15px; color: var(--ink-soft); max-width: 60em; }

@media (min-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1.55fr) minmax(380px, 1fr); min-height: 100svh; }
  .field { padding-bottom: 36px; }
  .field h1 { font-size: clamp(40px, 4.4vw, 60px); }
  /* A smaller pictogram here, so the chart under the title runs the field's full width clear of it. */
  .giant { width: clamp(120px, 14vw, 200px); }
  .chart { margin-top: 30px; }
  .panel { padding-top: 76px; padding-bottom: 36px; display: flex; flex-direction: column; }
  .panel .more { margin-top: auto; padding-top: 28px; align-self: flex-start; }
}
/* Phones, once fans have shot: the title and giant pictogram give their room to the chart and the controls. */
@media (max-width: 899px) {
  .playing .field h1, .playing .giant { display: none; }
  .playing .chart { margin-top: 14px; }
  .inputs input { font-size: 20px; }
  .inputs .unit { padding: 8px; font-size: 15px; }
  .go { font-size: 11px; letter-spacing: 0.02em; }
}
/* Short phones (Safari's 553px on a small iPhone): tighter, so the buttons stay on screen under the chart. */
@media (max-width: 899px) and (max-height: 700px) {
  .chart { height: 130px; }
  .status { margin-top: 10px; }
  .status .num { font-size: 22px; }
  .inputs { margin-top: 12px; padding-top: 10px; }
  .runs { margin-top: 8px; }
  .go { padding: 12px 2px; }
}
@media (max-width: 640px) {
  .math .ladder li { grid-template-columns: 7em 5.4em 1fr; gap: 8px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
