@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&display=swap');
:root{
  --bg:#F3F5F7; --surface:#FFFFFF; --surface-2:#EEF1F4; --ink:#0F1B22; --muted:#66757F; --line:#E2E7EB;
  --accent:#0E7C86; --accent-ink:#FFFFFF; --accent-soft:#E2F3F4; --good:#1E8E5A; --good-soft:#E3F4EB;
  --warn:#B7791F; --bad:#C2414F; --bad-soft:#FBE9EB; --live:#E0303F;
  --font:-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',Roboto,system-ui,sans-serif;
  --num:'Barlow Condensed','SF Pro Display',-apple-system,system-ui,sans-serif;
  --r:16px; --r-sm:12px; --tab-h:64px; color-scheme:light;
}
@media (prefers-color-scheme:dark){:root{
  --bg:#0F171C; --surface:#172229; --surface-2:#1E2C34; --ink:#E7EEF2; --muted:#8FA0AA; --line:#24343D;
  --accent:#45B8C1; --accent-ink:#06262A; --accent-soft:#16363B; --good:#4CC489; --good-soft:#153126;
  --warn:#E0A33A; --bad:#EF6B79; --bad-soft:#3A1D22; --live:#FF5A66; color-scheme:dark}}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.45 var(--font);-webkit-font-smoothing:antialiased;
  padding-bottom:calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px)}
a{color:var(--accent);text-decoration:none}
h1,h2,h3,h4{margin:0}
.muted{color:var(--muted)} .small{font-size:14px} .bad{color:var(--bad)} .good{color:var(--good)} .warn{color:var(--warn)} .center{text-align:center}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* app bar */
.appbar{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 86%,transparent);backdrop-filter:saturate(1.6) blur(18px);-webkit-backdrop-filter:saturate(1.6) blur(18px);
  padding-top:env(safe-area-inset-top);border-bottom:1px solid transparent}
.appbar-in{max-width:760px;margin:0 auto;display:flex;align-items:center;gap:8px;padding:12px 16px 10px}
.title{font-size:28px;font-weight:700;letter-spacing:-.02em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.appbar-right{display:flex;align-items:center;gap:8px}
.iconbtn{width:40px;height:40px;border-radius:50%;border:0;background:var(--surface);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 0 0 1px var(--line) inset}
.iconbtn:disabled{opacity:.6}
.iconbtn.spin svg{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.pulse{font-size:13px;font-weight:600;padding:6px 10px 6px 22px;border-radius:999px;position:relative;white-space:nowrap}
.pulse::before{content:"";position:absolute;left:10px;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%}
.pulse.on{background:var(--good-soft);color:var(--good)} .pulse.on::before{background:var(--good);box-shadow:0 0 0 0 var(--good);animation:ping 2.4s infinite}
.pulse.off{background:var(--bad-soft);color:var(--bad)} .pulse.off::before{background:var(--bad)}
@keyframes ping{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--good) 60%,transparent)}70%{box-shadow:0 0 0 7px transparent}100%{box-shadow:0 0 0 0 transparent}}

/* layout */
.page{max-width:760px;margin:0 auto;padding:6px 16px 0}
.section{font-size:13px;font-weight:600;color:var(--muted);text-transform:none;letter-spacing:.01em;margin:22px 4px 8px}
.section small{font-weight:500;margin-left:4px}
.card{background:var(--surface);border-radius:var(--r);padding:14px 16px;margin-bottom:10px;border:1px solid var(--line)}
.card.flush{padding:0;overflow:hidden}
.stackcards .card{margin-bottom:12px}
.eyebrow{font-size:12px;color:var(--muted);font-weight:500}
.meta{font-size:13px;color:var(--muted);margin-top:6px}
.hint{font-size:13px;color:var(--muted);margin:8px 4px}
.toast{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top) + 64px);z-index:40;max-width:min(92vw,520px);
  background:var(--ink);color:var(--bg);padding:10px 14px;border-radius:14px;font-size:14px;box-shadow:0 8px 24px rgba(0,0,0,.18);animation:toast 4.5s forwards}
@keyframes toast{0%{opacity:0;transform:translate(-50%,-8px)}8%,85%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;visibility:hidden}}
.note{background:var(--surface-2);border-radius:var(--r-sm);padding:10px 12px;font-size:14px;margin:8px 0}
.note.bad{background:var(--bad-soft);color:var(--bad)}
.empty{text-align:center;color:var(--muted);padding:56px 24px}
.empty svg{width:40px;height:40px;opacity:.5}
.empty h2{color:var(--ink);font-size:18px;margin:10px 0 6px}
.empty p{max-width:34ch;margin:0 auto;font-size:15px}

/* segmented + subbar */
.seg{display:flex;gap:4px;background:var(--surface-2);padding:4px;border-radius:12px;margin:4px 0 10px}
.seg a{flex:1 0 auto;text-align:center;padding:8px 12px;border-radius:9px;color:var(--muted);font-weight:600;font-size:14px;white-space:nowrap}
.seg a.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}
.scrollx{overflow-x:auto;scrollbar-width:none}.scrollx::-webkit-scrollbar{display:none}
.subbar{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--muted);margin:0 4px 4px}

/* games */
.game{display:grid;grid-template-columns:1fr auto;gap:4px 14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 16px;margin-bottom:8px;color:inherit}
.game.flagged{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.game.post{opacity:.7}
.team{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:16px;color:var(--muted)}
.team span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team b{font:600 24px/1.15 var(--num);font-variant-numeric:tabular-nums;color:var(--muted)}
.team.lead span,.team.lead b{color:var(--ink);font-weight:700}
.clock{display:flex;flex-direction:column;align-items:flex-end;justify-content:center;font-size:13px;color:var(--muted);min-width:76px;text-align:right}
.livedot{color:var(--live);font-weight:700;font-size:12px;letter-spacing:.02em;display:inline-flex;align-items:center;gap:5px}
.livedot::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--live)}
.chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.chip{font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;background:var(--surface-2);color:var(--muted)}
.chip.accent{background:var(--accent);color:var(--accent-ink)} .chip.good{background:var(--good-soft);color:var(--good)} .chip.bad{background:var(--bad-soft);color:var(--bad)}

/* review card */
.packet-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.status{font-size:12px;font-weight:700;padding:3px 9px;border-radius:999px;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.status.s-review_requested{background:var(--accent);color:var(--accent-ink)} .status.s-decided_HIGH{background:var(--good);color:#fff}
.scoreline{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;margin:10px 0 6px;color:var(--muted);font-size:15px}
.scoreline span:last-child{text-align:right}
.scoreline .lead{color:var(--ink);font-weight:700}
.scoreline b{font:700 30px/1 var(--num);color:var(--ink);font-variant-numeric:tabular-nums}
.pickline{display:flex;flex-direction:column;background:var(--accent-soft);border-radius:var(--r-sm);padding:10px 12px;margin:6px 0 10px}
.pickline span{font-weight:700} .pickline small{color:var(--muted)}
.proscons{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:440px){.proscons{grid-template-columns:1fr}}
.proscons h4{font-size:13px;margin-bottom:4px}.pros h4{color:var(--good)}.cons h4{color:var(--bad)}
.proscons ul{margin:0;padding-left:18px;font-size:14px}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center}
.actions form{margin:0}

/* game page */
.board .team b{font-size:34px}.board .team span{font-size:18px}

/* tables */
.table{width:100%;border-collapse:collapse;font-size:15px;font-variant-numeric:tabular-nums}
.table td,.table th{padding:10px 16px;border-bottom:1px solid var(--line);text-align:left}
.table th{font-size:13px;color:var(--muted);font-weight:600}
.table tr:last-child td{border-bottom:0}
.table td:not(:first-child),.table th:not(:first-child){text-align:right}

/* picks */
.stats2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.stat .big{font:700 38px/1.05 var(--num);margin-top:4px;font-variant-numeric:tabular-nums}

/* lists (iOS-style) */
.list .row{display:flex;align-items:center;gap:12px;width:100%;padding:13px 16px;background:none;border:0;border-bottom:1px solid var(--line);color:var(--ink);font:inherit;text-align:left;cursor:pointer;min-height:56px}
.list .row:last-child{border-bottom:0}
.list .row.static{cursor:default}
.list button.row:active,.list a.row:active{background:var(--surface-2)}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column}
.row-main b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-main small{color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis}
.row-end{color:var(--muted);font-size:15px}
.chev{width:16px;height:16px;color:var(--muted);flex:none}
.dot{width:10px;height:10px;border-radius:50%;flex:none;background:var(--muted)}
.dot.r-win{background:var(--good)}.dot.r-loss{background:var(--bad)}.dot.r-pending{background:var(--accent)}.dot.r-void{background:var(--line)}.dot.r-warn{background:var(--warn)}
.ico{width:30px;height:30px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-weight:800;color:#fff;flex:none}
.ico.teal{background:var(--accent)}.ico.amber{background:#E38B1B}

/* toggle switch */
.toggle input{position:absolute;opacity:0;pointer-events:none}
.toggle i{width:51px;height:31px;border-radius:999px;background:var(--line);position:relative;flex:none;transition:background .2s}
.toggle i::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 2px 4px rgba(0,0,0,.2);transition:transform .2s}
.toggle input:checked+i{background:var(--good)} .toggle input:checked+i::after{transform:translateX(20px)}
.toggle input:focus-visible+i{outline:2px solid var(--accent);outline-offset:2px}

/* forms + buttons */
.stack{display:flex;flex-direction:column;gap:12px}
label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600}
label small{font-weight:500;color:var(--muted)}
label.inline{flex-direction:row;align-items:center;gap:8px;font-weight:500}
input,select,textarea{font:16px var(--font);color:var(--ink);background:var(--surface-2);border:1px solid transparent;border-radius:var(--r-sm);padding:11px 12px;width:100%;outline:none}
input:focus,textarea:focus{border-color:var(--accent);background:var(--surface)}
input[type=checkbox]{width:20px;height:20px}
textarea{resize:vertical}
.btn{font:600 15px var(--font);padding:10px 18px;border-radius:12px;border:0;background:var(--surface-2);color:var(--ink);cursor:pointer;display:inline-flex;align-items:center;gap:6px;width:auto}
.btn.primary{background:var(--accent);color:var(--accent-ink)}
.btn.sm{padding:7px 12px;font-size:13px;border-radius:10px}
.btn:active{transform:scale(.98)}
.btn:focus-visible,.seg a:focus-visible,.row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.choice{display:flex;flex-wrap:wrap;gap:6px}
.choice label{flex-direction:row;font-weight:600}
.choice input{position:absolute;opacity:0;width:1px;height:1px}
.choice span{padding:9px 14px;border-radius:999px;background:var(--surface-2);color:var(--ink);font-size:14px;cursor:pointer}
.choice input:checked+span{background:var(--ink);color:var(--bg)}
.choice input:focus-visible+span{outline:2px solid var(--accent)}
.copy{display:flex;gap:8px;align-items:center}
.copy.col{flex-direction:column;align-items:flex-start}
.copy input,.copy textarea{font-size:14px;font-weight:400}
details summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:14px}

/* bottom sheets */
dialog.sheet{border:0;padding:16px 18px calc(18px + env(safe-area-inset-bottom));background:var(--surface);color:var(--ink);
  width:100%;max-width:560px;max-height:88vh;overflow:auto;border-radius:22px 22px 0 0;margin:auto auto 0;box-shadow:0 -10px 40px rgba(0,0,0,.2)}
dialog.sheet::backdrop{background:rgba(6,14,18,.45);backdrop-filter:blur(2px)}
@media (min-width:640px){dialog.sheet{border-radius:22px;margin:auto}}
.sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}
.sheet-head b{font-size:18px}
.sheet p{margin:6px 0}
.sheet h4{font-size:15px;margin-top:6px}
.close{width:32px;height:32px;border-radius:50%;border:0;background:var(--surface-2);color:var(--muted);font-size:22px;line-height:1;cursor:pointer;flex:none}
@media (prefers-reduced-motion:no-preference){dialog.sheet[open]{animation:up .22s cubic-bezier(.2,.8,.2,1)}@keyframes up{from{transform:translateY(40px);opacity:.4}}}

/* bottom tab bar */
.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;justify-content:space-around;
  background:color-mix(in srgb,var(--surface) 88%,transparent);backdrop-filter:saturate(1.6) blur(18px);-webkit-backdrop-filter:saturate(1.6) blur(18px);
  border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom));height:calc(var(--tab-h) + env(safe-area-inset-bottom))}
.tabbar a{flex:1;max-width:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--muted);font-size:11px;font-weight:600;position:relative}
.tabbar a svg{width:25px;height:25px}
.tabbar a.on{color:var(--accent)}
.tabbar .badge{position:absolute;top:2px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--live);color:#fff;font-size:11px;line-height:18px;text-align:center}

/* auth */
body.auth{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:24px}
.auth-card{width:100%;max-width:360px;text-align:center}
.auth-card h1{font-size:28px;margin-top:12px}
.auth-card .stack{margin-top:18px;align-items:center}
.auth-logo{width:72px;height:72px;border-radius:18px}
.list label.row{flex-direction:row;font-size:16px;font-weight:400;gap:12px}
.list label.row .row-main{align-items:flex-start;text-align:left}
.team b.line{font:600 15px/1.3 var(--font);white-space:nowrap}
.board .team b.line{font-size:18px}
