/* ============================================
   Valorant Tracker — layout + components
   Re-uses common.css primitives (.glass, .eyebrow, .btn, .input).
   Uses --purple-bright as accent; tier colour comes from rank icons.
   ============================================ */

/* Override common.css scroll-snap for this page — tracker is a data dashboard
   and needs natural scrolling through the match list. */
.val-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 120px;
}

/* common.js section-observer only runs on .page (scroll-snap) layouts. The val
   page opts out of scroll-snap, so valorant.js fires .is-active on .val-hero
   once at load to kick the reveal animations (search matches the rest of the
   site). The dashboard is shown manually after search — no reveal on it. */

/* ============================================
   Hero + search
   ============================================ */
.val-hero {
  position: relative;
  min-height: auto;
  overflow: hidden;
  overflow: clip;
  padding: calc(var(--nav-height) + 80px) 40px 60px;
}
.val-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 920px;
}
.val-hero .eyebrow a { transition: color 0.3s var(--ease-out); }
.val-hero .eyebrow a:hover { color: var(--white); }
.val-outdated {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--white-rule);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--white-dim);
}

.val-hero h1 {
  margin-top: 14px;
}
.val-hero h1 .accent {
  color: var(--purple-bright);
}

.val-tagline {
  margin: 22px auto 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--white-dim);
}
.val-tagline-dim {
  display: block;
  margin-top: 8px;
  color: var(--white-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
}

/* Saved players row — appears above the search when at least one favourite
   exists. Each chip is a one-click re-search shortcut. */
.val-favs {
  margin: 36px auto 0;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.val-favs[hidden] { display: none; }
.val-favs-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--white-faint);
}
.val-favs-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.val-fav-chip {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.val-fav-chip:hover {
  background: rgba(180, 165, 255, 0.14);
  border-color: rgba(180, 165, 255, 0.42);
}
.val-fav-chip-region {
  font-size: 9px;
  color: var(--white-faint);
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.val-fav-chip-x {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white-faint);
  font-size: 12px;
  line-height: 1;
  margin-left: 2px;
}
.val-fav-chip-x:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }

/* Search form */
.val-search {
  margin: 28px auto 0;
  max-width: 760px;
  text-align: left;
}

.val-search-row {
  display: grid;
  grid-template-columns: 1.3fr auto 0.8fr 0.9fr auto;
  gap: 10px;
  align-items: end;
}

.val-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.val-input-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-faint);
  padding-left: 2px;
}

.val-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  outline: none;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.val-input::placeholder { color: var(--white-faint); }
.val-input:hover    { border-color: rgba(255, 255, 255, 0.18); }
.val-input:focus    { border-color: var(--purple-bright); background: var(--bg-2); }

.val-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='rgba(255,255,255,0.55)' stroke-width='1.2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
}
.val-select option { background: var(--bg-1); color: var(--white); }

.val-input-hash {
  align-self: end;
  height: 48px;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white-faint);
  padding: 0 2px;
  user-select: none;
}

.val-search-btn {
  align-self: end;
  height: 48px;
  padding: 0 22px;
  white-space: nowrap;
}
.val-search-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* Status line */
.val-status {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
  min-height: 16px;
}
.val-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--white-faint);
  flex: none;
}
.val-status-dot.loading  { background: var(--purple-bright); animation: valPulse 1.1s var(--ease-smooth) infinite; }
.val-status-dot.ok       { background: #60d394; }
.val-status-dot.error    { background: #f26d6d; }
.val-status-dot.idle     { background: var(--white-faint); }

@keyframes valPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* ============================================
   Dashboard
   ============================================ */
.val-dashboard {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}
.val-dashboard.hidden { display: none; }
.val-dashboard-inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* dashboard fade/slide-in */
.val-dashboard:not(.hidden) > .val-dashboard-inner > * {
  animation: valRise 0.7s var(--ease-out) both;
}
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(1) { animation-delay: 0.00s; }
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(2) { animation-delay: 0.06s; }
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(3) { animation-delay: 0.12s; }
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(4) { animation-delay: 0.18s; }
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(5) { animation-delay: 0.24s; }
.val-dashboard:not(.hidden) > .val-dashboard-inner > *:nth-child(6) { animation-delay: 0.30s; }
@keyframes valRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ============================================
   Profile card
   ============================================ */
.val-profile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 0;
}
/* Player-card "PFP" — uses smallart from valorant-api.com (140x140 native).
   Sits on the left of the identity column, like an avatar. */
.val-pfp {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-0);
  flex: none;
  align-self: start;
  box-shadow:
    0 0 0 1px rgba(180, 165, 255, 0.28),
    0 12px 32px -8px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s var(--ease-out);
}
.val-pfp:not([src]) { visibility: hidden; }
.val-pfp:hover { transform: translateY(-1px); }

.val-profile-content {
  position: relative;
  z-index: 1;
  padding: 32px 36px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: start;
}

.val-identity { min-width: 0; }
.val-identity-label { margin-bottom: 14px; }

/* Recent-agent — "Last agent: [pic]" — label then small agent portrait.
   Hover the image for the agent name (set via title attribute in renderProfile).
   Hidden until renderProfile gets at least one match for the player. */
.val-recent-agent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  background: rgba(180, 165, 255, 0.10);
  border-color: rgba(180, 165, 255, 0.32);
}
.val-recent-agent[hidden] { display: none; }
.val-recent-agent-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-0);
  flex: none;
  box-shadow: 0 0 0 1px rgba(180, 165, 255, 0.4);
}
.val-recent-agent-label-inline {
  color: var(--white-faint);
  letter-spacing: 1.5px;
}

/* Updated-chip — a small "last refreshed Xs ago" indicator that appears next
   to level/region. Pulses faintly when live mode is on so users can see the
   data is being kept fresh. */
.val-updated-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.val-updated-chip[hidden] { display: none; }
.val-updated-chip .val-updated-label { color: var(--white-faint); }
.val-updated-chip.live {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fda4a4;
}
.val-updated-chip.live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f87171;
  animation: val-pulse 1.6s ease-in-out infinite;
}
.val-identity-name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  line-height: 1;
}
.val-name {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  word-break: break-word;
}
.val-tag {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--purple-bright);
  margin-left: 4px;
}
.val-identity-meta {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.val-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-dim);
}

/* Share + Go Live buttons — identical chip sizing so they sit flush. */
.val-identity-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.val-chip-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out), transform 0.1s var(--ease-out);
}
.val-chip-btn:hover {
  background: rgba(180, 165, 255, 0.12);
  border-color: rgba(180, 165, 255, 0.38);
}
.val-chip-btn:active { transform: translateY(1px); }
.val-chip-btn-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--purple-bright);
}
.val-chip-btn.copied .val-chip-btn-icon { color: #7ed99d; }
.val-chip-btn.saved {
  background: rgba(245, 185, 106, 0.14);
  border-color: rgba(245, 185, 106, 0.42);
}
.val-chip-btn.saved .val-chip-btn-icon { color: #f5b96a; }
.val-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
  transition: background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.val-live-btn.active {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
}
.val-live-btn.active .val-live-dot {
  background: #f87171;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28);
  animation: val-pulse 1.6s ease-in-out infinite;
}
@keyframes val-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.9); }
}

/* Ranks */
.val-ranks {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
.val-rank-block { min-width: 160px; }
.val-rank-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-faint);
  margin-bottom: 10px;
}
.val-rank-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.val-rank-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}
.val-rank-icon:not([src]) { visibility: hidden; }
.val-rank-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.val-rank-tier {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1.1;
}
.val-rank-rr {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-dim);
}
.val-rank-rr.dim { color: var(--white-faint); }

/* ============================================
   Mode filter pills — sit above session, switch which queue is loaded.
   ============================================ */
.val-mode-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-md);
  width: fit-content;
}
.val-mode-pill {
  appearance: none;
  cursor: pointer;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.val-mode-pill:hover { color: var(--white); background: rgba(255, 255, 255, 0.04); }
.val-mode-pill.active {
  color: var(--white);
  background: rgba(180, 165, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(180, 165, 255, 0.42);
}

/* ============================================
   Session summary (today's games, net RR, streak)
   ============================================ */
.val-session {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.val-session[hidden] { display: none; }
.val-session-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.val-session-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
}
.val-session-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.val-session-stat { min-width: 0; }
.val-session-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--white-faint);
  margin-bottom: 4px;
}
.val-session-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.val-session-value.pos { color: #7ed99d; }
.val-session-value.neg { color: #e38686; }
.val-session-form-pills {
  display: inline-flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.val-session-form-pill {
  display: inline-flex;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.val-session-form-pill.win  { background: rgba(126, 217, 157, 0.18); color: #7ed99d; }
.val-session-form-pill.loss { background: rgba(227, 134, 134, 0.18); color: #e38686; }
.val-session-form-pill.draw { background: rgba(255, 255, 255, 0.08); color: var(--white-dim); }

/* ============================================
   Stat tiles
   ============================================ */
.val-stats-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.val-stats-range {
  color: var(--white-faint);
  font-weight: 400;
  letter-spacing: 1.5px;
}

.val-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.val-stat {
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.val-stat:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: var(--bg-2);
}
.val-stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-faint);
  margin-bottom: 10px;
}
.val-stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1;
}
.val-stat-value .val-stat-unit {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--white-faint);
  margin-left: 4px;
}

/* ============================================
   Top agents / maps
   ============================================ */
.val-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.val-breakdown-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.val-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--white-line);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.val-breakdown-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-1);
  transition: background 0.25s var(--ease-out);
}
.val-breakdown-row:hover { background: var(--bg-2); }
.val-breakdown-row img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-0);
}
.val-breakdown-name {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.2px;
}
.val-breakdown-wr {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--white-dim);
  min-width: 56px;
  text-align: right;
}
.val-breakdown-wr.pos { color: #7ed99d; }
.val-breakdown-wr.neg { color: #e38686; }
.val-breakdown-games {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
  min-width: 60px;
  text-align: right;
}
.val-breakdown-empty {
  padding: 14px 16px;
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--white-faint);
}

/* Enhanced agent breakdown — richer row with KDA, ACS, WR bar */
.val-breakdown-row.rich {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 14px;
}
.val-agent-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  min-width: 86px;
}
.val-agent-kda {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--white);
}
.val-agent-kda .sep { color: var(--white-faint); padding: 0 2px; }
.val-agent-acs {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
}
.val-wr-bar {
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}
.val-wr-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--purple-bright), #60d394);
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}
.val-wr-bar-fill.neg {
  background: linear-gradient(90deg, #8b5cf6, #e06464);
}

/* ============================================
   Weapons block — top weapons by kills / headshot %
   ============================================ */
.val-weapons-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.val-weapons-range {
  color: var(--white-faint);
  font-weight: 400;
  letter-spacing: 1.5px;
}
.val-weapons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.val-weapons-empty {
  grid-column: 1 / -1;
  padding: 18px;
  background: var(--bg-1);
  border: 1px dashed var(--white-line);
  border-radius: var(--radius-sm);
  color: var(--white-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
}
.val-weapon {
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.val-weapon-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.val-weapon-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.val-weapon-kills {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}
.val-weapon-hs {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--white-faint);
}
.val-weapon-hs.hot { color: #f5b96a; }
.val-weapon-hs.elite { color: #7ed99d; }
.val-weapon-img {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  width: auto;
  opacity: 0.18;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(180, 165, 255, 0.3));
}

/* ============================================
   Match history
   ============================================ */
.val-matches-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.val-matches-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--white-faint);
  text-transform: uppercase;
}
.val-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.42);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #fda4a4;
}
.val-live-indicator[hidden] { display: none; }
.val-live-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f87171;
  animation: val-pulse 1.6s ease-in-out infinite;
}

/* Toast — small floating confirmation popup (share copied, new match, etc). */
.val-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 12px);
  z-index: 40;
  padding: 10px 18px;
  background: rgba(20, 14, 36, 0.95);
  border: 1px solid rgba(180, 165, 255, 0.38);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--white);
  box-shadow: 0 18px 42px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.val-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.val-toast[hidden] { display: none; }
.val-match-wrap.fresh .val-match {
  animation: val-match-fresh 2s var(--ease-out) 1;
}
@keyframes val-match-fresh {
  0%   { background: rgba(180, 165, 255, 0.22); }
  100% { background: transparent; }
}

.val-matches {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--white-line);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.val-matches-empty {
  padding: 18px;
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--white-faint);
  text-align: center;
}

.val-match-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
}

.val-match {
  display: grid;
  grid-template-columns: 4px 1.5fr 1fr 1fr 1fr 0.8fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px 14px 22px;
  background: var(--bg-1);
  transition: background 0.25s var(--ease-out);
  position: relative;
  cursor: pointer;
  user-select: none;
}
.val-match:hover { background: var(--bg-2); }
.val-match-wrap.open .val-match { background: var(--bg-2); }

.val-match-toggle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white-faint);
  transition: transform 0.25s var(--ease-out), color 0.2s var(--ease-out);
}
.val-match-wrap.open .val-match-toggle { transform: rotate(180deg); color: var(--purple-bright); }
.val-match-toggle svg { display: block; }

.val-match::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--white-line);
}
.val-match[data-result="win"]::before  { background: #60d394; }
.val-match[data-result="loss"]::before { background: #e06464; }
.val-match[data-result="draw"]::before { background: var(--white-faint); }

.val-match-result {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
.val-match[data-result="win"]  .val-match-result { color: #7ed99d; }
.val-match[data-result="loss"] .val-match-result { color: #e38686; }
.val-match[data-result="draw"] .val-match-result { color: var(--white-dim); }

.val-match-score {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--white-dim);
}

.val-match-map {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.val-match-map-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--white);
}
.val-match-mode {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
}

.val-match-agent {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.val-match-agent img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-0);
  flex: none;
}
.val-match-agent-name {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--white-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.val-match-kda {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--white);
}
.val-match-kda .sep { color: var(--white-faint); padding: 0 3px; }

.val-match-acs {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--white-dim);
}

.val-match-time {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
  white-space: nowrap;
}

/* Expanded scoreboard under a match row */
.val-match-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease-out);
  background: var(--bg-0);
}
.val-match-wrap.open .val-match-details { grid-template-rows: 1fr; }
.val-match-details-inner {
  overflow: hidden;
  min-height: 0;
}
.val-match-details-body {
  padding: 16px 22px 22px;
  border-top: 1px solid var(--white-line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.val-team {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Round-by-round timeline shown above the team scoreboards on expand. Each
   cell is one round, coloured by whether the player's side won it. */
.val-round-timeline {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-sm);
}
.val-round-timeline-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--white-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.val-round-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--white-dim);
  letter-spacing: 1.4px;
}
.val-round-key .val-round-cell { width: 10px; height: 10px; margin: 0 4px 0 8px; border-radius: 2px; }
.val-round-timeline-bar {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.val-round-cell {
  flex: 1 1 12px;
  min-width: 12px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.15s var(--ease-out);
}
.val-round-cell:hover { transform: translateY(-1px); }
.val-round-cell.win  { background: linear-gradient(180deg, rgba(126, 217, 157, 0.95), rgba(126, 217, 157, 0.55)); }
.val-round-cell.loss { background: linear-gradient(180deg, rgba(227, 134, 134, 0.95), rgba(227, 134, 134, 0.55)); }
.val-round-cell.draw { background: rgba(180, 165, 255, 0.45); }
.val-team-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}
.val-team-name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white-dim);
}
.val-team-name.win  { color: #7ed99d; }
.val-team-name.loss { color: #e38686; }
.val-team-score {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.val-scoreboard {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--white-line);
}
.val-scoreboard-head {
  display: contents;
}
.val-scoreboard-head > span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-faint);
  padding: 4px 0;
  border-bottom: 1px solid var(--white-line);
}
.val-scoreboard-head > span:nth-child(1) { text-align: center; }
.val-scoreboard-head > span:nth-child(3),
.val-scoreboard-head > span:nth-child(4),
.val-scoreboard-head > span:nth-child(5) { text-align: right; }

.val-sb-row {
  display: contents;
}
.val-sb-row > * {
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white-dim);
  min-width: 0;
}
.val-sb-row.self > * {
  color: var(--white);
  font-weight: 600;
}
.val-sb-agent {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-0);
  justify-self: center;
}
.val-sb-name {
  font-family: var(--font);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.val-sb-name .sb-tag {
  color: var(--white-faint);
  margin-left: 2px;
  font-size: 11px;
}
.val-sb-row.self .sb-tag { color: var(--purple-bright); }
.val-sb-name .sb-anon {
  font-style: italic;
  color: var(--white-faint);
  font-size: 12px;
}
.val-sb-acs, .val-sb-kda, .val-sb-hs { text-align: right; }

/* Notice shown above team scoreboards when Riot/Henrik anonymised the
   match — explains why every name reads as "<Agent> player". */
.val-sb-notice {
  grid-column: 1 / -1;
  padding: 10px 14px;
  background: rgba(245, 185, 106, 0.08);
  border: 1px solid rgba(245, 185, 106, 0.32);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #f5b96a;
  line-height: 1.5;
}

/* RR history chart */
.val-rr-head {
  display: flex;
  align-items: baseline;
}
.val-rr-range {
  color: var(--white-faint);
  font-weight: 400;
  letter-spacing: 1.5px;
}
.val-rr-chart {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--white-line);
  border-radius: var(--radius-md);
  padding: 20px 22px 22px;
  min-height: 180px;
  overflow: hidden;
}
.val-rr-chart svg { width: 100%; height: 160px; display: block; }
.val-rr-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--white-faint);
  text-align: center;
  padding: 24px 0 8px;
}
.val-rr-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--white-dim);
}
.val-rr-summary strong {
  font-weight: 600;
  color: var(--white);
  margin-right: 4px;
}
.val-rr-summary .pos { color: #7ed99d; }
.val-rr-summary .neg { color: #e38686; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .val-stats { grid-template-columns: repeat(3, 1fr); }
  .val-breakdown { grid-template-columns: 1fr; gap: 24px; }
  .val-weapons { grid-template-columns: repeat(3, 1fr); }
  .val-session-row { grid-template-columns: repeat(5, 1fr); gap: 14px; }
}

@media (max-width: 780px) {
  .val-hero { padding: calc(var(--nav-height) + 40px) 22px 40px; }
  .val-dashboard { padding: 0 22px; }

  .val-search-row {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      "name hash tag"
      "region region region"
      "btn btn btn";
    row-gap: 12px;
  }
  .val-input-name   { grid-area: name; }
  .val-input-hash   { grid-area: hash; }
  .val-input-tag    { grid-area: tag; }
  .val-input-region { grid-area: region; }
  .val-search-btn   { grid-area: btn; width: 100%; justify-content: center; }

  .val-profile-content {
    /* Mobile: PFP next to identity in a row, ranks wrap below. */
    grid-template-columns: auto 1fr;
    gap: 18px 16px;
    padding: 24px;
  }
  .val-pfp { width: 72px; height: 72px; }
  .val-ranks {
    grid-column: 1 / -1;
    gap: 18px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .val-rank-block { min-width: 0; flex: 1 1 140px; }

  .val-match {
    grid-template-columns: 4px 1fr 1fr auto auto;
    grid-template-rows: auto auto;
    row-gap: 6px;
    padding: 12px 12px 12px 18px;
  }
  .val-match-result { grid-column: 2; grid-row: 1; }
  .val-match-score  { grid-column: 3; grid-row: 1; }
  .val-match-time   { grid-column: 4; grid-row: 1; text-align: right; }
  .val-match-toggle { grid-column: 5; grid-row: 1 / span 2; align-self: center; }
  .val-match-map    { grid-column: 2; grid-row: 2; }
  .val-match-agent  { grid-column: 3; grid-row: 2; }
  .val-match-kda    { grid-column: 4; grid-row: 2; text-align: right; }
  .val-match-acs    { display: none; }

  .val-match-details-body { grid-template-columns: 1fr; gap: 18px; }
  .val-scoreboard { grid-template-columns: auto 1fr auto auto; }
  .val-sb-hs, .val-scoreboard-head > span:nth-child(5) { display: none; }
  .val-recent-agent-label { display: none; }

  .val-weapons { grid-template-columns: repeat(2, 1fr); }
  .val-session-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  .val-session-form { grid-column: 1 / -1; }
  .val-session-value { font-size: 18px; }
}

@media (max-width: 520px) {
  .val-stats { grid-template-columns: repeat(2, 1fr); }
  .val-weapons { grid-template-columns: repeat(2, 1fr); }
  .val-session-row { grid-template-columns: repeat(2, 1fr); }
  .val-session-form { grid-column: 1 / -1; }
  .val-name  { font-size: 32px; }
  .val-tag   { font-size: 18px; }
  .val-stat-value { font-size: 22px; }
}
