/* Top Bins. The whole app sits on grass: mown stripes, white chalk lines,
   corner-flag yellow. Matches play out in the animated stadium scene above
   a dot-matrix scoreboard. */
:root {
  --grass-1: #1f7a3d;
  --grass-2: #1b6e37;
  --deep: #0d3320;
  --deeper: #092617;
  --chalk: #ffffff;
  --soft: #d3ead9;
  --rule: rgba(255, 255, 255, .34);
  --flag: #ffd23f;
  --flag-deep: #c79a00;
  --ink: #10201a;
  --red: #ff6b5e;
  --go: #c6f560;
  --amber: #ffb72b;

  --t-tap: #dbe4de;
  --t-edge: #8fd3ff;
  --t-forty: #c6f560;
  --t-halfway: #ffa552;
  --t-keeper: #ffd23f;

  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --matrix: 'Doto', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: repeating-linear-gradient(90deg, var(--grass-1) 0 140px, var(--grass-2) 140px 280px) fixed;
  color: var(--chalk);
  font: 400 17px/1.45 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body[data-view="play"], body[data-view="fulltime"] { background: var(--deep); }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 48px); }

h2 { font: 900 clamp(30px, 3vw, 40px)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; }
h3 { font: 700 22px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 0 0 10px; }
.lede { color: var(--soft); max-width: 62ch; margin: 8px 0 0; }
.meta { font-size: 14px; color: var(--soft); text-align: right; line-height: 1.3; }
/* section headings sit on a chalk line */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-bottom: 10px; border-bottom: 4px solid var(--chalk); }
.section-head.sub { margin-top: 26px; border-bottom-width: 2px; }
.section-head h3 { margin: 0; }

:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }

/* buttons */
.btn { font: 900 24px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; padding: 15px 26px; border: 0; border-radius: 4px;
  background: var(--flag); color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 var(--flag-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--flag-deep); }
.btn-quiet { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 2px var(--chalk); }
.btn-quiet:active { box-shadow: inset 0 0 0 2px var(--chalk); }
.link { background: none; border: 0; padding: 4px 0; font: 500 15px var(--body); color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:disabled { opacity: .5; cursor: default; text-decoration: none; }
.bar { height: 6px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--flag); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* the stadium scene */
.scene { display: block; width: 100%; height: clamp(260px, 50vh, 540px); background: var(--grass-2); }
.scene-home { height: clamp(190px, 34vh, 360px); border-block: 4px solid var(--chalk); }

/* masthead */
.masthead-in { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding-block: clamp(20px, 3.4vw, 40px) clamp(16px, 2.4vw, 26px); flex-wrap: wrap; }
.logo { font: 900 clamp(72px, 13vw, 168px)/.8 var(--display); text-transform: uppercase; letter-spacing: -.01em; margin: 0; }
.strap { margin: 14px 0 0; font-size: clamp(16px, 1.5vw, 20px); color: var(--soft); max-width: 44ch; }
.level { display: flex; align-items: center; gap: 16px; min-width: min(100%, 300px); }
.shirt { font: 900 76px/.9 var(--display); color: var(--flag); min-width: 1ch; text-align: center; }
.level-info { flex: 1; display: grid; gap: 6px; }
.level-title { font: 700 26px/1 var(--display); text-transform: uppercase; }
.level-xp { font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }

/* home layout */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); padding-block: clamp(24px, 4vw, 48px) 64px; align-items: start; }
.col-main, .col-side { display: grid; gap: 44px; }
.col-side { gap: 36px; }

/* fixture list */
.fixtures { list-style: none; margin: 0; padding: 0; }
.fixtures button { width: 100%; display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 4px 18px; text-align: left;
  padding: 16px 12px 16px 0; background: none; border: 0; border-bottom: 1px solid var(--rule); color: inherit; font: inherit; cursor: pointer; }
.fixtures button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.fixtures .num { font: 900 52px/.9 var(--display); color: var(--flag); text-align: center; }
.fixtures .title { display: block; font: 700 28px/1.05 var(--display); text-transform: uppercase; }
.fixtures .sub { display: block; font-size: 15px; color: var(--soft); margin-top: 3px; }
.fixtures .best { font-size: 15px; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fixtures button:disabled { cursor: default; opacity: .62; }
.fixtures button:disabled .num { color: var(--chalk); }
.fixtures .next button { background: var(--chalk); color: var(--ink); box-shadow: inset 8px 0 0 var(--flag); }
.fixtures .next button:hover { background: var(--chalk); }
.fixtures .next .num { color: var(--grass-1); padding-left: 8px; }
.fixtures .next .sub { color: #3c5547; }
.fixtures .go { font: 900 18px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; background: var(--flag); color: var(--ink); padding: 9px 14px; border-radius: 3px; box-shadow: 0 3px 0 var(--flag-deep); }
.stars { color: var(--flag); letter-spacing: 2px; white-space: nowrap; font-size: 20px; }
.stars .off { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .6); }
.stars.big { font-size: 44px; letter-spacing: 6px; margin: 0; }
.stars small { display: block; font: 500 16px var(--body); letter-spacing: 0; color: var(--chalk); margin-top: 4px; }

/* distance ladder: widths follow the real yardages */
.ladder-bar { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1.25fr 1.7fr 2fr 3fr; }
.ladder-bar li { padding: 12px 12px 14px; border-top: 10px solid currentColor; display: grid; gap: 2px; align-content: start; }
.ladder-bar b { font: 900 44px/.9 var(--display); }
.ladder-bar span { font-weight: 600; color: var(--chalk); line-height: 1.2; }
.ladder-bar small { font-size: 14px; color: var(--soft); }

/* missions */
.mlist { list-style: none; margin: 0; padding: 0; }
.mission { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.mission .m-text { font-weight: 500; line-height: 1.3; }
.mission .m-xp { font: 700 20px/1.2 var(--display); color: var(--flag); white-space: nowrap; }
.mission .bar { grid-column: 1 / -1; height: 5px; }
.mission .m-prog { grid-column: 1 / -1; font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.mission.done .m-text { color: var(--soft); }
.mission.done .bar i { background: var(--go); }
.mission.done .m-xp { color: var(--go); }
.missions.picking .mission { cursor: pointer; background: rgba(255, 255, 255, .12); box-shadow: inset 5px 0 0 var(--flag); padding-inline: 14px; }
.hint { font-size: 15px; font-weight: 600; margin: 10px 0 0; color: var(--flag); }
.tag-chip { font-weight: 600; color: var(--flag); margin-right: 8px; }
/* boxes are drawn like a penalty area */
.box { border: 4px solid var(--chalk); border-bottom: 0; padding: 20px 20px 22px; background: rgba(9, 38, 23, .35); display: grid; gap: 14px; }
.box .btn { width: 100%; }
.box p { margin: 0; color: var(--soft); font-size: 15px; }
.box .strip li { background: var(--deep); }

/* sticker album */
.album-teaser { display: grid; gap: 14px; justify-items: start; }
.album-teaser .section-head, .album-teaser .bar { width: 100%; }
.album-teaser .lede { margin: 0; }
.album-wrap { padding-block: clamp(20px, 4vw, 48px) 64px; display: grid; gap: 16px; }
.album-wrap > .link { justify-self: start; }
#album-body h3 { margin: 30px 0 12px; font-size: 28px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.page { background: var(--deep); border: 2px solid var(--rule); padding: 14px 14px 16px; }
.page.complete { border-color: var(--flag); }
.page header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.page header span { font: 700 22px/1.05 var(--display); text-transform: uppercase; }
.page header b { font-size: 14px; font-weight: 500; color: var(--soft); white-space: nowrap; }
.page.complete header b { color: var(--flag); }
.stickers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
/* a missing sticker is an empty dashed slot; a found one is a white card with a tier-coloured edge */
.stickers li { min-width: 46px; padding: 6px 9px; text-align: center; font: 700 17px/1.2 var(--display); border: 2px dashed currentColor; border-radius: 3px; opacity: .6; }
.stickers li.got { opacity: 1; background: var(--chalk); border: 0; border-left: 7px solid currentColor; font: 600 15px/1.25 var(--body); padding: 7px 10px; }
.stickers li.got { -webkit-text-fill-color: var(--ink); }
.career { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 4px solid var(--chalk); }
.career div { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.career dt { font-size: 14px; color: var(--soft); }
.career dd { margin: 0; font: 900 34px/1 var(--display); }

/* briefing */
.brief-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding-block: clamp(24px, 5vw, 64px); align-items: start; }
.brief-main { display: grid; gap: 14px; justify-items: start; }
.brief-num { margin: 18px 0 0; font: 700 26px/1 var(--display); text-transform: uppercase; color: var(--flag); }
.brief-title { font-size: clamp(64px, 11vw, 150px); line-height: .82; }
.brief-main .lede { font-size: 20px; margin: 0; }
.brief-side { display: grid; gap: 32px; background: rgba(9, 38, 23, .45); padding: 24px; border: 4px solid var(--chalk); }
.targets, .topics { list-style: none; margin: 0; padding: 0; }
.targets li, .topics li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.targets li.got { font-weight: 600; }
.targets li.got::after { content: 'Won'; color: var(--go); margin-left: 12px; }
.targets li span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }

/* match */
.match-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); padding-block: clamp(18px, 3vw, 32px) 40px; align-items: start; }
.match-main, .match-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.scoreboard { display: grid; grid-template-columns: repeat(3, 1fr); background: #000; border: 3px solid #2c3a31; border-radius: 6px; padding: 12px 8px 8px; }
.scoreboard > div { display: grid; justify-items: center; gap: 2px; }
.scoreboard > div + div { border-left: 2px solid #1c2620; }
.sb-label { font-size: 14px; color: #9fb3a6; }
.dots { font: 900 clamp(34px, 4.6vw, 58px)/1 var(--matrix); color: var(--amber); letter-spacing: .02em; text-shadow: 0 0 14px rgba(255,183,43,.45); font-variant-numeric: tabular-nums; }
.clock { height: 8px; background: var(--deeper); margin-top: -8px; }
.clock i { display: block; height: 100%; width: 100%; background: var(--amber); }
.clock.low i { background: var(--red); }
.scoreboard.low #clock-num { color: var(--red); text-shadow: 0 0 14px rgba(255,107,94,.6); }
.q-tag { margin: 6px 0 -8px; font: 700 24px/1 var(--display); text-transform: uppercase; color: var(--flag); }
.q-prompt { font: 600 clamp(24px, 2.5vw, 34px)/1.2 var(--body); text-transform: none; letter-spacing: 0; max-width: 28ch; }
#shot-form { display: flex; gap: 10px; }
#shot-input { flex: 1; min-width: 0; font: 500 22px var(--body); padding: 14px 16px; border: 0; border-bottom: 4px solid var(--flag); border-radius: 4px 4px 0 0; background: #fff; color: var(--ink); }
#shot-input:focus { outline: none; border-bottom-color: var(--amber); }
#shot-form.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.reaction { min-height: 1.1em; margin: 0; font: 900 clamp(36px, 4.4vw, 64px)/1 var(--display); text-transform: uppercase; }
.reaction.bad { color: var(--red); }
.reaction.good { color: var(--go); }
.reaction small { display: block; font: 400 18px/1.35 var(--body); text-transform: none; color: var(--soft); margin-top: 6px; }
.reveal { display: grid; gap: 14px; justify-items: start; padding: 18px; border: 4px solid var(--chalk); background: var(--deeper); }
.reveal-head { margin: 0; color: var(--soft); }
.sheet { margin: 0; width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 0 16px; }
.sheet dt { font: 900 26px/1.25 var(--display); text-align: right; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.sheet dd { margin: 0; padding: 8px 0 6px; border-bottom: 1px solid var(--rule); line-height: 1.35; color: var(--chalk); }
.sheet .you { background: var(--flag); color: var(--ink); font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.t-tap { color: var(--t-tap); } .t-edge { color: var(--t-edge); } .t-forty { color: var(--t-forty); }
.t-halfway { color: var(--t-halfway); } .t-keeper { color: var(--t-keeper); }
.log h3 { padding-bottom: 8px; border-bottom: 2px solid var(--chalk); margin: 0; }
.log ol { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 1fr auto 3ch; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.log .ans { color: var(--soft); text-align: right; }
.log b { font: 900 24px/1 var(--display); text-align: right; }
.log-empty { margin: 10px 0 0; color: var(--soft); }
.match-links { display: flex; gap: 24px; margin: 0; color: var(--soft); }

/* full time */
.ft-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); padding-block: clamp(28px, 6vw, 72px); align-items: start; }
.ft-result { display: grid; gap: 18px; justify-items: start; }
.ft-label { margin: 0; font: 700 28px/1 var(--display); text-transform: uppercase; color: var(--flag); }
.ft-board { background: #000; border: 3px solid #2c3a31; border-radius: 6px; padding: 18px 28px 12px; display: grid; justify-items: center; }
.ft-board .dots { font-size: clamp(90px, 15vw, 200px); line-height: .9; }
.ft-note { margin: 0; color: var(--soft); max-width: 46ch; }
.ft-rank { margin: 0; font: 900 clamp(40px, 5vw, 68px)/1 var(--display); text-transform: uppercase; }
.strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.strip li { width: 58px; padding: 8px 0 6px; text-align: center; border-bottom: 6px solid currentColor; background: var(--deeper); }
.strip b { display: block; font: 900 30px/1 var(--display); color: #fff; }
.strip small { font-size: 12px; color: var(--soft); }
.strip .miss { color: #4d6b59; }
.strip .miss b { color: #7f9c8a; }
.ft-side { display: grid; gap: 28px; }
.ft-xp p { margin: 0 0 10px; }
.levelup { margin: 12px 0 0 !important; font: 900 30px/1 var(--display); text-transform: uppercase; color: var(--flag); }
.ft-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ft-actions .btn:not(.btn-quiet) { grid-column: 1 / -1; }

/* phones and narrow windows: one column */
@media (max-width: 860px) {
  .home-grid, .brief-grid, .ft-grid, .match-grid { grid-template-columns: 1fr; }
  .fixtures button { grid-template-columns: 48px 1fr auto; }
  .fixtures .num { font-size: 40px; }
  .fixtures .title { font-size: 24px; }
  .fixtures .best { display: none; }
  .ladder-bar { grid-template-columns: 1fr; }
  .ladder-bar li { grid-template-columns: 64px 1fr; border-top: 0; border-left: 10px solid currentColor; padding: 8px 12px; }
  .ladder-bar b { grid-row: span 2; font-size: 36px; }
  .scene { height: clamp(190px, 30vh, 260px); }
  .scene-home { height: clamp(170px, 26vh, 230px); }
  .q-prompt { max-width: none; }
  .strip li { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .bar i { transition: none; }
  #shot-form.shake { animation: none; }
}
.sheet .hidden-count { color: var(--soft); font-style: italic; }

/* account */
.level-info .link { justify-self: start; font-size: 14px; }
.account-wrap { padding-block: clamp(20px, 4vw, 48px) 64px; display: grid; gap: 20px; }
.account-wrap > .link { justify-self: start; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.account-wrap .box { border-bottom: 4px solid var(--chalk); max-width: 620px; }
.account-wrap label { font-weight: 600; margin-bottom: -8px; }
.account-wrap input { font: 500 20px var(--body); padding: 12px 14px; border: 0; border-bottom: 4px solid var(--flag); border-radius: 4px 4px 0 0; background: #fff; color: var(--ink); width: 100%; }
.account-wrap .code { font: 900 clamp(30px, 5vw, 46px)/1 var(--matrix); color: var(--amber); background: #000; padding: 16px; text-align: center; letter-spacing: .04em; border-radius: 6px; }
.acct-msg { margin: 0; font-weight: 600; color: var(--flag); min-height: 1.5em; }

/* ad slots stay hidden until ads are switched on in ads.js */
.ad-slot { min-height: 100px; }
#acct-email { border-color: var(--flag); }
