/* ===============================
   PVP PAGE
================================ */
.pvp{
  padding:14px;
  display:grid;
  grid-template-columns: 1fr 420px;
  gap:14px;
  align-items:start;
  min-width:0;
}

.pvp__left{ min-width:0; }
.pvp__panel{ padding:14px; }

.pvp__panelHead{
  padding-bottom:10px;
  border-bottom:1px dashed var(--line);
  margin-bottom:10px;
}

.pvp__panelTitle{ font-weight:900; font-size:18px; }
.pvp__panelMeta{ color:var(--muted); font-size:13px; margin-top:4px; }

/* Accordions */
.rare-section{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#0f1624;
  margin-bottom:10px;
}

.rare-header{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  background: rgba(18,25,38,.7);
  border:0;
  cursor:pointer;
  color:var(--text);
}

.rare-header strong{ font-size:14px; }
.rare-header span{ color: var(--muted); font-size:12px; }

.rare-body{
  padding:12px;
  border-top:1px solid rgba(34,48,73,.6);
}

.avatar-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.avatar-btn{
  width:54px;
  height:54px;
  padding:0;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0b1220;
  cursor:pointer;
  overflow:hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.avatar-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(96,165,250,.35);
}

.avatar-btn img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.avatar-btn.is-active{
  outline:3px solid rgba(122,162,255,.55);
  outline-offset:2px;
  box-shadow: 0 0 0 4px rgba(122,162,255,.15);
}

/* Team card */
.team-card{
  border:1px solid var(--line);
  border-radius:16px;
  background:#0f1624;
  padding:14px;
  margin-top:12px;
}

.team-title{
  font-weight:900;
  text-align:center;
  font-size:22px;
  letter-spacing:.8px;
  text-transform:uppercase;
}

.team-subtitle{
  text-align:center;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
  margin-bottom:12px;
}

.team-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
  justify-items:center;
  margin: 0 auto;
  max-width: 360px;
}

.team-slot{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.team-miscrit{
  width:56px;
  height:56px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0b1220;
  padding:0;
  cursor:pointer;
  overflow:hidden;
}

.team-miscrit img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.relic-grid{
  display:grid;
  grid-template-columns: repeat(1, 1fr);
  gap:8px;
}

.relic-btn{
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0b1220;
  padding:0;
  cursor:pointer;
  overflow:hidden;
}

.relic-btn img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.team-notes{
  margin-top:12px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

.topnav--header{ margin-top:6px; }

.visually-hidden{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
}

.pvp-carousel{
  margin-top:14px;
  padding:14px;
  position:relative;
  overflow:hidden;
}

.pvp-carousel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  flex-wrap:wrap;
}

.pvp-carousel__title{
  font-weight:900;
  font-size:16px;
}

.pvp-carousel__controls{
  display:flex;
  gap:10px;
}

.pvp-carousel__viewport{
  overflow:hidden;
  border-radius: var(--radius);
}

.pvp-marquee{
  display:flex;
  gap:14px;
  width:max-content;
  will-change: transform;
  animation: pvp-marquee 20s linear infinite;
  padding:4px 2px 8px;
}

@keyframes pvp-marquee{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

.topteam-card{
  flex:0 0 auto;
  width: 380px;
  max-width: 92vw;
  border:2px solid rgba(34,211,238,.85);
  box-shadow: 0 0 0 3px rgba(34,211,238,.10), 0 12px 30px rgba(0,0,0,.35);
}

.topteam-card:hover{
  border-color: rgba(34,211,238,1);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14), 0 14px 34px rgba(0,0,0,.40);
}

.topteam-card .team-title{
  font-size:22px;
  letter-spacing:1px;
}

.topteam-card .team-subtitle{ margin-bottom:12px; }

.pvp-carousel__fade{
  pointer-events:none;
  position:absolute;
  top:56px;
  bottom:14px;
  width:80px;
  z-index:2;
}

.pvp-carousel__fade.left{
  left:14px;
  background: linear-gradient(90deg, rgba(11,15,20,1), rgba(11,15,20,0));
}

.pvp-carousel__fade.right{
  right:14px;
  background: linear-gradient(270deg, rgba(11,15,20,1), rgba(11,15,20,0));
}

.modal{ position:fixed; inset:0; display:none; z-index:9999; }
.modal.is-open{ display:block; }
.modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.6); }
.modal__card{
  position:relative;
  margin: 6vh auto;
  width: min(860px, calc(100vw - 24px));
  background: #121926;
  border: 1px solid #223049;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.modal__close{
  position:absolute; top:10px; right:10px;
  background:transparent; border:0; color:#e6edf3;
  font-size:18px; cursor:pointer;
}
.modal__header{ display:flex; gap:12px; align-items:center; padding-right:32px; }
.modal__avatar{ width:64px; height:64px; border-radius:14px; object-fit:cover; border:1px solid #223049; }
.modal__title{ font-size:18px; font-weight:800; color:#e6edf3; }
.modal__meta{ color:#9aa4b2; margin-top:2px; font-size:13px; }

.modal__section{ margin-top:14px; }
.modal__sectionTitle{ color:#e6edf3; font-weight:800; font-size:14px; margin-bottom:10px; }

.statsGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
.statCard{
  background:#0b0f14;
  border:1px solid #223049;
  border-radius:14px;
  padding:10px;
}
.statLabel{ color:#9aa4b2; font-size:12px; }
.statValue{ color:#e6edf3; font-size:18px; font-weight:800; margin-top:4px; }

.relicRow{ display:flex; gap:10px; flex-wrap:wrap; }
.relicPill{
  display:flex; gap:8px; align-items:center;
  background:#0b0f14; border:1px solid #223049;
  border-radius:999px; padding:6px 10px;
}
.relicPill img{ width:24px; height:24px; border-radius:8px; }
.relicPill span{ color:#e6edf3; font-size:12px; }

.modal__topbar{
  display:flex;
  justify-content:center;
  margin-bottom:10px;
}

.modal__tierWrap{
  display:flex;
  gap:10px;
  align-items:center;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.badge--tier{ letter-spacing:0.5px; }
.badge--usage{ opacity:0.9; }

.typeIcon{
  width:18px;
  height:18px;
  display:inline-block;
  vertical-align:middle;
  opacity:0.95;
}

.modal__metaRow{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:6px;
}

.typeText{
  opacity:0.9;
  font-size:13px;
}

.badge--rarity{ font-weight:700; }
.badge--rank{ opacity:0.85; }

.badge--common{ border-color:#424242; }
.badge--rare{ border-color:#3b82f6; }
.badge--epic{ border-color:#1eff00; }
.badge--exotic{ border-color:#3c004b; }
.badge--legendary{ border-color:#eeff00; }

.badge--meta{ border-color:#22c55e; }

.badge--tier{ border-color: #22c55e;}

.badge--rank-rs{ 
  border-color:#ff0000;
  color: #ff0000; 
}
.badge--rank-splus{ 
  border-color:#51ff00; 
  color:#51ff00; 
}

.relicPill{
  cursor:pointer;
  user-select:none;
  transition:transform .08s ease, box-shadow .08s ease, border-color .08s ease;
  border:1px solid var(--line);
}

.relicPill:hover{ transform:translateY(-1px); }

.relicPill.is-active{
  border-color:var(--accent);
  box-shadow:0
}

.statHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.statIcon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.9;
}

.statLabel {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.statValue {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.statBreakdown {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.85;
}

.statValueRow{
  display:flex;
  align-items:baseline;
  gap:10px;
}

.statDelta{
  font-weight:800;
  font-size:22px;
  opacity:.9;
}

.statDelta--pos{ color:#0ba744; }
.statDelta--neg{ color:#ff0026; }

/* =========================================================
   PVP — Mobile
========================================================= */
@media (max-width: 460px){

  .pvp{
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .pvp__panel{ padding: 12px; }

  .pvp__panelTitle{ font-size: 16px; }
  .pvp__panelMeta{ font-size: 12px; }

  .rare-header{
    padding: 10px 12px;
  }
  .rare-body{
    padding: 10px;
  }

  .avatar-grid{ gap: 8px; }
  .avatar-btn{
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .team-card{
    padding: 12px;
    border-radius: 14px;
  }

  .team-title{
    font-size: 18px;
    letter-spacing: .6px;
  }

  .team-subtitle{
    font-size: 12px;
    margin-bottom: 10px;
  }

  .team-grid{
    max-width: 100%;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .team-miscrit{
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .relic-btn{
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  @media (max-width: 390px){
    .team-grid{
      grid-template-columns: repeat(2, minmax(0, 1fr));
      max-width: 260px;
    }
  }

  .team-notes{ font-size: 12px; }

  .pvp-carousel{
    padding: 12px;
  }

  .pvp-carousel__title{ font-size: 14px; }
  .pvp-carousel__controls{ gap: 8px; }

  .pvp-marquee{
    gap: 12px;
    animation-duration: 24s;
  }

  .topteam-card{
    width: 320px;
    max-width: calc(100vw - 48px);
  }

  .pvp-carousel__fade{
    width: 46px;
    top: 52px;
    bottom: 12px;
  }
  .pvp-carousel__fade.left{ left: 12px; }
  .pvp-carousel__fade.right{ right: 12px; }

  .modal__card{
    margin: 4vh auto;
    padding: 12px;
    border-radius: 14px;
  }

  .modal__header{
    gap: 10px;
  }

  .modal__avatar{
    width: 54px;
    height: 54px;
    border-radius: 12px;
  }

  .modal__title{ font-size: 16px; }
  .modal__meta{ font-size: 12px; }

  .statsGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .relicPill{
    padding: 6px 8px;
  }
  .relicPill span{
    font-size: 11px;
  }

  .statValue{ font-size: 20px; }
  .statDelta{ font-size: 20px; }
}
