@font-face { font-family: "Graduate"; src: url("/fonts/graduate.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/fonts/oswald-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/fonts/oswald-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Turkey Bowl look: charcoal + blaze orange + cream, varsity type, field backdrop */
:root {
  --bg: #0b0b0b;
  --surface: rgba(24, 23, 22, .94);
  --surface-2: #2a2724;
  --border: #3b3632;
  --text: #f6efe2;
  --muted: #b0a698;
  --accent: #f47b20;
  --accent-2: #e2601a;
  --accent-ink: #120a03;
  --accent-soft: rgba(244, 123, 32, .16);
  --live: #ff3b30;
  --ok: #34d058;
  --ok-soft: rgba(52, 208, 88, .15);
  --warn: #ffc53d;
  --warn-soft: rgba(255, 197, 61, .15);
  --bad: #ff5a4f;
  --bad-soft: rgba(255, 90, 79, .16);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --varsity: "Graduate", "Rockwell", Georgia, serif;
  --mono: "Oswald", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg) url("/img/field.webp") center bottom / cover fixed no-repeat; color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8,8,8,.97) 0%, rgba(8,8,8,.9) 55%, rgba(8,8,8,.55) 100%); pointer-events: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* header */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); font-size: 1.1rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1rem; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 6px; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.conn.on { background: var(--ok); }
.conn.off { background: var(--bad); }
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; padding: 8px 16px; }
  .nav { order: 3; flex-basis: 100%; }
}

.announce { max-width: 1200px; margin: 10px auto 0; padding: 0 16px; display: grid; gap: 6px; }
.announce div { padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--border); font-weight: 500; }
.announce .warning { background: var(--warn-soft); }
.announce .urgent { background: var(--bad-soft); color: var(--bad); font-weight: 700; }

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

/* primitives */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; }
.section-title h2 { margin: 0; }

button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; text-decoration: none; }
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad); filter: brightness(1.1); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 14px 18px; min-height: 56px; font-size: 1.1rem; }
.btn-ghost { background: transparent; border-color: transparent; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%; min-height: 40px; }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
input[type=color] { padding: 2px; width: 56px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.badge.live { background: var(--live); color: #fff; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.badge.final { background: var(--text); color: var(--bg); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* game cards */
.game-card { display: block; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.game-card:hover { text-decoration: none; border-color: var(--accent); }
.game-card.is-live { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.gc-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.gc-team { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.gc-team .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-team .name.tbd { color: var(--muted); font-weight: 500; font-style: italic; }
.gc-team .score { font-family: var(--mono); font-weight: 800; font-size: 1.25rem; min-width: 2ch; text-align: right; }
.gc-team.winner .name { color: var(--text); }
.gc-team.loser { opacity: .55; }
.gc-clock { font-family: var(--mono); font-weight: 700; color: var(--live); }

/* scoreboard */
.scoreboard { background: #111; color: #fff; border-radius: 16px; padding: 18px; text-align: center; }
.sb-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.sb-team .nm { font-size: clamp(1rem, 3.5vw, 1.6rem); font-weight: 800; }
.sb-team .sc { font-family: var(--mono); font-size: clamp(3rem, 14vw, 6rem); font-weight: 800; line-height: 1; }
.sb-team .bar { height: 6px; border-radius: 3px; margin: 6px auto; width: 60%; }
.sb-team .to { font-size: .8rem; opacity: .75; }
.sb-mid { min-width: 110px; }
.sb-clock { font-family: var(--mono); font-size: clamp(2rem, 9vw, 3.6rem); font-weight: 800; color: #fbbf24; }
.sb-clock.stopped { color: #f87171; }
.sb-period { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.poss::after { content: " \1F3C8"; }

.pbp { list-style: none; padding: 0; margin: 0; }
.pbp li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: baseline; }
.pbp li.voided { text-decoration: line-through; opacity: .5; }
.pbp .t { font-family: var(--mono); font-size: .8rem; color: var(--muted); min-width: 64px; }
.pbp .pts { font-weight: 800; color: var(--accent); }
.pbp .disc { color: var(--bad); font-weight: 700; }

/* bracket */
.bracket { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 12px; }
.b-round { display: flex; flex-direction: column; justify-content: space-around; min-width: 220px; gap: 14px; }
.b-round h3 { text-align: center; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }

/* ref zone */
.ref-wrap { max-width: 860px; margin: 0 auto; }
.ref-clock { font-family: var(--mono); font-size: clamp(3.5rem, 18vw, 7rem); font-weight: 800; text-align: center; line-height: 1; padding: 8px 0; }
.ref-clock.running { color: var(--ok); }
.ref-clock.stopped { color: var(--bad); }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ref-side { border-top: 5px solid var(--border); }
.ref-side .sc { font-family: var(--mono); font-size: 3rem; font-weight: 800; text-align: center; line-height: 1; }
.ref-side .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.ref-side .btns button { min-height: 52px; font-size: 1rem; }
.big-toggle { width: 100%; min-height: 72px; font-size: 1.4rem; }
.player-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; }
.player-pick button { justify-content: flex-start; text-align: left; }
.player-pick button.banned { opacity: .4; text-decoration: line-through; }
.alert-flash { position: fixed; inset: 0; pointer-events: none; animation: flash .8s 3; background: rgba(220, 38, 38, .25); z-index: 50; }
@keyframes flash { 50% { opacity: 0; } }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 10px 12px; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.gallery figcaption { font-size: .8rem; color: var(--muted); padding: 3px 2px; }
.gallery .del { position: absolute; top: 6px; right: 6px; }
.team-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; background: var(--surface-2); flex: none; }
.team-head { display: flex; gap: 14px; align-items: center; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--text); border-radius: 16px; padding: 18px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.toast.error { background: var(--bad); color: #fff; }
.toast.score { background: var(--accent); color: var(--accent-ink); }

/* TV mode */
body.tv .topbar, body.tv .announce { display: none; }
body.tv main { max-width: none; padding: 20px; }
.tv-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); }
.tv-ticker { font-size: 1.4rem; font-weight: 700; padding: 12px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); text-align: center; }

.qr-box { text-align: center; }
.qr-box img { width: min(280px, 100%); background: #fff; padding: 10px; border-radius: 12px; }
.waiver-text { white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 10px; max-height: 300px; overflow-y: auto; font-size: .9rem; }

@media print {
  .topbar, .announce, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- phone-first refinements ---------- */
html { -webkit-tap-highlight-color: transparent; }
button, .btn, a.btn { touch-action: manipulation; }       /* no double-tap zoom delay */
input, select, textarea { font-size: 16px; }              /* stops iOS zoom on focus */
.bottomnav { display: none; }
@media (max-width: 720px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding-top: calc(8px + env(safe-area-inset-top)); }
  .nav { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: .7rem; font-weight: 600; color: var(--muted); min-height: 56px; justify-content: center; }
  .bottomnav a .ic { font-size: 1.3rem; line-height: 1; }
  .bottomnav a.active { color: var(--accent); }
  .bottomnav a:hover { text-decoration: none; }
  main { padding: 12px 12px 24px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .btn-sm { min-height: 38px; padding: 6px 12px; }
  th, td { padding: 8px 6px; }
  .tabs button { padding: 12px 10px; }
  .ref-side .btns button { min-height: 56px; font-size: .95rem; padding: 6px; }
  .ref-side .sc { font-size: 2.6rem; }
  .ref-grid { gap: 8px; }
  .modal-back { align-items: end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; width: 100%; max-height: 88vh; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .modal .actions button { flex: 1; min-height: 48px; }
  .player-pick { grid-template-columns: 1fr 1fr; }
  .player-pick button { min-height: 52px; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tv-grid { grid-template-columns: 1fr; }
  .bracket { scroll-snap-type: x mandatory; }
  .b-round { min-width: 82vw; scroll-snap-align: start; }
  .userbox .btn-sm { font-size: .8rem; }
}
/* more sheet (bottom nav "More") */
.more-list a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); }
body.tv .bottomnav { display: none; }
body.tv { padding-bottom: 0; }

/* grid children shouldn't inherit the stacked-card top margin */
.grid > .card + .card, .ref-grid > .card + .card { margin-top: 0; }
.sb-teams { align-items: end; }
.sb-team .nm { min-height: 2.5em; display: flex; align-items: flex-end; justify-content: center; line-height: 1.15; }
@media (max-width: 720px) { .ref-side .btns button { font-size: .9rem; } }

/* ================= Turkey Bowl theme layer ================= */
.topbar { background: rgba(10, 10, 10, .96); border-bottom: 3px solid var(--accent); }
.brand { font-family: var(--varsity); font-weight: 400; letter-spacing: .02em; font-size: 1.25rem; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: #111 url("/img/turkey.png") center / cover; border: 2px solid var(--accent); font-size: 0; }
.nav a { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.nav a.active { background: var(--accent); color: var(--accent-ink); }
button, .btn { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.btn-primary { color: var(--accent-ink); font-weight: 700; }
.badge { font-family: var(--display); font-weight: 500; letter-spacing: .06em; }
.section-title h2 { font-size: 1.15rem; border-left: 5px solid var(--accent); padding-left: 10px; }
th { font-family: var(--display); }

.hero { text-align: center; margin: -4px 0 6px; }
.hero img { width: min(640px, 100%); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.6)); border-radius: 8px; }
.hero .meta { font-family: var(--display); text-transform: uppercase; letter-spacing: .3em; font-size: .95rem; color: var(--text); margin-top: 6px; }
.page-title { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .25em; text-align: center; font-size: clamp(1.4rem, 6vw, 2.2rem); margin: 6px 0 14px; text-shadow: 0 2px 8px #000; }

/* game cards: dark tile with orange header strip */
.game-card { padding: 0; overflow: hidden; background: rgba(18,17,16,.95); }
.game-card .gc-head { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); margin: 0; padding: 6px 12px; font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.game-card .gc-head .badge { background: rgba(0,0,0,.75); color: #fff; }
.game-card .gc-head .badge.live { background: var(--live); }
.game-card .gc-head .gc-clock { color: var(--accent-ink); }
.game-card .gc-team { padding: 6px 12px; }
.game-card .gc-team + .gc-team { border-top: 1px solid var(--border); }
.game-card .gc-team .name { font-family: var(--display); text-transform: uppercase; letter-spacing: .03em; font-weight: 500; font-size: 1.05rem; }
.game-card .gc-down { padding: 4px 12px 8px; font-family: var(--display); font-size: .8rem; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.game-card.is-live { border-color: var(--live); }

/* ---------- schedule grid (like the poster) ---------- */
.sched-wrap { border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.85); box-shadow: var(--shadow); background: rgba(14,14,14,.94); }
.sched { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sched th { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #fff; font-family: var(--display); font-weight: 700; font-size: clamp(.8rem, 3.6vw, 1.25rem); letter-spacing: .04em; text-align: center; padding: 10px 4px; border: 1px solid rgba(255,255,255,.75); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.sched td { border: 1px solid rgba(255,255,255,.75); text-align: center; padding: 8px 4px; vertical-align: middle; }
.sched td.slot { font-family: var(--display); font-weight: 700; font-size: clamp(.85rem, 3.8vw, 1.35rem); text-transform: uppercase; line-height: 1.1; }
.sched td.time { font-family: var(--display); font-weight: 500; font-size: clamp(.8rem, 3.6vw, 1.25rem); }
.sched td.time small { font-size: .7em; }
.sched td.mu a { display: block; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 500; font-size: clamp(.78rem, 3.5vw, 1.2rem); line-height: 1.15; text-transform: none; }
.sched td.mu .vs { display: block; font-size: .75em; color: var(--muted); font-weight: 500; }
.sched td.mu .sc { display: block; margin-top: 4px; font-size: .8em; color: var(--accent); font-weight: 700; }
.sched td.mu .sc.live { color: var(--live); }
.sched td.mu .w { color: var(--accent); }
.sched td.mu.mine { background: var(--accent-soft); }
.sched td.empty-cell { color: var(--muted); font-size: 1.4rem; }
.sched col.c-slot { width: 17%; } .sched col.c-time { width: 16%; }

/* ---------- CFP-style bracket ---------- */
.cfp { background: linear-gradient(180deg, #161514, #0c0c0c); border: 1px solid #2c2925; border-radius: 14px; padding: 14px 14px 10px; box-shadow: var(--shadow); }
.cfp-title { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; text-align: center; font-size: clamp(1rem, 4.5vw, 1.5rem); margin: 0 0 12px; }
.cfp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.cfp-grid { display: flex; gap: 0; min-width: max-content; }
.cfp-round { display: flex; flex-direction: column; width: var(--mw, 190px); margin-right: 34px; }
.cfp-round:last-child { margin-right: 0; }
.cfp-slot { flex: 1; display: flex; align-items: center; position: relative; padding: 18px 0 6px; }
.cfp-match { width: 100%; position: relative; display: block; color: inherit; text-decoration: none; background: #0f0f0f; border: 1.5px solid #8a8580; border-radius: 4px; }
.cfp-match:hover { text-decoration: none; border-color: var(--accent); }
.cfp-match.live { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.cfp-team { display: flex; align-items: stretch; height: 30px; }
.cfp-team + .cfp-team { border-top: 1.5px solid #8a8580; }
.cfp-seed { width: 26px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .85rem; background: #1d4ed8; color: #fff; }
.cfp-name { flex: 1; display: flex; align-items: center; padding: 0 8px; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fff; }
.cfp-name.tbd { color: #8f8a84; font-weight: 500; font-style: italic; text-transform: none; }
.cfp-score { min-width: 30px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: rgba(0,0,0,.35); color: #fff; }
.cfp-team.won .cfp-score { color: var(--accent); }
.cfp-team.lost { opacity: .5; }
.cfp-meta { position: absolute; top: -15px; left: 2px; font-family: var(--display); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.cfp-meta .lv { color: var(--live); font-weight: 700; }
/* connectors */
.cfp-round:not(.last) .cfp-slot::after { content: ""; position: absolute; right: -17px; width: 17px; top: 50%; border-top: 1.5px solid #8a8580; }
.cfp-round:not(.last) .cfp-slot.even::before { content: ""; position: absolute; right: -17px; top: 50%; bottom: 0; border-right: 1.5px solid #8a8580; }
.cfp-round:not(.last) .cfp-slot.odd::before { content: ""; position: absolute; right: -17px; top: 0; bottom: 50%; border-right: 1.5px solid #8a8580; }
.cfp-round:not(.first) .cfp-match::before { content: ""; position: absolute; left: -19px; width: 17px; top: 50%; border-top: 1.5px solid #8a8580; }
.cfp-labels { display: flex; min-width: max-content; margin-top: 4px; }
.cfp-labels div { width: var(--mw, 190px); margin-right: 34px; text-align: center; font-family: var(--display); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #d8d2c8; line-height: 1.2; }
.cfp-labels div small { display: block; color: var(--muted); font-weight: 500; }
.cfp-champ { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 150px; margin-left: 24px; text-align: center; }
.cfp-champ .trophy { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 0 18px rgba(244,123,32,.55)); }
.cfp-champ .lbl { font-family: var(--varsity); color: var(--accent); font-size: .95rem; margin-top: 6px; text-transform: uppercase; }
.cfp-champ .who { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.1rem; margin-top: 4px; }
.cfp-hint { text-align: center; font-size: .75rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) {
  .cfp { padding: 12px 8px 8px; margin: 0 -4px; }
  .cfp-round, .cfp-labels div { --mw: 150px; margin-right: 26px; }
  .cfp-round:not(.last) .cfp-slot::after, .cfp-round:not(.last) .cfp-slot.even::before, .cfp-round:not(.last) .cfp-slot.odd::before { right: -13px; }
  .cfp-round:not(.last) .cfp-slot::after { width: 13px; }
  .cfp-round:not(.first) .cfp-match::before { left: -15px; width: 13px; }
  .cfp-name { font-size: .8rem; padding: 0 6px; }
  .cfp-champ { width: 110px; margin-left: 16px; }
  .cfp-champ .trophy { font-size: 3.2rem; }
}

/* ---------- ref field mode (full screen, giant controls) ---------- */
body.refmode .topbar, body.refmode .announce, body.refmode .bottomnav { display: none !important; }
body.refmode { padding-bottom: 0 !important; }
body.refmode main { padding: 0 0 40px; max-width: 760px; }
.rf-top { position: sticky; top: 0; z-index: 25; background: #0a0a0a; border-bottom: 3px solid var(--accent); padding: calc(6px + env(safe-area-inset-top)) 10px 10px; }
.rf-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-family: var(--display); text-transform: uppercase; font-size: .8rem; color: var(--muted); letter-spacing: .05em; }
.rf-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin-top: 4px; }
.rf-team { text-align: center; min-width: 0; }
.rf-team .n { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(.8rem, 3.8vw, 1.1rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 4px solid var(--c, #555); padding-bottom: 2px; }
.rf-team .s { font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 13vw, 4.5rem); line-height: 1; margin-top: 2px; }
.rf-team .to { font-size: .7rem; color: var(--muted); font-family: var(--display); letter-spacing: .05em; }
.rf-team.poss .n::after { content: " 🏈"; }
.rf-clock { font-family: var(--display); font-weight: 700; font-size: clamp(3.6rem, 22vw, 7.5rem); line-height: .95; text-align: center; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.rf-clock.running, .rf-clock:not(.stopped) { color: #fff; }
.rf-clock.stopped { color: var(--warn); }
.rf-per { text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; color: var(--muted); }
.rf-down { text-align: center; font-family: var(--display); text-transform: uppercase; font-weight: 700; font-size: 1.05rem; color: var(--accent); letter-spacing: .05em; min-height: 1.3em; }
.rf-go { width: 100%; min-height: 84px; font-size: 1.7rem; font-weight: 700; margin-top: 8px; border-radius: 14px; letter-spacing: .08em; }
.rf-go.start { background: var(--ok); border-color: var(--ok); color: #04210c; }
.rf-go.stop { background: var(--live); border-color: var(--live); color: #fff; }
.rf-body { padding: 10px; }
.rf-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.rf-sec h3 { font-size: .85rem; color: var(--muted); margin: 0 0 8px; letter-spacing: .1em; }
.rf-row { display: grid; gap: 8px; }
.rf-row.c2 { grid-template-columns: 1fr 1fr; } .rf-row.c3 { grid-template-columns: repeat(3, 1fr); } .rf-row.c4 { grid-template-columns: repeat(4, 1fr); } .rf-row.c5 { grid-template-columns: repeat(5, 1fr); }
.rf-row button { min-height: 58px; font-size: 1.05rem; padding: 6px 4px; }
.rf-row button.big { min-height: 70px; font-size: 1.25rem; }
.rf-row button.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.rf-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rf-side { background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--c, #555); border-radius: 12px; padding: 8px; }
.rf-side .hdr { font-family: var(--display); font-weight: 700; text-transform: uppercase; text-align: center; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.rf-side .g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rf-side .g button { min-height: 60px; font-size: 1.05rem; padding: 4px; }
.rf-side .g .td { grid-column: span 2; min-height: 72px; font-size: 1.45rem; }
.rf-fine { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.rf-fine button { min-height: 44px; flex: 1; }

/* QR full-screen */
.qr-full { text-align: center; }
.qr-full img { width: min(86vw, 420px); background: #fff; padding: 12px; border-radius: 14px; }
.qr-full .code { font-family: var(--display); font-size: 2rem; letter-spacing: .3em; font-weight: 700; color: var(--accent); margin-top: 8px; }
.rf-team.poss::after { content: none; }
.rf-score { align-items: start; }
.sched td.slot { word-break: break-word; hyphens: auto; }
/* position checkboxes: big tappable chips */
.checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chk { margin: 0; }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--border); border-radius: 10px; font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; background: var(--surface-2); }
.chk input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chk input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge.pos { background: var(--accent-soft); color: var(--accent); }
.badge.coach { background: #1d4ed8; color: #fff; }
@media (max-width: 380px) { .checks { grid-template-columns: repeat(2, 1fr); } }
