:root {
  color-scheme: light;
  --page: #eef5f1;
  --ink: #17202a;
  --muted: #667487;
  --paper: rgba(255, 255, 255, .86);
  --solid: #ffffff;
  --line: rgba(35, 51, 67, .12);
  --mint: #2fbfa3;
  --teal: #167d8f;
  --gold: #c7923e;
  --rose: #d95d78;
  --violet: #7b6ed6;
  --green: #2fae73;
  --red: #d9534f;
  --shadow: 0 20px 60px rgba(44, 64, 86, .16);
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(238, 245, 241, .96), rgba(246, 242, 235, .9)),
    url("https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Vayne_0.jpg") center top/cover fixed;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; }

.app {
  width: min(1360px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .76);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(44, 64, 86, .1);
}

.brand, .top-actions, .topnav, .brand > div:last-child {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--teal), var(--mint));
  box-shadow: 0 10px 26px rgba(22, 125, 143, .25);
}

.brand > div:last-child {
  align-items: flex-start;
  flex-direction: column;
}
.brand span, .eyebrow, .mini-metric span, .account-chip small, .profile-card p, .stat-box span, .stat-box small, .resource-row span, .small-note, .match-card span {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(23, 32, 42, .05);
}

.nav-pill, .soft-btn, .primary, .icon-btn, .match-tab, .danger-btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.nav-pill {
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}
.nav-pill.active {
  background: #fff;
  color: var(--teal);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(44, 64, 86, .1);
}

.top-actions { gap: 8px; justify-content: end; }
.soft-btn {
  padding: 0 13px;
  background: #fff;
  border-color: var(--line);
  text-decoration: none;
}
.primary {
  padding: 0 15px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, var(--teal), var(--mint));
  box-shadow: 0 12px 26px rgba(22, 125, 143, .22);
}
.danger-btn {
  padding: 0 13px;
  color: #b33232;
  background: #fff;
  border-color: rgba(217, 83, 79, .22);
}
.danger-btn:hover {
  transform: translateY(-1px);
  background: #fff2f2;
}
.icon-btn {
  width: 38px;
  background: #fff;
  border-color: var(--line);
}
.soft-btn:hover, .primary:hover, .nav-pill:hover, .icon-btn:hover { transform: translateY(-1px); }

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 16px;
  align-items: stretch;
  margin: 16px 0 12px;
}

.welcome > div:first-child {
  min-height: 178px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,255,255,.94), rgba(255,255,255,.58)),
    url("https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Seraphine_0.jpg") center 24%/cover;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.eyebrow {
  display: block;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}
.welcome h1 {
  margin-top: 5px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .96;
  max-width: 720px;
}
.welcome p {
  margin-top: 8px;
  color: #435064;
}

.quick-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mini-metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(44, 64, 86, .1);
}
.mini-metric svg { color: var(--rose); }
.mini-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 190px 170px;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-search {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) 140px auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(44, 64, 86, .1);
}

.profile-search strong {
  display: block;
  white-space: nowrap;
}

.profile-search.compact {
  margin: 0;
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0;
  grid-template-columns: minmax(260px, 420px) 120px auto;
}

.profile-brand {
  color: inherit;
  text-decoration: none;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  padding: 0 12px;
  outline: 0;
}
.search input { border: 0; background: transparent; padding: 0; }

.account-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 2px 0 12px;
}
.account-chip {
  min-height: 74px;
  display: grid;
  grid-template-columns: 52px 1fr 12px;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 28px rgba(44, 64, 86, .08);
}
.account-chip.selected {
  border-color: rgba(22, 125, 143, .32);
  background: #fff;
  box-shadow: 0 16px 36px rgba(22, 125, 143, .16);
}
.chip-avatar, .profile-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #dce9e7;
  border: 1px solid var(--line);
}
.chip-avatar.fallback, .profile-icon.fallback {
  display: grid;
  place-items: center;
  font-weight: 950;
  color: var(--teal);
}
.account-chip strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tier-dot {
  width: 10px;
  height: 42px;
  border-radius: 999px;
  background: var(--muted);
}
.tier-dot.emerald { background: #22b783; }
.tier-dot.diamond { background: #5fc7e8; }
.tier-dot.platinum { background: #78cbbd; }
.tier-dot.gold { background: var(--gold); }
.tier-dot.master, .tier-dot.grandmaster, .tier-dot.challenger { background: var(--violet); }

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .85fr);
  gap: 12px;
  align-items: stretch;
}

.profile-panel, .insights-panel, .matches-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-page {
  width: min(1440px, calc(100vw - 28px));
}

.profile-root {
  margin-top: 16px;
}

.summoner-hero {
  min-height: 260px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(12,20,28,.92), rgba(12,20,28,.44)),
    var(--profile-bg) center 24%/cover;
  box-shadow: var(--shadow);
}

.summoner-identity {
  display: flex;
  align-items: end;
  gap: 16px;
}

.profile-icon.big {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  border-color: rgba(255,255,255,.34);
}

.summoner-identity h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: .92;
}

.summoner-identity p {
  margin-top: 5px;
  color: rgba(255,255,255,.76);
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-rank-card,
.profile-stat-card,
.profile-side-panel,
.profile-match-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(44, 64, 86, .08);
}

.profile-rank-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  overflow: hidden;
  min-height: 124px;
}

.profile-rank-card .rank-emblem {
  width: 96px;
  height: 96px;
  justify-self: center;
  transform: scale(2.05);
  transform-origin: center;
  filter: drop-shadow(0 12px 20px rgba(22, 125, 143, .18));
}

.profile-rank-card img.rank-emblem {
  clip-path: inset(20%);
}

.profile-rank-card .rank-empty {
  transform: none;
  width: 58px;
  height: 58px;
  background: #edf4f3;
}

.profile-rank-card span,
.profile-rank-card small,
.profile-stat-card span,
.profile-stat-card small,
.champion-row span,
.profile-mini-stats span {
  color: var(--muted);
  font-size: 12px;
}

.profile-rank-card strong,
.profile-stat-card strong {
  display: block;
  margin: 4px 0;
}

.grade-god { color: #c7923e !important; }
.grade-great { color: #7b6ed6 !important; }
.grade-good { color: #167d8f !important; }
.grade-mid { color: #667487 !important; }
.grade-bad { color: #d9534f !important; }

.profile-stat-card {
  padding: 15px;
}

.profile-stat-card strong {
  font-size: 26px;
}

.profile-content-grid {
  display: grid;
  grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.profile-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.profile-tab.active {
  background: #fff;
  border-color: var(--line);
  color: var(--teal);
  box-shadow: 0 8px 20px rgba(44, 64, 86, .08);
}

.profile-filter-bar {
  display: grid;
  grid-template-columns: 180px 220px 180px;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-side-panel,
.profile-match-panel {
  padding: 12px;
}

.profile-side-panel {
  background: linear-gradient(180deg, #ffffff, #f6fbf8);
  color: var(--ink);
  border-color: var(--line);
}

.profile-side-panel .card-title {
  margin: -12px -12px 8px;
  padding: 12px;
  background: #eef9f6;
  border-bottom: 1px solid var(--line);
}

.profile-side-panel .card-title span,
.profile-side-panel .card-title small {
  color: var(--ink);
}

.side-title {
  justify-content: space-between;
}

.side-title small {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
}

.champion-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
}

.compact-champion {
  grid-template-columns: 34px minmax(0, 1fr) 92px 56px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(35, 51, 67, .08);
}

.compact-champion .champ-icon {
  width: 32px;
  height: 32px;
}

.champion-row + .champion-row {
  margin-top: 6px;
}

.champion-row:hover {
  background: #eef9f6;
}

.champion-row strong,
.champion-row span {
  display: block;
}

.champion-row small,
.champion-kda span,
.champion-wr span {
  color: var(--teal);
  font-weight: 850;
}

.champion-kda,
.champion-wr {
  text-align: right;
}

.champion-kda strong,
.champion-wr strong {
  display: block;
  color: var(--teal);
  font-size: 12px;
}

.champion-kda span,
.champion-wr span {
  color: var(--muted);
  font-size: 11px;
}

.side-more {
  width: calc(100% + 24px);
  margin: 10px -12px -12px;
  min-height: 42px;
  border: 0;
  color: var(--teal);
  font-weight: 850;
  background: #e7f6f2;
}

.profile-subtitle {
  margin-top: 22px;
}

.recent-table {
  display: grid;
  gap: 1px;
}

.recent-head,
.recent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px 58px 70px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(35, 51, 67, .08);
}

.recent-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.recent-row {
  color: var(--ink);
  font-size: 12px;
}

.recent-summoner {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.recent-summoner img,
.recent-summoner span:first-child {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  background: #12162e;
}

.recent-summoner strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  background: #f7faf9;
}

.breakdown-row + .breakdown-row {
  margin-top: 6px;
}

.breakdown-row span,
.breakdown-row small {
  color: var(--muted);
  font-size: 12px;
}

.breakdown-row small {
  color: var(--teal);
  font-weight: 850;
}

.profile-mini-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: end;
}

.profile-mini-stats span {
  padding: 7px 9px;
  border-radius: 999px;
  background: #f3f8f6;
}

.profile-match-list {
  display: grid;
  gap: 8px;
}

.profile-match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.profile-match-card + .profile-match-card {
  margin-top: 8px;
}

.profile-match-card.win { border-left: 4px solid var(--green); }
.profile-match-card.loss { border-left: 4px solid var(--red); }

.profile-match-summary {
  min-height: 78px;
  display: grid;
  grid-template-columns: 92px 160px 112px 72px minmax(120px, 170px) minmax(260px, 1fr) 28px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(90deg, #f9fcfb, #eef8f5);
  list-style: none;
  cursor: pointer;
}

.profile-match-card.loss .profile-match-summary {
  background: linear-gradient(90deg, #fffafa, #f8f1f1);
}

.profile-match-summary::-webkit-details-marker {
  display: none;
}

.match-side strong,
.match-side span,
.match-side b,
.match-core strong,
.match-core span,
.match-core small {
  display: block;
}

.match-side strong {
  font-size: 12px;
}

.match-core strong {
  white-space: nowrap;
}

.match-core strong .score-win,
.match-core strong .score-loss {
  display: inline;
}

.match-side span,
.match-core span,
.match-core small {
  color: var(--muted);
  font-size: 11px;
}

.match-side b {
  margin-top: 6px;
  color: var(--teal);
  font-size: 12px;
}

.profile-match-card.loss .match-side b {
  color: var(--red);
}

.match-champion-block {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.match-champion-block strong,
.match-champion-block span {
  display: block;
}

.match-champion-block strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-champion-block span {
  color: var(--muted);
  font-size: 11px;
}

.champ-icon.large {
  width: 54px;
  height: 54px;
}

.summoner-loadout {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.summoner-loadout .spells,
.summoner-loadout .items {
  display: flex;
  gap: 3px;
}

.summoner-loadout .spells img,
.summoner-loadout .rune {
  width: 22px;
  height: 22px;
}

.score-win { color: var(--teal); }
.score-loss { color: var(--red); }

.match-items-block .items {
  display: grid;
  grid-template-columns: repeat(4, 24px);
  gap: 4px;
}

.match-items-block .items img,
.match-items-block .items span {
  width: 24px;
  height: 24px;
}

.match-team-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.match-team-preview > div {
  display: grid;
  gap: 3px;
}

.match-team-preview a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  min-width: 0;
}

.match-team-preview img,
.match-team-preview a > span:first-child {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  background: #dce9e7;
}

.match-team-preview a span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-match-summary > svg {
  color: var(--teal);
  transition: transform .16s ease;
}

.profile-match-card[open] .profile-match-summary > svg {
  transform: rotate(180deg);
}

.match-expanded {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.expanded-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.expanded-metrics article {
  padding: 9px;
  border-radius: 8px;
  background: #f3f8f6;
}

.expanded-metrics span,
.expanded-player small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.expanded-teams {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.expanded-team {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.expanded-team h3 {
  font-size: 14px;
}

.expanded-team-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.expanded-team-title span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.expanded-player {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}

.expanded-player:hover {
  background: #f3f8f6;
}

.expanded-player.detailed {
  grid-template-columns: 32px minmax(160px, 1fr) 88px minmax(150px, .8fr) minmax(214px, 1fr);
  min-height: 54px;
  gap: 10px;
  border: 1px solid transparent;
}

.expanded-player.live {
  grid-template-columns: 30px minmax(130px, 1fr) 94px auto;
}

.expanded-player img,
.expanded-player > span:first-child {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: #dce9e7;
}

.expanded-player > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.expanded-player-identity {
  min-width: 0;
}

.expanded-player-identity strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.expanded-player-kda {
  text-align: center;
}

.expanded-player-kda strong,
.expanded-player-kda small {
  display: block;
}

.expanded-player-kda strong {
  white-space: nowrap;
  font-size: 13px;
}

.expanded-player-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.expanded-player-stats span {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 7px;
  background: #f3f8f6;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.expanded-player-stats b {
  color: var(--ink);
}

.expanded-player-loadout {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
}

.expanded-player-loadout .spells,
.expanded-player-loadout .items {
  display: flex;
  gap: 3px;
}

.expanded-player-loadout img,
.expanded-player-loadout .items span {
  width: 18px;
  height: 18px;
}

.profile-live-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef9f6;
  margin-bottom: 12px;
}

.profile-live-header span {
  color: var(--muted);
  font-size: 12px;
}

.match-player-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.match-player-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 112px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #f3f8f6;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
}

.match-player-links img,
.match-player-links span:first-child {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: #dce9e7;
}

.match-player-links a span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champion-stats-table {
  display: grid;
  gap: 6px;
}

.champion-stats-head,
.champion-stats-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 100px 150px 80px 80px;
  gap: 10px;
  align-items: center;
}

.champion-stats-head {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.champion-stats-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.champion-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-warning,
.profile-live-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(22, 125, 143, .18);
  border-radius: 8px;
  background: #f2fbf8;
  margin-bottom: 12px;
}

.profile-warning svg,
.profile-live-card svg {
  width: 34px;
  height: 34px;
  color: var(--teal);
}

.profile-warning span,
.profile-live-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.ranked-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.compact-stat {
  box-shadow: none;
}

.profile-search-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-search-empty svg {
  width: 44px;
  height: 44px;
  color: var(--teal);
}

.profile-search-empty h1 {
  font-size: 46px;
}

.profile-search-empty p {
  max-width: 520px;
  color: var(--muted);
}

.profile-panel { min-height: 320px; overflow: hidden; }
.profile-card {
  height: 100%;
  min-height: 320px;
  padding: 18px;
  display: grid;
  grid-template-rows: 1fr auto auto auto auto;
  gap: 14px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(14,22,30,.9), rgba(14,22,30,.42)),
    var(--profile-bg) center/cover;
}
.profile-main {
  display: flex;
  align-items: end;
  gap: 14px;
}
.profile-main .profile-icon {
  width: 76px;
  height: 76px;
  border-color: rgba(255,255,255,.34);
}
.profile-main h2 {
  font-size: clamp(28px, 4vw, 52px);
  line-height: .96;
}
.profile-main p { color: rgba(255,255,255,.76); }

.profile-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-facts div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.profile-facts span {
  display: block;
  color: rgba(255,255,255,.7);
  font-size: 12px;
}

.profile-facts strong {
  display: block;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rank-pill {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 164px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
}
.rank-pill small { color: rgba(255,255,255,.72); }
.rank-pill strong { display: block; font-size: 18px; }
.rank-pill .rank-emblem {
  width: 132px;
  height: 132px;
  justify-self: center;
  transform: scale(2.55);
  transform-origin: center;
}

.rank-pill img.rank-emblem {
  clip-path: inset(20%);
}

.rank-pill .rank-empty {
  transform: none;
  width: 96px;
  height: 96px;
}

.rank-emblem {
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
}
.rank-empty {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255,255,255,.78);
  font-weight: 950;
}
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-actions .soft-btn {
  background: rgba(255,255,255,.92);
  color: var(--ink);
}

.profile-actions .secure-action {
  border-color: rgba(199, 146, 62, .34);
  color: #5f4218;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255, 247, 230, .92));
}

.profile-actions .secure-action svg {
  color: var(--gold);
}

.security-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(47, 174, 115, .26);
  border-radius: 8px;
  color: #246f4f;
  background: rgba(236, 249, 242, .86);
  font-size: 12px;
  font-weight: 850;
}

.security-chip svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.profile-momentum {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.profile-momentum span {
  display: block;
  color: rgba(255,255,255,.68);
  font-size: 12px;
}

.profile-momentum strong {
  display: block;
  margin-top: 3px;
}

.form-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.form-dots i {
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
}

.form-dots i.win { background: #34d186; }
.form-dots i.loss { background: #ef6f6c; }

.insights-panel {
  padding: 12px;
  display: grid;
  gap: 10px;
}
.friendly-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.warning-card {
  background: #fff7f7;
  border-color: rgba(217, 83, 79, .24);
}

.warning-card p {
  color: #71424a;
  font-size: 13px;
  line-height: 1.45;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 850;
}
.card-title svg { color: var(--teal); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stat-box {
  padding: 10px;
  border-radius: 8px;
  background: #f3f8f6;
  min-width: 0;
}
.stat-box strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resource-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.resource-row div {
  padding: 10px;
  border-radius: 8px;
  background: #f8f5ef;
}
.resource-row strong { display: block; margin-top: 3px; }
.activity-row strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.small-note { margin-top: 10px; }

.matches-shell,
.live-shell {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.live-empty {
  min-height: 160px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.live-empty.warning {
  border-color: rgba(217, 83, 79, .24);
  background: #fff7f7;
}

.live-empty > i {
  width: 42px;
  height: 42px;
  color: var(--teal);
}

.live-empty span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.live-empty small {
  display: block;
  margin-top: 8px;
  color: #9b4b4b;
  font-size: 12px;
}

.live-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.72)),
    url("https://ddragon.leagueoflegends.com/cdn/img/champion/splash/Jinx_0.jpg") center 32%/cover;
}

.live-hero h3 {
  font-size: 28px;
}

.live-hero p {
  color: var(--muted);
  margin-top: 4px;
}

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

.live-team {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.live-team.blue { border-top: 4px solid var(--teal); }
.live-team.red { border-top: 4px solid var(--rose); }

.live-team-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.live-team-head h3 {
  font-size: 17px;
}

.ban-row {
  display: flex;
  justify-content: end;
  gap: 4px;
}

.ban-row img,
.ban-row span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f1f4f6;
  object-fit: cover;
  color: var(--muted);
  font-size: 10px;
  display: grid;
  place-items: center;
}

.live-player {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 108px;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.live-player + .live-player {
  margin-top: 6px;
}

.live-player-meta {
  text-align: right;
}

.live-player-meta strong,
.live-player-meta span {
  display: block;
}

.live-player-meta span {
  color: var(--muted);
  font-size: 12px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.section-title h2 { font-size: 24px; }
.match-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: end;
}
.match-tab {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
}
.match-tab.active {
  color: #fff;
  background: var(--teal);
}
.matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.match-timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.match-timeline-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.match-timeline-head strong {
  display: block;
  margin-top: 3px;
}
.match-card {
  display: grid;
  grid-template-columns: 92px 54px minmax(0, 1fr) 120px 170px 92px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.match-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(44, 64, 86, .12);
  border-color: rgba(22, 125, 143, .22);
}
.match-card.win { border-left: 4px solid var(--green); }
.match-card.loss { border-left: 4px solid var(--red); }
.match-order strong,
.match-order span {
  display: block;
}
.match-order strong {
  color: var(--teal);
  font-size: 17px;
}
.champ-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #e6edf0;
}
.match-info { min-width: 0; }
.match-info strong, .match-info span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loadout {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}
.items, .spells { display: flex; gap: 3px; }
.items img, .items span, .spells img, .rune {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  background: #eef3f2;
  border: 1px solid var(--line);
}
.spells img, .rune { width: 20px; height: 20px; }
.match-kda,
.match-extra {
  text-align: right;
  min-width: 0;
}
.match-kda strong {
  display: block;
  color: var(--teal);
  font-size: 18px;
}
.match-extra span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.result-badge {
  min-width: 72px;
  text-align: center;
  padding: 7px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: #f1f4f6;
}
.match-card.win .result-badge { color: var(--green); background: #e9f8f0; }
.match-card.loss .result-badge { color: var(--red); background: #fdecec; }

.empty-state, .empty-inline {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.data-warning {
  min-height: 170px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(217, 83, 79, .24);
  border-radius: 8px;
  background: #fff7f7;
  color: var(--ink);
}

.data-warning > svg {
  width: 38px;
  height: 38px;
  color: var(--rose);
}

.data-warning strong,
.data-warning span {
  display: block;
}

.data-warning span {
  margin-top: 5px;
  color: #71424a;
  font-size: 13px;
}
.empty-state strong { color: var(--ink); }
.empty-state svg { width: 34px; height: 34px; color: var(--teal); }
.empty-inline {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

dialog {
  width: min(480px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.wide-dialog {
  width: min(1120px, calc(100vw - 24px));
}

.match-modal {
  padding: 18px;
}

.match-detail-hero {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: #f7faf9;
}

.match-detail-hero.win {
  background: linear-gradient(135deg, #ecf9f2, #fff);
}

.match-detail-hero.loss {
  background: linear-gradient(135deg, #fff0f0, #fff);
}

.hero-champ {
  width: 72px;
  height: 72px;
}

.match-detail-hero span,
.match-detail-hero p,
.match-analytics span,
.match-analytics small,
.team-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.match-detail-hero h3 {
  font-size: 28px;
  line-height: 1;
}

.hero-loadout {
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-analytics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.match-analytics section {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.match-analytics strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 18px;
}

.match-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.team-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.team-summary.win {
  background: #ecf9f2;
  border-color: rgba(47, 174, 115, .2);
}

.team-summary.loss {
  background: #fff0f0;
  border-color: rgba(217, 83, 79, .2);
}

.team-summary span,
.team-summary small,
.player-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.team-summary strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

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

.team-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.team-card h3 {
  font-size: 16px;
}

.team-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.player-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.player-row + .player-row {
  margin-top: 6px;
}

.selected-player {
  background: #eef9f6;
  border-color: rgba(22, 125, 143, .22);
}

.player-main,
.player-stats {
  min-width: 0;
}

.player-main strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-link {
  display: block;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-link:hover {
  color: var(--teal);
}

.player-stats {
  text-align: right;
  min-width: 118px;
}

.player-stats strong {
  display: block;
  color: var(--teal);
}

.player-stats span {
  white-space: nowrap;
}

dialog::backdrop { background: rgba(23, 32, 42, .36); backdrop-filter: blur(5px); }
form { padding: 18px; display: grid; gap: 12px; }
.dialog-head, .dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(90px);
  background: var(--ink);
  color: #fff;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: 850;
  transition: transform .18s ease;
  z-index: 20;
}
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .welcome, .dashboard, .matches-grid, .match-analytics, .live-grid, .profile-search, .profile-overview-grid, .profile-content-grid, .ranked-detail-grid { grid-template-columns: 1fr; }
  .team-columns, .match-overview { grid-template-columns: 1fr; }
  .topbar { grid-template-columns: 1fr; }
  .topnav, .top-actions { justify-content: start; }
  .match-card { grid-template-columns: 74px 50px minmax(0, 1fr) 100px; }
  .profile-match-summary { grid-template-columns: 80px minmax(0, 1fr) 100px; }
  .summoner-loadout, .match-items-block, .match-team-preview { grid-column: 2 / -1; }
  .expanded-metrics, .expanded-teams { grid-template-columns: 1fr; }
  .expanded-player.detailed { grid-template-columns: 32px minmax(150px, 1fr) 88px; }
  .expanded-player-stats,
  .expanded-player-loadout { grid-column: 2 / -1; }
  .expanded-player-loadout { justify-content: flex-start; }
  .match-extra, .result-badge { grid-column: 3 / -1; }
  .profile-search.compact { grid-template-columns: 1fr; width: 100%; }
  .champion-stats-head { display: none; }
  .champion-stats-row { grid-template-columns: 1fr 1fr; }
  .profile-filter-bar { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app { width: min(100vw - 18px, 1360px); padding-top: 8px; }
  .welcome > div:first-child { min-height: 150px; }
  .quick-metrics, .filters, .rank-row, .stat-grid, .resource-row, .profile-facts, .profile-momentum, .match-detail-hero, .live-empty, .data-warning { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 46px 1fr; }
  .profile-match-summary { grid-template-columns: 1fr; }
  .summoner-loadout, .match-items-block, .match-team-preview { grid-column: auto; }
  .expanded-player.detailed { grid-template-columns: 32px minmax(0, 1fr); }
  .expanded-player-kda,
  .expanded-player-stats,
  .expanded-player-loadout { grid-column: 2; }
  .expanded-player-kda { text-align: left; }
  .expanded-player-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .match-order { grid-column: 1 / -1; }
  .match-kda, .match-extra, .result-badge { grid-column: 2; text-align: left; }
  .player-row { grid-template-columns: 42px 1fr; }
  .player-stats { grid-column: 2; text-align: left; }
  .live-player { grid-template-columns: 42px 1fr; }
  .live-player-meta { grid-column: 2; text-align: left; }
  .summoner-hero, .summoner-identity { align-items: start; flex-direction: column; }
  .profile-topbar { position: static; }
}
