/* Greenie. Carried over from design/game.html, the approved mockup; see design/design-spec.md.
   Wordle-style layout: a slim menu bar across the top holds everything except the game;
   the game board sits alone in the middle. One layout for phone and desktop.
   The page is a darker green than the board's own Augusta-green frame, so the board stands forward. */
:root {
  --page: #12291a; --bar-line: #2c4a36; --frame: #1d4a2f; --board: #fcfcf9; --ink: #161616; --muted: #5d625e;
  --red: #c8261c; --good: #1b7a3e; --green: #0b5a3a; --slat: #e6e8e3; --tile-edge: #b8bdb6; --pencil: #55524c; --rule: #c9d3cc;
  --on-green: #e9efe9; --on-green-muted: #9fb5a6; --card: #1d428a; --card-ink: #fff; --band-1: #c8102e; --band-2: #1d428a;
  --board-face: "Barlow Condensed", "Arial Narrow", sans-serif;
  --card-face: "Libre Caslon Text", Georgia, serif;
  --hand: "Reenie Beanie", cursive;
  --body: "Archivo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--on-green); font-family: var(--body); min-height: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--on-green); outline-offset: 2px; }

.tile { display: grid; place-items: center; background: #fff; border: 1px solid var(--tile-edge); box-shadow: 0 2px 0 var(--tile-edge);
        font-family: var(--board-face); font-weight: 700; line-height: 1; color: var(--ink); }
.under { color: var(--red); }
.over { color: var(--good); }
.lbl { font-family: var(--card-face); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; }

/* ---------- Menu bar ---------- */
.bar { border-bottom: 1px solid var(--bar-line); }
.bar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 4px; padding: 8px 12px; min-height: 58px; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--on-green); flex: none; }
.icon svg { width: 24px; height: 24px; display: block; }
.wordmark { font-family: var(--card-face); font-weight: 700; letter-spacing: .3em; font-size: .95rem; color: var(--board); white-space: nowrap; margin-left: 4px; text-decoration: none; }
.spacer { flex: 1; }
.hcp { display: flex; align-items: center; gap: 7px; margin-left: 4px; }
.hcp .lbl { color: var(--on-green-muted); font-size: .6rem; white-space: nowrap; }
.hcp .tile { min-width: 44px; height: 36px; padding: 0 5px; font-size: 1.5rem; }
@media (max-width: 400px) { .bar-in { gap: 0; padding-inline: 8px; } .icon { width: 36px; } .wordmark { letter-spacing: .2em; font-size: .88rem; } .hcp .lbl { letter-spacing: .1em; } }

main { display: flex; justify-content: center; padding: 14px 12px 40px; }
main[hidden] { display: none; }

/* ---------- First screen: pick your course ---------- */
.pick { width: 100%; max-width: 400px; display: grid; gap: 14px; padding-top: 14px; }
.pick .date { font-family: var(--board-face); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .95rem; color: var(--on-green-muted); }
.pick h1 { margin: 2px 0 0; font-family: var(--card-face); font-weight: 400; font-size: 2rem; color: var(--board); }
.howbtn { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--on-green-muted); color: var(--board); padding: 11px;
          font-family: var(--board-face); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: .98rem; }
.howbtn svg { width: 20px; height: 20px; }
@media (hover: hover) { .howbtn:hover { background: var(--frame); } }
.courses { display: grid; gap: 10px; }
.crs { background: var(--board); color: var(--ink); display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: center; padding: 18px 14px 18px 10px;
       border-left: 7px solid var(--league, var(--frame)); text-align: left; width: 100%; }
.crs .lg { font-family: var(--board-face); font-weight: 700; font-size: 2.3rem; letter-spacing: .04em; text-align: center; line-height: 1; }
.crs .theme { font-family: var(--card-face); font-size: 1.12rem; line-height: 1.25; }
.crs .theme small { display: block; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.crs .go { font-family: var(--board-face); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .95rem;
           background: var(--frame); color: var(--board); padding: 10px 12px; text-align: center; line-height: 1.1; }
.crs .go small { display: block; font-weight: 600; font-size: .7rem; letter-spacing: .12em; opacity: .8; margin-top: 2px; }
.crs .done { width: 40px; height: 48px; font-size: 2rem; }
.crs.soon { background: var(--frame); color: var(--on-green-muted); border-left-color: #3b6b4c; cursor: default; }
.crs.soon .theme small { color: var(--on-green-muted); }
.crs .soontag { font-family: var(--card-face); font-style: italic; font-size: .85rem; }
/* Left line = the league's first colour; on hover its second colour sweeps in from the left and the text turns white.
   NBA: red line, blue fill. NFL: navy line, red fill. MLB: red line, navy fill. NHL: black line, orange fill. */
.crs.nba { --league: #c8102e; --fill: #1d428a; } .crs.nfl { --league: #013369; --fill: #d50a0a; } .crs.mlb { --league: #bf0d3e; --fill: #041e42; } .crs.nhl { --league: #141414; --fill: #e5751f; }
.crs:not(.soon) { position: relative; isolation: isolate; overflow: hidden; transition: color .25s; }
.crs:not(.soon)::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fill); transform: scaleX(0); transform-origin: left;
                          transition: transform .35s cubic-bezier(.4,0,.2,1); }
.crs .theme small, .crs .go { transition: color .25s, background-color .25s, box-shadow .25s; }
.crs:not(.soon):focus-visible { outline: 2px solid var(--board); outline-offset: 3px; }
@media (hover: hover) {
  .crs:not(.soon):hover::before { transform: scaleX(1); }
  .crs:not(.soon):hover, .crs:not(.soon):hover .theme small { color: #fff; }
  .crs:not(.soon):hover .go { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
}
.crs:not(.soon):focus-visible::before { transform: scaleX(1); }
.crs:not(.soon):focus-visible, .crs:not(.soon):focus-visible .theme small { color: #fff; }
.crs:not(.soon):focus-visible .go { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
@media (prefers-reduced-motion: reduce) { .crs:not(.soon)::before { transition: none; } }
.pick .next { text-align: center; font-family: var(--card-face); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-green-muted); padding-top: 4px; }

/* ---------- The game ---------- */
.game { width: 100%; max-width: 380px; background: var(--frame); padding: 9px 9px 0; }
/* Three bold bands run across the page behind the board, at its middle: primary, white, secondary.
   NBA: red, white, blue. NFL: navy with white stars, white, red. MLB: red, white, navy. NHL: black, white, orange. */
#v-game { position: relative; }
#v-game::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 96px; transform: translateY(-50%); z-index: 0;
                  background: linear-gradient(to bottom, var(--band-1) 0 33.34%, #fff 33.34% 66.67%, var(--band-2) 66.67% 100%); }
#v-game[data-league="nfl"]::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16.00 9.60 L17.70 14.25 L22.66 14.44 L18.76 17.50 L20.11 22.26 L16.00 19.50 L11.89 22.26 L13.24 17.50 L9.34 14.44 L14.30 14.25Z' fill='%23fff'/%3E%3C/svg%3E") center top / 32px 32px repeat-x,
              linear-gradient(to bottom, var(--band-1) 0 33.34%, #fff 33.34% 66.67%, var(--band-2) 66.67% 100%); }
.game { position: relative; z-index: 1; box-shadow: 0 2px 4px rgba(0,0,0,.35), 0 14px 32px rgba(0,0,0,.45); } /* the board casts a soft shadow onto the page and bands */
.boardwrap { background: var(--board); color: var(--ink); display: flex; flex-direction: column; min-height: 722px; }
.mast { text-align: center; display: grid; padding: 14px 14px 13px; font-family: var(--card-face); }
.mark { font-size: .82rem; letter-spacing: .26em; color: var(--green); font-weight: 700; text-transform: uppercase; }
.head { background: var(--frame); color: var(--board); display: flex; justify-content: space-between; align-items: baseline; padding: 6px 14px 9px;
        font-family: var(--board-face); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.head .big { font-size: 1.9rem; letter-spacing: .12em; }
.head .sm { font-size: 1.05rem; font-weight: 600; }
.slats { padding: 0 14px; background: repeating-linear-gradient(to bottom, transparent 0 33px, var(--slat) 33px 34px); border-bottom: 2px solid var(--frame); }
.q { text-transform: uppercase; font-family: var(--board-face); font-weight: 600; font-size: 1.32rem; line-height: 34px; margin: 0; letter-spacing: .02em; }
.lines { display: grid; padding: 8px 14px 0; font-family: var(--card-face); }
.line { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--rule); padding: 4px 2px; min-height: 44px; }
.line .lbl { white-space: nowrap; font-size: .68rem; }
.guess-input { width: 100%; min-width: 0; height: 38px; line-height: 38px; font-size: 1.9rem; border: 0; background: transparent; text-align: right; padding: 0 2px;
               font-family: var(--hand); color: var(--pencil); outline: none; }
.guess-input::placeholder { color: #b5b2ab; font-size: 1.5rem; }
.guess-input:focus-visible { box-shadow: 0 2px 0 var(--green); outline: none; }
.printed { justify-self: end; font-size: 1.35rem; color: var(--green); }
.blank { color: #b5b2ab; }
.result { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px 14px 10px; }
/* The score tile turns edge-on, the score swaps in, and it turns back. A single face, so every browser draws it. */
.flip { width: 78px; height: 96px; }
.face { position: relative; width: 100%; height: 100%; background: #fff; border: 1px solid var(--tile-edge); box-shadow: 0 2px 0 var(--tile-edge);
        display: grid; place-items: center; transform: perspective(600px) rotateY(0deg); }
.face::before { content: ""; position: absolute; top: 6px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--board); box-shadow: inset 0 1px 1px rgba(0,0,0,.35); } /* the hook hole leaderboard tiles hang from */
.face .label { font-family: var(--board-face); font-weight: 700; font-size: .7rem; letter-spacing: .14em; color: #9aa09a; text-transform: uppercase; margin-top: 10px; }
.face .num { font-family: var(--board-face); font-weight: 700; font-size: 3.6rem; line-height: 1; margin-top: 8px; }
.verdict { font-family: var(--card-face); font-size: 1.35rem; line-height: 1.25; min-height: 3.2em; }
.verdict small { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; color: var(--ink); }
.fact { font-family: var(--body); font-size: .9rem; line-height: 1.45; padding: 0 14px; margin: 0; min-height: 2.9em; transition: opacity .4s; }
.hidden-soft { opacity: 0; }

/* Scorecard */
.cardwrap { margin-top: auto; padding: 14px 6px 8px; }
table.card { table-layout: fixed; border-collapse: collapse; width: 100%; font-family: var(--card-face); font-size: .72rem; text-align: center; }
.card th, .card td { border: 1px solid var(--card); padding: 0; height: 26px; }
.card th { background: var(--card); color: var(--card-ink); font-weight: 400; letter-spacing: .06em; }
.card th:first-child, .card td:first-child { text-align: left; padding: 0 4px 0 5px; width: 46px; letter-spacing: .08em; font-size: .6rem; }
.card th.out, .card td.out { width: 32px; font-weight: 700; }
.card tr.score td { height: 36px; }
.d { font-family: var(--card-face); font-size: .95rem; font-variant-numeric: lining-nums tabular-nums; }
.u1 { background: #d23b30; } .u2 { background: #a8190f; } .u3 { background: #6e0f09; }
.o0 { background: #2f8c4f; } .o1 { background: #1a6a37; } .o2 { background: #0c3f20; }
td.u1, td.u2, td.u3, td.o0, td.o1, td.o2 { color: #fff; }
td.turn { animation: turn .45s ease-out; }
@keyframes turn { from { transform: rotateY(90deg); } to { transform: none; } }
/* A narrow outlined button centred on the green frame under the board: a third of the board's width (wider only if
   the label needs it), with the same green space above and below. Rollover fills it white. No press effect. */
.gobtn { display: block; min-width: 33.333%; margin: 10px auto; padding: 12px 18px; border: 1.5px solid var(--board); background: transparent; color: var(--board);
         text-align: center; line-height: 1; text-box: trim-both cap alphabetic; font-family: var(--board-face);
         text-transform: uppercase; letter-spacing: .2em; font-weight: 700; font-size: .98rem; transition: background-color .15s, color .15s; }
.gobtn:focus-visible { outline: 2px solid var(--board); outline-offset: 3px; }
@media (hover: hover) { .gobtn:hover { background: var(--board); color: var(--frame); } }

/* ---------- Popups (How to play, Stats, Round summary) and the menu drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6, 16, 10, .62); display: flex; justify-content: center; align-items: flex-start; padding: 64px 12px 24px; overflow-y: auto; z-index: 10; }
.overlay[hidden] { display: none; }
.pop { width: 100%; max-width: 420px; background: var(--board); color: var(--ink); border-top: 6px solid var(--frame); padding: 20px 20px 22px; position: relative; }
.pop h2 { margin: 0 0 4px; font-family: var(--card-face); font-weight: 400; font-size: 1.6rem; }
.pop .sub { margin: 0 0 14px; font-family: var(--body); font-size: .95rem; line-height: 1.45; color: var(--muted); }
.pop p, .pop li { font-family: var(--body); font-size: .93rem; line-height: 1.5; }
.pop h3 { margin: 18px 0 6px; }
.close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); }
.close svg { width: 20px; height: 20px; }
.pop .btn { display: block; width: 100%; margin-top: 18px; background: var(--frame); color: var(--board); text-align: center; padding: 12px;
            font-family: var(--board-face); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; font-size: .98rem; }
.pop .btn.second { margin-top: 8px; background: transparent; color: var(--frame); box-shadow: inset 0 0 0 1.5px var(--frame); }
.pop .note { margin: 8px 0 0; text-align: center; font-family: var(--card-face); font-size: .8rem; color: var(--muted); min-height: 1.2em; }

/* How to play */
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rules li { padding-left: 16px; position: relative; }
.rules li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; background: var(--frame); }
.partable { width: 100%; border-collapse: collapse; font-family: var(--card-face); font-size: .88rem; }
.partable td { border-top: 1px solid var(--rule); padding: 6px 0; }
.partable td:first-child { font-family: var(--board-face); font-weight: 700; letter-spacing: .08em; font-size: 1rem; width: 4.4em; }
.example { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; border: 1px solid var(--rule); padding: 10px 12px; margin-top: 4px; }
.example .cell { color: #fff; width: 38px; height: 44px; display: grid; place-items: center; font-family: var(--card-face); font-size: 1.15rem; }
.example p { margin: 0; font-size: .86rem; }
.shades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 4px; }
.shades div { display: grid; gap: 4px; justify-items: center; }
.shades i { display: block; width: 100%; height: 22px; }
.shades span { font-family: var(--card-face); font-size: .66rem; text-align: center; line-height: 1.2; }

/* Stats */
.index { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--frame); }
.index .tiles { display: flex; gap: 3px; }
.index .tile { width: 40px; height: 54px; font-size: 2.5rem; }
.index .tile.dot { width: 14px; border: 0; box-shadow: none; background: transparent; align-items: end; padding-bottom: 6px; }
.index .words { font-family: var(--card-face); font-size: 1.05rem; line-height: 1.3; }
.index .words small { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.track { margin-top: 7px; height: 6px; background: var(--slat); position: relative; }
.track i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--frame); }
.stat-table { width: 100%; border-collapse: collapse; font-family: var(--card-face); font-size: .84rem; font-variant-numeric: tabular-nums lining-nums; }
.stat-table th { text-align: right; font-weight: 400; padding: 0 0 4px; } .stat-table th:first-child { text-align: left; }
.stat-table td { text-align: right; padding: 5px 0; border-top: 1px solid var(--rule); }
.stat-table td:first-child { text-align: left; font-family: var(--board-face); font-weight: 700; font-size: 1rem; letter-spacing: .04em; }
.rd { display: grid; grid-template-columns: 4.4em 2.6em 1fr 30px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--rule); font-family: var(--card-face); font-size: .82rem; }
.rd .lg { font-family: var(--board-face); font-weight: 700; font-size: .95rem; letter-spacing: .04em; }
.strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; height: 14px; } .strip i { display: block; }
.rd .tile { width: 30px; height: 30px; font-size: 1.15rem; box-shadow: 0 1px 0 var(--tile-edge); }
.guestnote { margin-top: 14px; font-family: var(--card-face); font-size: .82rem; color: var(--muted); }
.empty { font-family: var(--card-face); font-size: .9rem; color: var(--muted); margin: 6px 0 0; }

/* Round summary */
.final { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 6px 0 14px; }
.final .tiles { display: flex; gap: 3px; }
.final .tile { width: 52px; height: 66px; font-size: 3.2rem; }
.final .words { font-family: var(--card-face); font-size: 1.35rem; line-height: 1.2; }
.final .words small { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-top: 4px; color: var(--ink); }
.facts { display: grid; margin-top: 10px; font-family: var(--card-face); }
.fl { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--rule); padding: 7px 2px; }
.fl b { font-weight: 400; font-size: .98rem; } .fl small { display: block; font-size: .78rem; color: #555; margin-top: 1px; }
.nextc { text-align: center; font-family: var(--card-face); font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: #555; margin-top: 14px; }

/* Menu drawer */
.drawer-wrap { justify-content: flex-start; align-items: stretch; padding: 0; }
.drawer { width: 300px; max-width: 86vw; background: var(--frame); color: var(--on-green); padding: 16px 0; display: flex; flex-direction: column; }
.drawer h3 { margin: 18px 18px 8px; color: var(--on-green-muted); }
.drawer a, .drawer .row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; text-decoration: none; color: var(--on-green); font-family: var(--card-face); font-size: 1rem; text-align: left; width: 100%; }
.drawer .row .lg { font-family: var(--board-face); font-weight: 700; letter-spacing: .06em; font-size: 1.2rem; width: 2.4em; flex: none; }
.drawer .row .st { margin-left: auto; font-size: .8rem; color: var(--on-green-muted); white-space: nowrap; }
.drawer .row .tile { width: 26px; height: 30px; font-size: 1.1rem; flex: none; }
.drawer hr { border: 0; border-top: 1px solid var(--bar-line); margin: 10px 18px; }

@media (prefers-reduced-motion: reduce) { td.turn { animation: none; } .fact { transition: none; } }
