:root {
  --navy: #0E2238;
  --navy2: #1B4469;
  --blue: #0B6FB8;
  --teal: #2E9E8F;
  --gold: #F2A900;
  --gold-bg: #FFF4D1;
  --page: #F4F7FA;
  --card: #fff;
  --line: #E6EDF3;
  --line2: #D3DEE8;
  --ink: #0E2238;
  --muted: #5D7389;
  --faint: #8FA3B6;
  --win: #1E8E5A;
  --loss: #C0392B;
  --head: 'Barlow Condensed', 'Arial Narrow', 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(--page); color: var(--ink); font: 400 15px/1.4 var(--body); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.h { font-family: var(--head); font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-name { font: 700 24px/1 var(--head); }
.brand-sub { font-size: 12px; opacity: .7; }
.tabs { display: none; }
.mine-btn { margin-left: auto; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mine-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #2A1D00; }
.bottom-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; min-height: 56px; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottom-tabs a:hover { text-decoration: none; }
.bottom-tabs a[aria-current="page"] { color: var(--blue); }
.bottom-tabs svg { width: 22px; height: 22px; }

.app { max-width: 1440px; margin: 0 auto; padding: 14px 16px 96px; outline: none; }
.foot { max-width: 1440px; margin: 0 auto; padding: 0 16px 90px; font-size: 12px; color: var(--muted); }
.loading { color: var(--muted); }

/* Common controls */
.seg { display: flex; gap: 4px; background: #E6EDF3; padding: 4px; border-radius: 10px; flex-shrink: 0; }
.seg button { flex: 1; height: 36px; min-width: 64px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(14,34,56,.12); }
.chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line2); background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.iconbtn { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--line2); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; flex-shrink: 0; }
.btn { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line2); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.section-title { font: 700 22px/1.1 var(--head); margin: 18px 0 10px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Crest */
.crest { border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.crest img { width: 100%; height: 100%; object-fit: contain; }
.crest.ini { border: 0; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.label { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.label b { font: 700 26px/1 var(--head); }
.label span { font-size: 12px; color: var(--muted); }
.divchips { display: flex; gap: 6px; }

/* Game card */
.game { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.game.followed { box-shadow: inset 4px 0 0 var(--gold); }
.game-top { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.status { font-size: 12px; font-weight: 700; color: var(--ink); }
.status.final { color: var(--win); letter-spacing: .06em; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: #EEF2F6; color: var(--muted); }
.divtag { position: absolute; top: 0; right: 0; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #fff; padding: 4px 9px; border-bottom-left-radius: 10px; }
.trow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tname { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.tname:hover { text-decoration: underline; }
.tname small { font-weight: 400; color: var(--faint); font-size: 12px; }
.star { border: 0; background: none; padding: 4px; cursor: pointer; color: #C3D2DF; font-size: 16px; line-height: 1; flex-shrink: 0; min-width: 28px; min-height: 28px; }
.star[aria-pressed="true"] { color: var(--gold); }
.score { font: 700 20px/1 var(--head); min-width: 22px; text-align: right; }
.score.lose { color: var(--faint); }
.game-foot { display: flex; align-items: center; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.game-foot a { color: var(--blue); }
.watch { color: var(--muted) !important; }

/* Month grid */
.month { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; background: #F8FAFC; border-bottom: 1px solid var(--line); text-transform: uppercase; }
.day { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; text-align: left; padding: 6px; min-height: 52px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day.out { background: #FAFBFC; color: #B8C6D3; }
.day.sel { box-shadow: inset 0 0 0 2px var(--blue); }
.dnum { font-size: 13px; font-weight: 600; }
.today .dnum { background: var(--navy); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; }
.dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.line { display: none; }
.more { display: none; }

/* Schedule layouts */
.sched { display: flex; flex-direction: column; gap: 14px; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 8px; }
.panel-h b { font: 700 22px/1 var(--head); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 4px; }
.weeklist h3 { font: 700 18px/1 var(--head); margin: 16px 0 8px; }

/* Tables */
.tablecard { overflow: hidden; }
.tablecard h3 { font: 700 20px/1 var(--head); margin: 0; padding: 14px 14px 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid #EEF2F6; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 14px; }
th.team, td.team { text-align: left; width: 100%; }
td.team a { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
tr.mine td { background: var(--gold-bg); }
tr.cut td { border-bottom: 2px dashed var(--gold); }
.cutlabel td { background: var(--gold-bg); color: #8A6A00; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; padding: 4px 14px; }
.cols3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chiprow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }

/* Conference */
.conf-head { border-radius: 14px; padding: 18px 20px; background: linear-gradient(120deg, var(--navy), var(--navy2)); color: #fff; display: flex; flex-direction: column; gap: 14px; }
.conf-head .kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.conf-head .name { font: 700 30px/1 var(--head); }
.champ { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px 14px; }
.champ .lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.champ a { color: #fff; font-weight: 700; font-size: 17px; }
.bracket { display: flex; align-items: center; padding: 14px; gap: 0; }
.semis { flex: 1.4; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.match { border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.match .slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; }
.match .slot + .slot { border-top: 1px solid #EEF2F6; }
.seed { width: 14px; font-size: 11px; font-weight: 700; color: var(--muted); }
.connector { width: 16px; align-self: stretch; display: flex; align-items: center; }
.connector i { display: block; width: 100%; height: 56%; border: 2px solid #C3D2DF; border-left: 0; border-radius: 0 8px 8px 0; }
.stub { width: 12px; height: 2px; background: #C3D2DF; }
.final { flex: 1; min-width: 0; border: 2px solid var(--blue); border-radius: 10px; padding: 10px; background: #F2F8FD; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.final b { color: var(--blue); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* Teams */
.teamgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.teamcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.teamcard a { color: var(--ink); font-weight: 600; flex: 1; min-width: 0; }
.teamcard small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* Team page */
.hero { border-radius: 16px; padding: 18px; background: linear-gradient(120deg, var(--navy), var(--navy2)); color: #fff; display: flex; flex-direction: column; gap: 16px; }
.hero-id { display: flex; align-items: center; gap: 14px; }
.hero h1 { font: 700 34px/1 var(--head); margin: 0; }
.hero .sub { opacity: .8; font-size: 13px; margin-top: 4px; }
.ranktag { display: inline-block; margin-top: 8px; background: var(--gold); color: #2A1D00; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 10px; }
.ranktag:hover { text-decoration: none; }
.follow { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.follow[aria-pressed="true"] { background: var(--gold); color: #2A1D00; border-color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.tile { background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px; }
.tile span { display: block; font-size: 11px; opacity: .75; }
.tile b { font: 700 24px/1.1 var(--head); }
.teamcols { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #EEF2F6; }
.sched-row .when { width: 72px; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.sched-row .when b { display: block; color: var(--ink); font-size: 13px; }
.sched-row .opp { flex: 1; min-width: 0; }
.sched-row .opp a.t { color: var(--ink); font-weight: 600; }
.sched-row .opp div { font-size: 12px; }
.res { font: 700 16px/1 var(--head); white-space: nowrap; }
.res.W { color: var(--win); } .res.L { color: var(--loss); } .res.T { color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid #EEF2F6; font-size: 13px; }
.kv span { color: var(--muted); }
.form { display: flex; gap: 6px; padding: 12px 14px; }
.form i { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; color: #fff; font-size: 13px; }
.trophies { padding: 4px 14px 14px; font-size: 13px; }
.trophies h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }

@media (min-width: 640px) {
  .teamgrid { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* Desktop */
@media (min-width: 900px) {
  .app { padding: 20px 24px 40px; }
  .foot { padding: 0 24px 30px; }
  .top-in { padding: 0 24px; height: 68px; gap: 24px; }
  .tabs { display: flex; height: 100%; gap: 4px; margin-left: 24px; }
  .tabs a { display: flex; align-items: center; padding: 0 16px; color: rgba(255,255,255,.75); font-weight: 600; font-size: 16px; border-bottom: 3px solid transparent; }
  .tabs a:hover { color: #fff; text-decoration: none; }
  .tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
  .bottom-tabs { display: none; }
  .label b { font-size: 30px; }

  .sched.with-rail { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 20px; align-items: start; }
  .rail { position: sticky; top: 88px; max-height: calc(100vh - 108px); overflow-y: auto; padding-right: 2px; }
  .day { min-height: 118px; padding: 8px; cursor: pointer; }
  .dots { display: none; }
  .line { display: block; font-size: 12px; line-height: 1.25; padding: 2px 6px; border-left: 3px solid var(--line2); background: #F6F9FB; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
  .line.past { color: #6B8197; }
  .line.mine { background: var(--gold-bg); }
  .line b { font-weight: 600; margin-right: 4px; }
  .more { display: block; font-size: 11px; font-weight: 600; color: var(--blue); padding-left: 4px; }

  .week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
  .wcol { background: #EEF3F8; border: 1px solid #E1E9F0; border-radius: 12px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
  .whead { border: 0; background: #fff; border-bottom: 1px solid var(--line); text-align: left; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; }
  .whead.today { background: var(--navy); color: #fff; }
  .whead span { font-size: 11px; font-weight: 700; letter-spacing: .08em; opacity: .75; }
  .whead b { font: 700 26px/1 var(--head); }
  .wbody { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
  .wbody .game { padding: 8px 10px; gap: 5px; }
  .wbody .tname { font-size: 12px; }
  .wbody .score { font-size: 16px; }
  .wbody .game-foot { font-size: 11px; }
  .wbody .star { display: none; }
  .dayview { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; align-items: start; }

  .cols3 { grid-template-columns: repeat(3, minmax(0,1fr)); align-items: start; }
  .chiprow.mobile-only { display: none; }
  .conf-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; align-items: start; }
  .confnav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
  .confnav button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
  .confnav button[aria-pressed="true"] { background: #EAF3FB; box-shadow: inset 3px 0 0 var(--blue); }
  .confnav small { color: var(--muted); font-size: 12px; }
  .conf-body { display: grid; grid-template-columns: minmax(0,1fr) 440px; gap: 16px; align-items: start; }
  .conf-head { flex-direction: row; align-items: center; grid-column: 1 / -1; }
  .conf-head .champ { width: 380px; flex-shrink: 0; margin-left: auto; }
  .teamgrid { grid-template-columns: repeat(3, 1fr); }
  .hero { flex-direction: row; align-items: center; padding: 22px 26px; }
  .hero-id { flex: 1; }
  .hero h1 { font-size: 44px; }
  .hero .tiles { width: 560px; flex-shrink: 0; }
  .teamcols { grid-template-columns: minmax(0,1fr) 400px; align-items: start; }
}
@media (max-width: 899px) {
  .desktop-only { display: none !important; }
  .confnav { display: none; }
  .conf-body { display: flex; flex-direction: column; gap: 14px; }
  .week { display: none; }
}
@media (min-width: 900px) { .mobile-only { display: none !important; } }
