:root {
  /* GFPA crest colors: navy, gold, white */
  --bg: #f3f4f8; --card: #fff; --ink: #0d1730; --muted: #5f6880; --line: #dde1ea;
  --green: #0A1F44; --green2: #14306B; --gold: #E9B23B; --win: #1f8a4c; --loss: #c0392b; --pick: #fff5d9;
  --display: Graduate, 'Alfa Slab One', 'Arial Black', serif;
  --label: Oswald, 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #070f22; --card: #0f1a33; --ink: #eef1f7; --muted: #9aa4bb; --line: #223052; --pick: #2a2614; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
header#top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--green); color: #fff; border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.brand .crest { width: 34px; height: 36px; object-fit: contain; flex: none; }
.brand .gfpa { font-family: var(--display); font-size: 22px; color: #fff; letter-spacing: 1px; text-shadow: 0 0 1px var(--gold), 1px 1px 0 var(--gold); }
.brand .leaguename { font-family: var(--label); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .brand .leaguename { display: none; } }
.hero { text-align: center; margin: 18px 0 6px; }
.hero img { width: 180px; max-width: 55vw; height: auto; filter: drop-shadow(0 4px 10px rgba(10, 31, 68, .25)); }
#who { font-family: var(--label); font-size: 13px; letter-spacing: .3px; white-space: nowrap; }
#who b { color: var(--gold); }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }
nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
nav#tabs a { flex: 1; text-align: center; padding: 8px 2px 10px; color: var(--muted); text-decoration: none; font-family: var(--label); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
nav#tabs a span { display: block; font-size: 22px; line-height: 1.2; }
nav#tabs a.on { color: var(--green2); box-shadow: inset 0 3px 0 var(--gold); }
@media (prefers-color-scheme: dark) { nav#tabs a.on { color: var(--gold); } }
h1 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 8px 0 10px; color: var(--green); letter-spacing: .5px; }
h2 { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 18px; margin: 20px 0 8px; color: var(--green2); }
@media (prefers-color-scheme: dark) { h1 { color: #fff; } h2 { color: var(--gold); } }
h3 { font-size: 15px; margin: 12px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding: 24px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
button, .btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px;
  padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; touch-action: manipulation; }
button, .btn, .badge, .chip, .weekbar select, .team .abbr, .team .score, .trophy .yr, th { font-family: var(--label); letter-spacing: .3px; }
button.primary, .btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
button.gold { background: var(--gold); border-color: var(--gold); color: var(--green); font-size: 18px; text-transform: uppercase; }
button.danger { color: var(--loss); }
button.sm, .btn.sm { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; }
button.big { width: 100%; padding: 14px; font-size: 17px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
textarea { min-height: 140px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.err { color: var(--loss); font-weight: 600; min-height: 1.2em; white-space: pre-line; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; }
.seg button.on { background: var(--green); color: #fff; }

/* week picker */
.weekbar { display: flex; align-items: center; gap: 8px; }
.weekbar select { flex: 1; font-weight: 700; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; -webkit-overflow-scrolling: touch; }
.chip { flex: none; font-size: 13px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--line); color: var(--ink); vertical-align: middle; }
.badge.win { background: var(--win); color: #fff; } .badge.loss { background: var(--loss); color: #fff; }
.badge.auto { background: #dfe9ff; color: #1d3f8a; } .badge.lock { background: #333; color: #fff; } .badge.gold { background: var(--gold); color: #222; }
.badge.live { background: #d9480f; color: #fff; }

/* game card */
.game { padding: 10px; }
.game .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 0 4px 8px; gap: 8px; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.team { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font-weight: 700; position: relative; min-height: 96px; justify-content: center; }
.team img { width: 40px; height: 40px; object-fit: contain; }
.team .abbr { font-size: 17px; }
.team .rec { font-size: 12px; color: var(--muted); font-weight: 500; }
.team .score { font-size: 22px; font-weight: 800; }
.team.picked { border-color: var(--gold); background: var(--pick); box-shadow: 0 0 0 1px var(--gold); }
.team.picked::after { content: "✓ PICK"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--green); color: var(--gold); font-family: var(--label);
  font-size: 10px; padding: 1px 7px; border-radius: 99px; letter-spacing: .5px; }
.team.picked.wrong { border-color: var(--loss); }
.team.picked.wrong::after { background: var(--loss); }
.team .fav { position: absolute; top: 4px; right: 6px; font-size: 10px; color: #9a6b00; font-weight: 700; font-family: var(--label); }
@media (prefers-color-scheme: dark) { .team .fav { color: var(--gold); } }
.team:disabled { opacity: 1; cursor: default; }
.vs { align-self: center; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.2; }
.note { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.note b { color: var(--ink); }
.pickline { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin: 8px 4px 0; gap: 6px; }
.linkbtn { background: none; border: 0; color: var(--green2); padding: 0; font-size: 12px; font-weight: 600; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .linkbtn { color: var(--gold); } }

/* tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--card); }
td.name, th.name { text-align: left; position: sticky; left: 0; background: var(--card); font-weight: 600; }
tr.me td { background: var(--pick); }
tr.chalk td { color: var(--muted); font-style: italic; }
td.top { background: rgba(233, 178, 59, .35); font-weight: 800; }
.pos { color: var(--win); font-weight: 700; } .neg { color: var(--loss); font-weight: 700; }

/* rules */
.teamgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.teamgrid button { padding: 8px 2px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.teamgrid button small { font-size: 10px; font-weight: 700; }
.teamgrid button.always { background: var(--win); color: #fff; border-color: var(--win); }
.teamgrid button.never { background: var(--loss); color: #fff; border-color: var(--loss); }

/* HOF */
.trophy { display: flex; align-items: center; gap: 12px; }
.trophy .yr { font-family: var(--display); font-size: 24px; min-width: 62px; color: var(--green); }
@media (prefers-color-scheme: dark) { .trophy .yr { color: var(--gold); } }
.trophy .champ { font-weight: 700; font-size: 17px; }
.hofgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hofgrid .card { margin: 0; border-top: 4px solid var(--gold); }
.hofgrid .champ { font-family: var(--label); font-size: 18px; font-weight: 600; }

.member { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #222; color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; transition: .2s; pointer-events: none; z-index: 10; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
label.row { flex-wrap: nowrap; align-items: center; }
label.row input[type=checkbox] { width: 20px; height: 20px; flex: none; margin: 0; }

/* ---------- More menu, badges, banners ---------- */
.dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--loss); color: #fff;
  font-size: 11px; line-height: 18px; font-family: var(--label); vertical-align: top; margin-left: 2px; }
nav#tabs a span .dot { position: relative; top: -2px; }
.menuitem { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.menuitem .mi { font-size: 30px; width: 40px; text-align: center; }
.menuitem .chev { margin-left: auto; font-size: 28px; color: var(--muted); }
.banner { display: block; background: var(--pick); border: 2px solid var(--gold); color: var(--ink); text-decoration: none; }
.status { font-size: 1.05em; }
.status.todo { border: 2px solid var(--loss); }
.status.done { border: 2px solid var(--win); }
button.ghost { background: transparent; border: 2px dashed var(--line); margin: 6px 0; }
details.why summary { font-size: 14px; color: var(--green2); font-weight: 600; padding: 6px 4px 0; }
@media (prefers-color-scheme: dark) { details.why summary { color: var(--gold); } }
.team .nick { font-family: var(--label); font-size: 18px; font-weight: 700; }
.standrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 18px; }
.standrow:last-child { border-bottom: 0; }
.standrow .rank { width: 28px; text-align: center; font-family: var(--label); color: var(--muted); }
.standrow .who { flex: 1; font-weight: 600; }
.standrow .wl { font-family: var(--label); font-weight: 700; font-size: 20px; }
.standrow.me { background: var(--pick); border-radius: 10px; }

/* ---------- Easy mode: bigger everything ---------- */
body.easy { font-size: 19px; }
body.easy .small { font-size: 16px; }
body.easy h1 { font-size: 28px; }
body.easy button, body.easy .btn { font-size: 18px; padding: 13px 16px; }
body.easy button.sm, body.easy .btn.sm { font-size: 16px; padding: 10px 12px; }
body.easy input, body.easy select { font-size: 18px; padding: 14px; }
body.easy .weekbar select { font-size: 20px; }
body.easy .weekbar button { font-size: 26px; padding: 8px 18px; }
body.easy .team { min-height: 128px; border-width: 3px; }
body.easy .team img { width: 52px; height: 52px; }
body.easy .team .nick { font-size: 22px; }
body.easy .team .rec { font-size: 15px; }
body.easy .team.picked::after { font-size: 13px; padding: 2px 10px; top: -11px; }
body.easy .game .meta { font-size: 15px; }
body.easy .vs { font-size: 16px; }
body.easy .pickline { font-size: 17px; justify-content: center; text-align: center; }
body.easy .note { font-size: 16px; }
body.easy nav#tabs a { font-size: 15px; padding: 10px 2px 12px; }
body.easy nav#tabs a span { font-size: 28px; }
body.easy main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
body.easy #toast { font-size: 18px; padding: 14px 22px; bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Side bets ---------- */
.stakes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stakes button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; }
.stakes button span { font-size: 30px; line-height: 1.1; }
.stakes button small { font-size: 10px; text-transform: capitalize; line-height: 1.1; }
.stakes button.on { border: 3px solid var(--gold); background: var(--pick); }
.qty { gap: 18px; }
.qty b { font-size: 26px; min-width: 30px; text-align: center; font-family: var(--label); }
.qty button { font-size: 22px; padding: 6px 18px; }
.pickpair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.pickpair button { padding: 10px 6px; }
.betrow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.betrow:last-child { border-bottom: 0; }
.betemoji { font-size: 32px; line-height: 1; }
.betbody { flex: 1; min-width: 0; }
.big-emoji { font-size: 20px; white-space: nowrap; }
.invite { text-align: center; }
.invemoji { font-size: 64px; line-height: 1.1; }
.invgame { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 22px; margin: 12px 0; }
.status-msg { font-size: 1.1em; }

/* ---------- Welcome tour ---------- */
.tour { padding-bottom: 20px; }
.tourtop { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--gold); }
.tournav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; position: sticky; bottom: 10px; }
.tournav button { padding: 16px; font-size: 18px; }
.big-card { font-size: 1.05em; }
button.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font-weight: 400; border: 2px solid var(--line); }
button.choice .mi { font-size: 30px; }
button.choice.on { border: 3px solid var(--gold); background: var(--pick); }
.teamgrid button:disabled { opacity: .35; }
nav#tabs[hidden] { display: none; }
.teamgrid button { min-width: 0; overflow-wrap: anywhere; }
body.easy .teamgrid { grid-template-columns: repeat(3, 1fr); }
body.easy .teamgrid button { font-size: 16px; padding: 10px 4px; }
