/* The bowling bet: an orange event field (score sheet and month) beside a navy panel. 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; }
/* One giant pictogram, cropped off the field's edge. Navy, since the field is orange. */
.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(6.5em, calc(100% - clamp(80px, 16vw, 220px))); }

/* The score sheet: ten frames, the last with three boxes. Strikes are X; the miss that ended the best game is a dash. */
.sheet { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)) minmax(0, 2.2fr); border: 2px solid var(--ink); max-width: 760px; }
.frame { border-left: 2px solid var(--ink); display: flex; flex-direction: column; }
.frame:first-child { border-left: 0; }
.frame .ev { padding: 4px 6px 0; font-size: 11px; }
.frame .boxes { display: flex; justify-content: flex-end; margin-top: auto; }
.frame i { flex: 0 0 auto; width: clamp(20px, 3.4vw, 40px); aspect-ratio: 1; border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); display: grid; place-items: center; font: 800 clamp(13px, 2vw, 22px) / 1 var(--font); font-style: normal; }
.frame .boxes i:first-child { margin-left: auto; }
.frame:last-child .boxes { justify-content: stretch; }
.frame:last-child i { flex: 1; width: auto; }
.frame:last-child i:first-child { border-left: 0; }
.frame { min-height: clamp(52px, 8vw, 84px); }
.frame i.x { background: var(--ink); color: #fff; animation: pop 0.3s var(--ease) both; }
.frame i.miss { color: var(--ink); }
@keyframes pop { from { transform: scale(1.6); } }

/* The month: 30 outlined squares, white once bowled; the day of a perfect game is filled navy. */
.month { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: clamp(3px, 0.5vw, 6px); margin-top: 18px; max-width: 760px; }
.month i { aspect-ratio: 1; outline: 2px solid rgba(20, 33, 61, 0.35); outline-offset: -2px; display: grid; place-items: center; font: 800 11px var(--font); font-style: normal; color: rgba(20, 33, 61, 0.55); }
.month i.on { background: #fff; outline-color: #fff; color: var(--ink); }
.month i.hit { background: var(--ink); outline-color: var(--ink); color: #fff; animation: pop 0.4s var(--ease) both; }

.status { display: flex; gap: clamp(24px, 5vw, 56px); margin-top: 18px; padding-top: 10px; border-top: 2px solid var(--ink); }
.num { font-size: clamp(30px, 7vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

.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 .more { display: inline-block; margin-top: 28px; color: #fff; }

.inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 20px; max-width: 560px; }
.inputs label { display: grid; gap: 6px; align-content: end; }
.inputs .unit { display: flex; align-items: baseline; gap: 6px; border: 2px solid #fff; padding: 8px 10px; font-size: 14px; color: var(--navy-soft); }
.inputs .unit:focus-within { border-color: var(--orange); }
.inputs input { width: 100%; min-width: 0; border: 0; padding: 0; background: transparent; color: #fff; font: 800 26px 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; }

.result { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; padding-top: 10px; border-top: 2px solid rgba(255, 255, 255, 0.3); max-width: 560px; }
.result .val { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.verdict { margin-top: 18px; padding: 12px 14px; max-width: 560px; font-size: clamp(17px, 3.6vw, 20px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.verdict.go { background: var(--orange); color: var(--ink); }
.verdict.stay { background: #fff; color: var(--ink); }
.even { margin-top: 10px; font-size: 15px; max-width: 560px; }
.even:empty { display: none; }

.cta { display: inline-block; margin-top: 20px; padding: 16px 24px; border: 2px solid #fff; border-radius: 0; background: #fff; color: var(--ink); font: 800 14px var(--font); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease); }
@media (hover: hover) { .cta:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); color: var(--ink); } }
.cta:active { transform: scale(0.97); }
.cta:disabled { opacity: 0.5; cursor: default; }

.end { margin-top: 0; }
.end .big { white-space: nowrap; font-size: clamp(52px, 6.4vw, 96px); font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; margin: 12px 0 6px; font-variant-numeric: tabular-nums; }
.end .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0 26px; padding-top: 10px; border-top: 2px solid rgba(255, 255, 255, 0.3); }
.end .stats .val { font-size: clamp(20px, 4.4vw, 26px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.end .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.end button { display: inline-flex; align-items: center; gap: 10px; 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; }
.end button.primary { background: #fff; color: var(--ink); }
@media (hover: hover) { .end button:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); } }
.end button .icon { width: 18px; height: 18px; }

/* The math: strikes in a row, the month's games, and the expected value; the odds 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: 7em 10em 1fr; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(20, 33, 61, 0.15); }
.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 .gap { display: block; text-align: center; color: var(--ink-soft); letter-spacing: 0.3em; border-top: 0; padding: 2px 0; }
.math .ladder .last { border-top: var(--rule) solid var(--ink); }
.math .ladder .last 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 .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: 12px 0; border-top: 2px solid rgba(255, 255, 255, 0.5); text-align: left; vertical-align: baseline; }
.math th { font-weight: 700; font-size: 17px; padding-right: 16px; }
.math td { text-align: right; font-size: clamp(24px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.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 { margin: 30px 0 auto; }
  .sheet { margin-top: 28px; }
  .panel { padding-top: 76px; padding-bottom: 36px; display: flex; flex-direction: column; }
  .panel .more { margin-top: auto; padding-top: 28px; align-self: flex-start; }
}
@media (max-width: 640px) {
  .month { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .inputs input { font-size: 22px; }
  .inputs .unit { font-size: 12px; padding: 8px; }
  .status .num { font-size: 30px; }
  .math .ladder li { grid-template-columns: 5.6em 8.6em 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .frame i.x, .month i.hit { animation: none; } }
.end .fine { margin: 14px 0 0; font-size: 14px; }

/* The month's result on the field: the payout big, then what happened and a link down to the details. */
.outcome { margin-top: 18px; font-size: 18px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.outcome[hidden] { display: none; }
.outcome b { font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.outcome a { color: inherit; }
