/* ── Reset ── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#0c0c0c;
  --bg-card:#141414;
  --bg-elevated:#1b1b1b;
  --border:#2a2a2a;
  --border-light:#3c3c3c;
  --text:#f2f2f2;
  --text-secondary:#a0a0a0;
  --text-muted:#757575;
  --red:#f85149;
  --radius:4px;
  --radius-sm:4px;
  --font:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,sans-serif;
  --accent:#3a7bd5;
}
/* Light theme - the default */
[data-theme="light"]{
  --bg:#f4f4f5;
  --bg-card:#ffffff;
  --bg-elevated:#ebebed;
  --border:#d9d9dc;
  --border-light:#c6c6ca;
  --text:#141416;
  --text-secondary:#56565e;
  --text-muted:#8b8b93;
  --red:#d93025;
}
html{scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.6;min-height:100vh;display:flex;flex-direction:column;overflow-x:hidden}
a{color:var(--text);text-decoration:none}a:hover{color:var(--text);text-decoration:underline}
button{cursor:pointer;font-family:inherit}

/* ── Site header ── */
.site-header{position:sticky;top:0;z-index:100;background:var(--bg);border-bottom:1px solid var(--border)}
.site-header .container{max-width:1440px;margin:0 auto;padding:0 28px;height:64px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.logo{display:inline-flex;align-items:center;gap:8px;text-decoration:none;white-space:nowrap}
.logo-img{height:38px;width:auto;display:block}

/* ── Site switch (APL / PUGS) ── */
.site-switch{display:inline-flex;align-items:center;gap:4px;margin-left:14px}
.site-switch-btn{padding:4px 14px;border-radius:999px;border:1px solid var(--border);font-size:.72rem;font-weight:700;letter-spacing:.06em;color:var(--text-muted);text-decoration:none;transition:all .12s}
.site-switch-btn:hover{color:var(--text);border-color:var(--text-secondary);text-decoration:none}
.site-switch-btn.active{background:var(--text);color:var(--bg);border-color:var(--text)}
.nav-auth{display:flex;align-items:center;gap:8px}
.nav-icon-btn{height:auto;width:auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--text-secondary);cursor:pointer;transition:all .15s;font-size:.82rem;font-weight:500}
.nav-icon-btn:hover{color:var(--text);border-color:var(--border-light);background:var(--bg-elevated)}
.search-dropdown{position:relative}
.search-dropdown-panel{position:absolute;top:calc(100% + 8px);right:0;min-width:320px;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:10px;z-index:200}
.search-dropdown-panel input{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);color:var(--text);font-size:.9rem;font-family:inherit;outline:none}
.search-dropdown-panel input:focus{border-color:var(--text-secondary)}
#siteSearchResults{margin-top:6px;max-height:300px;overflow-y:auto}
#siteSearchResults .search-item{padding:8px 10px;border-radius:4px;cursor:pointer;font-size:.88rem}
#siteSearchResults .search-item:hover{background:var(--bg-elevated)}
#siteSearchResults .sub{color:var(--text-muted);font-size:.75rem}

/* ── League bar ── */
.league-bar{background:var(--bg-card);border-bottom:1px solid var(--border)}
.league-bar-wrap{max-width:1440px;margin:0 auto;padding:0 28px}
.league-bar-scroll{display:flex;align-items:center;gap:2px;overflow-x:auto}
.league-nav{display:flex;align-items:center;gap:2px}
.league-nav a.gm-nav{margin-left:auto}
.league-nav a{padding:11px 12px;font-size:.85rem;font-weight:500;color:var(--text-secondary);white-space:nowrap;border-bottom:2px solid transparent;text-decoration:none;transition:color .15s}
.league-nav a:hover{color:var(--text);text-decoration:none}
.league-nav a.active{color:var(--text);border-bottom-color:var(--text)}

/* ── PUG bar (PUGS section nav) ── */
.pug-bar{background:var(--bg-card);border-bottom:1px solid var(--border)}
.pug-bar-wrap{max-width:1440px;margin:0 auto;padding:0 28px}
.pug-bar-scroll{display:flex;align-items:center;gap:2px;overflow-x:auto}
.pug-nav{display:flex;align-items:center;gap:2px}
.pug-nav a{padding:11px 12px;font-size:.85rem;font-weight:500;color:var(--text-secondary);white-space:nowrap;border-bottom:2px solid transparent;text-decoration:none;transition:color .15s}
.pug-nav a:hover{color:var(--text);text-decoration:none}
.pug-nav a.active{color:var(--text);border-bottom-color:var(--text)}
.pug-section{scroll-margin-top:70px}
.right{display:flex;align-items:center;gap:8px}
.auth-user{font-size:.82rem;color:var(--text);font-weight:500;text-decoration:none;padding:4px 8px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);transition:all.15s;max-width:240px;overflow:hidden;display:inline-flex;align-items:center;gap:6px}
.auth-user:hover{color:var(--text);background:var(--bg-elevated);border-color:var(--border-light);text-decoration:none}
.auth-user .uname{max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.team-tag{font-size:.65rem;font-weight:700;background:var(--bg-elevated);border:1px solid var(--border);border-radius:4px;padding:1px 6px;margin-left:5px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.03em;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.team-tag img{max-height:12px;width:auto;vertical-align:middle}
.fa-tag{color:var(--text-muted);border-style:dashed}
.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 16px;border-radius:var(--radius-sm);font-size:.82rem;font-weight:500;border:1px solid var(--border);background:transparent;color:var(--text);text-decoration:none;transition:all .15s}
.btn:hover{background:var(--bg-card);color:var(--text);text-decoration:none}
.btn-sm{padding:6px 14px;font-size:.8rem;font-weight:600}
.btn-sm:active{background:var(--text);color:var(--bg);border-color:var(--text);transform:translateY(1px)}
.btn-primary.btn-sm:active{background:var(--bg);color:var(--text);border-color:var(--text)}
.btn-primary{background:var(--text);color:var(--bg);border-color:var(--text);font-weight:600}
.btn-primary:hover{background:var(--text-secondary);border-color:var(--text-secondary)}
.admin-tag{font-size:.65rem;border:1px solid var(--text-secondary);color:var(--text-secondary);padding:2px 7px;border-radius:4px;font-weight:600;text-transform:uppercase}

/* ── Layout ── */
.wrap{flex:1;max-width:1440px;margin:28px auto 48px;padding:28px 28px;width:100%;background:linear-gradient(180deg,rgba(255,255,255,0.02),transparent);border-radius:4px}
.page-h{margin-bottom:24px}
.page-h h1{font-size:1.4rem;font-weight:700;margin-bottom:2px}
.page-h p{color:var(--text-secondary);font-size:.88rem}
.section-h{font-size:1rem;font-weight:600;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;padding-bottom:8px;border-bottom:1px solid var(--border)}
.empty{text-align:center;color:var(--text-muted);padding:32px 16px;font-size:.88rem;display:none}
.empty:only-child{display:block}

/* ── Home ── */
.hero{border:1px solid var(--border);border-radius:var(--radius);padding:44px 36px;text-align:center;margin-bottom:28px}
.hero h1{font-size:2rem;font-weight:800;color:var(--text);letter-spacing:-.01em}
.hero p{color:var(--text-secondary);margin-top:6px;font-size:.95rem}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-bottom:28px}
.stat{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px;text-align:center}
.stat .n{font-size:1.6rem;font-weight:700;color:var(--text)}
.stat .l{font-size:.78rem;color:var(--text-muted);margin-top:2px}
.grid-2{display:grid;grid-template-columns:1fr 300px;gap:24px;align-items:start}
@media(max-width:860px){.grid-2{grid-template-columns:1fr}}

/* ── Card ── */
.card{background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:16px;margin-bottom:14px}
.card h3{font-size:.82rem;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-bottom:10px}

/* ── Match Grid ── */
.m-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.m-card{width:auto;padding:12px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;gap:4px;transition:border-color.15s;position:relative}
.m-card:hover{border-color:var(--border-light)}
.m-card .m-time{font-size:.7rem;color:var(--text-muted);text-align:center;font-weight:600;padding-bottom:2px;text-transform:uppercase;letter-spacing:.03em}
.m-teams{display:flex;flex-direction:column;gap:3px}
.m-row{display:flex;align-items:center;gap:6px;justify-content:space-between}
.m-row .m-abbr{font-size:.82rem;font-weight:600;flex:1;min-width:0}
.m-row .m-score{font-size:1rem;font-weight:700;flex-shrink:0;min-width:1.3em;text-align:right}
.m-status{font-size:.7rem;color:var(--text-muted);text-align:center;padding-top:3px;border-top:1px solid var(--border);margin-top:2px}

/* ── News ── */
.news-list{display:flex;flex-direction:column;gap:10px}
.news-item{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px;position:relative;transition:border-color.15s;display:block;text-decoration:none;color:inherit}
.news-item:hover{border-color:var(--border-light)}
.news-item .ndate{font-size:.74rem;color:var(--text-muted);margin-bottom:5px}
.news-item .ntitle{font-size:1rem;font-weight:700;margin-bottom:5px}
.news-item .nbody{font-size:.86rem;color:var(--text-secondary);line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}

/* ── Stats rows (shared: profile + insights) ── */
.profile-career-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--border);font-size:.86rem}
.profile-career-row:last-child{border-bottom:none}
.profile-career-row label{color:var(--text-muted);min-width:0}
.profile-career-row span{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}

/* ── Admin bar ── */
.admin-bar{position:sticky;top:64px;z-index:90;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:8px 10px;margin-bottom:18px}
.admin-bar-jumps,.admin-bar-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.admin-bar .btn{background:var(--bg);color:var(--text-secondary)}
.admin-bar .btn:hover{color:var(--text);border-color:var(--text)}
.a-sec{scroll-margin-top:140px}

/* ── Admin tabs + views ── */
.admin-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:16px;flex-wrap:wrap}
.admin-tab{padding:10px 16px;font-size:.84rem;font-weight:600;color:var(--text-muted);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;transition:color .15s}
.admin-tab:hover{color:var(--text);text-decoration:none}
.admin-tab.active{color:var(--text);border-bottom-color:var(--text)}
.admin-view{display:none}
.admin-view.active{display:block}
.a-search{width:100%;margin-bottom:8px}

/* ── Ticket conversation ── */
.tk-head{font-size:1rem;margin-bottom:12px}
.ticket-thread{display:flex;flex-direction:column;gap:8px;max-height:320px;overflow-y:auto;padding:2px}
.ticket-msg{border:1px solid var(--border);background:var(--bg);border-radius:4px;padding:10px 12px}
.ticket-msg.mine{border-color:var(--border-light);background:var(--bg-elevated)}
.ticket-msg-head{display:flex;justify-content:space-between;gap:10px;font-size:.72rem;color:var(--text-muted);margin-bottom:4px}
.ticket-msg-head b{color:var(--text)}
.ticket-msg-body{font-size:.88rem;white-space:pre-wrap;line-height:1.5}
.ticket-reply{margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}
.ticket-reply textarea{width:100%;min-height:64px;resize:vertical}

/* ── Chat inputs (ticket page + admin ticket modal) match the site ── */
.tk-chat-input textarea,.ticket-reply textarea{
  -webkit-appearance:none;appearance:none;
  background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--text);
  font-family:var(--font);font-size:.88rem;line-height:1.5;padding:10px 12px;
  caret-color:var(--text);transition:border-color .12s,box-shadow .12s;
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;resize:vertical
}
.tk-chat-input textarea:focus,.ticket-reply textarea:focus{outline:none;border-color:var(--text);box-shadow:0 0 0 1px var(--text)}
.tk-chat-input textarea::placeholder,.ticket-reply textarea::placeholder{color:var(--text-muted)}
.tk-chat-input textarea::selection,.ticket-reply textarea::selection{background:var(--text);color:var(--bg)}
.tk-chat-input textarea::-webkit-scrollbar,.ticket-reply textarea::-webkit-scrollbar{width:6px}
.tk-chat-input textarea::-webkit-scrollbar-thumb,.ticket-reply textarea::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.tk-chat-input .btn{padding:9px 18px;align-self:stretch;display:inline-flex;align-items:center}

/* ── Ticket type badges (admin panel) ── */
.tick-type{display:inline-block;font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;padding:2px 7px;border:1px solid var(--border);border-radius:2px}
.tick-type[data-t="team"]{color:#3a7bd5;border-color:rgba(58,123,213,.4)}
.tick-type[data-t="report"]{color:var(--red);border-color:rgba(248,81,73,.4)}
.tick-type[data-t="general"]{color:var(--text-secondary);border-color:var(--border)}

/* ── Player attribute editor modal ── */
.pa-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.pa-name{font-size:1.05rem;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pa-ovr{font-size:.82rem;color:var(--text-muted);white-space:nowrap}
.pa-ovr b{font-size:1.2rem;color:var(--text);font-variant-numeric:tabular-nums;margin-left:6px}
.pa-row{display:flex;align-items:center;gap:10px;padding:7px 0}
.pa-label{width:110px;flex-shrink:0;font-size:.85rem;color:var(--text-muted)}
.pa-row input[type="range"]{flex:1;accent-color:var(--text);min-width:0}
.pa-val{width:30px;text-align:right;font-weight:700;font-variant-numeric:tabular-nums;flex-shrink:0}
.pa-note{font-size:.72rem;color:var(--text-muted);margin-top:10px}

/* ── Toggle switch (site-styled) ── */
.switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-size:.85rem;user-select:none;color:var(--text)}
.switch input{display:none}
.switch .track{width:44px;height:22px;border:1px solid var(--border);background:var(--bg-elevated);border-radius:4px;position:relative;flex-shrink:0;transition:all .15s}
.switch .track::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;background:var(--text-muted);border-radius:2px;transition:all .15s}
.switch input:checked + .track{background:var(--text);border-color:var(--text)}
.switch input:checked + .track::after{left:24px;background:var(--bg)}

/* ── Horizontally scrollable preset chips (iOS-style) ── */
.deadline-presets{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;margin-bottom:8px}
.deadline-presets .btn{flex-shrink:0;white-space:nowrap}
.deadline-presets::-webkit-scrollbar{height:4px}
.deadline-presets::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}

/* ── Contract deadline fields (YYYY - MM - DD  at  HH : MM) ── */
.deadline-fields{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.deadline-fields .dl-y{width:80px;text-align:center;font-variant-numeric:tabular-nums}
.deadline-fields .dl-m{width:54px;text-align:center;font-variant-numeric:tabular-nums}
.deadline-fields .dl-sep{color:var(--text-muted);font-weight:700}
.deadline-fields .dl-sp{font-size:.66rem;text-transform:uppercase;letter-spacing:.08em}

/* ── Teams grid ── */
.teams-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}
.team-tile{display:block;text-align:center;padding:24px 16px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);text-decoration:none;color:inherit;transition:border-color .15s}
.team-tile:hover{border-color:var(--border-light)}
.team-tile-logo{width:56px;height:56px;object-fit:cover;display:block;margin:0 auto 10px;border-radius:var(--radius-sm)}
.team-tile-name{font-weight:600;font-size:.95rem}
.team-tile-record{font-size:.78rem;color:var(--text-muted);margin-top:2px}
.team-tile-ovr{display:block;margin-top:3px;font-size:.72rem;font-weight:700;color:var(--text-secondary)}

/* ── Table ── */
.t-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius)}
.sidebar-card .t-wrap{border:none;border-radius:0}
table{width:100%;border-collapse:collapse;font-size:.84rem}
th{text-align:center;padding:10px;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);background:var(--bg-card);border-bottom:1px solid var(--border);white-space:nowrap}
th.sortable{cursor:pointer;user-select:none}
.sort-indicator{font-size:.62em;color:var(--text-muted)}
/* Header and body share the same column alignment - no width tricks that
   squeeze the header while the body row stays wide */
th:nth-child(2),td:nth-child(2){text-align:left}
th.num,td.num{text-align:right}
.tp-bc{font-size:.82rem;color:var(--text-muted);margin-bottom:10px}
.tp-bc a{color:var(--text-muted);text-decoration:none}
.tp-bc a:hover{color:var(--text)}
.tp-color-dot{display:inline-block;width:10px;height:10px;border-radius:4px;margin-right:6px;vertical-align:middle;flex-shrink:0}

/* ── Standings card / table (shared by standings + stats pages) ── */
.standings-card{background:var(--bg-card);border:1px solid var(--border);border-radius:4px;overflow:hidden}
.standings-card .t-wrap{max-height:none;overflow-x:auto;border:none;border-radius:0}
.standings-header{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:16px 18px;border-bottom:1px solid var(--border)}
.standings-title{font-size:1.05rem;font-weight:800}
.standings-sub{font-size:.78rem;color:var(--text-muted);margin-top:2px}
.standings-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.stats-filterbar{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;padding:12px 18px;border-bottom:1px solid var(--border)}
.cdd-toggle{display:flex;gap:2px;background:var(--bg-elevated);border:1px solid var(--border);border-radius:4px;padding:3px}
.cdd-toggle a{display:inline-flex;align-items:center;padding:5px 12px;border-radius:4px;font-size:.78rem;font-weight:600;color:var(--text-secondary);text-decoration:none;white-space:nowrap;transition:all .12s}
.cdd-toggle a:hover{color:var(--text)}
.cdd-toggle a.active{background:var(--text);color:var(--bg)}
.standings-table{width:100%;border-collapse:collapse;font-size:.88rem}
.standings-table th{padding:10px 12px;border-bottom:1px solid var(--border);color:var(--text-muted);font-size:.66rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;text-align:center;white-space:nowrap;background:var(--bg-elevated)}
.standings-table th:first-child{width:auto}
.standings-table td{padding:11px 12px;border-bottom:1px solid var(--border);white-space:nowrap;text-align:center;font-variant-numeric:tabular-nums}
.standings-table td:nth-child(2){font-weight:inherit;text-align:left}
.standings-table tbody tr:last-child td{border-bottom:none}
.standings-table tbody tr{transition:background .1s}
.standings-table tbody tr:hover{background:var(--bg-elevated)}
.standings-team-cell{display:flex;align-items:center;gap:12px;min-width:0}
.standings-team-logo{width:40px;height:40px;border-radius:4px;object-fit:cover;flex-shrink:0;border:1px solid var(--border);background:var(--bg-elevated)}
.standings-team-dot{width:40px;height:40px;border-radius:4px;flex-shrink:0;border:1px solid var(--border)}
.standings-team-name{font-weight:700;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.standings-pts{font-weight:800}
.standings-gd-pos{color:#4ade80}
.standings-gd-neg{color:#f87171}
.standings-streak{font-size:.78rem;font-weight:800}
.standings-streak-w{color:#4ade80}
.standings-streak-l{color:#f87171}
.standings-empty{padding:28px;text-align:center;color:var(--text-muted);font-size:.88rem}
td{padding:9px 10px;border-bottom:1px solid var(--border);white-space:nowrap;text-align:center}
tr:last-child td{border-bottom:none}
tr:hover{background:var(--bg-elevated)}
.pts{font-weight:700;color:var(--text)}
.p-m{color:var(--text-muted)}

/* ── Tabs ── */
.tabs{display:flex;gap:2px;background:var(--bg-card);border-radius:var(--radius-sm);padding:3px}
.tab{background:transparent;border:none;color:var(--text-muted);padding:4px 12px;border-radius:4px;font-size:.8rem;font-weight:500;cursor:pointer;transition:all.15s}
.tab:hover{color:var(--text)}
.tab.active{background:var(--text);color:var(--bg);font-weight:600}

/* ── Shoutbox ── */
.shoutbox{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}
.shoutbox .sh-head{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--border)}
.shoutbox .sh-head h3{font-size:.85rem;font-weight:600}
.shoutbox .sh-head span{font-size:.75rem;color:var(--text-muted)}
.shoutbox form{padding:10px 14px;border-bottom:1px solid var(--border);display:flex;gap:8px}
.shoutbox form input{flex:1;padding:9px 12px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:.85rem}
.shoutbox form input:focus{border-color:var(--text-muted);outline:none}
.shoutbox form button{padding:9px 14px;background:var(--text);color:var(--bg);border:none;border-radius:var(--radius-sm);font-weight:600;font-size:.82rem}
.shoutbox-msgs{max-height:340px;overflow-y:auto;font-size:.86rem}
.shoutbox-msgs::-webkit-scrollbar{width:5px}
.shoutbox-msgs::-webkit-scrollbar-track{background:var(--bg)}
.shoutbox-msgs::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}
.msg{padding:8px 14px;display:flex;align-items:flex-start;gap:8px;position:relative}
.msg:hover{background:var(--bg-elevated)}
.msg .mt{flex:0 0 4.2rem;padding:2px 5px;background:var(--bg-elevated);color:var(--text-muted);border-radius:4px;font-size:.72em;text-align:center;flex-shrink:0}
.msg .ma{color:var(--text);font-weight:600}
.msg .mx{color:var(--text-secondary);overflow-wrap:anywhere}

/* ── Sidebar ── */
.s-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:12px}
.s-card:last-child{margin-bottom:0}
.s-card h3{font-size:.8rem;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-bottom:9px}
.s-row{display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid var(--border)}
.s-row:last-child{border-bottom:none}
.sr{width:22px;font-size:.8rem;color:var(--text-muted);text-align:center;font-weight:600}
.sn{flex:1;font-size:.83rem;font-weight:500}
.st{color:var(--text-muted);font-weight:400;font-size:.74rem}
.sp{font-size:.85rem;font-weight:700}
.cloud{font-size:.8rem;line-height:1.8;color:var(--text-secondary)}

/* ── Hover admin controls ── */
.hov{position:absolute;top:3px;right:3px;display:flex;gap:2px;opacity:0;transition:opacity.15s}
*:hover>.hov{opacity:1}
.hov-btn{width:22px;height:22px;border-radius:4px;border:1px solid var(--border);background:var(--bg-card);color:var(--text-muted);cursor:pointer;font-size:11px;display:flex;align-items:center;justify-content:center}
.hov-btn:hover{background:var(--bg-elevated);color:var(--text)}

/* ── Admin ── */
.a-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}
@media(max-width:800px){.a-grid{grid-template-columns:1fr}}
.a-sec{background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:16px}
.a-sec h2{font-size:.95rem;font-weight:700;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.i-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid var(--border);font-size:.85rem}
.i-row:last-child{border-bottom:none}
.i-row .ia{display:flex;align-items:center;gap:6px;flex-wrap:wrap;flex-shrink:0}
.i-row .ia input[type="number"],.i-row .ia select{padding:7px 10px;font-size:.85rem;border-radius:var(--radius-sm);background:var(--bg);border:1px solid var(--border);color:var(--text)}
.i-row .ia input[type="number"]{width:76px;text-align:center}
.i-row .ia input[type="number"]:focus,.i-row .ia select:focus{outline:none;border-color:var(--text-secondary)}

/* ── Form ── */
.fg{margin-bottom:12px}
.fg label{display:block;font-size:.8rem;color:var(--text-muted);margin-bottom:3px;font-weight:500}
.fg input,.fg select,.fg textarea{width:100%;padding:9px 12px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:.85rem;font-family:inherit}
.fg select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b949e' d='M5 6 0 0h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:10px 6px;padding-right:30px;cursor:pointer}
.fg input:focus,.fg select:focus,.fg textarea:focus{border-color:var(--text-muted);outline:none}
.fg textarea{resize:vertical;min-height:80px}
.hidden{display:none !important}
.fr{display:flex;gap:10px}.fr>*{flex:1}
.fa{display:flex;gap:8px;margin-top:16px;justify-content:flex-end}

.admin-fab{position:fixed;bottom:20px;right:20px;z-index:999;display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:4px;background:var(--bg-card);border:1px solid var(--border);color:var(--text);box-shadow:0 4px 16px rgba(0,0,0,.25);transition:all.15s;text-decoration:none;font-size:.82rem;font-weight:600}
.admin-fab:hover{background:var(--bg-elevated);border-color:var(--text-secondary);transform:translateY(-1px);text-decoration:none}
.admin-fab svg{width:16px;height:16px;flex-shrink:0}

.notif-wrap{display:inline-flex;position:relative}
.notif-dot{position:absolute;top:4px;right:4px;width:7px;height:7px;border-radius:50%;background:var(--text);animation:ping 1.5s ease-in-out infinite}
@keyframes ping{0%,100%{opacity:1}50%{opacity:.4}}
.notif-dd{
  position:absolute;top:100%;right:0;z-index:200;background:var(--bg-card);border:1px solid var(--border-light);border-radius:4px;min-width:280px;max-width:320px;padding:6px 0;margin-top:6px;overflow:hidden;
}
.notif-dd .notif-dd-header{
  padding:12px 14px;font-weight:700;font-size:1.02rem;border-bottom:1px solid var(--border)
}
.notif-dd .notif-list{max-height:220px;overflow:auto;background:var(--bg);padding:6px 0}
.notif-dd .notif-list .notif-list-item{padding:12px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.notif-dd .notif-list .notif-list-item:last-child{border-bottom:none}
.notif-dd .notif-list .notif-title{font-weight:700;font-size:0.98rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.notif-dd .notif-meta{color:var(--text-muted);font-size:.78rem;margin-top:6px}
.notif-dd .notif-preview{
    color:var(--text-muted);
    margin-top:8px;
    font-size:.95rem;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    text-overflow:ellipsis;
  }
.notif-dd .notif-dd-footer{border-top:1px solid var(--border);padding:10px;text-align:left;background:var(--bg-card)}
.notif-item{padding:10px 14px;border-bottom:1px solid var(--border);font-size:.82rem;line-height:1.4}
.notif-item:last-child{border-bottom:none}
.notif-src{color:var(--text-muted);font-size:.72rem;margin-bottom:2px}
.notif-msg{color:var(--text)}
.notif-empty{padding:14px;color:var(--text-muted);font-size:.82rem;text-align:center}
/* ── Modal ── */
.modal{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;padding:24px}
.modal-box{background:var(--bg-card);border:1px solid var(--border-light);border-radius:4px;padding:26px;max-width:520px;width:100%;max-height:90vh;overflow-y:auto}
.modal-box h2{font-size:1.05rem;margin-bottom:14px}

/* ── Signup ── */
.su-wrap{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 24px}
.su-card{background:var(--bg-card);border:1px solid var(--border-light);border-radius:4px;max-width:420px;width:100%;overflow:hidden}
.su-head{text-align:center;padding:32px 24px 20px;border-bottom:1px solid var(--border)}
.su-head h1{font-size:1.3rem;font-weight:700;margin-bottom:4px}
.su-head p{color:var(--text-secondary);font-size:.88rem}
.su-body{padding:22px}
.su-result{padding:10px;border-radius:var(--radius-sm);margin-bottom:14px;text-align:center;font-size:.85rem;display:none}
.su-result.show{display:block}
.su-result.ok{background:var(--bg-elevated);border:1px solid var(--border-light);color:var(--text)}
.su-info{display:flex;flex-direction:column;gap:8px;margin-top:16px}
.su-info-row{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--bg-elevated);border-radius:var(--radius-sm);font-size:.85rem;color:var(--text-secondary)}
.su-foot{padding:14px 24px;border-top:1px solid var(--border);text-align:center;font-size:.85rem}

/* ── Header search & logos ── */
.nav-search{position:relative;display:inline-block;margin-left:12px}
.nav-search input{padding:6px 10px;border-radius:4px;border:1px solid var(--border);background:var(--bg);color:var(--text);font-size:.85rem;width:220px}
.search-dd{position:absolute;top:36px;left:0;z-index:300;background:var(--bg-card);border:1px solid var(--border-light);border-radius:4px;min-width:260px;overflow:hidden}
.search-item{padding:8px 12px;cursor:pointer}
.search-item:hover{background:var(--bg-elevated)}
.search-item .sub{font-size:.82rem;color:var(--text-muted);margin-top:2px}

/* Team logos */
.team-logo{width:20px;height:20px;border-radius:4px;object-fit:cover;vertical-align:middle;margin-right:6px;flex-shrink:0}
.team-logo-sm{width:16px;height:16px;border-radius:4px;object-fit:cover;vertical-align:middle;margin-right:4px;flex-shrink:0}
.team-logo-md{width:56px;height:56px;border-radius:4px;object-fit:cover;display:block;margin:0 auto 10px}
.team-logo-lg{width:80px;height:80px;border-radius:4px;object-fit:cover;flex-shrink:0}

/* Auth avatar */
.auth-user{display:inline-flex;align-items:center;gap:8px}
.auth-avatar{width:20px;height:20px;border-radius:50%;object-fit:cover;flex-shrink:0}
.avatar-letter{width:20px;height:20px;border-radius:50%;background:var(--bg-elevated);border:1px solid var(--border);display:inline-flex;align-items:center;justify-content:center;font-size:.65rem;font-weight:700;color:var(--text-muted);flex-shrink:0}

/* Notifications panel */
.notif-panel{position:fixed;right:0;top:0;height:100%;width:min(480px,100%);background:var(--bg-card);z-index:600;transform:translateX(100%);transition:transform .28s ease;display:flex;flex-direction:column}
.notif-panel.open{transform:translateX(0)}
.notif-panel .notif-panel-header{display:flex;align-items:center;gap:12px;padding:16px;border-bottom:1px solid var(--border);background:var(--bg-card)}
.notif-panel .notif-panel-body{display:flex;flex:1;overflow:hidden}
.notif-panel .notif-list{width:320px;border-right:1px solid var(--border);overflow:auto;background:var(--bg);padding:8px}
.notif-panel .notif-list-item{padding:10px;border-bottom:1px solid var(--border);cursor:pointer}
.notif-panel .notif-list-item:hover{background:var(--bg-elevated)}
.notif-panel .notif-detail{flex:1;overflow:auto;padding:16px}
.notif-panel .notif-detail .title{font-weight:700;margin-bottom:8px}
.notif-panel .notif-detail .from{color:var(--text-muted);font-size:.9rem;margin-bottom:8px}
.notif-panel .notif-detail .body{white-space:pre-wrap;color:var(--text)}

/* ── Settings ── */
.pcards{display:flex;flex-direction:column;gap:14px}
.pcard{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px}
.pcard-head{font-size:.8rem;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-bottom:10px}

/* ── Profile / GM header ── */
.pheader{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:4px}
.pheader-inner{display:flex;align-items:center;gap:16px;flex:1;min-width:0}
.pname{font-size:1.4rem;font-weight:700;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pname-team{font-size:.9rem;color:var(--text-muted)}
.pmeta{display:flex;gap:12px;color:var(--text-muted);font-size:.85rem;margin-top:4px;flex-wrap:wrap}

/* ── Notifications page ── */
.notif-page-item{padding:10px 12px;border-bottom:1px solid var(--border);cursor:pointer;border-radius:4px}
.notif-page-item:hover{background:var(--bg-elevated)}
.notif-unread{background:var(--bg-elevated)}

/* ── Live match centre ── */
.live-scoreboard{display:grid;grid-template-columns:1fr auto 1fr;gap:14px;align-items:center}
.live-team{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;text-align:center}
.live-team-logo img{width:44px;height:44px;border-radius:4px;object-fit:cover}
.live-team-name{font-size:.9rem;font-weight:700;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.live-center{text-align:center}
.live-score{font-size:2rem;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.live-meta{font-size:.78rem;color:var(--text-muted);margin-top:6px;display:flex;align-items:center;justify-content:center;gap:6px}

.pressure-wrap{margin-top:14px}
.pressure-bar{position:relative;display:flex;height:16px;border-radius:4px;overflow:hidden;background:var(--bg-elevated);border:1px solid var(--border)}
.pressure-bar::after{content:'';position:absolute;left:50%;top:0;bottom:0;width:1px;background:rgba(255,255,255,.28)}
.pressure-fill{position:absolute;top:0;bottom:0;transition:width .6s ease}
.pressure-blue{background:linear-gradient(90deg,#3a7bd5,#5b9bd5);transition:width .6s ease}
.pressure-red{background:linear-gradient(90deg,#e05252,var(--red));transition:width .6s ease}
.pressure-labels{display:flex;justify-content:space-between;font-size:.75rem;color:var(--text-muted);margin-top:4px;font-weight:600}
.pressure-labels span:first-child{color:#5b9bd5}
.pressure-labels span:last-child{color:#e05252}
.pressure-history{margin-top:8px}
.pressure-spark{width:100%;height:64px;display:block}

/* ── Color swatches ── */
.swatches{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.swatch{width:26px;height:26px;border-radius:4px;border:2px solid transparent;cursor:pointer;padding:0;transition:transform .1s}
.swatches{display:flex;flex-wrap:wrap;gap:6px;align-items:center;position:relative}
.swatches.has-pinned{padding-top:44px}
.swatch-pinned{position:absolute;top:0;left:0;z-index:2;width:36px;height:36px;border-radius:4px;box-shadow:0 2px 10px rgba(0,0,0,.55)}
.swatch.active{border-color:var(--text)}
.swatch-custom-chip{width:26px;height:26px;border-radius:4px;border:1px solid var(--border);cursor:pointer;padding:0;background:var(--bg-elevated);display:inline-flex;align-items:center;justify-content:center;color:var(--text-muted);transition:all .12s;position:relative}
.swatch-custom-chip::before{content:'';position:absolute;inset:3px;border-radius:4px;background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red);opacity:.85}
.swatch-custom-chip svg{position:relative;z-index:1;width:12px;height:12px;color:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.7))}
.swatch-custom-chip:hover{border-color:var(--text-secondary);color:var(--text)}
.swatch-custom-chip.active{border-color:var(--text)}

/* ── Custom color picker popup ── */
.ccp{display:flex;flex-direction:column;gap:12px}
.ccp-sv-wrap canvas{display:block;width:200px;height:150px;border:1px solid var(--border);border-radius:4px;cursor:crosshair}
.ccp-hue-wrap canvas{display:block;width:200px;height:14px;border:1px solid var(--border);border-radius:4px;cursor:crosshair}
.ccp-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ccp-preview{width:30px;height:30px;border-radius:4px;border:1px solid var(--border);flex-shrink:0}
.ccp-controls input{width:90px;padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);color:var(--text);font-family:inherit;font-size:.85rem;font-variant-numeric:tabular-nums;outline:none}
.ccp-controls input:focus{border-color:var(--text-secondary)}
.swatch:hover{transform:scale(1.12)}
.swatch.active{border-color:var(--text);outline:2px solid var(--bg);outline-offset:-2px}
.swatch-custom-wrap{width:26px;height:26px;border-radius:4px;border:2px solid transparent;cursor:pointer;padding:0;background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red);transition:border-color .12s}
.swatch-custom-wrap:hover{border-color:var(--text-secondary)}
.swatch-custom-wrap.active{border-color:var(--text)}

/* ── Offer list (GM page) ── */
.offer-list{max-height:280px;overflow:auto;border:1px solid var(--border);border-radius:4px;background:var(--bg)}
.offer-row{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid var(--border);cursor:pointer;font-size:.85rem;transition:background .1s}
.offer-row:last-child{border-bottom:none}
.offer-row:hover{background:var(--bg-elevated)}
.offer-row.active{background:var(--bg-elevated);box-shadow:inset 3px 0 0 #3a7bd5}
.offer-row .g-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.offer-row .offer-ovr{color:var(--text-muted);font-size:.75rem;font-weight:600;width:52px;text-align:right;flex-shrink:0}
.offer-row .offer-cost{color:#4ade80;font-weight:700;font-size:.78rem;width:72px;text-align:right;flex-shrink:0}

/* ── Budget display ── */
.budget-pill{display:inline-flex;align-items:center;gap:6px;background:var(--bg-elevated);border:1px solid var(--border);border-radius:999px;padding:4px 12px;font-size:.8rem;font-weight:600}
.budget-pill .budget-val{color:#4ade80;font-weight:700}
.budget-pill.low .budget-val{color:var(--red)}

/* ── Logo file buttons ── */
.logo-preview{width:56px;height:56px;border-radius:4px;object-fit:cover;border:1px solid var(--border);background:var(--bg-elevated)}

/* Long list containers scroll inside their card instead of stretching it */
.offer-list,.a-list-scroll,#aMatches,#aNews,#aTeams,#aShoutbox,#aUsers,.roster-list{max-height:360px;overflow-y:auto}

/* ── Admin users card ── */
.a-users-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.u-chip{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);background:var(--bg-elevated);border:1px solid var(--border);border-radius:999px;padding:2px 10px}
.u-chip-warn{color:var(--red);border-color:var(--red)}
.u-chip-ok{color:#4ade80;border-color:#4ade80}
#aUsers{max-height:420px}
.u-row{align-items:flex-start;padding:9px 2px}
.u-main{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.u-avatar{width:38px;height:38px;border-radius:8px;object-fit:cover;border:1px solid var(--border);background:var(--bg-elevated);flex-shrink:0}
.u-info{min-width:0;display:flex;flex-direction:column;gap:2px}
.u-name{font-weight:700;color:var(--text);display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-width:0;font-size:.88rem}
.u-ign{font-style:normal;color:var(--text-muted);font-size:.7rem;font-weight:400}
.u-badge{width:18px;height:18px;border-radius:4px;object-fit:cover;vertical-align:middle}
.u-sub{font-size:.7rem;color:var(--text-muted);display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.u-tag{font-size:.6rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#fff;background:var(--text-secondary);border-radius:4px;padding:1px 6px;line-height:1.4}
.u-tag-fa{background:#3a7bd5}
.u-tag-owner{background:var(--text);color:var(--bg-card)}
.u-tag-adm{background:#8b5cf6}
.u-tag-ban{background:var(--red)}
.u-tag-dc{background:#5865f2}
.u-stats{font-size:.7rem;color:var(--text-muted)}
.u-row .ia{align-self:center;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.u-row .ia .hov-btn{width:26px;height:26px;flex-shrink:0}
.u-row .ia .hov-btn svg{display:block}
.u-row .ia .select-sm{height:26px;padding-top:0;padding-bottom:0;display:flex;align-items:center}

/* ── Presence ── */
.presence-dot{width:10px;height:10px;border-radius:50%;background:var(--text-muted);flex-shrink:0;display:inline-block}
.presence-online{background:#4ade80;box-shadow:0 0 0 2px var(--bg-card)}
.fa-cell{display:inline-flex;align-items:center;gap:7px}
.u-avatar-wrap{position:relative;flex-shrink:0}
.u-avatar-wrap .presence-dot{position:absolute;right:-2px;bottom:-2px;width:12px;height:12px;border:2px solid var(--bg-card)}

/* ── News items (home feed + detail) ── */
.news-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.news-top .hov-btn{margin-left:auto}

/* ── Transfers / activity feed ── */
.news-feed-list{display:flex;flex-direction:column}
.news-feed-row{display:flex;align-items:flex-start;gap:10px;padding:8px 2px;border-bottom:1px solid var(--border)}
.news-feed-row:last-child{border-bottom:none}
.news-feed-icon-wrap{flex-shrink:0;width:32px;height:32px;border-radius:4px;background:var(--bg-elevated);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;overflow:hidden}
.news-feed-icon{width:22px;height:22px;object-fit:contain}
.news-feed-body{flex:1;min-width:0}
.news-feed-title{font-weight:700;color:var(--text);font-size:.9rem}
.news-feed-copy{color:var(--text-secondary);font-size:.82rem;margin-top:1px;white-space:pre-line}
.news-feed-link{color:var(--text);font-weight:600;text-decoration:none}
.news-feed-link:hover{text-decoration:underline}
.news-feed-time{display:block;margin-top:2px;color:var(--text-muted);font-size:.72rem}
.news-feed-admin{margin-left:auto;flex-shrink:0}
.news-link-row{text-decoration:none;color:inherit}
.news-link-row:hover{text-decoration:none}
.news-signed{display:block;font-size:.72rem;font-weight:600;color:#4ade80;margin-top:2px}
.news-pin{display:inline-block;background:var(--text);color:var(--bg);font-size:.56rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;padding:1px 6px;margin-left:8px;vertical-align:middle}
.tp-signed{display:block;font-size:.7rem;font-weight:600;color:#4ade80}
.news-section-title{font-size:1rem;font-weight:800;color:var(--text);margin:0 0 10px;text-transform:uppercase;letter-spacing:.05em}
.news-feed-wrap{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:4px 16px}
ul.news-feed-list{list-style:none;margin:0;padding:0}
.news-page-meta{color:var(--text-muted);font-size:.78rem;padding:10px 0 4px;border-top:1px solid var(--border);margin-top:4px}
.sec-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:12px;flex-wrap:wrap}
.sec-tab{padding:9px 14px;font-size:.84rem;font-weight:600;color:var(--text-muted);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;transition:color .15s}
.sec-tab:hover{color:var(--text);text-decoration:none}
.sec-tab.active{color:var(--text);border-bottom-color:var(--text)}

/* ── Admin analytics ── */
.a-stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-bottom:14px}
.a-stat-card{background:var(--bg-elevated);border:1px solid var(--border);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.a-stat-label{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted)}
.a-stat-value{font-size:1.5rem;font-weight:800;color:var(--text);font-variant-numeric:tabular-nums;line-height:1.1}
.a-stat-delta{font-size:.72rem;font-weight:700}
.a-stat-delta.up{color:#4ade80}
.a-stat-delta.down{color:var(--red)}
.a-stats-chart{background:var(--bg-elevated);border:1px solid var(--border);padding:14px}

/* ── Custom dropdowns ── */
.cdd{position:relative;display:inline-block;min-width:120px;vertical-align:middle}
.fg .cdd,.stats-form .cdd{display:block;width:100%}
.cdd-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);color:var(--text);font-size:.85rem;font-family:inherit;cursor:pointer;transition:border-color .12s;text-align:left}
.cdd-trigger:hover{border-color:var(--text-secondary)}
.cdd.open .cdd-trigger{border-color:var(--text-secondary)}
.cdd-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cdd-arrow{color:var(--text-muted);font-size:.7rem;transition:transform .15s;flex-shrink:0}
.cdd.open .cdd-arrow{transform:rotate(180deg)}
.cdd-panel{display:none;position:absolute;top:calc(100% + 6px);left:0;z-index:300;min-width:100%;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:4px;box-shadow:0 8px 24px rgba(0,0,0,.45);max-height:260px;overflow:auto}
.cdd-panel.open{display:block}
.cdd-opt{padding:8px 12px;border-radius:4px;font-size:.85rem;color:var(--text);cursor:pointer;white-space:nowrap;transition:background .1s}
.cdd-opt:hover{background:var(--bg-elevated)}
.cdd-opt.selected{font-weight:700;background:var(--bg-elevated)}

/* ── Custom scrollbars ── */
*{scrollbar-width:thin;scrollbar-color:var(--border) transparent}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px}
::-webkit-scrollbar-thumb:hover{background:var(--border-light)}
::-webkit-scrollbar-corner{background:transparent}

/* ── Number input arrows ── */
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{opacity:1;background:var(--bg-elevated);border-left:1px solid var(--border);height:100%}
input[type=number]::-webkit-inner-spin-button:hover{background:var(--border)}

/* ── Selects (universal theme) ── */
select{appearance:none;-webkit-appearance:none;background:var(--bg) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238b949e' d='M5 6 0 0h10z'/%3E%3C/svg%3E") no-repeat right 10px center/10px 6px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text);font-size:.85rem;font-family:inherit;padding:8px 30px 8px 12px;cursor:pointer}
select:hover{border-color:var(--text-secondary)}
select:focus{outline:none;border-color:var(--text-secondary)}
select option{background:var(--bg-card);color:var(--text)}
.select-sm{font-size:.75rem;padding:4px 26px 4px 8px;background-position:right 7px center;background-size:8px 5px}

/* ── Inputs (universal theme - every text box matches) ── */
input[type="text"],input[type="search"],input[type="number"],input[type="password"],input[type="email"],textarea{
  width:100%;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);
  color:var(--text);font-size:.85rem;font-family:inherit;padding:9px 12px;transition:border-color .12s
}
input[type="text"]:focus,input[type="search"]:focus,input[type="number"]:focus,input[type="password"]:focus,input[type="email"]:focus,textarea:focus{
  outline:none;border-color:var(--text-secondary)
}
input::placeholder,textarea::placeholder{color:var(--text-muted)}

/* Every input element - type-less inputs (admin panel etc.) don't match
   the type selectors above, so this catches the rest of the site */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
select,textarea{
  background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm);
  color:var(--text);font-size:.85rem;font-family:inherit;padding:9px 12px
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus,
select:focus,textarea:focus{outline:none;border-color:var(--text-secondary)}

/* ── Server cards (admin) ── */
.server-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.server-card{background:var(--bg-elevated);border:1px solid var(--border);border-radius:4px;padding:14px;position:relative;overflow:hidden}
.server-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px}
.server-card.s-good::before{background:#4ade80}
.server-card.s-ok::before{background:#facc15}
.server-card.s-poor::before{background:#f97316}
.server-card.s-offline::before{background:var(--red)}
.server-name{font-size:.9rem;font-weight:700;padding-right:60px}
.server-type{color:var(--text-muted);font-size:.75rem;font-weight:500;margin-left:4px}
.server-meta{color:var(--text-muted);font-size:.78rem;margin-top:4px;font-variant-numeric:tabular-nums}
.server-health{position:absolute;top:12px;right:12px;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;padding:2px 8px;border-radius:999px;border:1px solid var(--border)}
.server-card.s-good .server-health{color:#4ade80;border-color:rgba(74,222,128,.4)}
.server-card.s-ok .server-health{color:#facc15;border-color:rgba(250,204,21,.4)}
.server-card.s-poor .server-health{color:#f97316;border-color:rgba(249,115,22,.4)}
.server-card.s-offline .server-health{color:var(--red);border-color:rgba(248,81,73,.4)}
.server-updated{font-size:.72rem;color:var(--text-muted);margin-top:10px}

/* ── Admin groups ── */
.a-group{margin-bottom:26px}
.a-group-title{font-size:.75rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.08em;font-weight:600;margin:0 0 10px;padding-left:2px}
.a-updated{font-size:.72rem;color:var(--text-muted);font-weight:400;text-transform:none;letter-spacing:normal}

/* ── Admin summary strip ── */
.a-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;margin-bottom:18px}
.a-summary .a-stat{background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:14px;text-align:center}
.a-summary .a-stat .a-n{font-size:1.5rem;font-weight:800;line-height:1.1}
.a-summary .a-stat .a-l{font-size:.72rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;margin-top:2px}
.a-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:18px;padding:0 6px;background:var(--bg-elevated);border:1px solid var(--border);border-radius:999px;font-size:.7rem;font-weight:700;color:var(--text-secondary);vertical-align:middle;margin-right:6px}

/* ── Chart hover tooltip ── */
.chart-tip{position:fixed;transform:translate(-50%,-100%);background:var(--bg-elevated);border:1px solid var(--border);border-radius:4px;padding:4px 10px;font-size:.75rem;color:var(--text);pointer-events:none;z-index:9999;white-space:nowrap;display:none}

/* ── Footer ── */
footer{width:100%;background:var(--bg-card);border-top:1px solid var(--border);padding:18px 24px;text-align:center;margin-top:auto}
footer p{color:var(--text-muted);font-size:.78rem}

/* ── Small global polish ── */
input:focus,select:focus,textarea:focus,.cdd-trigger:focus{outline:none;border-color:var(--border-light)}
.card:hover{border-color:var(--border-light)}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px;border:2px solid var(--bg)}
::-webkit-scrollbar-track{background:transparent}

/* ── Discord invite button ── */
.discord-nav{background:#5865F2;color:#fff !important;font-weight:600;display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:4px;text-decoration:none !important;transition:filter .12s}
.discord-nav:hover{filter:brightness(1.15)}

/* ── Discord link banner (shown until the player connects) ── */
.discord-banner{background:var(--bg-card);border-bottom:1px solid var(--border)}
.discord-banner-inner{max-width:1440px;margin:0 auto;padding:10px 28px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.discord-banner-icon{width:26px;height:26px;border-radius:4px;background:#5865F2;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.discord-banner-icon svg{width:14px;height:14px;fill:#fff}
.discord-banner-text{flex:1;min-width:220px;font-size:.85rem;color:var(--text-secondary)}
.discord-banner-text b{color:var(--text)}
.discord-banner-x{background:transparent;border:none;color:var(--text-muted);font-size:.8rem;cursor:pointer;padding:4px}
.discord-banner-x:hover{color:var(--text)}




/* â”€â”€ Phone layout: app feel â”€â”€ */
@media (max-width: 768px) {
  html{-webkit-text-size-adjust:100%}
  *{-webkit-tap-highlight-color:transparent}
  body{background:var(--bg);padding-bottom:calc(64px + env(safe-area-inset-bottom));overscroll-behavior-y:none}

  /* header: compact, blurred, safe-area aware */
  .site-header{position:sticky;top:0;z-index:120;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);background:rgba(12,12,12,.82)}
  [data-theme="light"] .site-header{background:rgba(244,244,245,.86)}
  .site-header .container{height:52px;padding:calc(env(safe-area-inset-top) + 4px) 12px 4px;gap:8px}
  .logo-img{height:26px;width:auto}
  .site-switch-btn{padding:3px 11px;font-size:.66rem;border-radius:999px}
  .nav-icon-btn{padding:7px 9px}
  .search-dropdown-panel{position:fixed;left:10px;right:10px;top:calc(env(safe-area-inset-top) + 56px);min-width:0;border-radius:14px;box-shadow:0 12px 32px rgba(0,0,0,.35)}

  /* league nav: sticky pill scroller */
  .league-bar{position:sticky;top:calc(env(safe-area-inset-top) + 52px);z-index:119;border-bottom:1px solid var(--border)}
  .league-bar-scroll{-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:4px 8px;gap:4px}
  .league-bar-scroll::-webkit-scrollbar{display:none}
  .league-nav a{padding:9px 12px;font-size:.8rem;border-radius:999px;border:1px solid transparent;white-space:nowrap}
  .league-nav a.active{background:var(--text);color:var(--bg);border-color:var(--text)}

  /* content */
  .wrap{max-width:100%;margin:10px auto 20px;padding:12px 12px 0}
  .page-h h1{font-size:1.35rem;letter-spacing:-.01em}
  .page-h p{font-size:.82rem}
  .tp-bc{font-size:.74rem;margin-bottom:8px}
  .section-h{font-size:.88rem;margin-bottom:10px;padding-bottom:6px}

  /* app surfaces */
  .card,.news-item,.s-card,.a-sec,.standings-card,.shoutbox,.m-card,.team-tile,.su-card{border-radius:14px}
  .card{padding:14px;margin-bottom:10px}
  .m-card{padding:10px;border-radius:12px}
  .m-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
  .hero{border-radius:16px;padding:26px 16px;margin-bottom:18px}
  .hero h1{font-size:1.55rem}
  .stat{padding:13px;border-radius:14px}
  .stat .n{font-size:1.3rem}
  .news-item{padding:13px}
  .btn{padding:7px 14px;font-size:.8rem;border-radius:10px}
  .btn-primary,.btn-sm{min-height:38px}
  .hov-btn{width:28px;height:28px}

  /* tables: rounded scroll containers, compact */
  .t-wrap{border-radius:12px}
  th,td{padding:9px 7px;font-size:.76rem}
  .standings-table th{padding:8px 6px;font-size:.62rem}

  /* grids collapse */
  .grid-2,.a-grid{gap:12px}
  .a-stats-grid{grid-template-columns:1fr 1fr}

  /* forms */
  .fg input,.fg select,.fg textarea,select,input[type="text"],input[type="number"],input[type="password"],input[type="search"]{font-size:16px;border-radius:10px}
  input,select,textarea{max-width:100%}

  /* modals become bottom sheets */
  .modal{align-items:flex-end;padding:0;background:rgba(0,0,0,.55)}
  .modal-box{width:100%;max-width:100%;max-height:88dvh;border-radius:18px 18px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom));animation:sheetUp .28s cubic-bezier(.22,1,.36,1)}
  @keyframes sheetUp{from{transform:translateY(40px);opacity:0}to{transform:translateY(0);opacity:1}}
  .modal-box::before{content:'';display:block;width:44px;height:5px;border-radius:3px;background:var(--border-light);margin:0 auto 16px}

  /* notifications panel full screen */
  .notif-panel{width:100%}
  .admin-bar{position:static;border-radius:12px;margin:0 0 12px}
  .admin-fab{bottom:calc(76px + env(safe-area-inset-bottom));right:16px;border-radius:999px;padding:10px 14px;box-shadow:0 6px 20px rgba(0,0,0,.4)}

  /* profile/team tweaks */
  .profile-header{gap:12px;padding:10px 0 12px}
  .profile-avatar{width:74px;height:74px;font-size:1.7rem}
  .profile-meta{font-size:.78rem;gap:10px}
  .profile-career-row,.profile-comment-body{font-size:.82rem}

  /* bottom app dock */
  .mobile-dock{position:fixed;left:0;right:0;bottom:0;z-index:130;display:flex;align-items:stretch;
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    background:rgba(12,12,12,.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--border)}
  [data-theme="light"] .mobile-dock{background:rgba(244,244,245,.94)}
  .mobile-dock a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:5px 2px;border-radius:10px;
    font-size:.6rem;font-weight:700;letter-spacing:.02em;color:var(--text-muted);text-decoration:none}
  .mobile-dock a svg{width:22px;height:22px}
  .mobile-dock a.active{color:var(--text)}
  .mobile-dock a.active svg{stroke-width:2.4}
  .mobile-dock a.active span{color:var(--text)}

  footer{padding:14px 12px calc(20px + env(safe-area-inset-bottom))}
}
@media (min-width: 769px){.mobile-dock{display:none}}
@media (max-width: 480px) {
  .a-stats-grid{grid-template-columns:1fr}
  .m-grid{grid-template-columns:repeat(auto-fill,minmax(125px,1fr))}
  .page-h p{font-size:.78rem}
  .games-strip{gap:8px}
  .standings-team-logo,.standings-team-dot{width:32px;height:32px}
  .mobile-dock a{font-size:.56rem}
}

/* â”€â”€ Universal overflow containment: nothing may leave the canvas â”€â”€ */
html,body{overflow-x:hidden;max-width:100%}
.wrap{min-width:0;overflow-x:clip}
.wrap>*{min-width:0}
.t-wrap,.m-grid,.games-strip,.games-grid,.a-grid,.grid-2,.m-card,table{max-width:100%}
@media (max-width:768px){
  .wrap{overflow-x:hidden}
  .m-grid,.games-strip,.games-grid{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .i-row,.live-scoreboard,.tp-stand,.leader-row{flex-wrap:wrap}
  .standings-table,.tp-sched-tbl{display:block;overflow-x:auto;white-space:nowrap}
  .a-sec,.s-card,.card{overflow-x:hidden}
}

/* â”€â”€ Wrap integrity: the background always covers every child â”€â”€ */
.wrap{height:auto;min-height:100%;position:relative}
.wrap::after{content:'';display:table;clear:both}

/* â”€â”€ Homepage on phones â”€â”€ */
@media (max-width:768px){
  .home-layout{gap:14px}
  .home-main,.home-sidebar{min-width:0}
  /* full-bleed swipeable match strip */
  .games-strip{margin:0 -12px;padding:2px 12px 8px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .games-strip::-webkit-scrollbar{display:none}
  .games-strip>*{flex:0 0 158px;scroll-snap-align:start}
  .games-strip .m-card{width:auto}
  .m-card .m-abbr{font-size:.8rem}
  .m-card .m-score{font-size:1.15rem}
  /* news feed becomes stacked cards */
  .news-list{display:flex;flex-direction:column;gap:10px}
  .news-list .news-item{margin-bottom:0;border-radius:14px}
  /* sidebar league banner */
  .sidebar-league-card{flex-direction:row;align-items:center;gap:12px;text-align:left;padding:14px}
  .sidebar-league-logo{width:44px;height:44px}
  .sidebar-league-name{font-size:.95rem}
  .sidebar-league-season{font-size:.75rem}
  /* league info as a 2-col mini grid */
  .sidebar-card .info-row{display:flex;justify-content:space-between;padding:7px 0;font-size:.85rem}
  /* online players: wrap tiles */
  .online-list{display:flex;flex-wrap:wrap;gap:8px}
  .ol-tile{flex:0 0 auto;width:52px;text-align:center;font-size:.62rem}
  .ol-tile img,.ol-tile .ol-letter{width:40px;height:40px;border-radius:12px;font-size:1rem}
  /* standings compact */
  .sidebar-card .t-wrap table th,.sidebar-card .t-wrap table td{padding:7px 5px;font-size:.72rem}
  .sidebar-more{display:block;text-align:center;padding-top:8px;font-size:.78rem}
  /* discord card button full width */
  .sidebar-discord-card .discord-nav{width:100%}
}