@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  --bg: #060a14; --panel: #0f1629; --panel2: #161f38; --line: #25304f; --text: #eef2ff; --mute: #8e9bbd;
  --win: #16a34a; --loss: #dc2626; --live: #f59e0b; --accent: #3b82f6; --gold: #fbbf24;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text); min-height: 100vh;
  background: radial-gradient(1200px 500px at 50% -120px, #1e3a8a55, transparent), var(--bg);
}
a { color: #93c5fd; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px 16px 120px; }
.wide { max-width: 1500px; }

/* header */
.hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 16px; }
.hero img.nfl { width: 52px; height: 52px; }
.hero h1 { font-family: Oswald, sans-serif; font-size: 30px; line-height: 1; margin: 0; letter-spacing: .5px; text-transform: uppercase; }
.hero .sub { color: var(--mute); font-size: 14px; margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); }
.chip.gold { background: #fbbf2422; border-color: #fbbf2466; color: var(--gold); }
.chip.red { background: #dc262622; border-color: #dc262666; color: #fca5a5; }
.chip.green { background: #16a34a22; border-color: #16a34a66; color: #86efac; }
.nav { display: flex; gap: 8px; margin-left: auto; }
.nav a { text-decoration: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.panel h2 { font-family: Oswald, sans-serif; text-transform: uppercase; font-size: 18px; margin: 0 0 10px; letter-spacing: .5px; }
.muted { color: var(--mute); }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.field label { font-size: 12px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .6px; }
input[type=text], input[type=number], input[type=password], select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font-size: 17px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; background: var(--panel2); border: 1px solid var(--line); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn.primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #3b82f6; color: #fff; }
.btn.go { background: linear-gradient(135deg, #16a34a, #15803d); border-color: #22c55e; color: #fff; font-size: 18px; padding: 15px 22px; }
.btn.danger { color: #fca5a5; }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* pick cards */
.games { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .games { grid-template-columns: 1fr 1fr; } }
.game { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 10px; position: relative; }
.game.done { border-color: #22c55e55; }
.game.tb { grid-column: 1 / -1; border: 2px solid var(--gold); box-shadow: 0 0 0 4px #fbbf2418; }
.gmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); font-weight: 600; padding: 2px 6px 8px; letter-spacing: .3px; }
.gmeta .lk { color: #fca5a5; }
.gteams { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: stretch; }
.at { display: flex; align-items: center; justify-content: center; font-family: Oswald, sans-serif; font-size: 20px; color: var(--mute); }
.team {
  position: relative; border: 2px solid var(--line); background: var(--panel2); border-radius: 14px; padding: 12px 8px 10px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 128px;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s; overflow: hidden;
}
.team:active { transform: scale(.97); }
.team img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 6px #0008); position: relative; }
.team b { font-family: Oswald, sans-serif; font-size: 19px; text-transform: uppercase; letter-spacing: .4px; line-height: 1.05; position: relative; }
.team small { font-size: 12px; color: var(--mute); position: relative; }
.team .ha { position: absolute; top: 6px; left: 8px; font-size: 10px; font-weight: 800; color: var(--mute); letter-spacing: .8px; }
.team::before { content: ''; position: absolute; inset: 0; background: linear-gradient(145deg, var(--tc), color-mix(in srgb, var(--tc) 55%, #000)); opacity: 0; transition: opacity .15s; }
.team.on { border-color: var(--ta); box-shadow: 0 0 0 2px var(--ta), 0 8px 24px color-mix(in srgb, var(--tc) 50%, transparent); }
.team.on::before { opacity: 1; }
.team.on small, .team.on .ha { color: #fffc; }
.team.on::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #111; font-weight: 900; font-size: 15px; display: grid; place-items: center; }
.team.off { opacity: .42; }
/* Logo watermark behind a centered team name, tinted with the club color. */
.team { justify-content: center; background: linear-gradient(145deg, color-mix(in srgb, var(--tc) 28%, var(--panel2)), var(--panel2) 75%); }
.team .bg { position: absolute; inset: -12% -8%; background: center / contain no-repeat; opacity: .32; transform: rotate(-10deg); transition: opacity .15s, transform .2s; pointer-events: none; }
.team.on .bg { opacity: .5; transform: rotate(-10deg) scale(1.08); }
.team b { font-size: 22px; text-shadow: 0 2px 10px #000, 0 0 2px #000; z-index: 1; }
.team .ha { z-index: 1; }
.team.on::after { z-index: 2; }
@media (max-width: 520px) { .team b { font-size: 19px; } }
.team:disabled { cursor: not-allowed; }
.tbbox { margin: 10px 4px 2px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #fbbf2412; border-radius: 12px; padding: 12px; }
.tbbox .lbl { flex: 1; min-width: 180px; }
.tbbox .lbl b { color: var(--gold); font-family: Oswald, sans-serif; letter-spacing: .5px; font-size: 16px; }
.tbbox .lbl div { font-size: 13px; color: var(--mute); margin-top: 2px; }
.tbbox input { width: 120px; font-size: 24px; font-weight: 800; text-align: center; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #060a14ee; backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 20; }
.bar .in { max-width: 980px; margin: 0 auto; display: flex; gap: 14px; align-items: center; }
.prog { flex: 1; }
.prog .t { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.prog .track { height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; }
.prog .fill { height: 100%; background: linear-gradient(90deg, #22c55e, #86efac); width: 0; transition: width .2s; }

.banner { padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; font-weight: 600; }
.banner.info { background: #1d4ed822; border: 1px solid #3b82f655; }
.banner.warn { background: #f59e0b1a; border: 1px solid #f59e0b55; color: #fde68a; }
.banner.ok { background: #16a34a1f; border: 1px solid #22c55e66; color: #bbf7d0; }

/* summary */
.sumlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sumlist div { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: 14px; }
.sumlist img { width: 26px; height: 26px; }

/* board */
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.sg { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 128px; font-size: 13px; }
.sg.live { border-color: var(--live); box-shadow: 0 0 0 1px #f59e0b55; }
.sg .t { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.sg .t img { width: 20px; height: 20px; }
.sg .t b { margin-left: auto; }
.sg .t.lead b { color: #fff; }
.sg .t.trail { color: var(--mute); }
.sg .s { font-size: 11px; color: var(--mute); margin-top: 3px; font-weight: 600; }
.sg.live .s { color: var(--live); }

.gridwrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; max-height: 78vh; background: var(--panel); }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 6px; text-align: center; white-space: nowrap; }
.grid thead th { position: sticky; top: 0; background: #111a30; z-index: 2; vertical-align: bottom; }
.grid .rk { color: var(--mute); width: 30px; }
.grid .nm { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; font-weight: 700; min-width: 110px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); }
.grid thead .nm { z-index: 3; background: #111a30; }
.grid .num { font-weight: 800; font-size: 15px; min-width: 38px; }
.grid .num small { display: block; font-size: 10px; font-weight: 700; color: var(--mute); }
.grid .num small.up { color: #fcd34d; }
.grid .w { color: #86efac; }
.gh { display: flex; flex-direction: column; gap: 2px; align-items: stretch; min-width: 62px; position: relative; }
.gh-t { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.gh-t img { width: 16px; height: 16px; }
.gh-t b { margin-left: auto; color: var(--mute); }
.gh-t b.lead { color: #fff; }
.gs { font-size: 10px; color: var(--mute); font-weight: 600; margin-top: 2px; }
.gs.live { color: var(--live); }
.tbcol { background: #fbbf2410 !important; }
.tbtag { position: absolute; top: -4px; right: -4px; background: var(--gold); color: #111; font-size: 9px; font-weight: 900; padding: 1px 4px; border-radius: 4px; }
.pc img { width: 24px; height: 24px; display: block; margin: 0 auto; }
.pc span { font-size: 10px; font-weight: 800; display: block; opacity: .85; }
.pc.win { background: #16a34a40; }
.pc.loss { background: #dc262630; }
.pc.loss img { opacity: .45; filter: grayscale(.8); }
.pc.winning { background: #f59e0b30; box-shadow: inset 0 -3px 0 #22c55e; }
.pc.losing { background: #dc26261a; box-shadow: inset 0 -3px 0 #dc2626; }
.pc.tied { background: #f59e0b1a; }
.pc.hid, .pc.none { color: var(--mute); }
.grid tbody tr:hover td, .grid tbody tr:hover th { background-color: #1b2646; }

.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat .k { font-size: 11px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: .8px; }
.stat .v { font-family: Oswald, sans-serif; font-size: 26px; margin-top: 2px; }
.stat .v small { font-family: Inter; font-size: 13px; color: var(--mute); }
.stat.win { border-color: var(--gold); background: linear-gradient(135deg, #fbbf2422, var(--panel)); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mute); margin: 8px 2px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.weeknav { display: flex; align-items: center; gap: 6px; }
.names { display: flex; flex-wrap: wrap; gap: 8px; }

/* admin */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th, .list td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.list th { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: .6px; }
.toggle { width: 46px; height: 26px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); position: relative; cursor: pointer; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--mute); transition: left .15s; }
.toggle.on { background: #16a34a; border-color: #22c55e; }
.toggle.on::after { left: 22px; background: #fff; }
textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; color: inherit; min-height: 90px; }

#toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 30px); background: #16a34a; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; transition: .2s; z-index: 50; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #dc2626; }
.spin { text-align: center; padding: 60px 0; color: var(--mute); }
@media (max-width: 520px) {
  .hero .nav { width: 100%; margin-left: 0; }
  .hero img.nfl { width: 40px; height: 40px; }
  .hero h1 { font-size: 24px; }
  .team { min-height: 118px; }
  .team img { width: 50px; height: 50px; }
  .team b { font-size: 16px; }
}

/* admin v4 */
.linkbox { font-family: ui-monospace, Menlo, monospace; font-size: 20px; font-weight: 700; padding: 14px 16px; background: var(--bg); border: 2px dashed #3b82f6; border-radius: 12px; word-break: break-all; color: #bfdbfe; user-select: all; }
.gridwrap.fitted { max-height: none; overflow: hidden; }
details.panel summary { cursor: pointer; font-size: 15px; }

/* games-down layout */
.gridT .gl { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; border-right: 1px solid var(--line); }
.gridT thead .gl { z-index: 3; background: #111a30; }
.gridT .pn { vertical-align: bottom; padding: 8px 4px; min-width: 40px; }
.gridT .pn span { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: 13px; white-space: nowrap; max-height: 130px; overflow: hidden; text-overflow: ellipsis; }
.glg { display: flex; flex-direction: column; gap: 2px; min-width: 92px; }
.glg .gt { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12px; }
.glg .gt img { width: 18px; height: 18px; }
.glg .gt b { margin-left: auto; color: var(--mute); }
.glg .gt b.lead { color: #fff; }
.gridT .pc img { width: 28px; height: 28px; }
.gridT .tbrow td, .gridT .tbrow th { background-color: #fbbf2412; }
.gridT .sumrow td, .gridT .sumrow th { font-weight: 800; background: #111a30; }
.gridT .tbsum td { color: var(--gold); font-size: 15px; }

/* ---- v6: mobile polish ---- */
html { -webkit-tap-highlight-color: transparent; }
button, .btn, .team, a { touch-action: manipulation; }
body.noscroll { overflow: hidden; }
.small { font-size: 13px; }
.block { display: flex; width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { min-height: 44px; }
.btn.sm { min-height: 36px; }
.banner.big { font-size: 18px; }
.err { background: #dc262622; border: 1px solid #dc262688; color: #fecaca; border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-weight: 600; }
.where { font-size: 12px; font-weight: 700; color: #93c5fd; padding: 0 6px 8px; margin-top: -4px; }
.needpick { display: none; text-align: center; color: #fca5a5; font-weight: 800; font-size: 13px; padding-top: 8px; }
.game.missing { border: 2px solid #ef4444; box-shadow: 0 0 0 4px #ef444426; animation: shake .35s; }
.game.missing .needpick { display: block; }
.game.tb.missing .needpick { display: none; }
.game.tb.missing .tbbox { outline: 2px solid #ef4444; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tbbox input { font-size: 26px; }
.tbline { font-size: 16px; margin: 14px 0 6px; }
.tbline b { color: var(--gold); font-size: 20px; }
.sumlist div { background: linear-gradient(135deg, color-mix(in srgb, var(--tc, #334155) 35%, var(--panel2)), var(--panel2)); }

/* confirm sheet */
.sheet { position: fixed; inset: 0; background: #000a; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 520px; animation: up .2s ease-out; }
.sheet-card h2 { font-family: Oswald, sans-serif; text-transform: uppercase; margin: 0 0 12px; font-size: 22px; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* admin */
.weekbar { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; margin-bottom: 14px; }
.weekbar .btn { font-size: 22px; padding: 0; }
.weekbar select { font-weight: 800; font-size: 18px; text-align: center; text-align-last: center; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.pinfo span { font-size: 12px; }
.paid { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--mute); font-weight: 700; text-transform: uppercase; }
.linkbox { font-size: 18px; }
@media (max-width: 520px) {
  .wrap { padding: 12px 12px 110px; }
  .panel { padding: 14px 12px; }
  .gridT .pn { min-width: 34px; }
  .gridT .pc img { width: 24px; height: 24px; }
  .bar .btn.go { padding: 14px 20px; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

/* pot card (public) */
.potcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(135deg, #fbbf2433, #f59e0b14 60%, var(--panel)); border: 1px solid #fbbf2466; }
.potcard .k { font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #fde68a; }
.potcard .v { font-family: Oswald, sans-serif; font-size: 40px; line-height: 1; color: var(--gold); margin-top: 4px; text-shadow: 0 2px 16px #fbbf2455; }
.potr { text-align: right; font-size: 14px; font-weight: 600; line-height: 1.5; }
.potr b { font-size: 20px; color: #fff; }
.potr span { color: var(--mute); font-size: 13px; }
.btn.danger.armed { background: #dc2626; border-color: #ef4444; color: #fff; }

/* ---- v7: admin home tabs + all weeks ---- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tabs[hidden] { display: none; }
.tabs button { border: 0; background: transparent; border-radius: 10px; min-height: 44px; font-weight: 800; font-size: 15px; color: var(--mute); cursor: pointer; }
.tabs button.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.wk { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; scroll-margin-top: 12px; }
.wk.now { border: 2px solid var(--gold); box-shadow: 0 0 0 4px #fbbf2414; }
.wk.done { opacity: .6; }
.wk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-top b { font-family: Oswald, sans-serif; font-size: 20px; text-transform: uppercase; letter-spacing: .4px; display: inline-flex; align-items: center; }
.wk-meta { font-size: 13px; color: var(--mute); margin-top: 3px; }
.wk-link { font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 700; color: #bfdbfe; margin-top: 8px; word-break: break-all; user-select: all; }
.wk-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.tag { font-family: Inter, sans-serif; font-size: 10px; font-weight: 900; letter-spacing: .8px; padding: 3px 7px; border-radius: 6px; background: var(--gold); color: #111; margin-left: 8px; }
