/* Built for older eyes: big text, big buttons, high contrast, nothing hidden. */
:root {
  --ink: #111;
  --muted: #555;
  --bg: #fff;
  --panel: #f3f5f8;
  --line: #c9ced6;
  --navy: #0b2545;
  --win: #ffe14d;
  --rev: #ffd29a;
  --now: #cfe8ff;
  --live: #b00020;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--navy); }

main { max-width: 1280px; margin: 0 auto; padding: 16px; }

h1 { font-size: 30px; margin: 8px 0 16px; }
h2 { font-size: 24px; margin: 24px 0 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 2px solid var(--navy);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* Header and tabs: always visible, wrap instead of hiding. */
.site-header { background: var(--navy); color: #fff; padding: 12px 16px 14px; }
.brand { color: #fff; font-size: 26px; font-weight: 800; text-decoration: none; display: block; margin-bottom: 10px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.tab.active { background: #fff; color: var(--navy); }

/* Game header */
.game-head { text-align: center; padding: 8px 0; }
.week-label { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.matchup { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 12px 0; }
.team { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.team img { width: 72px; height: 72px; }
.team-name { font-size: 20px; font-weight: 800; border-bottom: 4px solid var(--team); padding-bottom: 2px; }
.at { font-size: 20px; color: var(--muted); }
.status { font-size: 20px; margin: 8px 0; }
.status .big-score { display: block; font-size: 32px; font-weight: 800; }
.status .detail { font-weight: 700; color: var(--muted); }
.status.live .detail { color: var(--live); }
.checking { background: #fff4d6; border: 2px solid #e0a800; border-radius: 10px; padding: 12px; font-weight: 700; }

.week-nav { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }

/* Board */
.grid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { color: var(--muted); margin: 4px 0 8px; }
@media (min-width: 900px) { .hint { display: none; } }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 2px solid var(--ink); border-radius: 6px; }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1000px; table-layout: fixed; }
.grid col.dcol { width: 40px; }
/* Row numbers stay put while the names scroll sideways on a phone. */
.grid tbody th.digit, .grid .side-labels th:nth-child(-n + 4), .grid .corner, .grid .plabel.top { position: sticky; z-index: 1; }
.grid tbody th.digit:nth-child(1), .grid .side-labels th:nth-child(1), .grid .corner { left: 0; }
.grid tbody th.digit:nth-child(2), .grid .side-labels th:nth-child(2) { left: 40px; }
.grid tbody th.digit:nth-child(3), .grid .side-labels th:nth-child(3) { left: 80px; }
.grid tbody th.digit:nth-child(4), .grid .side-labels th:nth-child(4), .grid .plabel.top { left: 120px; }
.grid th, .grid td { border: 1px solid var(--line); text-align: center; }
.grid .corner { background: var(--panel); }
.grid .plabel { background: var(--panel); font-size: 12px; font-weight: 700; padding: 2px; }
.grid .digit { font-size: 15px; font-weight: 700; padding: 2px; background: #fff; }
.grid .cur, .grid tr.cur .digit, .grid tr.cur .plabel { background: var(--navy); color: #fff; }
.grid .side-labels th { font-size: 12px; }
.grid .side-labels th { background: var(--panel); }
.grid .sq { height: 64px; padding: 4px; font-size: 15px; line-height: 1.2; vertical-align: middle; }
.grid .sq .name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.grid .sq.win { background: var(--win); outline: 3px solid #b38f00; outline-offset: -3px; }
.grid .sq.rev { background: var(--rev); }
.grid .sq.now { background: var(--now); outline: 3px dashed #1e6fc2; outline-offset: -3px; }
.badge { display: inline-block; margin: 2px 2px 0; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 800; background: var(--ink); color: #fff; }
.badge.now { background: #1e6fc2; }
.grid .sq.mine { box-shadow: inset 0 0 0 4px #1e6fc2; }
.mine-note { font-weight: 700; color: #1e6fc2; margin: 4px 0 8px; }

.updated { color: var(--muted); font-size: 16px; }

/* Winners table */
.winners { width: 100%; border-collapse: collapse; font-size: 18px; }
.winners th, .winners td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
.winners thead th { font-size: 16px; color: var(--muted); }
.winners tbody th { font-size: 20px; }
.winners tr.done td strong { background: var(--win); padding: 0 4px; }
.amount { color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); }

/* Lists */
.game-list ul { list-style: none; padding: 0; margin: 0; }
.game-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  min-height: 64px;
}
.game-row.current { background: var(--panel); border-left: 6px solid var(--navy); }
.gl-label { font-weight: 800; }
.gl-teams { grid-column: 1; display: flex; align-items: center; gap: 8px; font-size: 20px; }
.gl-state { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; color: var(--muted); }

.empty, .contact { text-align: center; padding: 32px 0; }
.contact-links { list-style: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.contact .icon { font-weight: 800; }

.site-footer { text-align: center; color: var(--muted); font-size: 15px; padding: 24px 16px 40px; }

/* Header account buttons */
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.header-top .brand { margin-bottom: 0; }
.account-buttons { display: flex; gap: 8px; }
.acct-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.acct-btn.primary, .acct-btn.active { background: #fff; color: var(--navy); }

/* Forms */
.form-page { max-width: 520px; margin: 0 auto; padding: 16px 0; }
.big-form { display: flex; flex-direction: column; gap: 18px; margin: 16px 0; }
.big-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.big-form input { font: inherit; font-size: 20px; padding: 12px; min-height: 52px; border: 2px solid var(--line); border-radius: 10px; }
.big-form input:focus { border-color: var(--navy); outline: none; }
.optional { font-weight: 400; color: var(--muted); }
.btn.primary { background: var(--navy); color: #fff; font-size: 20px; justify-content: center; }
.error { background: #fde8ea; border: 2px solid var(--live); border-radius: 10px; padding: 12px; font-weight: 700; }

/* Account */
.account { max-width: 720px; margin: 0 auto; }
.my-squares, .soon { padding-left: 20px; }
.my-squares li, .soon li { margin: 8px 0; }

/* Winners tab */
.winners-game { margin-bottom: 24px; }
.winners-game h2 a { text-decoration: none; }
.example-note { background: #eef2ff; border: 2px dashed #5561c9; border-radius: 10px; padding: 12px; font-weight: 800; }
.winners.example { opacity: 0.85; }

/* Super admin */
.admin { font-size: 16px; }
.admin h2 { margin-top: 32px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stats div { background: var(--panel); border-radius: 10px; padding: 12px 16px; }
.stats strong { font-size: 24px; display: block; }
.flash { background: #e7f6ec; border: 2px solid #2e8b57; border-radius: 10px; padding: 12px; font-weight: 700; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn.small { min-height: 36px; padding: 4px 10px; font-size: 15px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form input, .inline-form select { font: inherit; font-size: 16px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.chip-form { display: inline-flex; align-items: center; margin: 2px 4px 2px 0; }
.chip { background: #e7f6ec; border-radius: 999px; padding: 2px 10px; }
.chip.pending { background: #fff4d6; }
.chip-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.log-error td { color: var(--live); font-weight: 700; }
.log-warn td { color: #8a6100; }
.copy-box { width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 2px solid var(--navy); border-radius: 10px; }
.version { font-size: 13px; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Print page: laid out for paper on screen too, so it works even when a browser blocks printing. */
.print-bar { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--panel); }
.print-view main { max-width: 1100px; padding: 8px; }
.print-view .week-nav, .print-view .print-btn, .print-view .hint, .print-view .updated, .print-view .checking, .print-view .grid-head, .print-view .mine-note { display: none !important; }
.print-view .game-head { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 0 4px; }
.print-view .week-label { font-size: 14px; }
.print-view .matchup { margin: 0; gap: 8px; }
.print-view .team { flex-direction: row; gap: 6px; min-width: 0; }
.print-view .team img { width: 28px; height: 28px; }
.print-view .team-name, .print-view .at, .print-view .status { font-size: 13px; margin: 0; }
.print-view .status .big-score { display: inline; font-size: 13px; margin-right: 6px; }
.print-view h2 { font-size: 12px; margin: 4px 0 2px; }
.print-view .grid-wrap { overflow: visible; border: 1px solid #000; }
.print-view .grid { min-width: 0; }
.print-view .grid col.dcol { width: 26px; }
.print-view .grid th, .print-view .grid td { position: static !important; }
.print-view .grid .sq { height: 36px; font-size: 10px; padding: 1px; }
.print-view .grid .digit { font-size: 12px; }
.print-view .grid .plabel, .print-view .grid .side-labels th { font-size: 9px; }
.print-view .badge { font-size: 8px; }
.print-view .winners, .print-view .winners tbody th, .print-view .winners thead th, .print-view .amount { font-size: 10px; }
.print-view .winners th, .print-view .winners td { padding: 1px 4px; }
.print-view .winners td { white-space: nowrap; }
.print-view .amount { display: inline; margin-left: 6px; }

@media print {
  @page { size: landscape; margin: 0.25in; }
  .site-header, .site-footer, .week-nav, .print-btn, .hint, .print-bar { display: none !important; }
  main { padding: 0; max-width: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
