:root {
  --ink: #121A2E;
  --ink-2: #4B5570;
  --line: #DDE2EC;
  --bg: #F3F5FA;
  --card: #FFFFFF;
  --accent: #C2410C;
  --accent-ink: #FFFFFF;
  --navy: #121A2E;
  --navy-2: #26304A;
  --navy-ink: #C3CBDD;
  --good: #15803D;
  --danger: #B91C1C;
  --radius: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); }
a { color: #1E3A8A; }
a:hover { color: #142A66; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: 0.2px; margin: 0; line-height: 1.05; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* header */
.top { background: var(--navy); color: #fff; padding: 18px 0 0; }
.top .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--navy-ink); text-decoration: none; }
.brand:hover { color: #fff; }
.top h1 { font-size: 36px; margin-top: 4px; word-break: break-word; }
.top .sub { color: var(--navy-ink); font-size: 14px; margin-top: 2px; }
.live { font-size: 12px; font-weight: 700; background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.live.done { background: var(--good); }
.tabs { display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: transparent; border: 0; color: var(--navy-ink); padding: 12px 14px; font-weight: 600; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); }

main { padding: 18px 0 60px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 10px; }
.section-title h2 { font-size: 24px; text-transform: uppercase; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
.pad { padding: 14px 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

/* standings */
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; text-align: left; cursor: pointer; min-height: 60px; }
.team-row:hover { border-color: #B8C1D4; }
.rank { width: 26px; font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--ink-2); text-align: center; flex: none; }
.rank.first { color: var(--accent); }
.swatch { width: 12px; height: 38px; border-radius: 6px; flex: none; }
.team-main { flex: 1; min-width: 0; }
.team-name { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: #E4E8F1; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; transition: width .5s ease; }
.pts { font-family: var(--display); font-weight: 800; font-size: 28px; flex: none; min-width: 48px; text-align: right; }
.breakdown { margin: -2px 0 4px 50px; padding: 8px 14px; font-size: 14px; }
.breakdown div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.breakdown div:last-child { border-bottom: 0; }

.next { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.next .card { padding: 12px 14px; }
.kicker { font-size: 11px; font-weight: 700; color: #1E3A8A; text-transform: uppercase; letter-spacing: 0.6px; }
.vs { font-weight: 600; margin-top: 4px; }

/* your team + schedule */
.myteam { background: var(--card); border: 3px solid; border-radius: 18px; overflow: hidden; margin-top: 8px; }
.myteam-head { color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.myteam-head h2 { font-size: 34px; }
.myteam-rank { font-weight: 700; font-size: 15px; background: rgba(0,0,0,.22); padding: 6px 12px; border-radius: 20px; }
.up-item { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.up-item:last-child { border-bottom: 0; }
.up-time { font-family: var(--display); font-weight: 800; font-size: 18px; min-width: 82px; flex: none; color: var(--ink); }
.sched-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sched-row:last-child { border-bottom: 0; }
.sched-row .grow { flex: 1; min-width: 160px; }
.sched-row.sub { padding-left: 28px; background: #FAFBFD; font-size: 14px; }
.sched-row.sub .up-time { font-size: 16px; color: var(--ink-2); }
.sched-row.past { opacity: .6; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 12px; white-space: nowrap; background: #EEF1F7; color: var(--ink); }
.tag.done { background: #DCF2E3; color: #14532D; }
.tag.live { background: var(--accent); color: #fff; }
.tag.mine { background: #E0E7FF; color: #1E3A8A; }
.quick { background: #F7F8FB; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }

/* games */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 20px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.dot { width: 8px; height: 8px; border-radius: 4px; background: #9AA3B8; flex: none; }
.dot.live { background: var(--accent); padding: 0; }
.dot.done { background: var(--good); }

.bracket { display: flex; gap: 18px; overflow-x: auto; padding: 4px 2px 14px; }
.round { display: flex; flex-direction: column; gap: 10px; min-width: 200px; flex: none; }
.round h3 { font-size: 15px; text-transform: uppercase; color: var(--ink-2); font-weight: 600; letter-spacing: .6px; }
.round-matches { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; flex: 1; }
.match { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: 100%; text-align: left; padding: 0; display: block; }
button.match { cursor: pointer; }
button.match:hover { border-color: #8E99B3; }
.match .side { display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-height: 40px; }
.match .side + .side { border-top: 1px solid var(--line); }
.match .side .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .side.win { font-weight: 700; }
.match .side.lose { color: var(--ink-2); }
.match .side .sc { font-weight: 700; min-width: 24px; text-align: right; }
.match .tbd { color: #8A93A8; font-style: italic; }
.match .where { font-size: 11px; color: var(--ink-2); padding: 4px 12px; background: #F7F8FB; border-top: 1px solid var(--line); }
.mini { width: 8px; height: 22px; border-radius: 4px; flex: none; }

.rank-list .item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rank-list .item:last-child { border-bottom: 0; }

/* teams */
.team-card h3 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.player { background: #EEF1F7; border-radius: 16px; padding: 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.player button { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--ink-2); font-size: 16px; line-height: 1; min-width: 24px; min-height: 24px; }

/* forms */
label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
input[type=text], input[type=number], select, textarea { width: 100%; border: 1px solid #C9D0E0; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid #93A9E8; outline-offset: 1px; }
.field { margin-bottom: 12px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline > .grow { flex: 1 1 180px; }
.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; cursor: pointer; min-height: 44px; background: var(--navy); color: #fff; }
.btn:hover { background: #1E2A48; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #A3360A; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #C9D0E0; }
.btn.ghost:hover { background: #F3F5FA; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #E8B4B4; }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); font-size: 14px; }
.check input { width: 20px; height: 20px; }
.colors { display: flex; gap: 6px; flex-wrap: wrap; }
.colors button { width: 32px; height: 32px; border-radius: 16px; border: 3px solid transparent; cursor: pointer; }
.colors button[aria-pressed="true"] { border-color: var(--ink); }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.admin-row .grow { flex: 1; min-width: 140px; }
.note { background: #FFF7ED; border: 1px solid #FCD9B6; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(18,26,46,.55); }
dialog .pad { padding: 18px; }
dialog h2 { font-size: 26px; margin-bottom: 4px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pick button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; min-height: 56px; }
.pick button[aria-pressed="true"] { border-color: var(--ink); background: #EEF1F7; }

/* landing */
.hero { background: var(--navy); color: #fff; padding: 40px 0 46px; }
.hero h1 { font-size: 52px; }
.hero p { color: var(--navy-ink); font-size: 18px; max-width: 560px; margin: 12px 0 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.steps .card { padding: 16px; }
.steps .num { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--accent); }
footer { color: var(--ink-2); font-size: 13px; padding: 30px 0; text-align: center; }

@media (max-width: 560px) {
  .top h1 { font-size: 30px; }
  .hero h1 { font-size: 40px; }
  .breakdown { margin-left: 0; }
  .pts { font-size: 24px; }
}

/* schedule tools */
.tbd { color: #6B7489; font-style: italic; }
.sched-game { display: grid; grid-template-columns: minmax(130px, 1.3fr) repeat(4, minmax(90px, 1fr)); gap: 8px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.sched-game label { margin: 0; font-size: 12px; }
.sched-game input, .sched-game select { min-height: 38px; padding: 6px 8px; margin-top: 3px; }
.sg-name { align-self: center; }
details.hand { border-top: 1px solid var(--line); padding: 8px 0; }
details.hand summary { cursor: pointer; padding: 6px 0; min-height: 32px; }
@media (max-width: 640px) {
  .sched-game { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-name { grid-column: 1 / -1; }
}

/* calendar timeline */
.sched-bar { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid #C9D0E0; border-radius: 12px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.tl { padding: 0; overflow: hidden; }
.tl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-inner { position: relative; }
.tl-row { display: flex; min-height: 70px; border-top: 1px solid #EEF1F6; }
.tl-row.first { border-top: 1px solid var(--line); }
.tl-name { position: sticky; left: 0; z-index: 3; width: 140px; flex: none; background: #fff; padding: 8px 10px; border-right: 1px solid var(--line); border-left: 5px solid transparent; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.tl-name strong { font-size: 14px; }
.tl-track { position: relative; flex: none; }
.tl-axis { min-height: 34px; background: #F7F8FB; border-top: 0; position: sticky; top: 0; z-index: 4; }
.tl-axis .tl-name { background: #F7F8FB; border-left-color: #F7F8FB; }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid transparent; }
.tl-axis .tl-tick span { position: absolute; top: 8px; left: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tl-body { position: relative; }
.tl-overlay { position: absolute; top: 0; bottom: 0; left: 140px; pointer-events: none; z-index: 1; }
.tl-overlay .tl-tick { border-left: 1px dashed #E6E9F0; }
.tl-overlay .tl-tick.hour { border-left: 1px solid #DDE2EC; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.tl-now::before { content: 'Now'; position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 800; color: var(--accent); }
.tl-block { position: absolute; top: 6px; bottom: 6px; z-index: 2; border: 1px solid; border-left-width: 4px; border-radius: 8px; padding: 4px 6px; overflow: hidden; text-align: left; font: inherit; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
button.tl-block { cursor: pointer; }
button.tl-block:hover { filter: brightness(.96); }
.tl-block .tb-top { font-size: 10px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.tl-block .tb-teams { font-size: 12px; font-weight: 600; line-height: 1.25; overflow: hidden; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-block.mine { outline: 3px solid var(--ink); outline-offset: -1px; z-index: 3; }
.tl-block.done { opacity: .5; }
.tl-block.extra { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(51,65,85,.06) 6px 12px); }
@media (max-width: 560px) { .tl-name { width: 108px; } .tl-overlay { left: 108px; } }

main.wrap.wide { max-width: 1400px; }
.note.warn { background: #FEF2F2; border-color: #FCA5A5; color: #7F1D1D; margin-bottom: 12px; }
.stack-choice { border: 0; padding: 0; margin: 6px 0 8px; }
.stack-choice legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.stack-choice .check { align-items: flex-start; margin-bottom: 6px; }
.stack-choice .check input { margin-top: 2px; flex: none; }
