/* Sportz Rulez: a Qu game. Off-white page, navy ink, yellow accent, Fraunces. The pitches keep their own colours. */
:root {
  --bg: var(--color-off-white, #F8F9F0);
  --ink: var(--color-navy, #1E3A5F);
  --yellow: var(--color-yellow, #FDE358);
  --soft: rgba(30, 58, 95, .68);
  --line: rgba(30, 58, 95, .22);
  --ok: #2C9A5A;
  --no: #D5503F;
  --font: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; text-align: left; }
#app { position: fixed; inset: var(--bar-h, 64px) 0 0 0; overflow-y: auto; overscroll-behavior: contain; }
.sr { max-width: 1080px; margin: 0 auto; padding: 22px 20px 72px; }
.loading { text-align: center; padding-top: 80px; color: var(--soft); }
a { color: var(--ink); }

/* ---- home ---- */
.hero { text-align: center; padding: 10px 0 28px; }
.hero h1 { font-weight: 400; font-size: clamp(38px, 7vw, 60px); margin: 0 0 10px; line-height: 1.05; }
.hero h1 b { font-weight: 700; }
.hero p { margin: 0 auto; color: var(--soft); font-size: clamp(14px, 4.4vw, 19px); line-height: 1.45; }
.hero p span { display: block; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { display: block; width: 100%; background: transparent; border: 1.5px solid var(--ink); border-radius: 10px; padding: 0; overflow: hidden; transition: box-shadow .15s, background .15s; }
.card:hover, .card:focus-visible { background: #fff; box-shadow: 0 0 0 3px var(--yellow); outline: none; }
.card .th { aspect-ratio: 100 / 64; overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.card .th svg, .spside .th svg { display: block; width: 100%; height: 100%; }
.card .cb { padding: 14px 16px 16px; }
.card h2 { margin: 0; font-size: 24px; font-weight: 700; }
.card p { margin: 2px 0 12px; color: var(--soft); font-size: 15px; }
.meter { height: 5px; background: rgba(30, 58, 95, .12); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); }
.mini { display: block; margin-top: 8px; font-size: 13px; color: var(--soft); }
.fine { text-align: center; color: var(--soft); font-size: 13px; margin-top: 32px; }

.back { background: none; border: 0; padding: 4px 0 10px; font-size: 15px; color: var(--soft); }
.back:hover { color: var(--ink); text-decoration: underline; }
.kicker { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.kicker.live { color: var(--no); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.dotlive { width: 9px; height: 9px; border-radius: 50%; background: var(--no); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---- sport page: pitch and intro on the left, the levels on the right ---- */
.sport { display: grid; gap: 24px; align-items: start; }
.spside .th { aspect-ratio: 100 / 64; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.spside h1 { font-size: clamp(34px, 6vw, 50px); font-weight: 700; margin: 0 0 8px; line-height: 1.05; }
.spside p { margin: 0 0 8px; color: var(--soft); font-size: 18px; line-height: 1.45; }
.spside .src { font-size: 13px; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lv { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; column-gap: 14px; width: 100%; background: transparent; border: 1.5px solid var(--ink); border-radius: 10px; padding: 12px 16px; text-align: left; transition: background .15s, box-shadow .15s; }
.lv:hover:not(:disabled), .lv:focus-visible { background: #fff; box-shadow: 0 0 0 3px var(--yellow); outline: none; }
.lv .n { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 18px; line-height: 1; }
.lv.done .n { background: var(--yellow); }
.lv .t { display: grid; gap: 2px; min-width: 0; text-align: left; }
.lv .t b { font-size: 18px; line-height: 1.2; }
.lv .t small { color: var(--soft); font-size: 14px; line-height: 1.3; }
.lv .stars { color: var(--ink); letter-spacing: 2px; font-size: 14px; white-space: nowrap; text-align: right; }
.stars i, .bigstars i { font-style: normal; opacity: .2; }
.lv.match { background: var(--yellow); }
.lv.match:hover:not(:disabled) { background: var(--yellow); }
.lv.match .n { background: var(--ink); color: var(--yellow); }
.lv.locked, .lv.locked:hover { background: transparent; opacity: .5; cursor: not-allowed; box-shadow: none; }
.lv.locked .n { background: transparent; color: var(--ink); }

/* ---- the stage: the pitch never leaves ---- */
.play { display: grid; gap: 0 32px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "pitch" "panel"; }
.ptop { grid-area: top; }
.pitch { grid-area: pitch; min-width: 0; }
.panel { grid-area: panel; min-width: 0; padding-top: 18px; }
.scene { border-radius: 10px; overflow: hidden; border: 1.5px solid var(--ink); background: #0b1524; line-height: 0; }
.sv { display: block; width: 100%; height: auto; }
.sv .grass { fill: #3C8A58; } .sv .mow { fill: #409062; }
.sv .ln { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: .5; }
.sv .dot { fill: #fff; } .sv .goal { fill: rgba(255, 255, 255, .9); }
.f-basketball .wood { fill: #D69A5C; } .f-basketball .ln { stroke: #fff; } .f-basketball .rim { fill: none; stroke: #E8542E; stroke-width: .6; }
.f-tennis .outc { fill: #3C8A58; } .f-tennis .court { fill: #3B78C0; } .f-tennis .net { stroke: #fff; stroke-width: .7; stroke-dasharray: .8 .6; } .f-tennis .post { fill: #ddd; }
.f-nfl .ez.a { fill: #3069B5; } .f-nfl .ez.b { fill: #C14E42; } .f-nfl .yd { fill: rgba(255, 255, 255, .38); font-size: 2.6px; text-anchor: middle; font-weight: 700; }
.f-nfl .goalpost { stroke: #FDE358; stroke-width: .7; }
.f-baseball .outc { fill: #2A6E48; } .f-baseball .grass { fill: #3C8A58; } .f-baseball .grass2 { fill: #489E68; } .f-baseball .dirt { fill: #C29463; }
.f-baseball .ln { stroke: #fff; stroke-width: .45; } .f-baseball .fence { fill: none; stroke: #14452B; stroke-width: 1.4; } .f-baseball .base { fill: #fff; } .f-baseball .base-ln { stroke: #fff; stroke-width: .3; fill: none; }
.f-cricket .outc { fill: #2A6E48; } .f-cricket .grass { fill: #48996A; } .f-cricket .rope { fill: none; stroke: #fff; stroke-width: .8; stroke-dasharray: 0 1.6; stroke-linecap: round; }
.f-cricket .strip { fill: #D5B988; } .f-cricket .stump { stroke: #fff; stroke-width: .35; }
.ob circle { stroke: #fff; stroke-width: .4; }
.ob { transition: transform .95s cubic-bezier(.45, 0, .25, 1); }
.ob.a circle { fill: #2F7FE0; } .ob.b circle { fill: #E04F42; } .ob.r circle { fill: #FDE358; stroke: #1E3A5F; } .ob.n circle { fill: #aaa; }
.ob text { font-family: var(--font); font-size: 2.2px; font-weight: 700; fill: #fff; text-anchor: middle; pointer-events: none; }
.ob.r text { fill: #1E3A5F; }
.f-nfl .ob text { font-size: 1.7px; }
.ob.ball { transition-duration: .7s; } .ob.ball circle { stroke: #222; stroke-width: .3; fill: #fff; }
.ob.ball.bb circle { fill: #F0701F; } .ob.ball.tn circle { fill: #D8F04B; } .ob.ball.nf circle { fill: #8B4A22; } .ob.ball.ck circle { fill: #C8281E; }
.dec { transition: opacity .5s; }
.labbg { fill: rgba(14, 28, 51, .82); }
.dt { font-family: var(--font); font-size: 2.6px; font-weight: 700; }
.zoomed .dt { font-size: 1.75px; }
.zoomed .ob circle { stroke-width: .3; }
.tappable { cursor: crosshair; }
.tapmark circle { fill: none; stroke-width: .8; } .tapmark.ok circle { stroke: #6FD08C; } .tapmark.no circle { stroke: #FF7A6B; }
.zone { fill: rgba(111, 208, 140, .3); stroke: #6FD08C; stroke-width: .5; stroke-dasharray: 1.4 1; pointer-events: none; }
.scap { margin: 10px 2px 0; font-size: 15px; line-height: 1.4; color: var(--soft); min-height: 1.4em; }
.sbar { display: flex; justify-content: flex-end; margin-top: 2px; }
.replay { display: inline-flex; gap: 6px; align-items: center; background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--ink); }
.replay:hover { border-color: var(--ink); }

/* ---- the words ---- */
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: rgba(30, 58, 95, .14); max-width: 46px; }
.steps i.d { background: var(--ink); } .steps i.c { background: var(--yellow); box-shadow: inset 0 0 0 1.5px var(--ink); }
.lvtitle { font-size: clamp(28px, 4.5vw, 38px); margin: 0 0 12px; font-weight: 700; line-height: 1.1; }
.lead { font-size: 19px; line-height: 1.5; color: var(--soft); margin: 0 0 18px; }
.lesson p { font-size: 18px; line-height: 1.5; margin: 0 0 12px; }
.lesson .rule { display: block; width: max-content; max-width: 100%; margin-bottom: 18px; }
.rule { display: inline-block; margin: 2px 0 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; background: rgba(253, 227, 88, .55); border-radius: 999px; padding: 3px 11px; }
.qtext { font-size: clamp(22px, 3.6vw, 28px); margin: 0 0 16px; line-height: 1.25; font-weight: 700; }
.taphint { color: var(--soft); margin: -6px 0 10px; font-size: 15px; }
.choices { display: grid; gap: 10px; }
.choices.held { opacity: .35; pointer-events: none; }
.choice { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; column-gap: 12px; background: transparent; border: 1.5px solid var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 17px; line-height: 1.3; transition: background .15s, box-shadow .15s; }
.choice .ltr { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.choice:hover:not(:disabled) { background: #fff; box-shadow: 0 0 0 3px var(--yellow); }
.choice:disabled { cursor: default; }
.choice.right { background: rgba(44, 154, 90, .16); border-color: var(--ok); }
.choice.right .ltr { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.wrong { background: rgba(213, 80, 63, .13); border-color: var(--no); }
.choice.wrong .ltr { background: var(--no); border-color: var(--no); color: #fff; }
.fb { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 10px; font-size: 16.5px; line-height: 1.5; background: #fff; border: 1.5px solid var(--line); }
.fb.show { display: block; } .fb.ok { border-left: 6px solid var(--ok); } .fb.no { border-left: 6px solid var(--no); }
.fb b { display: block; margin-bottom: 2px; font-size: 18px; }
.fb .rule { display: block; width: max-content; margin: 8px 0 12px; }
.primary { background: var(--yellow); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 12px 28px; font-weight: 700; font-size: 18px; text-align: center; transition: box-shadow .15s; }
.primary:hover { box-shadow: 0 0 0 4px rgba(253, 227, 88, .6); }
.ghost { background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; padding: 10px 22px; font-size: 16px; text-align: center; }
.ghost:hover { background: #fff; }

.done { text-align: center; padding: 8px 0; }
.done h1 { font-size: 38px; margin: 6px 0; } .done p { color: var(--soft); font-size: 18px; margin: 4px 0 18px; }
.bigstars { font-size: 44px; letter-spacing: 6px; }
.bigscore { font-size: 80px; font-weight: 700; line-height: 1; } .bigscore small { font-size: 32px; color: var(--soft); }
.dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; } .dots i { width: 14px; height: 14px; border-radius: 50%; } .dots .ok { background: var(--ok); } .dots .no { background: var(--no); }
.row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---- wide screens and phones turned sideways: pitch beside the words ---- */
@media (min-width: 900px) {
  .sport { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; }
  .spside { position: sticky; top: 8px; }
  .play { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); grid-template-areas: "top top" "pitch panel"; align-items: start; }
  .pitch { position: sticky; top: 8px; }
  .panel { padding-top: 0; }
}
/* phone upright: while answering, the pitch stays pinned at the top, a little smaller, and the answers scroll beneath it */
@media (max-width: 899px) and (orientation: portrait) {
  .play.asking .pitch { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 6px; }
  .play.asking .scene { max-width: calc(24vh * 1.5625); margin: 0 auto; }
  .play.asking .scap { font-size: 14px; margin-top: 6px; min-height: 0; text-align: center; }
  .play.asking .sbar { margin-top: 0; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .sr { padding: 10px 16px 40px; }
  /* the whole pitch must fit in the height that is left under the site bar */
  .play { grid-template-columns: min(55vw, calc((100vh - var(--bar-h, 90px) - 96px) * 1.5625)) minmax(0, 1fr); grid-template-areas: "top top" "pitch panel"; align-items: start; gap: 0 20px; }
  .ptop .back { padding-bottom: 4px; }
  .pitch { position: sticky; top: 4px; }
  .panel { padding-top: 0; }
  .scap { font-size: 13px; margin-top: 6px; }
  .qtext { font-size: 20px; margin-bottom: 10px; }
  .choice { padding: 8px 12px; font-size: 15px; }
  .choices { gap: 7px; }
  .lesson p { font-size: 16px; }
  .lvtitle { font-size: 26px; }
  .sport { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; }
  .spside .th { display: none; }
}
@media (max-width: 560px) {
  .sr { padding: 14px 14px 56px; }
  .spside .th { display: none; }
  .spside h1 { font-size: 34px; }
  .spside p { font-size: 16px; }
  .lv { column-gap: 12px; padding: 11px 12px; }
  .lv .stars { font-size: 12px; letter-spacing: 1px; }
  .choice { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) { .ob, .dec { transition: none !important; } .dotlive { animation: none; } }

/* stacked lists inside text */
.para { font-size: 18px; line-height: 1.5; margin: 0 0 12px; }
.para .rl { display: block; }
ul.stack { list-style: none; margin: 6px 0 2px; padding: 0; }
ul.stack li { position: relative; padding-left: 22px; margin: 6px 0; line-height: 1.4; }
ul.stack li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.fb .rl { display: inline; } .fb ul.stack { margin: 6px 0; } .fb ul.stack + .rl, .fb .rl + ul.stack { display: block; }
.ti .para { font-size: 15.5px; margin: 4px 0; line-height: 1.45; }
.srcs summary { cursor: pointer; } .srcs p { margin: 6px 0 0; line-height: 1.6; font-size: 14.5px; }
@media (orientation: landscape) and (max-height: 560px) { .lesson .para { font-size: 16px; } }
.spside .srcs p { font-size: 14px; line-height: 1.7; } .spside .srcs summary { font-size: 13px; }

/* even out short blocks of text so no line runs long next to a short one */
.safety, .hero p, .done p, .res p, .scap, .fine, .catblurb, .lead, .qtext, .lvtitle, .taphint, .card p, .hero h1, .done h1, .cat { text-wrap: balance; }
.safety { max-width: 560px; }
