[hidden] { display: none !important; }
:root {
  --navy: #0b1d33; --ice: #f4f7fb; --line: #dfe6ef; --ink: #14202e; --muted: #5b6b7d;
  --green: #15803d; --green-bg: #e8f6ee; --red: #b91c1c; --red-bg: #fdecec; --amber: #b45309; --amber-bg: #fff4e0;
  --blue: #1d4ed8; --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ice); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
h1 { font-size: 1.35rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: .95rem; margin: .8rem 0 .3rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 2rem 1rem; }
.error { color: var(--red); } .big { font-size: 1.25rem; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: calc(.6rem + var(--safe-t)) 1rem .6rem; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { border-radius: 6px; }
.topbar .muted { color: #b8c4d3; }

main#view { max-width: 720px; margin: 0 auto; padding: 1rem 1rem calc(5.5rem + var(--safe-b)); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { flex: 1; text-align: center; padding: .75rem 0; color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 600; }
.tabbar a.active { color: var(--navy); box-shadow: inset 0 3px 0 var(--navy); }

.banner { max-width: 720px; margin: .75rem auto 0; padding: .7rem 1rem; border-radius: var(--radius); background: var(--amber-bg); color: #6b3d06; font-size: .92rem; }
.banner button { margin-left: .5rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; }
.card.narrow { max-width: 460px; margin: 2rem auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }

.game { display: block; text-decoration: none; color: inherit; }
.game .when { font-weight: 700; }
.game .vs { font-size: 1.05rem; }
.game.past { opacity: .75; }
.game-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.next-label { display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: var(--navy); padding: .1rem .45rem; border-radius: 999px; margin-bottom: .3rem; }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill.in { background: var(--green-bg); color: var(--green); }
.pill.out { background: var(--red-bg); color: var(--red); }
.pill.none { background: #eef2f7; color: var(--muted); }
.pill.confirmed { background: var(--green-bg); color: var(--green); }
.pill.at-risk { background: var(--red-bg); color: var(--red); }
.pill.on-track { background: var(--amber-bg); color: var(--amber); }
.pill.duty { background: #e0e9ff; color: var(--blue); }
.pill.W { background: var(--green-bg); color: var(--green); } .pill.L, .pill.OTL { background: var(--red-bg); color: var(--red); } .pill.T { background: #eef2f7; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.in { background: var(--green); border-color: var(--green); color: #fff; }
.btn.out { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; }
.btn.sel-in { outline: 3px solid #86efac; } .btn.sel-out { outline: 3px solid #fca5a5; }
.rsvp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .8rem 0; }
.rsvp-buttons .btn { min-height: 56px; font-size: 1.1rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.meter { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: .35rem 0 .2rem; }
.meter > span { display: block; height: 100%; background: var(--green); }
.meter.short > span { background: var(--amber); }

label { display: block; font-weight: 600; margin: .6rem 0 .25rem; font-size: .92rem; }
input, select, textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input[type=checkbox] { width: auto; transform: scale(1.25); margin-right: .5rem; }
.check { display: flex; align-items: flex-start; gap: .25rem; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .45rem .35rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-input { width: 3.2rem; padding: .3rem; text-align: center; }
.record { font-size: 2rem; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(5rem + var(--safe-b)); transform: translateX(-50%); background: var(--navy); color: #fff;
  padding: .6rem 1rem; border-radius: 999px; font-weight: 600; z-index: 10; max-width: 90vw; }
.seg { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.seg a { padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
.seg a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
details summary { cursor: pointer; font-weight: 600; }
.standalone main.card { text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .92rem; }
@media (min-width: 720px) { .tabbar { justify-content: center; } .tabbar a { flex: 0 0 110px; } }

/* Pull to refresh (custom: installed web apps have no native one). Disable the iOS rubber-band so the gesture is ours. */
html, body { overscroll-behavior-y: none; }
.ptr { position: fixed; left: 50%; top: 0; z-index: 4; transform: translate(-50%, -44px); opacity: 0;
  background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem;
  font-size: .85rem; font-weight: 600; box-shadow: 0 2px 8px rgba(11,29,51,.12); pointer-events: none; white-space: nowrap; }
.ptr.on { opacity: 1; }
.ptr.settle { transition: transform .2s ease, opacity .2s ease; }
