/* ════════════════════════════════════════════════
   OLYCITY · Layout
   Topbar, hero, sections, main
   ════════════════════════════════════════════════ */

/* TOP BAR */
.topbar{
  position:sticky; top:0; z-index:100;
  background:rgba(10,12,16,.85);
  backdrop-filter:blur(20px) saturate(180%);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  border-bottom:1px solid var(--border);
}
:root[data-theme="light"] .topbar{ background:rgba(244,241,234,.85); }

.topbar-row{
  display:flex; align-items:center; gap:20px;
  padding:14px 32px; max-width:1600px; margin:0 auto;
}

.brand{
  display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
  padding:0; border:0; background:transparent; color:inherit; text-decoration:none;
}
.brand-mark{
  width:38px; height:38px;
  background:linear-gradient(135deg, var(--red), #c1303d);
  display:flex; align-items:center; justify-content:center;
  font-family:'Tomorrow',sans-serif; font-weight:700; font-size:18px;
  color:#fff; letter-spacing:-1px;
  clip-path:polygon(15% 0, 100% 0, 85% 100%, 0 100%);
  box-shadow:0 0 20px var(--red-glow);
}
.brand-mark-wheel{
  clip-path:none;
  box-shadow:none;
  overflow:visible;
}
/* PAGE NAV (Accueil / Maps / Roster) */
.page-nav{
  display:flex; gap:4px; flex-shrink:0;
}
.page-nav-btn{
  background:transparent; border:1px solid transparent; cursor:pointer;
  padding:8px 18px; display:flex; align-items:center; gap:7px;
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:600;
  letter-spacing:1.5px; text-transform:uppercase;
  color:var(--muted); transition:all .2s;
  clip-path:polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.page-nav-btn:hover{ color:var(--text); background:var(--surf2); }
.page-nav-btn.active{
  background:var(--red); border-color:var(--red); color:#fff;
}
.oly-icon-sprite{ position:absolute; width:0; height:0; overflow:hidden; }
.page-nav-icon,
.mobile-nav-section-icon,
.hero-cta-icon{
  width:18px; height:18px; flex:0 0 auto; fill:none; stroke:currentColor;
  stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round;
}
.page-nav-icon{ width:16px; height:16px; }
.oly-icon-fill{ fill:currentColor; stroke:none; }
.hero-cta-icon{ width:17px; height:17px; }
.hero-cta-primary,.hero-cta-secondary{ display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.mobile-nav-more-trigger,
.mobile-nav-more-backdrop { display:none; }

.mobile-nav-more-backdrop[hidden] { display:none !important; }

/* MAP NAV (dans page Maps) */
.nav-maps{ display:flex; gap:2px; flex:1; justify-content:center; flex-wrap:wrap; }
.nav-map-btn{
  position:relative; background:transparent; border:none; cursor:pointer;
  padding:8px 14px 8px 10px; display:flex; align-items:center; gap:8px;
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:600;
  letter-spacing:1.5px; text-transform:uppercase;
  color:var(--muted); transition:color .15s;
  clip-path:polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.nav-map-btn:hover{ color:var(--text); background:var(--surf2); }
.nav-map-btn.active{ background:var(--red-low); color:var(--red); }
.nav-map-icon{
  width:22px; height:16px; background:var(--surf3);
  flex-shrink:0; overflow:hidden;
}
.nav-map-icon img{ width:100%; height:100%; object-fit:cover; display:block; }
.nav-map-label{ }

/* SPA PAGES */
.spa-page{ display:none; }
.spa-page.active{ display:block; }

/* HERO CTAs */
.hero-ctas{
  display:flex; gap:12px; justify-content:center; flex-wrap:wrap;
  margin-top:28px;
}
.hero-cta-primary{
  background:var(--red); border:1px solid var(--red); color:#fff;
  padding:12px 28px; cursor:pointer;
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:600;
  letter-spacing:2px; text-transform:uppercase;
  transition:all .2s; clip-path:polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.hero-cta-primary:hover{ background:#e63a4a; transform:translateY(-2px); box-shadow:0 8px 20px var(--red-glow); }
.hero-cta-secondary{
  background:transparent; border:1px solid var(--border2); color:var(--text);
  padding:12px 28px; cursor:pointer;
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:600;
  letter-spacing:2px; text-transform:uppercase;
  transition:all .2s; clip-path:polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.hero-cta-secondary:hover{ border-color:var(--red-mid); color:var(--red); background:var(--red-low); }

/* MAP SECTION TABS (Comps / Lineups) */
.map-section-tabs{
  display:flex; gap:0; margin-bottom:0;
  border-bottom:1px solid var(--border);
  position:sticky; top:56px; z-index:10;
  background:var(--bg); 
}
.map-section-tab{
  background:transparent; border:none; border-bottom:2px solid transparent;
  color:var(--muted); cursor:pointer; padding:12px 22px;
  font-family:'Tomorrow',sans-serif; font-size:11px; font-weight:600;
  letter-spacing:2px; text-transform:uppercase; transition:all .15s;
  margin-bottom:-1px;
}
.map-section-tab:hover{ color:var(--text); }
.map-section-tab.active{ color:var(--red); border-bottom-color:var(--red); }
.map-section-panel{ display:none; padding-top:24px; }
.map-section-panel.active{ display:block; scroll-margin-top:100px; }

/* ROSTER PAGE */
.roster-page-inner{
  max-width:1600px; margin:0 auto; padding:48px 32px;
}

.topbar-tools{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.tool-btn{
  background:transparent; border:1px solid var(--border2);
  color:var(--muted); cursor:pointer; padding:7px 10px;
  font-family:'Tomorrow',sans-serif; font-size:11px; font-weight:600;
  letter-spacing:1px; text-transform:uppercase;
  display:flex; align-items:center; gap:6px; transition:all .15s;
}
.tool-btn:hover{ color:var(--text); border-color:var(--red-mid); background:var(--red-low); }
.tool-icon{ font-size:14px; }

.search-wrap{
  position:relative; display:flex; align-items:center;
  background:var(--surf2); border:1px solid var(--border2);
  padding:0 10px; transition:border-color .15s;
}
.search-wrap:focus-within{ border-color:var(--red); box-shadow:0 0 0 2px var(--red-low); }
.search-icon{ color:var(--muted); font-size:13px; }
.search-input{
  background:transparent; border:none; outline:none;
  color:var(--text); font-family:'DM Sans',sans-serif; font-size:13px;
  padding:8px 6px; width:140px;
}
.search-input::placeholder{ color:var(--dim); }

.search-results{
  display:none; position:fixed; top:56px; right:16px;
  background:var(--surf); border:1px solid var(--border2);
  min-width:280px; max-height:400px; overflow-y:auto;
  margin-top:0;
  box-shadow:0 8px 32px rgba(0,0,0,.6);
  z-index:400;
}
.search-results.show{ display:block; }
.search-result-item{
  padding:10px 14px; cursor:pointer; display:flex; align-items:center; gap:10px;
  border-bottom:1px solid var(--border); transition:background .15s;
}
.search-result-item:hover{ background:var(--surf2); }
.search-result-item:last-child{ border-bottom:none; }
.search-result-thumb{
  width:32px; height:32px; background:var(--surf3); overflow:hidden; flex-shrink:0;
}
.search-result-thumb img{ width:100%; height:100%; object-fit:cover; object-position:top center; display:block; }
.search-result-info{ display:flex; flex-direction:column; gap:1px; flex:1; min-width:0; }
.search-result-name{
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:600;
  color:var(--text); text-transform:uppercase; letter-spacing:.5px;
}
.search-result-detail{ font-size:11px; color:var(--muted); }
.search-empty{ padding:20px; text-align:center; color:var(--dim); font-size:12px; }

/* HERO */
.hero{
  position:relative; text-align:center;
  padding:60px 32px 40px; z-index:2;
  overflow:hidden;
}


.hero-title{
  font-family:'Tomorrow',sans-serif;
  font-size:clamp(60px, 9vw, 120px); font-weight:700;
  line-height:.9; letter-spacing:-2px; color:var(--text); position:relative;
}
.hero-title-frame{ display:inline-block; position:relative; padding:0 8px; }
.hero-title-frame::before, .hero-title-frame::after{
  content:''; position:absolute; width:24px; height:24px; border:2px solid var(--red);
}
.hero-title-frame::before{ top:-8px; left:-8px; border-right:none; border-bottom:none; }
.hero-title-frame::after{ bottom:-8px; right:-8px; border-left:none; border-top:none; }

/* MAIN */
.main{ position:relative; z-index:2; max-width:1600px; margin:0 auto; padding:0 32px 40px; }
.mobile-map-picker{ display:none; }

/* SECTIONS */
.section{ padding:48px 32px; border-top:1px solid var(--border); }
.section-inner{ max-width:1600px; margin:0 auto; }
.section-header{
  display:flex; align-items:baseline; gap:14px; margin-bottom:28px; flex-wrap:wrap;
}
.section-tag{
  font-family:'Tomorrow',sans-serif; font-size:11px; font-weight:700;
  letter-spacing:3px; text-transform:uppercase; color:var(--red);
}
.section-title{
  font-family:'Tomorrow',sans-serif; font-size:28px; font-weight:600;
  letter-spacing:.2px; color:var(--text);
}
.section-line{ flex:1; height:1px; background:linear-gradient(90deg, var(--border2), transparent); min-width:80px; }

/* ROSTER SECTION */
.roster-section{
  position:relative; padding:60px 32px; border-top:1px solid var(--border);
  background:linear-gradient(180deg, var(--bg), var(--bg-deep));
}
.roster-header{
  display:flex; align-items:baseline; gap:16px;
  max-width:1600px; margin:0 auto 32px; flex-wrap:wrap;
}
.roster-eyebrow{
  font-family:'Tomorrow',sans-serif; font-size:11px; font-weight:700;
  letter-spacing:4px; text-transform:uppercase; color:var(--red);
}
.roster-title{
  font-family:'Tomorrow',sans-serif; font-size:42px; font-weight:700;
  letter-spacing:.2px; color:var(--text); line-height:1;
}
.search-input:focus-visible{ outline:none; }
.roster-sub{ color:var(--muted); font-size:13px; margin-left:auto; letter-spacing:.5px; }

.roster-grid{
  max-width:1600px; margin:0 auto;
  display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:16px;
}

/* FOOTER */
.footer{
  margin-top:auto; padding:18px 32px; border-top:1px solid var(--border);
  background:var(--bg-deep); position:relative; z-index:2;
}
.footer-inner{
  max-width:1600px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:12px;
  font-size:11px; color:var(--dim); letter-spacing:.5px;
}
.footer a{ color:var(--red); text-decoration:none; }
.footer a:hover{ text-decoration:underline; }

/* MAP SECTION (in main) */
.map-section{ display:none; }
.map-section.active{
  display:block;
  animation:mapSlideIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes mapSlideIn{
  from{ opacity:0; transform:translateX(-14px); }
  to  { opacity:1; transform:translateX(0); }
}

.map-hero{
  position:relative; height:300px; overflow:hidden; margin-bottom:32px;
  border:1px solid var(--border); background:var(--surf2);
}
.map-hero-img-wrap{ position:absolute; inset:0; overflow:hidden; }
.map-hero-img{
  width:100%; height:100%; object-fit:cover; display:block;
  filter:brightness(.55) saturate(.85) contrast(1.05);
  transform:scale(1.05); transition:transform .8s ease;
}
.map-hero:hover .map-hero-img{ transform:scale(1.08); }
.map-hero-overlay{
  position:absolute; inset:0;
  background:
    linear-gradient(135deg, rgba(10,12,16,.95) 0%, rgba(10,12,16,.3) 50%, rgba(10,12,16,.1) 100%),
    linear-gradient(to top, rgba(10,12,16,.95) 0%, transparent 60%);
}
:root[data-theme="light"] .map-hero-overlay{
  background:
    linear-gradient(135deg, rgba(244,241,234,.95) 0%, rgba(244,241,234,.4) 50%, rgba(244,241,234,.1) 100%),
    linear-gradient(to top, rgba(244,241,234,.95) 0%, transparent 60%);
}
.map-hero-grid{
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(255,70,86,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,70,86,.04) 1px, transparent 1px);
  background-size:40px 40px;
}
.map-hero-content{
  position:absolute; inset:0;
  display:flex; align-items:flex-end; justify-content:space-between;
  padding:36px 40px; gap:24px; flex-wrap:wrap;
}
.map-hero-left{ flex:1; min-width:280px; }
.map-hero-sub{
  font-family:'Tomorrow',sans-serif; font-size:11px; font-weight:500;
  letter-spacing:4px; text-transform:uppercase; color:var(--red); margin-bottom:8px;
}
.map-hero-title{
  font-family:'Tomorrow',sans-serif; font-size:64px; font-weight:700;
  color:var(--text); line-height:.95; letter-spacing:2px; text-transform:uppercase;
}
.map-hero-tags{
  display:flex; gap:6px; margin-top:14px; flex-wrap:wrap;
}
.map-tag{
  font-family:'Tomorrow',sans-serif; font-size:10px; font-weight:600;
  letter-spacing:2px; text-transform:uppercase;
  padding:4px 12px; border:1px solid var(--red-mid); color:var(--red);
  background:var(--red-low);
}
.map-hero-stats{ display:flex; gap:20px; flex-wrap:wrap; }
.map-stat{ display:flex; flex-direction:column; gap:2px; }
.map-stat-val{
  font-family:'Tomorrow',sans-serif; font-size:28px; font-weight:700;
  color:var(--text); line-height:1;
}
.map-stat-lbl{
  font-family:'Tomorrow',sans-serif; font-size:9px; font-weight:600;
  letter-spacing:2px; text-transform:uppercase; color:var(--muted);
}

/* When agent page is active, hide SPA pages + footer */
body.agent-mode .spa-page{ display:none !important; }
body.agent-mode .footer{ display:none; }

/* Maps hover dropdown */
.nav-maps-dropdown {
  position: relative;
}
.nav-maps-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--surf); border: 1px solid var(--border2);
  min-width: 180px; z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: dropIn .15s ease;
}
@keyframes dropIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.nav-maps-dropdown.open .nav-maps-menu { display: block; }
.nav-maps-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer;
  font-family: 'Tomorrow', sans-serif; font-size: 11px;
  font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); transition: all .12s; border: none;
  background: transparent; width: 100%; text-align: left;
}
.nav-maps-menu-item:hover { color: var(--text); background: var(--surf2); }
.nav-maps-menu-item img {
  width: 28px; height: 18px; object-fit: cover; opacity: .7;
  transition: opacity .12s;
}
.nav-maps-menu-item:hover img { opacity: 1; }

/* Map side arrows — fixed to viewport center */
.map-side-right { right: 0; border-right: none; border-radius: 3px 0 0 3px; }

/* ═══════════════ LIVE PAGE ═══════════════ */
.live-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 22px; font-family: 'DM Sans', system-ui, sans-serif; }
.live-page > [data-game-panel="valorant"] { width: min(1320px, 100%); }
.live-session-picker{
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:16px;
  width:min(1320px,100%); box-sizing:border-box; margin:0 0 12px; padding:10px 12px;
  border:1px solid var(--border); background:var(--surf);
}
.live-session-picker-heading{ display:grid; gap:2px; min-width:150px; }
.live-session-picker-heading span{
  color:var(--text); font:700 10px 'Tomorrow',sans-serif; letter-spacing:1.4px; text-transform:uppercase;
}
.live-session-picker-heading small{ color:var(--muted); font-size:10px; }
.live-session-picker-list{ display:flex; gap:7px; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.live-session-card{
  appearance:none; display:grid; grid-template-columns:auto minmax(88px,1fr) auto; align-items:center; gap:9px;
  min-width:215px; min-height:54px; box-sizing:border-box; padding:7px 9px; border:1px solid var(--border);
  background:rgba(255,255,255,.018); color:var(--text); cursor:pointer; text-align:left;
  transition:border-color .15s,background .15s,transform .15s;
}
.live-session-card:hover,.live-session-card:focus-visible{ border-color:var(--border2); background:rgba(255,255,255,.04); outline:none; }
.live-session-card:active{ transform:translateY(1px); }
.live-session-card.is-selected{ border-color:var(--red-mid); background:var(--red-low); }
.live-session-avatars{ display:flex; padding-left:6px; }
.live-session-avatars .live-session-avatar{ margin-left:-6px; border-color:var(--surf); }
.live-session-card.is-selected .live-session-avatar{ border-color:#2a1a22; }
.live-session-copy{ display:grid; gap:1px; min-width:0; }
.live-session-copy strong{ color:var(--text); font:700 10px 'Tomorrow',sans-serif; letter-spacing:1.5px; }
.live-session-card.is-selected .live-session-copy strong{ color:var(--red); }
.live-session-copy span,.live-session-copy small{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.live-session-copy span{ color:var(--muted); font-size:9px; }
.live-session-copy small{ color:var(--dim); font:600 7px 'Tomorrow',sans-serif; letter-spacing:.7px; text-transform:uppercase; }
.live-session-state{ color:var(--dim); font:700 7px 'Tomorrow',sans-serif; letter-spacing:.8px; text-transform:uppercase; }
.live-session-card.is-selected .live-session-state{ color:var(--red); }
.live-diagnostic {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 14px;
  width: 100%; min-height: 60px; box-sizing: border-box; margin: 0 0 12px; padding: 9px 12px;
  border: 1px solid var(--border); border-left: 2px solid #687181;
  background: linear-gradient(90deg,rgba(255,255,255,.035),transparent 55%),var(--surf);
}
.live-diagnostic[data-state="online"],.live-diagnostic[data-state="idle"]{ border-left-color:#3fcf6b; }
.live-diagnostic[data-state="agent-select"]{ border-left-color:#f5c842; }
.live-diagnostic[data-state="in-game"]{ border-left-color:var(--red); }
.live-diagnostic[data-state="error"],.live-diagnostic[data-state="riot-offline"]{ border-left-color:#ff9f43; }
.live-diagnostic-summary { display:flex; align-items:center; gap:10px; min-width:175px; }
.live-diagnostic-dot {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%;
  background: #687181; box-shadow: 0 0 0 4px rgba(104,113,129,.1);
}
.live-diagnostic-copy { display: grid; gap: 2px; min-width: 0; }
.live-diagnostic-copy strong {
  color: var(--text); font-size: 11px; font-weight: 700;
  letter-spacing: 1.35px; text-transform: uppercase;
}
.live-diagnostic-copy span {
  color: var(--muted); font-size: 10px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.live-diagnostic-version {
  grid-column:2; grid-row:1;
  color: var(--dim); font-family: 'Tomorrow', sans-serif; font-size: 8px;
  letter-spacing: 1.2px; text-transform: uppercase; white-space:nowrap;
}
.live-download-link {
  display:flex; align-items:center; gap:6px; min-height:34px; box-sizing:border-box; padding:7px 10px;
  border:1px solid var(--red-mid); background:var(--red-low); color:var(--red);
  font-family:'Tomorrow',sans-serif; font-size:8px; font-weight:700; letter-spacing:.8px;
  text-decoration:none; text-transform:uppercase; transition:border-color .2s,background .2s;
}
.live-download-link[hidden]{ display:none; }
.live-download-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:8px; }
.live-diagnostic .live-download-actions { grid-column:3; grid-row:1; }
.live-download-actions .live-download-link { min-height:36px; box-sizing:border-box; font-size:12px; letter-spacing:.2px; text-transform:none; white-space:nowrap; }
.live-download-actions .live-download-secondary { color:var(--muted); background:transparent; border-color:var(--border); }
.live-download-actions .live-download-link:focus-visible { outline:2px solid var(--red); outline-offset:3px; }
@media (min-width:769px) and (max-width:1100px) {
  .live-diagnostic .live-download-actions { grid-column:3; }
}
@media (max-width:768px) {
  .live-download-actions { display:none; }
}
.live-download-link:hover { border-color: var(--red); background: rgba(255,70,86,.18); }
.live-client-list {
  grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:stretch; gap:10px; min-width:0;
}
.live-client-list::-webkit-scrollbar{ display:none; }
.live-client-chip {
  --client-status:#62d895;
  position: relative; display: flex; align-items: center; gap: 11px;
  flex:1 1 175px; min-width:0; max-width:260px; min-height:70px; box-sizing:border-box;
  padding:12px; border:1px solid rgba(255,255,255,.09); border-radius:2px;
  background:#151921;
}
.live-client-chip::before {
  content: ''; position: absolute; inset: 12px auto 12px 0; width: 2px; background:var(--client-status);
}
.live-client-chip[data-state="agent-select"] { --client-status:#f5cd64; }
.live-client-chip[data-state="in-game"] { --client-status:#ff6571; }
.live-client-chip[data-state="error"],
.live-client-chip[data-state="away"],
.live-client-chip[data-state="riot-offline"] { --client-status:#ffae62; }
.live-client-chip[data-state="away"] .live-client-info small { color: #ffb36b; }
.live-client-chip.selected { border-color: rgba(255,70,86,.45); background: var(--red-low); }
.live-client-avatar {
  position: relative; flex: 0 0 34px; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 50%; background: var(--bg);
}
.live-client-avatar .avatar-stack,
.live-client-avatar .avatar-layer { width: 100%; height: 100%; }
.live-client-avatar .avatar-layer { object-fit: cover; border-radius:50%; }
.live-client-avatar::after {
  content:''; position:absolute; right:-2px; bottom:-2px; z-index:2;
  width:10px; height:10px; border:2px solid #151921; border-radius:50%; background:var(--client-status);
}
.live-client-initial {
  display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted);
  font-size: 11px; font-weight: 700;
}
.live-client-info { display: grid; gap: 4px; min-width: 0; }
.live-client-info strong {
  overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700;
  text-overflow: ellipsis; white-space: nowrap;
}
.live-client-info small {
  color: #b8c2cf; font-size: 12px;
  font-weight: 500; line-height: 1.3;
  overflow-wrap:anywhere;
}
.live-client-chip[data-state="agent-select"] .live-client-info small,
.live-client-chip[data-state="in-game"] .live-client-info small { color:var(--client-status); }
.live-client-chip-version {
  display:none;
}
.live-client-group {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:1 1 360px; min-width:0;
  padding:8px; border:1px solid color-mix(in srgb,var(--border) 75%,var(--red));
  background:color-mix(in srgb,var(--surf2) 88%,transparent);
}
.live-client-group-heading {
  display:grid; gap:2px; min-width:76px; padding:0 5px;
}
.live-client-group-heading strong { color:var(--red); font-size:9px; font-weight:700; text-transform:uppercase; }
.live-client-group-heading small {
  overflow:hidden; max-width:110px; color:var(--muted); font-size:8px;
  text-overflow: ellipsis; white-space: nowrap;
}
.live-client-group-members { display:flex; flex-wrap:wrap; flex:1 1 250px; min-width:0; gap:8px; }
.live-client-group .live-client-chip { background:#151921; }
.live-client-group .live-client-chip-version { display: none; }
.live-diagnostic[data-state="online"] .live-diagnostic-dot,
.live-diagnostic[data-state="idle"] .live-diagnostic-dot {
  background: #3fcf6b; box-shadow: 0 0 0 4px rgba(63,207,107,.1), 0 0 14px rgba(63,207,107,.4);
}
.live-diagnostic[data-state="agent-select"] .live-diagnostic-dot {
  background: #f5c842; box-shadow: 0 0 0 4px rgba(245,200,66,.1), 0 0 14px rgba(245,200,66,.4);
}
.live-diagnostic[data-state="in-game"] .live-diagnostic-dot {
  background: var(--red); box-shadow: 0 0 0 4px rgba(255,70,86,.1), 0 0 14px rgba(255,70,86,.45);
}
.live-diagnostic[data-state="error"] .live-diagnostic-dot,
.live-diagnostic[data-state="riot-offline"] .live-diagnostic-dot {
  background: #ff9f43; box-shadow: 0 0 0 4px rgba(255,159,67,.1);
}
.live-waiting { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 32px; }
.live-content { width: 100%; }
.live-signal-notice {
  margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(245,200,66,.35);
  border-left: 3px solid #f5c842; background: rgba(245,200,66,.08);
  color: #f6de91; font: 600 12px/1.45 'DM Sans', sans-serif;
}
.live-signal-notice[hidden] { display: none; }

/* Shared async states: stable layout instead of a lone "Chargement" label. */
.data-state-card {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px;
  min-height: 82px; box-sizing: border-box; padding: 18px 20px; border: 1px solid var(--border);
  background: var(--surf); font-family: 'DM Sans', system-ui, sans-serif;
}
.data-state-card > div { display: grid; gap: 4px; min-width: 0; }
.data-state-card strong { color: var(--text); font-size: 14px; font-weight: 650; }
.data-state-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.data-state-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.data-state-card.is-loading .data-state-pulse { background: var(--red); box-shadow: 0 0 0 5px var(--red-low); animation: dataPulse 1.5s ease-in-out infinite; }
.data-state-card.is-error .data-state-pulse { background: #ff9f43; }
.data-state-lines { display: grid; gap: 7px; width: 88px; }
.data-state-lines i { position: relative; overflow: hidden; display: block; height: 5px; background: var(--surf2); }
.data-state-lines i:last-child { width: 62%; }
.data-state-card.is-loading .data-state-lines i::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg,transparent,var(--red-mid),transparent); animation: dataShimmer 1.25s ease-in-out infinite;
}
@keyframes dataPulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes dataShimmer { to { transform: translateX(100%); } }
.live-header {
  position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:stretch;
  justify-content:space-between; gap:24px; min-height:150px; box-sizing:border-box;
  margin-bottom:12px; padding:22px 24px; border:1px solid var(--border); background:var(--surf);
}
.live-header.is-gauntlet{
  min-height:116px; padding-block:18px;
  background:linear-gradient(115deg,rgba(157,92,255,.09),transparent 42%),var(--surf);
}
.live-header.is-gauntlet .live-match-art,
.live-header.is-gauntlet .live-match-art-shade{ display:none; }
.live-header.is-gauntlet .live-map-name{ font-size:clamp(25px,2.5vw,34px); letter-spacing:4px; }
.live-match-art{
  position:absolute; z-index:-3; inset:0 0 0 auto; width:62%; height:100%; object-fit:cover;
  object-position:center; filter:saturate(.92) contrast(1.08) brightness(.72);
}
.live-match-art-shade{
  position:absolute; z-index:-2; inset:0; background:
    linear-gradient(90deg,var(--surf) 4%,rgba(18,23,33,.96) 31%,rgba(18,23,33,.68) 66%,rgba(18,23,33,.28)),
    linear-gradient(0deg,rgba(5,8,13,.7),transparent 65%);
}
.live-match-context{ position:relative; z-index:1; display:grid; align-content:center; gap:7px; min-width:0; }
.live-match-kicker{
  color:var(--red); font:700 9px/1 'Tomorrow',sans-serif; letter-spacing:3px; text-transform:uppercase;
}
.live-map-name {
  color:#fff; font-family:'Tomorrow',sans-serif; font-size:clamp(27px,3vw,42px); font-weight:700;
  line-height:1; letter-spacing:5px; text-transform:uppercase; text-shadow:0 4px 18px rgba(0,0,0,.6);
}
.live-match-meta{ display:flex; align-items:center; gap:8px; min-width:0; }
.live-server {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; min-width: 155px; height: 40px;
  box-sizing: border-box; padding: 6px 46px 6px 10px;
  border: 1px solid rgba(76, 201, 240, .32);
  background: linear-gradient(120deg, rgba(76, 201, 240, .12), rgba(8, 12, 18, .94));
  color: #65d9f5;
}
.live-server.has-visual::after {
  content: ''; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, rgba(7, 11, 17, .94) 5%, rgba(7, 11, 17, .72) 58%, rgba(7, 11, 17, .3));
}
.live-server-image {
  position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; filter: saturate(.72) contrast(1.08);
}
.live-server-copy { display: grid; gap: 2px; position: relative; z-index: 1; }
.live-server-copy small {
  font-family: 'DM Sans', sans-serif; font-size: 8px; line-height: 1;
  letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .52);
}
.live-server-copy strong {
  font-family: 'Tomorrow', sans-serif; font-size: 11px; line-height: 1.1;
  letter-spacing: 1.8px; text-transform: uppercase; color: #fff;
}
.live-server-credit {
  position: absolute; z-index: 2; right: 7px; bottom: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 7px; letter-spacing: .7px;
  color: rgba(255, 255, 255, .48); text-decoration: none;
}
.live-server-credit:hover { color: #fff; }
.live-data-notice {
  margin: -6px 0 16px; padding: 10px 13px;
  border: 1px solid rgba(245, 200, 66, .28);
  background: rgba(245, 200, 66, .07); color: #d8c783;
  font-size: 11px; line-height: 1.5;
}
.live-data-notice strong {
  color: #f5c842; font-weight: 650;
}
/* Score en direct : même gabarit que la phase et le serveur, posé sur la
   même bande sombre de l'en-tête (celui-ci reste sombre dans les deux thèmes). */
.live-score {
  display:inline-flex; align-items:center; gap:10px; min-height:40px; box-sizing:border-box;
  padding:4px 12px; border:1px solid rgba(255,255,255,.18); background:rgba(7,10,15,.72);
  font-family:'Tomorrow',sans-serif; color:#fff; font-variant-numeric:tabular-nums;
}
.live-score[hidden] { display:none; }
.live-score-side { display:inline-flex; align-items:center; gap:7px; }
.live-score-side small {
  font-size:8px; font-weight:600; letter-spacing:1.6px; text-transform:uppercase; color:rgba(255,255,255,.52);
}
.live-score-side strong { min-width:1.2em; font-size:22px; font-weight:700; line-height:1; text-align:center; }
.live-score-sep { color:rgba(255,255,255,.35); font-size:16px; }
.live-score[data-state="ahead"] { border-color:rgba(63,207,111,.45); }
.live-score[data-state="ahead"] .live-score-side:not(.is-theirs) strong { color:#3fcf6f; }
.live-score[data-state="behind"] { border-color:rgba(255,70,86,.45); }
.live-score[data-state="behind"] .live-score-side:not(.is-theirs) strong { color:#ff4656; }
.live-phase {
  display:inline-flex; align-items:center; min-height:40px; box-sizing:border-box; padding:6px 10px;
  border:1px solid rgba(255,255,255,.18); background:rgba(7,10,15,.56); color:rgba(255,255,255,.78);
  font-family:'Tomorrow',sans-serif; font-size:9px; font-weight:600; letter-spacing:1.6px; text-transform:uppercase;
}
.live-phase.combat { color: var(--red); border-color: var(--red-mid); background: var(--red-low); }
.live-phase.planted { color: var(--gold); border-color: rgba(245,200,66,.4); background: var(--gold-low); }
.live-timer {
  margin-left: auto; font-family: 'Tomorrow', sans-serif; font-size: 24px;
  font-weight: 700; color: var(--text); letter-spacing: 3px;
}
.live-match-actions{
  position:relative; z-index:1; display:flex; flex-direction:column; align-items:flex-end;
  justify-content:space-between; gap:12px; min-width:230px;
}
.live-avg-rank{
  display:flex; align-items:center; gap:9px; min-height:44px; box-sizing:border-box; padding:7px 11px;
  border:1px solid rgba(255,255,255,.16); background:rgba(5,8,13,.72); backdrop-filter:blur(7px);
}
.live-avg-rank[hidden]{ display:none; }
.live-avg-rank img{ width:30px; height:30px; object-fit:contain; }
.live-avg-rank-copy{ display:grid; gap:2px; }
.live-avg-rank-copy small{ color:rgba(255,255,255,.58); font:600 8px/1 'Tomorrow',sans-serif; letter-spacing:1.2px; text-transform:uppercase; }
.live-avg-rank-copy strong{ color:#fff; font:700 11px/1.15 'Tomorrow',sans-serif; letter-spacing:1.5px; text-transform:uppercase; }
.live-body { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; align-items:start; }
.live-pregame-panel {
  display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px;
}
.live-pregame-header {
  --side-color: #7d8799;
  --side-rgb: 125, 135, 153;
  position: relative; overflow: hidden;
  display: flex; align-items: stretch; justify-content: space-between; gap: 18px;
  min-height: 82px; padding: 15px 20px;
  border: 1px solid rgba(var(--side-rgb), .32);
  background:
    linear-gradient(100deg, rgba(var(--side-rgb), .14), transparent 48%),
    var(--surf);
}
.live-pregame-header::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--side-color); box-shadow: 0 0 22px rgba(var(--side-rgb), .7);
}
.live-pregame-header.attack { --side-color: #ff4656; --side-rgb: 255, 70, 86; }
.live-pregame-header.defense { --side-color: #45d6d1; --side-rgb: 69, 214, 209; }
.live-pregame-heading {
  display: grid; align-content: center; gap: 3px; min-width: 0;
  font-family: 'Tomorrow', sans-serif; text-transform: uppercase;
}
.live-pregame-heading .live-pregame-kicker {
  color: var(--side-color); font-size: 9px; font-weight: 700; letter-spacing: 4px;
}
.live-pregame-heading .live-pregame-kicker i {
  margin: 0 4px; color: var(--dim); font-style: normal;
}
.live-pregame-heading strong {
  color: var(--text); font-size: clamp(16px, 1.8vw, 23px); line-height: 1.15; letter-spacing: 3px;
  overflow: hidden; text-overflow: ellipsis;
}
.live-pregame-heading > span:last-child {
  color: var(--dim); font-size: 8px; letter-spacing: 2px;
}
.live-side-card {
  --side-color: #7d8799;
  --side-rgb: 125, 135, 153;
  display: flex; align-items: center; gap: 12px; min-width: 230px; padding: 12px 16px;
  border: 1px solid rgba(var(--side-rgb), .42);
  background: rgba(var(--side-rgb), .08);
}
.live-side-card.attack { --side-color: #ff4656; --side-rgb: 255, 70, 86; }
.live-side-card.defense { --side-color: #45d6d1; --side-rgb: 69, 214, 209; }
.live-side-icon {
  position: relative; flex: 0 0 38px; width: 38px; height: 38px;
  border: 1px solid rgba(var(--side-rgb), .55); transform: rotate(45deg);
  background: rgba(var(--side-rgb), .12); box-shadow: inset 0 0 16px rgba(var(--side-rgb), .12);
}
.live-side-icon::before {
  content: '•'; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--side-color); font-size: 26px; line-height: 1; transform: rotate(-45deg);
}
.live-side-card.attack .live-side-icon::before { content: '▲'; font-size: 16px; }
.live-side-card.defense .live-side-icon::before { content: '◆'; font-size: 17px; }
.live-side-card.pending .live-side-icon { animation: live-side-pulse 1.4s ease-in-out infinite; }
.live-side-copy { display: grid; gap: 3px; font-family: 'Tomorrow', sans-serif; text-transform: uppercase; }
.live-side-copy small { color: var(--dim); font-size: 7px; letter-spacing: 2px; }
.live-side-copy strong { color: var(--side-color); font-size: 11px; line-height: 1.3; letter-spacing: 2px; }
@keyframes live-side-pulse { 50% { opacity: .4; } }
.live-pregame-comps{
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; gap:10px;
}
.live-pregame-comp{ min-width:0; padding:12px 14px; border:1px solid var(--border); background:var(--surf); }
.live-pregame-comp-label{
  margin-bottom:8px; color:var(--muted); font:700 8px 'Tomorrow',sans-serif;
  letter-spacing:2px; text-transform:uppercase;
}
.live-comp-agents{ display:flex; align-items:center; gap:6px; min-height:30px; margin-bottom:8px; }
.live-comp-agents img{ width:30px; height:30px; object-fit:cover; }
.live-comp-agents > span{ color:var(--dim); font-size:9px; }
.live-comp-agent-names{
  overflow:hidden; color:var(--dim); font:600 9px 'Tomorrow',sans-serif;
  letter-spacing:.7px; text-overflow:ellipsis; white-space:nowrap;
}
.live-pro-team-picker{ display:flex; gap:5px; margin:0 0 8px; }
.live-pro-preset-btn{
  min-width:47px; height:32px; padding:4px 6px; display:flex; align-items:center; justify-content:center; gap:4px;
  border:1px solid var(--border2); background:transparent; color:var(--dim); cursor:pointer;
}
.live-pro-preset-btn:hover,.live-pro-preset-btn.active{ border-color:#4d9fff; color:var(--text); background:rgba(30,120,255,.1); }
.live-pro-preset-btn img{ width:20px; height:20px; padding:2px; object-fit:contain; box-sizing:border-box; border:1px solid rgba(255,255,255,.68); border-radius:4px; background:#edf1f7; }
.live-pro-preset-btn span{ font:700 8px 'Tomorrow',sans-serif; letter-spacing:.5px; }
.live-comp-team-meta{ min-height:28px; margin-bottom:8px; display:flex; align-items:center; gap:7px; }
.live-comp-team-meta > img{ width:26px; height:26px; padding:2px; object-fit:contain; box-sizing:border-box; border:1px solid rgba(255,255,255,.68); border-radius:5px; background:#edf1f7; }
.live-comp-team-meta > span{ min-width:0; display:grid; gap:1px; }
.live-comp-team-meta strong{ overflow:hidden; color:var(--text); font:700 9px 'Tomorrow',sans-serif; text-overflow:ellipsis; white-space:nowrap; }
.live-comp-team-meta small{ overflow:hidden; color:var(--dim); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.live-players { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0; }
.live-players.is-deathmatch > .live-team-title{ grid-column:1 / -1; }
.live-players.is-gauntlet{ gap:10px 12px; }
.live-players.is-gauntlet .live-player-portrait{ display:none; }
.live-players.is-gauntlet .live-player-summary{ min-height:50px; padding:8px 14px; }
.live-players.is-gauntlet .live-player-details{ padding-left:14px; }
.live-team-tabs{ display:none; }
.live-team {
  --team-accent:125,135,153; display:flex; flex-direction:column; gap:5px; min-width:0;
  padding:10px; border:1px solid var(--border); background:rgba(18,23,33,.5);
}
.live-team-allies{ --team-accent:69,214,209; }
.live-team-enemies{ --team-accent:255,70,86; }
.live-team-title {
  display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:27px;
  padding:0 3px 5px; border-bottom:1px solid rgba(var(--team-accent),.22);
  color:rgba(var(--team-accent),.95); font-family:'Tomorrow',sans-serif; text-transform:uppercase;
}
.live-team-title strong{ font-size:10px; letter-spacing:2px; }
.live-team-title small{ color:var(--muted); font-size:8px; letter-spacing:1px; }
.live-players.is-syncing {
  min-height: 235px; grid-template-columns: 1fr; place-items: center;
  border: 1px solid var(--border); background: rgba(18,23,33,.5);
}
.live-roster-sync {
  display: grid; justify-items: center; gap: 7px; padding: 24px;
  color: var(--muted); text-align: center;
}
.live-roster-sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 5px rgba(245,200,66,.1), 0 0 18px rgba(245,200,66,.45);
  animation: live-roster-sync-pulse 1.3s ease-in-out infinite;
}
.live-roster-sync strong {
  color: var(--text); font-family: 'Tomorrow', sans-serif;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
}
.live-roster-sync small { max-width: 360px; font-size: 11px; line-height: 1.45; }
@keyframes live-roster-sync-pulse { 50% { opacity: .35; transform: scale(.75); } }
.live-player-row {
  display:block; min-width:0; overflow:hidden; background:var(--surf); border:1px solid var(--border);
  transition:border-color .2s,background .2s;
}
.live-player-row > summary{ list-style:none; }
.live-player-row > summary::-webkit-details-marker{ display:none; }
.live-player-summary{
  display:flex; align-items:center; gap:10px; min-width:0; min-height:54px; box-sizing:border-box;
  padding:7px 9px; cursor:pointer;
}
.live-player-row:hover{ border-color:rgba(var(--team-accent),.42); }
.live-player-row[open]{ border-color:rgba(var(--team-accent),.5); background:color-mix(in srgb,var(--surf) 90%,rgba(var(--team-accent),.12)); }
.live-player-row.dead { opacity: .4; filter: grayscale(.6); }
.live-player-row.me { border-color: var(--red-mid); background: var(--red-low); }
.live-player-portrait{ position:relative; flex:0 0 40px; width:40px; height:40px; }
.live-player-agent { width:40px; height:40px; object-fit:cover; background:var(--surf3); }
.live-player-member-avatar{
  position:absolute; right:-4px; bottom:-3px; width:18px; height:18px; overflow:hidden;
  border:2px solid var(--surf); border-radius:50%; background:var(--bg);
}
.live-player-member-avatar .avatar-stack,.live-player-member-avatar .avatar-layer{ width:100%; height:100%; }
.live-player-member-avatar .avatar-layer{ object-fit:cover; }
.live-player-main{ flex:1; display:grid; gap:5px; min-width:0; }
.live-player-identity{ display:flex; align-items:baseline; gap:6px; min-width:0; }
.live-player-name {
  overflow:hidden; color:var(--text); font-family:'Tomorrow',sans-serif; font-size:11.5px;
  font-weight:700; letter-spacing:.45px; text-overflow:ellipsis; white-space:nowrap;
}
.live-player-agent-name{ flex:0 0 auto; color:var(--muted); font-size:10px; }
.live-player-primary-stats{ display:flex; align-items:center; gap:7px; min-width:0; overflow:hidden; }
.live-rank-current,.live-rank-peak{ font:600 9px/1.2 'Tomorrow',sans-serif; letter-spacing:.55px; white-space:nowrap; }
.live-rank-peak{ padding-left:7px; border-left:1px solid var(--border2); }
.live-rank-prefix{ color:var(--dim); font-size:7px; letter-spacing:.8px; }
.live-player-badge{ flex:0 0 auto; padding:2px 5px; border:1px solid var(--border2); color:var(--muted); font:700 7px/1 'Tomorrow',sans-serif; letter-spacing:.8px; text-transform:uppercase; }
.live-player-badge.oly{ border-color:rgba(255,70,86,.48); color:var(--red); }
.live-player-badge.smurf{ border-color:rgba(255,70,86,.4); color:var(--red); }
.live-player-badge.warning{ border-color:rgba(245,200,66,.35); color:var(--gold); }
.live-player-chevron{ flex:0 0 auto; color:var(--dim); font-size:13px; transition:transform .2s,color .2s; }
.live-player-row[open] .live-player-chevron{ color:var(--text); transform:rotate(180deg); }
.live-player-details{
  display:flex; align-items:center; gap:8px; min-height:32px; box-sizing:border-box; margin:0 9px;
  padding:7px 0 8px 50px; border-top:1px solid var(--border); color:var(--muted);
}
.live-player-season,.live-player-rr{ font:500 9px/1.3 'Tomorrow',sans-serif; letter-spacing:.5px; }
.live-player-rr .positive,.live-player-rr.positive{ color:#3fcf6b; }
.live-player-rr .negative,.live-player-rr.negative{ color:#ff4656; }
.live-player-rr .separator{ color:var(--dim); }
.live-player-tracker{
  margin-left:auto; color:var(--red); font:700 8px/1 'Tomorrow',sans-serif; letter-spacing:.8px;
  text-decoration:none; text-transform:uppercase;
}
.live-player-tracker:hover{ text-decoration:underline; }
.live-player-hp { font-family: 'Tomorrow',sans-serif; font-size: 11px; color: var(--muted); min-width: 60px; text-align: right; }
.live-hp-bar { height: 4px; background: var(--border); width: 100px; border-radius: 2px; overflow: hidden; }
.live-hp-fill { height: 100%; background: #3fcf6b; transition: width .3s; border-radius: 2px; }
.live-ult { font-size: 9px; padding: 2px 6px; border: 1px solid var(--border2); color: var(--dim); font-family: Tomorrow,sans-serif; letter-spacing: 1px; }
.live-ult.ready { color: var(--gold); border-color: rgba(245,200,66,.4); background: var(--gold-low); }

/* History v2 */
:root[data-theme="dark"] #page-history {
  --text: #f2f4f9;
  --muted: #b4bbcc;
  --dim: #8992aa;
  --surf: #121721;
  --surf2: #19202c;
  --border: rgba(255,255,255,.12);
  --border2: rgba(255,255,255,.2);
}
#page-history { font-family: 'DM Sans', system-ui, sans-serif; }
.history-page-title {
  margin: 0 0 3px; color: var(--text); font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 26px; font-weight: 700; letter-spacing: -.4px;
}
.history-page-subtitle { margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.history-view-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.history-view-tabs .history-filter-button {
  min-width: 118px; padding: 10px 18px; font-size: 14px; font-weight: 600;
}
.history-filters {
  display: flex; align-items: flex-end; gap: 22px; margin-bottom: 22px; padding: 12px 14px;
  border: 1px solid var(--border); background: rgba(18,23,33,.72);
}
.history-filter-group { display: grid; gap: 8px; min-width: 0; }
.history-filter-group > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.history-filter-group > div { display: flex; flex-wrap: wrap; gap: 5px; }
.history-filter-button {
  appearance: none; padding: 7px 11px; border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); font: 500 12px/1.2 'DM Sans', system-ui, sans-serif; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.history-filter-button:hover { color: var(--text); border-color: var(--border2); }
.history-filter-button.active { color: #fff; border-color: var(--red); background: rgba(255,70,86,.18); }
.history-view-panel { display: none; }
.history-view-panel.active { display: block; }
.history-analysis { margin-bottom: 34px; border: 1px solid var(--border); background: var(--surf); }
.history-analysis > summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 14px 16px; list-style: none; cursor: pointer;
}
.history-analysis > summary::-webkit-details-marker { display: none; }
.history-analysis > summary:hover { background: rgba(255,255,255,.02); }
.history-analysis > summary span { color: var(--text); font-size: 14px; font-weight: 600; }
.history-analysis > summary small { color: var(--muted); font-size: 12px; }
.history-analysis > summary i { color: var(--muted); font-size: 17px; font-style: normal; transition: transform .2s; }
.history-analysis[open] > summary i { transform: rotate(180deg); }
.history-analysis-content { padding: 18px 16px 0; border-top: 1px solid var(--border); }
.history-empty-filter { padding: 32px 20px; border: 1px solid var(--border); background: var(--surf); color: var(--muted); font-size: 14px; text-align: center; }
.history-section-title {
  margin: 0 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .2px;
}
.history-daily-section { margin-bottom: 32px; }
.history-group-recap { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin:0 0 18px;border:1px solid var(--border);background:var(--border); }
.history-group-recap>div { display:grid;gap:3px;min-width:0;padding:14px 16px;background:var(--surf); }
.history-group-recap small { color:var(--muted);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase; }
.history-group-recap strong { overflow:hidden;color:var(--text);font-size:20px;line-height:1.15;text-overflow:ellipsis;white-space:nowrap; }
.history-group-recap span { color:var(--dim);font-size:11px; }
.history-daily-grid { display: grid; gap: 7px; }
@media(max-width:700px){.history-group-recap{grid-template-columns:repeat(2,minmax(0,1fr));}.history-group-recap>div{padding:12px}.history-group-recap strong{font-size:17px}}
.history-day-card {
  position: relative; overflow: hidden; border: 1px solid var(--border); background: var(--surf);
}
.history-day-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--red);
}
.history-day-summary {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 10px 14px 10px 17px;
  list-style: none; cursor: pointer;
}
.history-day-summary::-webkit-details-marker { display: none; }
.history-day-summary:hover { background: rgba(255,255,255,.02); }
.history-day-summary > strong { min-width: 150px; color: var(--text); font-size: 15px; text-transform: capitalize; }
.history-day-summary > span { color: var(--muted); font-size: 12px; }
.history-day-summary > b { color: var(--text); font-size: 13px; font-weight: 650; white-space: nowrap; }
.history-day-summary > b.positive { color: #3fcf6b; }
.history-day-summary > b.negative { color: #ff4656; }
.history-day-summary > b.muted { color: var(--dim); }
.history-day-summary > .history-day-dm { color: #e0b341; }
.history-day-summary > i { margin-left: auto; color: var(--dim); font-size: 16px; font-style: normal; transition: transform .2s; }
.history-day-card[open] > .history-day-summary > i { transform: rotate(180deg); }
.history-day-detail { padding: 0 14px 14px 17px; border-top: 1px solid var(--border); }
.history-day-context { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 0 0; color: var(--muted); font-size: 12px; }
.history-day-performance { margin-top: 12px; border: 1px solid var(--border); background: var(--bg); }
.history-day-performance > summary {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px;
  padding: 10px; list-style: none; cursor: pointer;
}
.history-day-performance > summary::-webkit-details-marker { display: none; }
.history-day-performance > summary:hover { background: rgba(255,255,255,.02); }
.history-day-performance > summary:focus { outline: none; }
.history-day-performance > summary:focus-visible { outline: 1px solid var(--red); outline-offset: -1px; }
.history-day-performance > summary > span { color: var(--muted); font-size: 10px; font-weight: 600; }
.history-day-performance > summary > strong {
  overflow: hidden; color: var(--text); font-size: 11px; font-weight: 600; text-align: right;
  text-overflow: ellipsis; white-space: nowrap;
}
.history-day-performance > summary > i { color: var(--dim); font-size: 14px; font-style: normal; transition: transform .2s; }
.history-day-performance[open] > summary > i { transform: rotate(180deg); }
.history-day-performance-list { display: grid; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.history-day-player { padding: 10px; border: 1px solid var(--border); background: var(--surf2); }
.history-day-player > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.history-day-player > header strong { color: var(--text); font-size: 13px; }
.history-day-player > header span { color: var(--muted); font-size: 9px; }
.history-day-player-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.history-day-player-metrics > div { display: grid; gap: 2px; min-width: 0; padding-left: 7px; border-left: 1px solid var(--border); }
.history-day-player-metrics strong { color: var(--text); font-size: 12px; white-space: nowrap; }
.history-day-player-metrics small { color: var(--muted); font-size: 9px; }
.history-day-best { margin-top: 8px; color: #e0b341; font-size: 10px; font-weight: 600; }
.history-agents-section, .history-maps-section { margin-bottom: 34px; }
.history-agent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.history-agent-chip { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border: 1px solid var(--border); background: var(--surf); }
.history-agent-chip > img { width: 34px; height: 34px; object-fit: cover; }
.history-agent-copy { display: grid; gap: 1px; }
.history-agent-copy strong { color: var(--text); font-size: 14px; font-weight: 600; }
.history-agent-copy small { color: var(--muted); font-size: 11px; }
.history-map-stats { display: flex; flex-direction: column; gap: 6px; }
.history-map-stat { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border: 1px solid var(--border); background: var(--surf); }
.history-map-stat-name { width: 90px; flex-shrink: 0; color: var(--text); font-size: 14px; text-transform: capitalize; }
.history-map-stat-track { position: relative; flex: 1; height: 5px; overflow: hidden; background: var(--bg); }
.history-map-stat-track > div { position: absolute; inset: 0 auto 0 0; transition: width .4s; }
.history-map-stat-wr { width: 42px; font-size: 14px; text-align: right; }
.history-map-stat-record { width: 56px; color: var(--muted); font-size: 11px; text-align: right; }
.history-latest-sections { display: grid; gap: 30px; }
.history-mode-section { min-width: 0; }
.history-game-list { display: flex; flex-direction: column; gap: 5px; }
.history-game { border: 1px solid var(--border); border-left: 4px solid var(--result-color); background: var(--surf); }
.history-game summary { list-style: none; }
.history-game summary::-webkit-details-marker { display: none; }
.history-game-summary {
  display: flex; align-items: center; gap: 13px; padding: 11px 14px; cursor: pointer;
}
.history-game-summary:hover { background: rgba(255,255,255,.018); }
.history-result { width: 22px; color: var(--result-color); font-size: 14px; font-weight: 700; text-align: center; }
.history-self-agent { width: 36px; height: 36px; object-fit: cover; background: var(--surf3); }
.history-game-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.history-game-main strong { color: var(--text); font-size: 15px; font-weight: 700; }
.history-game-main small { color: var(--muted); font-size: 11px; }
.history-score { color: var(--text); font-size: 16px; font-weight: 600; }
.history-score.muted { color: var(--dim); }
.history-rr { min-width: 52px; font-size: 12px; font-weight: 700; text-align: right; }
.history-rr.positive { color: #3fcf6b; }
.history-rr.negative { color: #ff4656; }
.history-duration { width: 62px; color: var(--muted); font-size: 11px; text-align: right; }
.history-expand { color: var(--dim); font-size: 16px; transition: transform .2s; }
.history-game[open] .history-expand { transform: rotate(180deg); }
.history-game-detail { padding: 14px; border-top: 1px solid var(--border); }
.history-detail-loading { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.history-detail-loading.is-loading { display: flex; align-items: center; justify-content: center; gap: 9px; }
.history-detail-loading.is-loading > span { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: dataPulse 1.5s ease-in-out infinite; }
.history-detail-loading.error { color: var(--red); }
.history-load-more-wrap { display: flex; justify-content: center; align-items: center; padding: 22px 0 4px; color: var(--dim); font-size: 11px; }
.history-detail-layout { display: grid; grid-template-columns: minmax(200px, .3fr) 1fr; gap: 14px; align-items: stretch; }
.history-map-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 190px; padding: 16px; border: 1px solid var(--border);
  background:
    linear-gradient(0deg, rgba(7,9,14,.96) 0%, rgba(7,9,14,.3) 70%),
    var(--history-map-image), var(--surf2);
  background-position: center; background-size: cover;
}
.history-map-visual::after { content: ''; position: absolute; inset: 0; border-left: 2px solid var(--result-color); pointer-events: none; }
.history-match-result {
  position: absolute; z-index: 2; top: 14px; left: 14px; display: grid; gap: 1px;
  padding: 8px 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(7,9,14,.8);
  backdrop-filter: blur(5px);
}
.history-match-result > span { color: rgba(255,255,255,.72); font-size: 10px; font-weight: 600; }
.history-match-result > strong { color: #fff; font-size: 20px; line-height: 1; }
.history-match-result.win { border-color: rgba(63,207,107,.5); }
.history-match-result.loss { border-color: rgba(255,70,86,.5); }
.history-match-result.deathmatch { border-color: rgba(224,179,65,.5); }
.history-map-visual span,
.history-map-visual small { position: relative; z-index: 1; color: rgba(255,255,255,.78); font-size: 11px; }
.history-map-visual strong { position: relative; z-index: 1; margin: 3px 0; color: #fff; font-size: 25px; font-weight: 700; }
.history-match-facts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.history-match-facts > span {
  display: grid; gap: 1px; min-width: 68px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(7,9,14,.68); color: rgba(255,255,255,.6); font-size: 9px;
}
.history-match-facts > span > strong { margin: 0; color: #fff; font-size: 12px; }
.history-match-facts > span > strong.positive { color: #3fcf6b; }
.history-match-facts > span > strong.negative { color: #ff4656; }
.history-tracker-link {
  position:relative; z-index:1; align-self:flex-start; display:inline-flex; align-items:center; gap:7px;
  min-height:34px; box-sizing:border-box; margin-top:9px; padding:7px 10px;
  border:1px solid rgba(255,70,86,.45); background:rgba(7,9,14,.74); color:#fff;
  font:650 10px 'Tomorrow',sans-serif; letter-spacing:.8px; text-decoration:none; text-transform:uppercase;
}
.history-tracker-link:hover,.history-tracker-link:focus-visible{ border-color:#ff4656; background:rgba(255,70,86,.16); outline:none; }
.history-detail-content { display: grid; align-content: start; gap: 12px; min-width: 0; }
.history-match-overview { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.history-performance-card { min-width: 0; border: 1px solid var(--border); background: var(--bg); }
.history-performance-card.self { display: grid; grid-template-columns: minmax(150px,.42fr) 1fr; align-items: center; gap: 12px; padding: 10px; border-color: var(--red-mid); background: var(--red-low); }
.history-performance-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.history-performance-player > img { width: 46px; height: 46px; flex-shrink: 0; object-fit: cover; background: var(--surf3); }
.history-performance-player > span { display: grid; min-width: 0; }
.history-performance-player small, .history-performance-player em { color: var(--muted); font-size: 10px; font-style: normal; }
.history-performance-player strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.history-performance-metrics { display: grid; grid-template-columns: repeat(4,minmax(55px,1fr)); gap: 5px; }
.history-performance-metrics > div { display: grid; gap: 2px; padding: 7px; border-left: 1px solid var(--border); }
.history-performance-metrics strong { color: var(--text); font-size: 14px; white-space: nowrap; }
.history-performance-metrics span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.history-performance-card.mvp { display: flex; flex-direction: column; justify-content: center; padding: 10px 13px; }
.history-mvp-label { margin-bottom: 4px; color: #e0b341; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.history-performance-card.mvp > strong { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-performance-card.mvp > small { color: var(--muted); font-size: 10px; }
.history-performance-card.self-mvp { border-color: rgba(224,179,65,.38); background: rgba(224,179,65,.07); }
.history-detail-players { min-width: 0; }
.history-roster-disclosure { min-width: 0; }
.history-roster-disclosure > summary { display: none; }
.history-roster-content { min-width: 0; }
.history-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.history-team { display: grid; gap: 5px; }
.history-deathmatch-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; }
.history-team-heading {
  display: grid; grid-template-columns: 32px minmax(90px,1fr) auto 55px; align-items: end; gap: 9px;
  grid-column: 1 / -1; margin-bottom: 2px; padding: 0 9px; color: var(--muted);
}
.history-team-heading > strong { grid-column: 1 / -1; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.history-team-heading > span { font-size: 9px; text-align: right; }
.history-team-heading > span:first-of-type { grid-column: 2; text-align: left; }
.history-team-heading > span:nth-of-type(2) { grid-column: 3; }
.history-team-heading > span:nth-of-type(3) { grid-column: 4; }
.history-team-title {
  margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.history-player {
  display: grid; grid-template-columns: 32px minmax(90px,1fr) auto 55px; align-items: center; gap: 9px;
  min-height: 38px; padding: 7px 9px; background: var(--bg); border: 1px solid transparent;
}
.history-player.self { border-color: var(--red-mid); background: var(--red-low); }
.history-player > img { width: 32px; height: 32px; object-fit: cover; }
.history-player-rank {
  display: grid; place-items: center; width: 32px; height: 32px; color: #e0b341; border: 1px solid rgba(224,179,65,.3);
  background: rgba(224,179,65,.08); font-size: 12px; font-weight: 700;
}
.history-player-name { display: grid; min-width: 0; color: var(--text); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.history-player-name small { color: var(--muted); font-size: 10px; font-weight: 400; }
.history-player > strong { color: var(--text); font-size: 12px; white-space: nowrap; }
.history-player > span:last-child { color: var(--muted); font-size: 11px; text-align: right; white-space: nowrap; }
.history-legacy-note { padding: 18px; color: var(--muted); border: 1px solid var(--border); background: var(--bg); font-size: 13px; }

/* ═══════════ COURBES DE PROGRESSION ═══════════ */
/* Le graphique est un SVG construit à la main (js/rr-curve-page.mjs) : le site
   n'embarque aucune bibliothèque de tracé, et une ligne brisée n'en vaut pas
   une. Tout est donc mis en forme ici. */

/* `.container` n'a aucune définition de base dans le projet : sans cette
   enveloppe, la page collait aux deux bords de l'écran. */
.curves-page{ max-width:860px; margin:0 auto; padding:0 20px 40px; }

.curve-chart-wrap{
  border:1px solid rgba(255,255,255,.1); border-radius:14px;
  background:rgba(255,255,255,.02); padding:10px; overflow:hidden;
  /* Étiré sur toute la largeur d'un écran de bureau, le tracé s'aplatissait
     et les variations devenaient illisibles. On laisse du vide autour. */
  max-width:820px;
}
.curve-chart{ display:block; width:100%; height:auto; }

/* Quadrillage volontairement à la limite du visible : il sert de repère, pas
   de décor. */
.curve-grid-line{ stroke:rgba(255,255,255,.045); stroke-width:1; }
.curve-area{ pointer-events:none; }

.curve-ranges{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.curve-range{
  padding:5px 12px; border-radius:999px; cursor:pointer;
  border:1px solid rgba(255,255,255,.12); background:transparent;
  color:var(--txt-2,#b6bccd); font-size:12px; font-family:inherit;
  transition:border-color .15s, color .15s, background .15s;
}
.curve-range:hover{ border-color:rgba(255,255,255,.3); color:#fff; }
.curve-range.active{ border-color:var(--accent,#ff4656); background:color-mix(in srgb,var(--accent,#ff4656) 14%,transparent); color:#fff; }

.curve-untracked{
  margin:14px 0 0; padding:10px 14px; border-radius:10px;
  border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.02);
  color:var(--txt-2,#8992aa); font-size:12px; line-height:1.6;
}
.curve-untracked p{ margin:0 0 6px; }
.curve-untracked ul{ margin:0; padding-left:18px; }
.curve-untracked li{ margin:2px 0; }
.curve-untracked strong{ color:var(--text,#e7eaf3); font-weight:600; }
.curve-grid-label{ fill:rgba(255,255,255,.34); font-size:10px; font-family:inherit; text-anchor:end; }
.curve-axis-date{ fill:rgba(255,255,255,.4); font-size:11px; font-family:inherit; }
.curve-axis-date-end{ text-anchor:end; }

.curve-line{ fill:none; stroke-width:1.7; stroke-linejoin:round; stroke-linecap:round; }
.curve-dot{ opacity:.85; pointer-events:none; transition:r .12s; }
.curve-dot.last{ opacity:1; }
/* Cible de survol : un disque de 3 px ne se vise pas à la souris. */
.curve-hit{ fill:transparent; cursor:crosshair; }
.curve-hit:hover + .curve-dot{ r:5; opacity:1; }
/* Le tracé survolé passe devant : avec dix comptes, les courbes se croisent. */
.curve-line:hover{ stroke-width:2.6; }

.curve-legend{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }

/* ── Synergies ──────────────────────────────────────────────────────────────
   Sous la courbe, pas à côté : c'est une lecture d'ensemble, on y vient après
   avoir regardé sa propre progression. */
.curve-synergies{ margin-top:22px; padding-top:18px; border-top:1px solid var(--border); }
.curve-synergies-title{
  display:flex; align-items:baseline; gap:10px; margin:0 0 12px;
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:700;
  letter-spacing:2px; text-transform:uppercase; color:var(--text);
}
.curve-synergies-title small{
  font-size:9px; font-weight:500; letter-spacing:1px; color:var(--dim); text-transform:none;
}
.curve-synergy-list{ display:grid; gap:4px; margin:0; padding:0; list-style:none; }
.curve-synergy{
  position:relative; display:grid; align-items:center; gap:10px;
  grid-template-columns:22px minmax(0,1fr) 46px 66px;
  padding:8px 10px; overflow:hidden;
  background:var(--surf2); border:1px solid var(--border);
}
.curve-synergy-rank{
  font-family:'Tomorrow',sans-serif; font-size:12px; font-weight:700; color:var(--dim); text-align:center;
}
.curve-synergy-duo{
  overflow:hidden; color:var(--text); font-family:'Tomorrow',sans-serif; font-size:12px;
  font-weight:600; letter-spacing:.5px; text-overflow:ellipsis; white-space:nowrap;
}
.curve-synergy-wr{ font-family:'Tomorrow',sans-serif; font-size:14px; font-weight:700; text-align:right; }
.curve-synergy-record{
  color:var(--dim); font-family:'Tomorrow',sans-serif; font-size:10px;
  letter-spacing:.5px; text-align:right;
}
/* Un duo sous 50 % perd plus qu'il ne gagne — c'est ce qu'on vient chercher. */
.curve-synergy.is-up .curve-synergy-wr{ color:var(--S); }
.curve-synergy.is-down .curve-synergy-wr{ color:var(--D); }
/* La barre se lit d'un coup d'œil ; elle reste sous le texte, jamais devant. */
.curve-synergy-bar{ position:absolute; inset:auto 0 0 0; height:2px; background:var(--border); }
.curve-synergy-bar i{ display:block; height:100%; background:currentColor; }
.curve-synergy.is-up .curve-synergy-bar i{ background:var(--S); }
.curve-synergy.is-down .curve-synergy-bar i{ background:var(--D); }

@media(max-width:620px){
  .curve-synergy{ grid-template-columns:20px minmax(0,1fr) 42px; }
  .curve-synergy-record{ grid-column:2/-1; text-align:left; }
}
.curve-legend-item{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:999px; cursor:pointer;
  border:1px solid rgba(255,255,255,.12); background:transparent;
  color:var(--txt-2,#b6bccd); font-size:13px; font-family:inherit;
  /* Un compte masqué reste lisible : il doit pouvoir être rallumé. */
  opacity:.5; transition:opacity .15s, border-color .15s, color .15s;
}
.curve-legend-item.active{ opacity:1; border-color:var(--curve-color); color:#fff; }
.curve-legend-item:hover{ opacity:1; }
.curve-legend-dot{ width:11px; height:11px; border-radius:50%; background:var(--curve-color); flex:none; }
/* Le smurf est en pointillés sur la courbe : l'anneau le rappelle ici. */
.curve-legend-dot.smurf{ background:transparent; border:2.5px solid var(--curve-color); }
.curve-legend-tag{
  font-size:10px; text-transform:uppercase; letter-spacing:.06em;
  color:rgba(255,255,255,.45); border:1px solid rgba(255,255,255,.14);
  border-radius:4px; padding:1px 5px;
}

.curve-empty{ color:var(--txt-2,#b6bccd); padding:28px 4px; text-align:center; }

@media (max-width:640px){
  .curves-page{ padding:0 14px 32px; }
  .curve-legend-item,.curve-range{ font-size:12px; padding:6px 10px; }
  .curve-chart-wrap{ padding:6px; border-radius:10px; }
}
