.container.title {
  margin-top: 200px;
}

main {
  margin-top: 20px;
  width: 100%;
}

.championLayout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1400px;
}

.championSidebar {
  background-color: var(--sub-color);
  border-radius: 6px;
  padding: 8px;
  max-height: 690px;
  overflow: hidden;
  position: sticky;
  top: 150px;
}

.championSidebar input {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 5px;
  background-color: #1f1f25;
  color: white;
  outline: none;
  padding: 0 12px;
  font-size: 14px;
}

.championSidebar input::placeholder {
  color: var(--sub2-color);
}

.championSearchBox {
  position: relative;
}

.championSearchBox input {
  padding-right: 42px;
}

.championSearchClear {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background-color: #282830;
  color: var(--sub2-color);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.championSearchClear:hover {
  background-color: #3e3e48;
  color: white;
}

.championSearchClear[hidden] {
  display: none;
}

.championPositionFilter {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid #3e3e48;
  border-radius: 4px;
  overflow: hidden;
  background-color: #282830;
}

.championPositionFilter button {
  height: 52px;
  border: 0;
  border-right: 1px solid #3e3e48;
  background-color: transparent;
  color: var(--sub2-color);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.championPositionFilter button:last-child {
  border-right: 0;
}

.championPositionFilter button:hover {
  background-color: #3e3e48;
  color: white;
}

.championPositionFilter button.select {
  background-color: var(--sub3-color);
  color: white;
}

.positionSvgMask {
  width: 25px;
  height: 25px;
  background-color: currentColor;
  display: block;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.positionSvgMask--all {
  -webkit-mask-image: url("../images/roles/position_svgs/position_all.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_all.svg?v=riot-precise-20260628");
}

.positionSvgMask--top {
  -webkit-mask-image: url("../images/roles/position_svgs/position_top.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_top.svg?v=riot-precise-20260628");
}

.positionSvgMask--jungle {
  -webkit-mask-image: url("../images/roles/position_svgs/position_jungle.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_jungle.svg?v=riot-precise-20260628");
}

.positionSvgMask--mid {
  -webkit-mask-image: url("../images/roles/position_svgs/position_mid.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_mid.svg?v=riot-precise-20260628");
}

.positionSvgMask--bot {
  -webkit-mask-image: url("../images/roles/position_svgs/position_bot.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_bot.svg?v=riot-precise-20260628");
}

.positionSvgMask--support {
  -webkit-mask-image: url("../images/roles/position_svgs/position_support.svg?v=riot-precise-20260628");
  mask-image: url("../images/roles/position_svgs/position_support.svg?v=riot-precise-20260628");
}

.positionLabel {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.championImageList {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 6px;
  max-height: 570px;
  overflow-y: auto;
  padding-right: 2px;
}

.championImageList::-webkit-scrollbar {
  width: 4px;
}

.championImageList::-webkit-scrollbar-thumb {
  background-color: #555563;
  border-radius: 999px;
}

.championImageItem {
  min-width: 0;
  padding: 0;
  background: transparent;
  color: white;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.championImageItem img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.championImageItem span {
  display: block;
  width: 100%;
  margin-top: 3px;
  color: var(--sub2-color);
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.championImageItem:hover span {
  color: white;
}

.championImageItem.selected img {
  outline: 2px solid var(--sub3-color);
  outline-offset: 2px;
}

.championImageItem.selected span {
  color: white;
}

.championImageList .empty {
  grid-column: 1 / -1;
  color: var(--sub2-color);
  font-size: 13px;
  padding: 20px 4px;
  text-align: center;
}

.championContent {
  min-width: 0;
}

.championRankHeader {
  min-height: 74px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background-color: var(--sub-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.championRankHeader[hidden] {
  display: none;
}

.selectedChampionInfo {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.selectedChampionInfo img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.selectedChampionInfo p {
  color: var(--sub2-color);
  font-size: 13px;
  margin-bottom: 4px;
}

.selectedChampionInfo h2 {
  color: white;
  font-size: 22px;
  line-height: 1.1;
}

#clearChampionRanking {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background-color: #282830;
  color: white;
  cursor: pointer;
  transition: 0.3s ease;
}

#clearChampionRanking:hover {
  background-color: #3e3e48;
}

.menu {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
}

.menu button {
  flex: 1;
  height: 100%;
  font-size: 15px;
  background-color: var(--sub-color);
  color: var(--sub2-color);
  transition: 0.3s ease;
  border-radius: 0px;
  border: none;
  box-shadow: none;
  cursor: pointer;
}

.menu button:hover {
  background-color: #3e3e48;
}

.menu button.select {
  background-color: var(--sub3-color);
  color: white;
}

.tableWrap {
  overflow: auto;
  position: relative;
}

table {
  margin-top: 20px;
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  text-align: center;
  border-collapse: collapse;
}

table.championTable--champion th:nth-child(1),
table.championTable--champion td:nth-child(1) {
  width: 7%;
  min-width: 56px;
}

table.championTable--champion th:nth-child(2),
table.championTable--champion td:nth-child(2) {
  width: 28%;
}

table.championTable--champion th:nth-child(3),
table.championTable--champion td:nth-child(3) {
  width: 26%;
}

table.championTable--champion th:nth-child(4),
table.championTable--champion td:nth-child(4),
table.championTable--champion th:nth-child(5),
table.championTable--champion td:nth-child(5) {
  width: 19.5%;
}

table.championTable--master th:nth-child(1),
table.championTable--master td:nth-child(1) {
  width: 8%;
}

table.championTable--master th:nth-child(2),
table.championTable--master td:nth-child(2) {
  width: 20%;
}

table.championTable--master th:nth-child(3),
table.championTable--master td:nth-child(3) {
  width: 29%;
}

table.championTable--master th:nth-child(4),
table.championTable--master td:nth-child(4) {
  width: 9%;
}

table.championTable--master th:nth-child(5),
table.championTable--master td:nth-child(5) {
  width: 16%;
}

table.championTable--master th:nth-child(6),
table.championTable--master td:nth-child(6) {
  width: 18%;
}

table > thead > tr {
  position: sticky;
  top: 0;
  z-index: 2;
  th {
    background: #282830;
    color: var(--sub2-color);
    font-size: 15px;
    padding: 5px;
  }
  th:first-child {
    color: #5383e8;
    border-bottom: 1px solid #5383e8;
  }
}

.masterSortButton {
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.masterSortButton:hover {
  background-color: #3e3e48;
  color: white;
}

.masterSortButton[aria-pressed="true"] {
  background-color: var(--sub3-color);
  color: white;
}

.masterWinRateSortGroup {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.masterWinRateSortGroup .masterSortButton {
  width: 92px;
  flex: 0 0 92px;
}

.masterMinMatchesSelect {
  width: 68px;
  height: 28px;
  flex: 0 0 68px;
  border: 1px solid #3f3f4c;
  border-radius: 4px;
  background-color: #25252c;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
  color-scheme: dark;
  cursor: pointer;
  outline: none;
}

.masterMinMatchesSelect:hover,
.masterMinMatchesSelect:focus {
  border-color: #8fbdff;
}

table > tbody > tr {
  height: 50px;
  width: 100%;
  transition: 0.3s ease;
  background: #31313c;

  &:hover {
    background-color: #3f3f4c;
  }

  td {
    color: #9ca3af;
    font-size: 12px;
    height: 100%;
    min-width: 110px;
    height: 100%;
  }

  td:first-child {
    background: #282830;
    color: var(--sub2-color);
  }
  td:nth-child(2) {
    color: white;
    text-align: left;
    font-size: 17px;
    position: sticky;
    left: 0%;
    z-index: 1;
    padding-left: 10px;
    background-color: var(--sub-color);

    p {
      display: flex;
      align-items: center;
      gap: 7px;
      min-width: 0;

      .champion {
        width: 28px;
        flex: none;
        height: 28px;
        border-radius: 50%;
      }

      .championNameText {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
  td:nth-child(3) {
    height: 100%;
    position: relative;
    min-width: 130px;
    padding: 5px 10px;
    progress {
      width: 100%;
      height: 20px;
      border-radius: 100px;
      appearance: none;
      border: none;
    }

    
    progress::-webkit-progress-bar {
      background-color: var(--red-color); 
      border-radius: 100px;
    }

    
    progress::-webkit-progress-value {
      background-color: var(--sub3-color); 
      border-radius: 100px;
    }
    .percent {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: white;
      font-size: 12px;
    }
  }

  td:nth-child(5) {
    img {
      width: 30px;
      height: 30px;
    }
  }
}

.masterUserButton {
  max-width: 100%;
  border: 0;
  background: transparent;
  color: white;
  font-size: 17px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masterUserButton:hover {
  color: var(--sub3-color);
}

.win-loss-rate {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.win-loss-bar {
  flex: 1 1 170px;
  width: 170px;
  max-width: 170px;
  min-width: 120px;
  height: 20px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background-color: var(--red-color);
}

.win-loss-bar .wins,
.win-loss-bar .losses {
  flex: 0 0 auto;
  min-width: 24px;
  height: 100%;
  color: white;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.win-loss-bar .wins {
  background-color: var(--sub3-color);
}

.win-loss-bar .losses {
  background-color: var(--red-color);
}

.win-loss-bar.is-all-win {
  background-color: var(--sub3-color);
}

.win-loss-bar.is-all-loss {
  background-color: var(--red-color);
}

.win-loss-bar.is-all-win .wins,
.win-loss-bar.is-all-win .losses,
.win-loss-bar.is-all-loss .wins,
.win-loss-bar.is-all-loss .losses {
  width: 50% !important;
  flex-basis: 50%;
  max-width: 50%;
  min-width: 0;
  background-color: transparent;
}

.win-loss-bar:has(> .wins[style*="100%"]),
.win-loss-bar:has(> .losses[style*="100%"]) {
  background-color: var(--red-color);
}

.win-loss-bar:has(> .wins[style*="100%"]) {
  background-color: var(--sub3-color);
}

.win-loss-bar:has(> .wins[style*="100%"]) .wins,
.win-loss-bar:has(> .wins[style*="100%"]) .losses,
.win-loss-bar:has(> .losses[style*="100%"]) .wins,
.win-loss-bar:has(> .losses[style*="100%"]) .losses {
  width: 50% !important;
  flex-basis: 50%;
  max-width: 50%;
  min-width: 0;
  background-color: transparent;
}

.win-loss-rate .percent {
  flex: none;
  min-width: 42px;
  position: static;
  top: auto;
  left: auto;
  transform: none;
  font-size: 13px;
}

table > tbody > tr td:nth-child(3) .win-loss-rate .percent {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.win-loss-rate .percent.is-high {
  color: var(--red-color);
}

.win-loss-rate .percent.is-mid {
  color: white;
}

.win-loss-rate .percent.is-low {
  color: var(--sub3-color);
}

.masterPosition,
.masterTier {
  white-space: nowrap;
}

.masterPosition img,
.masterTier img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

table > tbody > tr.emptyRow td {
  height: 160px;
  color: var(--sub2-color);
  text-align: center;
  background-color: var(--sub-color);
  font-size: 15px;
}

@media (max-width: 900px) {
  .championLayout {
    grid-template-columns: 1fr;
  }

  .championSidebar {
    position: static;
    max-height: none;
  }

  .championImageList {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-height: 220px;
  }

  .tableWrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  table.championTable--champion {
    min-width: 640px;
  }

  table.championTable--master {
    min-width: 760px;
  }

  table > tbody > tr td {
    min-width: 0;
  }

  .win-loss-rate {
    gap: 6px;
  }

  .win-loss-bar {
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .container.title {
    margin-top: 178px;
  }

  .championRankHeader {
    min-height: 68px;
    padding: 10px;
    gap: 10px;
  }

  .selectedChampionInfo {
    gap: 10px;
  }

  .selectedChampionInfo img {
    width: 48px;
    height: 48px;
  }

  .selectedChampionInfo h2 {
    font-size: 20px;
  }

  #clearChampionRanking {
    height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .menu {
    height: 44px;
  }

  .menu button {
    font-size: 14px;
  }
}
