/* ---------- Perfil de jugador ---------- */

.profile { position: relative; display: flex; align-items: center; gap: 22px; padding: 22px; margin-bottom: 18px; overflow: hidden; }
.profile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 220px at 0% 0%, rgba(0, 215, 194, 0.13), transparent 70%);
  pointer-events: none;
}
.avatar { position: relative; flex: none; }
.avatar img { width: 86px; height: 86px; border-radius: 18px; border: 2px solid rgba(0, 215, 194, 0.6); box-shadow: 0 0 26px rgba(0, 215, 194, 0.25); }
.avatar .level {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font: 600 12px var(--mono);
}
.profile h1 { margin: 0 0 2px; font-size: 28px; }
.profile h1 span { color: var(--dim-fg); font-weight: 500; }
.profile-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }

.player-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; }

.rank-body { display: flex; align-items: center; gap: 14px; padding: 10px 16px 12px; }
.emblem { display: grid; place-items: center; flex: none; width: 64px; height: 64px; overflow: hidden; }
.emblem-img { width: 64px; height: 64px; object-fit: cover; transform: scale(2.2); }
.crest-lg { width: 46px; height: 46px; opacity: 0.6; }
.tier { font-weight: 800; font-size: 18px; }
.rank-wr { margin-left: auto; text-align: right; font-size: 13px; }
.wr-num { font-size: 16px; font-weight: 600; }
.wr-great { color: var(--legendary); }
.wr-good { color: var(--brand-light); }
.wr-bad { color: var(--loss); }

.winbar { height: 4px; margin: 0 16px 16px; border-radius: 99px; background: rgba(255, 90, 100, 0.35); overflow: hidden; }
.winbar span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

.summary-top { display: flex; align-items: center; gap: 18px; padding: 14px 16px; }
.donut {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--wr) * 1%), rgba(255, 90, 100, 0.55) 0);
}
.donut::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.donut span { position: relative; font: 700 18px var(--mono); }
.wl { font: 600 14px var(--mono); }
.kda-avg { font: 600 17px var(--mono); margin: 2px 0; }
.kda-ratio { font-family: var(--mono); font-size: 13px; font-weight: 600; }

.mini-list { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mini-row .name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .right { text-align: right; font-family: var(--mono); font-size: 12px; }

.roles { display: flex; gap: 6px; padding: 0 16px 16px; flex-wrap: wrap; }
.role { padding: 3px 9px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); color: var(--muted-fg); }
.role b { color: var(--fg); }

.mastery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding: 14px 16px 16px; }
.mastery { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12px; }
.mastery:hover .mname { color: var(--brand-light); }
.mname { font-weight: 700; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlvl {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--brand-line);
  color: var(--brand-light);
  font: 600 11px var(--mono);
}

/* ---------- Partidas ---------- */

.matches-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 0 10px; }
.matches-head h2 { margin: 0; font-size: 18px; }

.match {
  position: relative;
  display: grid;
  grid-template-columns: 100px auto 96px 88px auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 44px 12px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.match::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dim-fg); transition: box-shadow 0.2s; }
.match.win { --glow: 0, 215, 194; background: linear-gradient(90deg, rgba(0, 215, 194, 0.09), var(--card) 45%); }
.match.win::before { background: var(--win); box-shadow: 0 0 14px var(--win); }
.match.loss { --glow: 255, 90, 100; background: linear-gradient(90deg, rgba(251, 44, 54, 0.09), var(--card) 45%); }
.match.loss::before { background: var(--loss); }
.match.remake { --glow: 161, 161, 161; opacity: 0.7; }

/* Al pasar el mouse: brilla con el color del resultado y aparece la flecha */
.match:hover,
.match:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(var(--glow), 0.6);
  box-shadow: 0 0 0 1px rgba(var(--glow), 0.25), 0 8px 30px rgba(var(--glow), 0.16);
}
.match.win:hover, .match.win:focus-visible { background: linear-gradient(90deg, rgba(0, 215, 194, 0.16), var(--card) 60%); }
.match.loss:hover, .match.loss:focus-visible { background: linear-gradient(90deg, rgba(251, 44, 54, 0.15), var(--card) 60%); }
.match:hover::before { box-shadow: 0 0 18px rgba(var(--glow), 0.9); }
.m-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 22px;
  height: 22px;
  color: rgb(var(--glow));
  opacity: 0;
  transform: translate(-8px, -50%);
  filter: drop-shadow(0 0 6px rgba(var(--glow), 0.8));
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.match:hover .m-arrow,
.match:focus-visible .m-arrow { opacity: 1; transform: translate(0, -50%); }
@media (hover: none) {
  .m-arrow { opacity: 0.55; transform: translate(0, -50%); }
}

.m-meta { font-size: 12px; line-height: 1.5; }
.m-queue { font-weight: 700; font-size: 13px; }
.m-result { margin-top: 4px; font-weight: 800; font-size: 14px; }
.match.win .m-result { color: var(--win); }
.match.loss .m-result { color: var(--loss); }

.loadout { display: flex; align-items: center; gap: 4px; }
.champ-wrap { position: relative; flex: none; }
.champ-lg { width: 52px; height: 52px; border-radius: 10px; }
.champ-md { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border-strong); }
.champ-sm { width: 30px; height: 30px; border-radius: 7px; flex: none; }
.clvl {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font: 600 10px var(--mono);
}
.stack { display: flex; flex-direction: column; gap: 3px; }
.spell { width: 24px; height: 24px; border-radius: 6px; }
.rune { width: 24px; height: 24px; border-radius: 50%; background: #000; }
.rune.sub { padding: 4px; background: rgba(255, 255, 255, 0.06); }

.m-kda .kda-line { font: 600 15px var(--mono); }
.m-stats { font-size: 12.5px; line-height: 1.6; }

.m-items { display: grid; grid-template-columns: repeat(4, 24px); gap: 3px; }
.item { width: 24px; height: 24px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); }
.item.trinket { border-radius: 50%; }
/* Recompensa de la misión de rol (por ejemplo, las botas del tirador) */
.item.role-item { box-shadow: 0 0 0 1px rgba(227, 184, 91, 0.7); }

.m-players { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; min-width: 0; font-size: 11.5px; }
.mp { display: flex; align-items: center; gap: 5px; min-width: 0; line-height: 18px; color: var(--muted-fg); }
.mp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp:hover { color: var(--fg); }
.mp.is-target { color: var(--fg); font-weight: 700; }
.mp-icon { width: 16px; height: 16px; border-radius: 4px; flex: none; }

.img-empty { display: block; background: rgba(255, 255, 255, 0.05); }

.more { display: flex; justify-content: center; margin-top: 12px; }

/* ---------- Detalle de partida ---------- */

.detail-top { margin-bottom: 14px; }

.detail-head { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 18px 22px; padding: 22px 24px; margin-bottom: 18px; overflow: hidden; }
.detail-head::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
.detail-head.win { border-color: rgba(0, 215, 194, 0.35); }
.detail-head.win::before { background: radial-gradient(640px 240px at 0% 0%, rgba(0, 215, 194, 0.17), transparent 70%); }
.detail-head.loss { border-color: rgba(255, 90, 100, 0.32); }
.detail-head.loss::before { background: radial-gradient(640px 240px at 0% 0%, rgba(251, 44, 54, 0.15), transparent 70%); }
.detail-head > * { position: relative; }
.detail-head h1 { margin: 2px 0 4px; font-size: 34px; line-height: 1.1; }
.detail-head.win h1 { color: var(--win); text-shadow: 0 0 22px rgba(0, 215, 194, 0.4); }
.detail-head.loss h1 { color: var(--loss); }
.d-queue { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-fg); }
.champ-xl { width: 76px; height: 76px; border-radius: 16px; border: 2px solid var(--border-strong); }
.detail-head.win .champ-xl { border-color: rgba(0, 215, 194, 0.6); box-shadow: 0 0 24px rgba(0, 215, 194, 0.25); }
.detail-head.loss .champ-xl { border-color: rgba(255, 90, 100, 0.55); }
.scoreboard { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 36px; font-weight: 600; }
.scoreboard .blue { color: var(--blue); }
.scoreboard .red { color: var(--red); }
.scoreboard .vs { font: 600 14px var(--font); color: var(--dim-fg); }

.dteam { margin-bottom: 18px; overflow: hidden; }
.dteam.blue { border-top: 3px solid var(--blue); }
.dteam.red { border-top: 3px solid var(--red); }
.dteam-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); }
.dteam-head h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.team-side { color: var(--muted-fg); font-weight: 600; }
.dteam.blue .team-side { color: var(--blue); }
.dteam.red .team-side { color: var(--red); }
.team-totals { display: flex; gap: 12px; font-size: 13px; color: var(--muted-fg); }
.objectives { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted-fg); }
.objectives span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.objectives img { width: 20px; height: 20px; object-fit: contain; }
.objectives b { color: var(--fg); font-family: var(--mono); }

.dcols,
.drow {
  display: grid;
  grid-template-columns: 44px 48px minmax(150px, 1.4fr) 104px minmax(120px, 1fr) 62px 72px 88px 204px;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}
.dcols { padding-top: 10px; padding-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim-fg); }
.drow { border-top: 1px solid var(--border); font-size: 13.5px; transition: background 0.15s; }
.drow:hover { background: rgba(255, 255, 255, 0.025); }
.drow.is-focus { background: linear-gradient(90deg, rgba(0, 215, 194, 0.12), transparent 65%); box-shadow: inset 3px 0 0 var(--brand); }
.champ-d { width: 44px; height: 44px; border-radius: 9px; }
.d-loadout { display: grid; grid-template-columns: repeat(2, 22px); gap: 3px; }
.spell-d { width: 22px; height: 22px; border-radius: 5px; }
.rune-d { width: 22px; height: 22px; border-radius: 50%; background: #000; }
.rune-d.sub { padding: 4px; background: rgba(255, 255, 255, 0.06); }
.d-name { min-width: 0; }
.d-player { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-player span { color: var(--dim-fg); font-weight: 500; }
a.d-player:hover { color: var(--brand-light); }
.drow.is-focus .d-player { color: var(--brand-light); }
.d-sub { font-size: 12px; }
.d-vision .d-sub, .d-cs .d-sub { white-space: nowrap; }
.d-name .badges { margin-top: 4px; }
.dmgbar { height: 6px; margin-top: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.dmgbar span { display: block; height: 100%; border-radius: 99px; background: var(--muted-fg); }
.dteam.blue .dmgbar span { background: var(--blue); }
.dteam.red .dmgbar span { background: var(--red); }
.drow.is-focus .dmgbar span { background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.d-items { display: flex; gap: 3px; }
