:root {
  color-scheme: dark;
  --bg: #08080a;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f7f8;
  --muted: #a1a1aa;
  --quiet: #6f7078;
  --win: #30d158;
  --loss: #ff453a;
  --gold: #ffd60a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 70% 0%, rgba(255, 255, 255, 0.09), transparent 28rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small,
.api-badge,
.hint,
.eyebrow,
.field label,
.status-card,
.profile-card p,
.stat-card span,
.rank-card span,
.champion-card span,
.match-meta {
  color: var(--muted);
}

.api-badge {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 46px 20px 80px;
}

.hero {
  padding: 42px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(54px, 12vw, 108px);
  line-height: 0.9;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 7vw, 42px);
}

.search-card {
  display: grid;
  gap: 12px;
  max-width: 760px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 800;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.36);
}

.search-button {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #08080a;
  cursor: pointer;
  font-weight: 850;
}

.hint {
  margin-top: 14px;
  font-size: 13px;
}

.status-card,
.profile-card,
.stat-card,
.rank-card,
.champion-card,
.match-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px;
}

.status-card p {
  margin: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--quiet);
}

.status-dot.loading {
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(255, 214, 10, 0.12);
}

.status-dot.error {
  background: var(--loss);
  box-shadow: 0 0 0 6px rgba(255, 69, 58, 0.12);
}

.status-dot.success {
  background: var(--win);
  box-shadow: 0 0 0 6px rgba(48, 209, 88, 0.12);
}

.profile-layout {
  display: grid;
  gap: 14px;
}

.profile-card,
.stat-card {
  padding: 22px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

#profile-icon,
.profile-fallback {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 24px;
}

#profile-icon {
  object-fit: cover;
}

.profile-fallback {
  display: grid;
  place-items: center;
  background: #fff;
  color: #08080a;
  font-weight: 900;
}

.profile-card h2 {
  margin: 0 0 8px;
  font-size: 32px;
}

.profile-card p {
  margin-bottom: 0;
}

.stat-card strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 46px;
  line-height: 1;
}

.section {
  margin-top: 48px;
}

.section-head {
  margin-bottom: 18px;
}

.rank-grid,
.champion-grid {
  display: grid;
  gap: 14px;
}

.rank-card,
.champion-card {
  padding: 20px;
}

.rank-card strong,
.champion-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
}

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

.match-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.match-card.win {
  border-color: rgba(48, 209, 88, 0.3);
}

.match-card.loss {
  border-color: rgba(255, 69, 58, 0.3);
}

.match-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.match-result {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.match-result.win {
  background: rgba(48, 209, 88, 0.13);
  color: #a8f5bb;
}

.match-result.loss {
  background: rgba(255, 69, 58, 0.13);
  color: #ffb4ad;
}

.match-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.skeleton {
  min-height: 130px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  background-size: 220% 100%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (min-width: 760px) {
  .search-card {
    grid-template-columns: minmax(0, 1fr) 150px 130px;
    align-items: end;
  }

  .profile-layout {
    grid-template-columns: 1.5fr 0.75fr 0.75fr;
  }

  .rank-grid,
  .champion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f7f8;
    --panel: rgba(255, 255, 255, 0.86);
    --panel-strong: #fff;
    --line: rgba(0, 0, 0, 0.11);
    --text: #101114;
    --muted: #55565c;
    --quiet: #85868d;
    --shadow: none;
  }

  body {
    background: #f7f7f8;
  }

  .topbar {
    background: rgba(247, 247, 248, 0.82);
  }
}
