:root {
  color-scheme: dark;
  --bg: #080c11; --panel: #111923; --card: #151f2b; --line: #263443;
  --text: #f6f8fb; --muted: #91a0b0; --orange: #ff7a22; --green: #45e08b; --red: #ff6574;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: radial-gradient(circle at 10% 0,#1c1820 0,transparent 32%),var(--bg); color: var(--text); font: 14px Inter,ui-sans-serif,system-ui,sans-serif; }
.top { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 22px clamp(18px,4vw,56px) 18px; border-bottom: 1px solid var(--line); }
h1 { margin: 3px 0; font-size: clamp(26px,3.5vw,40px); line-height: 1.05; }
p { margin: 8px 0 0; color: var(--muted); }
.eyebrow { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.updated { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tabs, main { width: 100%; max-width: 1800px; margin: auto; }
.tabs { display: flex; gap: 8px; padding: 14px clamp(14px,3vw,32px) 0; }
.tabs button, .filters button, .filters select { min-height: 40px; border: 1px solid var(--line); background: #0f161f; color: var(--text); border-radius: 9px; padding: 9px 13px; }
.tabs button.active { border-color: var(--orange); color: var(--orange); }
main { padding: 14px clamp(14px,3vw,32px) 48px; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.filters select { min-width: 150px; }
.summary { color: var(--muted); margin: 12px 0; }
.franchise { min-width: 0; background: rgba(17,25,35,.84); border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; overflow: hidden; }
.franchise > header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.logo { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: #242f3b; display: grid; place-items: center; font-weight: 900; color: var(--orange); overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.franchise h2, .team h3 { margin: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 12px; padding: 12px; }
body[data-view="changes"] .team-grid { grid-template-columns: minmax(0,1fr); }
.team { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.team-head { border-left: 3px solid var(--tier-color,var(--green)); padding-left: 9px; margin-bottom: 10px; }
.team-head span { font-size: 10px; color: var(--tier-color,var(--green)); font-weight: 800; }
.players { display: grid; gap: 6px; }
.player { width: 100%; min-width: 0; border: 1px solid transparent; background: #101923; color: var(--text); border-radius: 8px; padding: 9px 10px; text-align: left; font: inherit; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.player:hover { border-color: #3b5268; background: #13202c; transform: translateY(-1px); }
.player:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.player-top { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.player-identity { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 5px; }
.player-identity strong { overflow-wrap: anywhere; }
.role-pill { display: inline-flex; padding: 3px 6px; border: 1px solid rgba(255,122,34,.32); border-radius: 999px; color: #ffad70; background: rgba(255,122,34,.08); font-size: 10px; font-weight: 800; line-height: 1.1; }
.open-player { margin-left: auto; color: #61778d; font-size: 22px; font-weight: 400; }
.avatar-fallback { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #243241; color: var(--orange); }
.player img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; margin-top: 7px; }
.stats div { min-width: 0; }
.stats span { display: block; color: var(--muted); font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; }
.stats strong { display: block; color: var(--text); font-size: 12px; margin-top: 2px; }
.timeline { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 12px; width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding: 12px 4px 15px; scrollbar-gutter: stable; }
.snapshot { flex: 0 0 clamp(230px,25vw,320px); min-width: 0; background: #0d171e; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.snapshot.current { border-color: var(--tier-color,#18878f); }
.snapshot header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.snapshot .member { padding: 7px 8px; background: #12242c; border-radius: 6px; margin: 5px 0; }
.transition { display: grid; flex: 0 0 190px; min-width: 0; place-content: center; gap: 7px; text-align: center; color: var(--muted); }
.arrow { color: #67ecf0; font-size: 24px; }
.change { background: #0b171d; border-radius: 6px; padding: 7px; font-size: 12px; }
.out { color: var(--red); } .in { color: var(--green); }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.player-dialog { width: min(620px,calc(100% - 24px)); max-height: min(720px,calc(100vh - 24px)); overflow: auto; padding: 0; border: 1px solid #34485c; border-radius: 16px; color: var(--text); background: #101822; box-shadow: 0 26px 80px rgba(0,0,0,.55); }
.player-dialog::backdrop { background: rgba(2,6,10,.78); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; z-index: 2; top: 12px; float: right; width: 36px; height: 36px; margin: 12px 12px -48px 0; border: 1px solid #34485c; border-radius: 9px; color: var(--muted); background: #172431; font-size: 24px; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--text); border-color: #55708b; }
.dialog-hero { display: flex; align-items: center; gap: 16px; padding: 28px 58px 22px 24px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 85% 0,rgba(255,122,34,.13),transparent 38%); }
.dialog-hero img { width: 70px; height: 70px; flex: 0 0 70px; border: 1px solid #455b70; border-radius: 16px; object-fit: cover; }
.dialog-hero h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 4px 0; font-size: 27px; }
.dialog-hero h2 .role-pill { margin-left: 0; }
.dialog-hero p { margin: 0; }
.dialog-kicker { color: var(--tier-color,var(--orange)); font-size: 11px; font-weight: 850; letter-spacing: 1px; }
.dialog-stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.dialog-stats div { min-width: 0; padding: 11px; border-radius: 8px; background: #141f2b; }
.dialog-stats span { display: block; color: var(--muted); font-size: 10px; line-height: 1.25; }
.dialog-stats strong { display: block; margin-top: 4px; font-size: 15px; }
.map-section { padding: 20px 24px 26px; }
.map-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 8px; margin-top: 10px; }
.map-list span { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #141f2b; font-weight: 700; }
.map-list b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; color: var(--orange); background: rgba(255,122,34,.1); font-size: 11px; }
@media (min-width: 1550px) { .team-grid { grid-template-columns: repeat(auto-fit,minmax(225px,1fr)); } }
@media (max-width: 760px) {
  .top { display: block; padding: 18px 16px 15px; }
  .top p { line-height: 1.45; }
  .updated { margin-top: 12px; white-space: normal; }
  .tabs, main { padding-left: 12px; padding-right: 12px; }
  .tabs { overflow-x: auto; }
  .filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filters label, .filters button, .filters select { width: 100%; min-width: 0; }
  .team-grid { grid-template-columns: minmax(0,1fr); padding: 9px; }
  .stats { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 8px; }
  .dialog-stats { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 15px; }
  .dialog-hero { padding-left: 16px; }
  .map-section { padding: 18px 15px 22px; }
  .snapshot { flex-basis: min(78vw,275px); }
  .transition { flex-basis: min(58vw,190px); }
}
@media (max-width: 420px) {
  .filters { grid-template-columns: 1fr; }
  .franchise > header { padding: 12px; }
  .team { padding: 10px; }
}
