:root {
  --nav-color: #131318;
  --bg-primary: #23232b;
  --bg-secondary: #19191f;
  --bg-card: #2a2a3a;
  --bg-input: #23232b;
  --text-primary: #f3f3f3;
  --text-secondary: #b0b0b0;
  --user-primary: #8be9fd;
  --game-primary: #ffb86c;
  --accent-primary: #ff6fae;
  --accent-secondary: #5865f2;
  --border-color: #3a3a4a;
  --shadow-color: rgba(0, 0, 0, 0.18);
  --hover-bg: #3a3a4a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--hover-bg);
  color: var(--text-primary);
  font-family: 'Inter', Arial, sans-serif;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 120px;
  padding-bottom: 48px;
}

.champions__hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 14px 0;
}

.history__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
#champions-guild-filter {
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: .85rem;
}

.champions__eyebrow {
  color: var(--game-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.champions__hero h1 {
  margin-top: 6px;
  font-size: 3rem;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}

.champions__intro {
  max-width: 620px;
  margin-top: 8px;
  color: rgba(243, 243, 243, 0.82);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.champions__filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.champions__filter {
  border: 0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
}

.champions__filter.active {
  background: var(--accent-primary);
  color: var(--bg-input);
}

.history__period {
  background: rgba(42, 42, 58, 0.82);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 14px 40px var(--shadow-color);
}

.history__placement {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hover-bg);
  font-weight: 800;
}

.history__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
}

.history__user {
  min-width: 0;
  overflow: hidden;
  color: var(--user-primary);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.history__credits {
  color: var(--game-primary);
  font-weight: 800;
  white-space: nowrap;
}

.history__section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(19, 19, 24, 0.28);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.history__header {
  padding: 0;
  border-radius: 8px;
  background: transparent;
}

.history__header h2 {
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.history__header,
.history__period__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.history__filters {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.champions__lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  gap: 8px;
  align-items: end;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
}

.champions__lookup input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.78rem 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  outline: none;
}

.champions__lookup input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(255, 111, 174, 0.18);
}

.champions__results {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
  align-items: stretch;
}

.player__lookup {
  display: flex;
  height: fit-content;
  flex-direction: column;
  align-self: stretch;
  gap: 12px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(42, 42, 58, 0.82);
  box-shadow: 0 14px 40px var(--shadow-color);
}

.player__lookup h3 {
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.1;
}

.player__lookup .history__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  background: var(--bg-input);
}

.player__lookup__header {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 800;
}

.player__lookup__content {
  width: 100%;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.player__lookup__list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-card);
}

.player__summary__card {
  display: grid;
  gap: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: var(--bg-input);
}

.player__summary__identity {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}

.player__summary__identity img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  object-fit: cover;
}

.player__summary__identity span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player__summary__identity strong {
  overflow: hidden;
  color: var(--user-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__summary__identity small {
  color: var(--text-secondary);
}

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

.placement__summary__item {
  display: grid;
  gap: 4px;
  justify-items: center;
  border-radius: 8px;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.06);
}

.placement__summary__item span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.placement__summary__item strong {
  color: var(--game-primary);
  font-size: 1.15rem;
}

.player__lookup__item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  text-decoration: none;
}

.player__lookup__item:hover {
  border-color: var(--accent-primary);
}

.player__lookup__item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  object-fit: cover;
}

.player__lookup__item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player__lookup__item strong,
.player__lookup__item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__lookup__item strong {
  color: var(--user-primary);
}

.player__lookup__item small {
  color: var(--text-secondary);
}

.player__lookup__item b {
  color: var(--game-primary);
}

.period__browser {
  --period-row-height: 76px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: calc((var(--period-row-height) * 3) + 20px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-card);
}

.period__button {
  display: grid;
  gap: 4px;
  min-height: var(--period-row-height);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: rgba(42, 42, 58, 0.82);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.period__button.active {
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.period__button span {
  color: var(--game-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.period__button small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history__header span,
.history__period__header span,
.history__period__header p,
.history__detail {
  color: var(--text-secondary);
}

.history__period__header {
  margin-bottom: 14px;
  text-transform: capitalize;
}

.history__period__header h3 {
  color: var(--text-primary);
}

.history__winners {
  display: grid;
  gap: 10px;
  list-style: none;
}

.history__winner {
  display: grid;
  grid-template-columns: 36px 44px minmax(120px, 0.8fr) minmax(110px, auto) 70px minmax(220px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-input);
}

.history__winner:hover {
  background: rgba(76, 90, 113, 0.9);
}

.history__detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history__detail--game {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.history__empty {
  padding: 24px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 768px) {
  main {
    width: min(100% - 16px, 680px);
    padding-top: 88px;
  }

  .champions__hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }


  .history__header {
    align-items: center;
    gap: 10px;
  }

  .history__period__header {
    align-items: center;
  }

  .champions__hero h1 {
    font-size: 2rem;
  }

  .champions__intro {
    font-size: 0.9rem;
  }

  .champions__filters {
    justify-content: flex-end;
  }

  .history__filters {
    gap: 6px;
  }

  .champions__filter {
    padding: 0.58rem 0.72rem;
    font-size: 0.82rem;
  }

  .history__period {
    padding: 12px;
  }

  .champions__results {
    grid-template-columns: minmax(0, 1.3fr) minmax(150px, 0.75fr);
    gap: 10px;
  }

  .champions__lookup {
    grid-template-columns: minmax(180px, 1fr);
    gap: 8px;
  }

  .champions__lookup input {
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
  }

  .period__browser {
    --period-row-height: 62px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: calc((var(--period-row-height) * 3) + 20px);
  }

  .period__button {
    padding: 8px;
    font-size: 0.78rem;
  }

  .history__winner {
    grid-template-columns: 28px 32px minmax(0, 1fr) minmax(74px, auto);
    gap: 8px;
    min-height: 52px;
    padding: 8px;
    font-size: 0.78rem;
  }

  .history__detail {
    display: none;
  }

  .history__placement {
    width: 24px;
    height: 24px;
  }

  .history__avatar {
    width: 32px;
    height: 32px;
  }

  .player__lookup__item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 52px;
    padding: 8px;
    font-size: 0.78rem;
  }

  .player__lookup__item img {
    width: 30px;
    height: 30px;
  }
}
