:root{--bg:#f4f6f8;--card:#fff;--card-soft:#f8fafc;--text:#111827;--muted:#6b7280;--line:#e5e7eb;--accent:#0f766e;--accent-soft:#dff5f1;--danger:#b42318;--shadow:0 10px 30px rgba(15,23,42,.06);--topbar:rgba(244,246,248,.92);--nav:rgba(255,255,255,.96);--button-soft:#f3f4f6;--logo:#101828}
:root[data-theme="dark"]{--bg:#343b49;--card:#3b4252;--card-soft:#414a5a;--text:#eceff4;--muted:#c2cad6;--line:#4c566a;--accent:#88c0d0;--accent-soft:#405563;--danger:#bf616a;--shadow:0 10px 30px rgba(20,24,32,.18);--topbar:rgba(52,59,73,.92);--nav:rgba(59,66,82,.96);--button-soft:#434c5e;--logo:#2e3440}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#343b49;--card:#3b4252;--card-soft:#414a5a;--text:#eceff4;--muted:#c2cad6;--line:#4c566a;--accent:#88c0d0;--accent-soft:#405563;--danger:#bf616a;--shadow:0 10px 30px rgba(20,24,32,.18);--topbar:rgba(52,59,73,.92);--nav:rgba(59,66,82,.96);--button-soft:#434c5e;--logo:#2e3440}}*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text)}button{font:inherit}.app-shell{min-height:100vh;padding-bottom:calc(74px + env(safe-area-inset-bottom));}.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top)) 16px 12px;background:var(--topbar);backdrop-filter:blur(18px);border-bottom:1px solid rgba(229,231,235,.9)}.eyebrow{font-size:11px;letter-spacing:.12em;color:var(--accent);font-weight:700;text-transform:uppercase}.topbar h1{font-size:22px;line-height:1.1;margin:2px 0 0}.top-actions{display:flex;gap:8px}.icon-btn{width:38px;height:38px;border:0;border-radius:12px;background:var(--card);box-shadow:var(--shadow);font-size:20px;color:var(--text)}main{width:min(100%,1120px);margin:0 auto;padding:12px 12px 24px}.date-strip,.segmented{display:flex;gap:8px;overflow:auto;padding-bottom:2px;scrollbar-width:none}.date-strip::-webkit-scrollbar,.segmented::-webkit-scrollbar,.round-strip::-webkit-scrollbar{display:none}.date-pill,.seg-btn{flex:0 0 auto;border:1px solid var(--line);background:var(--card);color:var(--muted);border-radius:12px;padding:9px 12px}.date-pill.active,.seg-btn.active{background:var(--accent-soft);color:var(--accent);border-color:rgba(136,192,208,.58);box-shadow:inset 0 0 0 1px rgba(136,192,208,.16)}.date-pill strong{display:block;font-size:14px;color:inherit}.date-pill span{display:block;font-size:11px;margin-top:2px;color:inherit;opacity:.8}.section-head{display:flex;align-items:end;justify-content:space-between;margin:18px 2px 10px}.section-head h2{margin:0;font-size:17px}.section-head small{color:var(--muted);font-size:12px}.match-list,.tournament-list,.rank-list{display:grid;gap:10px}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.match-card{padding:12px}.match-top{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:10px}.comp{font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta{font-size:11px;color:var(--muted)}.status{font-size:11px;color:var(--accent);background:var(--accent-soft);padding:4px 7px;border-radius:999px;white-space:nowrap}.status.done{color:var(--muted);background:var(--button-soft)}.player-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;padding:7px 0}.player-main{display:flex;align-items:center;gap:8px;min-width:0}.flag{font-size:19px;line-height:1}.player-name{font-size:15px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.score{font-variant-numeric:tabular-nums;font-weight:750;letter-spacing:.03em}.match-foot{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:9px;margin-top:3px;color:var(--muted);font-size:12px}.tournament-card{padding:13px;display:grid;grid-template-columns:44px 1fr auto;gap:11px;align-items:center}.tour-logo{width:44px;height:44px;border-radius:12px;background:var(--logo);color:#fff;display:grid;place-items:center;font-weight:800;font-size:12px}.tour-title{font-size:15px;font-weight:750;margin-bottom:4px;color:var(--text)}.tour-sub{font-size:12px;color:var(--muted)}.chev{color:#98a2b3;font-size:22px}.rank-card{overflow:hidden}.rank-tabs{display:flex;padding:10px 10px 0;gap:8px}.rank-row{display:grid;grid-template-columns:34px 1fr auto;gap:8px;align-items:center;padding:11px 12px;border-top:1px solid var(--line)}.rank-pos{font-weight:800;font-size:13px}.rank-name{font-size:14px;font-weight:650}.rank-country{font-size:11px;color:var(--muted);margin-top:2px}.rank-points{font-weight:750;font-variant-numeric:tabular-nums}.bottom-nav{position:fixed;z-index:40;left:0;right:0;bottom:0;height:calc(62px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(3,1fr);background:var(--nav);backdrop-filter:blur(18px);border-top:1px solid var(--line)}.bottom-nav button{border:0;background:transparent;color:#7b8491;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}.bottom-nav button span{font-size:18px}.bottom-nav button b{font-size:11px}.bottom-nav button.active{color:var(--accent)}.empty-note{padding:18px;color:var(--muted);font-size:13px}.detail-head{padding:14px}.back-row{display:flex;align-items:center;gap:8px;margin-bottom:10px}.back-btn{border:0;background:var(--button-soft);color:var(--text);border-radius:10px;padding:7px 10px}.detail-title{font-size:20px;font-weight:800}.detail-sub{color:var(--muted);font-size:12px;margin-top:5px}.round-strip{display:flex;gap:8px;overflow:auto;margin:12px 0 10px;scrollbar-width:none}.round-col{flex:0 0 88%;max-width:360px}.round-title{font-size:13px;font-weight:800;margin:0 0 7px 2px}.bracket-match{padding:10px;margin-bottom:8px}.bracket-match .player-row{padding:5px 0}.hint{font-size:11px;color:var(--muted);padding:0 2px 8px}.desktop-tabs{display:none}@media(min-width:760px){.app-shell{padding-bottom:0}.bottom-nav{display:none}.desktop-tabs{display:flex;gap:8px;margin:4px 0 14px}.topbar{padding-left:22px;padding-right:22px}main{padding:18px 20px 36px}.date-strip{max-width:620px}.match-list{grid-template-columns:repeat(2,minmax(0,1fr))}.tournament-list{grid-template-columns:repeat(2,minmax(0,1fr))}.round-strip{overflow:visible;display:grid;grid-template-columns:repeat(4,1fr);align-items:start}.round-col{max-width:none}.rank-card{max-width:760px}}

.theme-btn{font-size:17px}.card,.date-pill,.seg-btn,.icon-btn,.bottom-nav,.topbar,.back-btn{transition:background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease}body{transition:background-color .2s ease,color .2s ease}

[data-theme="dark"] .date-pill,[data-theme="dark"] .seg-btn{background:#394252;border-color:#4c566a;color:#cbd5e1}
[data-theme="dark"] .date-pill.active,[data-theme="dark"] .seg-btn.active{background:#4a5a6d;color:#f3f7fb;border-color:#88c0d0;box-shadow:inset 0 0 0 1px rgba(136,192,208,.12)}
[data-theme="dark"] .date-pill.active span,[data-theme="dark"] .date-pill.active strong{color:#f3f7fb}
@media(max-width:520px){.date-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;overflow:visible}.date-pill{min-width:0;padding:9px 6px}.segmented{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;overflow:visible}.seg-btn{min-width:0;padding:9px 6px}.section-head{align-items:center;gap:10px}.section-head h2{flex:0 0 auto}.section-head small{min-width:0;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* Nord Night v3: muted information hierarchy */
html[data-theme="dark"]{
  --bg:#303846;
  --card:#374151;
  --text:#E5E9F0;
  --muted:#AEB8C6;
  --line:#4B5567;
  --accent:#88C0D0;
  --accent-soft:#3A5661;
  --danger:#BF616A;
  --shadow:0 10px 28px rgba(15,23,42,.16);
}
html[data-theme="dark"] .topbar{background:rgba(48,56,70,.94);border-bottom-color:#4B5567}
html[data-theme="dark"] .bottom-nav{background:rgba(55,65,81,.97);border-top-color:#4B5567}
html[data-theme="dark"] .card{background:#374151;border-color:#4B5567}
html[data-theme="dark"] .tour-logo{background:#2B3442;color:#E5E9F0}
html[data-theme="dark"] .tour-title{color:#E5E9F0}
html[data-theme="dark"] .chev{color:#8F9AAA}
html[data-theme="dark"] .date-pill,html[data-theme="dark"] .seg-btn{background:#354052;color:#BBC4D0;border-color:#4B586D}
html[data-theme="dark"] .date-pill.active,html[data-theme="dark"] .seg-btn.active{background:#415361;color:#F0F4F8;border-color:#6FA3B1;box-shadow:inset 0 0 0 1px rgba(136,192,208,.16)}
html[data-theme="dark"] .bottom-nav button{color:#8793A3}
html[data-theme="dark"] .bottom-nav button.active{color:#9BC8D3}
html[data-theme="dark"] .eyebrow{color:#9BC8D3}
html[data-theme="dark"] .status{color:#B8D8DF;background:#3A5059}
html[data-theme="dark"] .status.done{color:#AEB8C6;background:#343D4B}
html[data-theme="dark"] .back-btn{background:#343D4B;color:#D8DEE9}

[data-theme="dark"] .tour-title{color:var(--text)!important;}

/* compact mobile header/filter refinement */
@media(max-width:759px){
  .topbar{padding:calc(8px + env(safe-area-inset-top)) 14px 8px}
  .eyebrow{font-size:10px}
  .topbar h1{font-size:20px;margin-top:1px}
  .topbar .icon-btn,.theme-btn{width:36px;height:36px;border-radius:11px}
  main{padding:10px 10px 22px}
  .date-strip{gap:6px}
  .date-pill{min-height:54px;padding:7px 8px;border-radius:11px}
  .date-pill strong{font-size:13px}
  .date-pill span{font-size:10px;margin-top:1px}
  .segmented{gap:6px;margin-top:7px!important}
  .seg-btn{min-height:44px;padding:7px 10px;border-radius:11px}
  .section-head{margin:14px 2px 8px}
  .section-head h2{font-size:16px}
  .section-head small{font-size:12px}
  .bottom-nav{height:calc(70px + env(safe-area-inset-bottom))}
  .bottom-nav button span{font-size:23px}
  .bottom-nav button b{font-size:12.5px;font-weight:650}
  .bottom-nav button{gap:4px}
}

.schedule-mode-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:10px 0 4px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:var(--card)}.schedule-mode-row>div{display:flex;flex-direction:column;gap:2px}.schedule-mode-row strong{font-size:14px}.schedule-mode-row span{font-size:11.5px;color:var(--muted)}.toggle{width:46px;height:28px;border:0;border-radius:999px;padding:3px;background:var(--line);position:relative;flex:0 0 auto}.toggle span{display:block;width:22px;height:22px;border-radius:50%;background:var(--card);box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .18s ease}.toggle.on{background:var(--accent)}.toggle.on span{transform:translateX(18px)}.empty{padding:28px 16px;text-align:center;color:var(--muted);font-size:13px}
/* Full schedule date range: horizontal, scrollable on portrait phones. */
.schedule-date-strip{display:flex!important;grid-template-columns:none!important;gap:6px;overflow-x:auto!important;overflow-y:hidden;padding:2px 1px 5px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.schedule-date-strip .date-pill{flex:0 0 64px;min-width:64px;min-height:50px;padding:6px 7px;scroll-snap-align:start}
.schedule-date-strip .date-pill strong{font-size:13px}
.schedule-date-strip .date-pill span{font-size:10px}


/* Schedule player metadata + tournament timeline */
.player-flag{width:20px;height:14px;object-fit:cover;border-radius:2px;box-shadow:0 0 0 1px var(--line);flex:0 0 auto}
.player-country{font-size:11px;color:var(--muted);margin-left:2px;white-space:nowrap}
.tour-section{margin:0 0 20px}.tour-section-head{display:flex;align-items:center;justify-content:space-between;margin:12px 2px 8px}.tour-section-head h3{margin:0;font-size:15px}.tour-section-head span{font-size:11px;color:var(--muted)}
.tournament-card{grid-template-columns:44px minmax(0,1fr) auto}.tour-copy{min-width:0}.tour-date{font-size:14px;font-weight:800;font-variant-numeric:tabular-nums;margin-bottom:3px;color:var(--text)}.tour-status{font-size:11px;font-weight:700;padding:5px 8px;border-radius:999px;white-space:nowrap}.tour-status.ongoing{color:var(--accent);background:var(--accent-soft)}.tour-status.upcoming{color:var(--text);background:var(--button-soft)}.tour-status.finished{color:var(--muted);background:transparent;border:1px solid var(--line)}.tournament-card.finished{opacity:.82}.tournament-card.ongoing{box-shadow:0 0 0 1px rgba(136,192,208,.16),var(--shadow)}
@media(max-width:520px){.tournament-card{grid-template-columns:40px minmax(0,1fr) auto;gap:9px}.tour-date{font-size:13px}.tour-status{font-size:10px;padding:4px 6px}.player-main{gap:6px}}

.double-members{display:flex;flex-direction:column;gap:5px;min-width:0}.double-member{display:flex;align-items:center;gap:7px;min-width:0;font-size:14px;font-weight:650}.double-member span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.double-player-row{align-items:center}.tournament-card.clickable{cursor:pointer}.tournament-card.clickable:active{transform:scale(.995)}.tournament-detail-head{padding:14px;margin-top:10px}.tour-day{margin:14px 0}.tour-day-head{display:flex;align-items:baseline;gap:8px;margin:0 2px 8px}.tour-day-head strong{font-size:16px}.tour-day-head span{font-size:12px;color:var(--muted)}.detail-match{padding:11px;margin-bottom:8px}.detail-match-top{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px;padding-bottom:7px;border-bottom:1px solid var(--line)}.detail-match-top b{font-weight:650;color:var(--muted)}.detail-team{display:grid;grid-template-columns:1fr auto;gap:12px;padding:7px 0;font-size:14px}.detail-team strong{font-variant-numeric:tabular-nums}.back-btn{margin:2px 0 8px}

.player-flag-missing{width:22px;height:15px;border-radius:2px;border:1px dashed var(--line);background:transparent;display:inline-block;flex:0 0 auto;opacity:.65}.double-member{display:flex;align-items:center;gap:7px;min-height:21px}.double-members{display:grid;gap:3px;min-width:0}.double-member span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
