:root{
  --bg:#0d1117; --panel:#161b22; --panel2:#1c2128;
  --border:#30363d; --border2:#262c36;
  --text:#e6edf3; --muted:#8b949e; --dim:#6e7681;
  --blue:#4da6ff; --blue2:#0969da;
  --green:#3fb950; --red:#e05252; --purple:#c792ea; --gold:#e3b341;
  --radius:10px; --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#30363d;border-radius:6px}

/* nav */
.topnav{display:flex;justify-content:space-between;align-items:center;height:56px;padding:0 22px;background:#101216;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:50}
.nav-left{display:flex;align-items:center;gap:6px}
.logo{display:flex;align-items:center;gap:9px;font-weight:700;font-size:16px;margin-right:14px}
.logo .mark{width:30px;height:30px;border-radius:8px;object-fit:cover}
.navlink{padding:7px 11px;border-radius:7px;color:#c9d1d9;font-size:14px;font-weight:500;cursor:pointer;transition:.12s;white-space:nowrap}
.navlink:hover{background:#1c2230;color:#fff}
.navlink.active{color:var(--blue);font-weight:700;background:#11233a}
.nav-divider{width:1px;height:22px;background:var(--border);margin:0 6px}
.nav-right{display:flex;align-items:center;gap:12px}
.team-badge{display:flex;align-items:center;gap:8px;background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:4px 10px 4px 5px}
.team-badge .crest{width:26px;height:26px;border-radius:6px;object-fit:cover}
.team-crest{width:56px;height:56px;border-radius:14px;object-fit:cover}
.btn-icon{width:18px;height:18px;object-fit:cover;border-radius:4px;vertical-align:middle;margin-right:4px}

/* layout */
.wrap{max-width:1180px;margin:0 auto;padding:26px 22px 60px}
.page-head{margin-bottom:18px}
.page-head h1{font-size:24px;font-weight:800;letter-spacing:-.4px}
.page-head p{color:var(--muted);font-size:13.5px;margin-top:3px}
.row-between{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:12px}

.grid{display:grid;gap:16px}
.card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:16px}
.card h3{font-size:13px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);font-weight:700;margin-bottom:12px;display:flex;align-items:center;gap:8px}

.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:2px 9px;border-radius:20px;font-weight:600}
.pill.green{background:#103423;color:var(--green)} .pill.red{background:#3a1717;color:var(--red)}
.pill.blue{background:#11233a;color:var(--blue)} .pill.purple{background:#241b34;color:var(--purple)}
.pill.gray{background:#21262d;color:var(--muted)} .pill.gold{background:#33290c;color:var(--gold)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:9px;padding:10px 16px;font-weight:600;font-size:14px;cursor:pointer;border:1px solid var(--border);background:var(--panel2);color:var(--text);transition:.12s;font-family:var(--font)}
.btn:hover{border-color:#4b5563;background:#222b38}
.btn.primary{background:linear-gradient(135deg,#4da6ff,#1d7fe0);border:none;color:#06121f}
.btn.report{background:linear-gradient(135deg,#e05252,#b83232);border:none;color:#fff;font-weight:700;letter-spacing:.4px}
.btn.ghost{background:transparent}
.btn.lg{padding:14px 22px;font-size:15px}

/* stat */
.stat{display:flex;flex-direction:column;gap:3px}
.stat .big{font-size:28px;font-weight:800;letter-spacing:-.5px}
.stat .lbl{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
.tag{font-size:11px;color:var(--muted)}

/* match rows */
.match{display:flex;align-items:center;gap:14px;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:11px 14px;transition:.12s}
.match:hover{border-color:var(--blue);background:#141b26}
.match + .match{margin-top:9px}
.m-cat{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0}
.m-cat.scrim{background:#1a2440;color:var(--blue)} .m-cat.pub{background:#2b2410;color:var(--gold)} .m-cat.official{background:#241b34;color:var(--purple)}
.m-teams{min-width:210px;font-weight:600;font-size:14px;display:flex;align-items:center;gap:7px}
.m-teams .vs{color:var(--dim);font-weight:500;font-size:12px}
.m-heroes{display:flex;gap:10px;align-items:center;flex:1;justify-content:center}
.hero{width:44px;height:32px;border-radius:4px;background:#222b38;border:2px solid #2f3a4a;display:flex;align-items:center;justify-content:center;font-size:9px;color:var(--muted);object-fit:cover;object-position:center 20%}
.hero.r{border-color:#3fb95066} .hero.d{border-color:#e0525266}
.m-meta{display:flex;align-items:center;gap:8px;flex-shrink:0;min-width:230px;justify-content:flex-end}
.m-meta .mid{font-family:monospace;color:var(--dim);font-size:11px}
.win-r{color:var(--green);font-weight:700;font-size:11px} .win-d{color:var(--red);font-weight:700;font-size:11px}

/* match draft section */
.draft-section h4{color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;margin-bottom:12px}
.draft-row{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px}
.draft-row:last-child{margin-bottom:0}
.draft-side-label{font-size:11px;font-weight:700;min-width:80px;padding-top:14px;text-align:right;flex-shrink:0}
.draft-chips{display:flex;flex-wrap:wrap;gap:6px}
.draft-entry{display:flex;flex-direction:column;align-items:center;gap:2px;cursor:default}
.draft-seq-lbl{font-size:9px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.draft-hero-img{width:54px;height:61px;object-fit:cover;object-position:center 15%;border-radius:4px;display:block}
.draft-hero-lbl{font-size:9px;color:var(--muted);max-width:58px;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}

/* filters */
.filterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.chip{padding:7px 13px;border-radius:8px;border:1px solid var(--border);background:var(--panel);color:#c9d1d9;font-size:13px;cursor:pointer;font-weight:500}
.chip.active{background:#11233a;border-color:var(--blue);color:var(--blue);font-weight:700}
.seg{display:inline-flex;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:4px;gap:4px}
.seg a{color:var(--muted);font-weight:600;font-size:13.5px;padding:7px 16px;border-radius:7px}
.seg a.active{background:var(--blue2);color:#fff}

/* dropzone / calendar / hero rows */
.dropzone{border:2px dashed #2f3a4a;border-radius:12px;padding:26px;text-align:center;background:#0f141b;color:var(--muted)}
.dropzone b{color:var(--blue)}
.cal-event{display:flex;gap:10px;padding:9px 0;border-bottom:1px solid var(--border2)}
.cal-event:last-child{border:none}
.cal-strip{width:3px;border-radius:3px}
.cal-date{flex-shrink:0;width:42px;text-align:center}
.cal-date .d{font-size:18px;font-weight:800;line-height:1}
.cal-date .m{font-size:10px;color:var(--muted);text-transform:uppercase}
.cal-event .ev{font-weight:600;font-size:13.5px}
.cal-event .ti{font-size:12px;color:var(--muted)}
.hero-row{display:flex;align-items:center;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--border2)}
.hero-row:last-child{border:none}
.hero-row .hn{display:flex;align-items:center;gap:9px}

.note{background:#11233a;border-left:3px solid var(--blue);border-radius:8px;padding:11px 14px;font-size:13px;color:#b8c7d9}

/* upload */
.dropzone.drag-over{border-color:var(--blue);background:#11233a}
.up-file-list{margin-top:14px;display:flex;flex-direction:column;gap:5px;text-align:left}
.up-file-item{display:flex;align-items:center;gap:8px;padding:7px 10px;background:var(--panel2);border:1px solid var(--border);border-radius:7px;font-size:12.5px;flex-wrap:wrap}
.up-file-item .fi-name{flex:1;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.up-file-item .fi-size{color:var(--dim);white-space:nowrap}
.up-file-item .fi-status{min-width:18px;text-align:center}
.up-file-item.ok{border-color:#1f4a30;background:#0d2818}
.up-file-item.error{border-color:#4a1f1f;background:#2d0f0f}
.up-file-item .fi-tip{width:100%;font-size:11.5px;color:var(--muted);padding-top:2px;white-space:normal}

/* report selector */
.select{padding:10px 12px;border-radius:9px;border:1px solid var(--border);background:var(--panel2);color:var(--text);font-size:14px;font-family:var(--font)}
.empty{padding:40px;text-align:center;color:var(--muted);font-size:14px}
.tabs{display:flex;gap:6px;border-bottom:1px solid var(--border);margin-bottom:18px;flex-wrap:wrap}
.tab{padding:9px 14px;color:var(--muted);font-weight:600;font-size:13.5px;border-bottom:2px solid transparent;margin-bottom:-1px}
.tab.active{color:var(--blue);border-color:var(--blue)}

/* auth */
.login-bg{min-height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(900px 500px at 70% -10%,#13233b 0%,transparent 60%),radial-gradient(700px 480px at 10% 110%,#1a1430 0%,transparent 55%),var(--bg)}
.login-card{width:390px;background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:34px 30px;box-shadow:0 24px 60px rgba(0,0,0,.5)}
.login-card .logo{justify-content:center;font-size:20px;margin:0 0 6px}
.login-card .logo .mark{width:40px;height:40px;font-size:22px}
.login-sub{text-align:center;color:var(--muted);font-size:13px;margin-bottom:22px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px;font-weight:600}
.field input{width:100%;background:#0c0e12;border:1px solid var(--border);border-radius:9px;padding:11px 12px;color:var(--text);font-size:14px;outline:none;font-family:var(--font)}
.field input:focus{border-color:var(--blue)}
.auth-foot{text-align:center;color:var(--dim);font-size:12px;margin-top:18px}
.auth-foot a{color:var(--blue)}
.flash{background:#3a1717;border:1px solid #e0525244;color:#ffb4b4;border-radius:9px;padding:10px 13px;font-size:13px;margin-bottom:14px}

/* player table */
.ptable{width:100%;border-collapse:collapse;font-size:13px}
.ptable th{text-align:left;color:var(--muted);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.4px;padding:6px 8px;border-bottom:1px solid var(--border)}
.ptable td{padding:7px 8px;border-bottom:1px solid var(--border2)}
.ptable tbody tr:last-child td{border:none}
.ptable td:first-child{font-weight:600}

/* zone presence */
.swatch{width:10px;height:10px;border-radius:3px;display:inline-block;vertical-align:middle;margin-right:3px}
.pres-row{padding:7px 0;border-bottom:1px solid var(--border2)}
.pres-row:last-child{border:none}
.pres-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:600;margin-bottom:5px;gap:10px}
.pres-head .tag{font-weight:400}
.pres-bar{display:flex;height:9px;border-radius:5px;overflow:hidden;background:#0c0e12}
.pres-bar > span{display:block;height:100%}

/* item build table */
.ib-table{border-collapse:collapse;width:100%;font-size:13px}
.ib-table th{text-align:left;color:var(--muted);font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:.4px;padding:6px 8px;border-bottom:1px solid var(--border);white-space:nowrap}
.ib-table td{padding:5px 6px;border-bottom:1px solid var(--border2);vertical-align:top}
.ib-table tbody tr:last-child td{border:none}
.ib-table tbody tr:hover td{background:var(--panel2)}
.ib-player{display:flex;align-items:center;gap:8px;min-width:130px;white-space:nowrap}
.ib-player img{width:44px;height:32px;border-radius:4px;object-fit:cover;object-position:center 20%;background:var(--panel2);flex-shrink:0}
.ib-player span{font-weight:600;font-size:13px}
.ib-bucket{display:flex;flex-wrap:wrap;gap:3px;min-width:64px;min-height:26px}
.ib-item{display:flex;flex-direction:column;align-items:center;gap:1px}
.ib-item img{width:32px;height:23px;border-radius:2px;object-fit:cover;background:var(--panel2)}
.ib-t{font-size:8px;color:var(--dim)}

/* tournament list */
.search-box{width:100%;max-width:520px;background:#0c0e12;border:1px solid var(--border);border-radius:9px;padding:10px 14px;color:var(--text);font-size:14px;outline:none;font-family:var(--font);margin-bottom:16px}
.search-box:focus{border-color:var(--blue)}
.t-list{display:flex;flex-direction:column;gap:7px}
.t-card{display:flex;justify-content:space-between;align-items:center;padding:13px 16px;background:var(--panel);border:1px solid var(--border);border-radius:9px;transition:.12s}
.t-card:hover{border-color:var(--blue);background:#141b26}
.t-name{font-weight:700;font-size:15px}
.t-meta{display:flex;gap:16px;align-items:center}
.t-games{color:var(--green);font-weight:600;font-size:13px}
.hero-portrait-mini{width:34px;height:20px;border-radius:2px;object-fit:cover;vertical-align:middle;margin-right:6px}
.team-logo{width:20px;height:20px;object-fit:contain;vertical-align:middle;margin-right:6px;border-radius:3px}
.team-logo.lg{width:32px;height:32px;margin-right:8px}
.ptable th.num,.ptable td.num{text-align:right}
.ptable th.sorted{color:var(--blue)}
.ptable.sortable th[data-k]:hover{color:var(--text)}

/* scouting rows */
.sc-row{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid var(--border2)}
.sc-row:last-child{border:none}
.sc-hero{flex:1;min-width:0;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-bar{flex:1;height:6px;background:#0c0e12;border-radius:4px;overflow:hidden;max-width:160px}
.sc-bar > span{display:block;height:100%;background:var(--blue)}

/* dashboard: analytics link card + recent form */
.link-card{transition:.12s;cursor:pointer}
.link-card:hover{border-color:var(--blue);background:#141b26}
.form-row{display:flex;gap:5px;flex-wrap:wrap}
.form-pip{width:24px;height:24px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800}
.form-pip.w{background:#103423;color:var(--green)}
.form-pip.l{background:#3a1717;color:var(--red)}

/* match overview: per-player stats table */
.team-block{margin-bottom:16px}
.team-header{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.team-name{font-size:14px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.winner-badge{background:#103423;color:var(--green);font-size:11px;padding:2px 8px;border-radius:10px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.stats-table{width:100%;border-collapse:collapse;font-size:13px}
.stats-table th{color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:6px 8px;text-align:center;border-bottom:1px solid var(--border);white-space:nowrap}
.stats-table th.left{text-align:left}
.stats-table td{padding:6px 8px;text-align:center;border-bottom:1px solid var(--border2);vertical-align:middle}
.stats-table td.left{text-align:left}
.stats-table tr:hover td{background:var(--panel2)}
.stats-table tr.totals td{border-top:1px solid var(--border);color:var(--muted);font-size:11px}
.hero-cell{display:flex;align-items:center;gap:8px}
.hero-portrait{width:52px;height:38px;border-radius:4px;object-fit:cover;object-position:center 20%;background:var(--panel2);flex-shrink:0}
.hero-cell-text{display:inline-flex;flex-direction:column;justify-content:center;line-height:1.25}
.hero-name-txt{font-weight:700;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--text);display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.hero-sublabel{font-size:10px;color:var(--muted)}
.role-badge{width:14px;height:14px;object-fit:contain;border-radius:3px;background:#0c0e1233;padding:1px}
.kda-k{color:var(--green)}
.kda-d{color:var(--red)}
.kda-a{color:var(--muted)}
.net-worth{color:var(--gold);font-weight:600}
.gpm-xpm{color:#90a4ae}
.items-cell{display:flex;flex-direction:row;flex-wrap:nowrap;gap:2px;align-items:center;justify-content:flex-start;min-width:208px}
.item-icon{width:32px;height:24px;border-radius:2px;object-fit:cover;background:#0c0e12;flex-shrink:0}
.item-slot-empty{width:32px;height:24px;border-radius:2px;background:var(--panel2);border:1px solid var(--border2);flex-shrink:0}
.stats-table-wrap{overflow-x:auto}

/* movement: zone presence below the heatmap, in a readable multi-column grid */
.pres-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:2px 24px}

/* open page: filter inputs + pagination */
.filt{flex:1;min-width:120px;max-width:200px;background:#0c0e12;border:1px solid var(--border);border-radius:8px;padding:9px 12px;color:var(--text);font-size:13px;outline:none;font-family:var(--font)}
.filt:focus{border-color:var(--blue)}
.pager{display:flex;gap:6px;justify-content:center;align-items:center;flex-wrap:wrap;padding:22px 0}
.pg{padding:7px 12px;border:1px solid var(--border);border-radius:7px;color:#c9d1d9;font-size:13px;font-weight:600;background:var(--panel)}
.pg:hover{border-color:var(--blue);color:#fff}
.pg.cur{background:var(--blue2);border-color:var(--blue2);color:#fff}
.pg.disabled,.pg.dots{color:var(--dim);border-color:transparent;background:none;pointer-events:none}
