.dps-tierlist {
  --dps-accent: #e59928;
  --dps-purple: #64316f;
  --dps-panel: rgba(20, 20, 20, .96);
  --dps-border: #303030;
  --dps-muted: #89848c;
  padding-bottom: 2rem;
}

.dps-tierlist__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.6rem;
}

.dps-tierlist__heading h1 {
  margin: .15rem 0 .35rem;
}

.dps-tierlist__eyebrow {
  margin: 0;
  color: var(--dps-accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.dps-tierlist__intro {
  max-width: 780px;
  margin: 0;
  color: #aaa6ad;
  line-height: 1.7;
}

.dps-tierlist__standalone {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem 1rem;
  border: 1px solid #514256;
  border-radius: 4px;
  color: #ddd8df;
  background: #211c23;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.dps-tierlist__standalone:hover {
  border-color: #745d7b;
  color: #fff;
  background: #2a222d;
  text-decoration: none;
}

.gadget .dps-tierlist__panel,
.gadget .dps-tierlist__explanation {
  margin-bottom: 2rem;
  border: 1px solid var(--dps-border);
  border-radius: 5px;
  color: #f1f1f1;
  background: var(--dps-panel);
}

.gadget .dps-tierlist__panel {
  padding: 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}

.dps-tierlist__toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid #2b2b2b;
}

.dps-tierlist__dataset p {
  margin: 0 0 .25rem;
  color: #77727a;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.dps-tierlist__dataset h2 {
  margin: 0;
  font-family: "Nata Sans", sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.dps-tierlist__actions {
  display: flex;
  align-items: flex-end;
  gap: .8rem;
}

.dps-tierlist__period-picker {
  display: grid;
  gap: .35rem;
  min-width: 245px;
}

.dps-tierlist__period-picker > span {
  color: #77727a;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.gadget .dps-tierlist__period-picker select {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 0 2.5rem 0 .8rem;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  color: #eee;
  background:
    linear-gradient(45deg, transparent 50%, #918d94 50%) calc(100% - 16px) 19px / 6px 6px no-repeat,
    linear-gradient(135deg, #918d94 50%, transparent 50%) calc(100% - 10px) 19px / 6px 6px no-repeat,
    #1a1a1a;
  appearance: none;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 700;
}

.gadget .dps-tierlist__period-picker select:hover,
.gadget .dps-tierlist__period-picker select:focus {
  border-color: #69566f;
  outline: none;
}

.gadget .dps-tierlist__period-picker select:disabled {
  cursor: wait;
  opacity: .58;
}

.dps-tierlist__tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  background: #191919;
}

.gadget .dps-tierlist__tab {
  min-width: 92px;
  min-height: 39px;
  margin: 0;
  padding: .45rem .9rem;
  border: 0;
  border-radius: 3px;
  color: #aaa5ad;
  background: transparent;
  box-shadow: none;
  font-size: .85rem;
  font-weight: 800;
  transition: background .16s ease, color .16s ease;
}

.gadget .dps-tierlist__tab:hover {
  color: #fff;
  background: #252525;
}

.gadget .dps-tierlist__tab.is-active {
  color: #fff;
  background: var(--dps-purple);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 4px 14px rgba(100, 49, 111, .25);
}

.dps-tierlist__notice {
  margin: 1rem 0 0;
  padding: .75rem .9rem;
  border: 1px solid #62552d;
  border-left: 4px solid var(--dps-accent);
  border-radius: 3px;
  color: #ead9a7;
  background: rgba(88, 68, 18, .2);
  font-size: .82rem;
  line-height: 1.5;
}

.dps-tierlist__notice.is-error {
  border-color: #743333;
  border-left-color: #bf3838;
  color: #ffd0d0;
  background: rgba(95, 25, 25, .22);
}

.dps-tierlist__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.25rem;
  margin-top: 1rem;
  padding: .65rem .8rem;
  border: 1px solid #292929;
  color: #aaa5ad;
  background: #181818;
  font-size: .74rem;
}

.dps-tierlist__legend span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.dps-tierlist__legend i {
  display: inline-block;
  width: 26px;
  height: 7px;
  border-radius: 99px;
  background: #b66bc4;
}

.dps-tierlist__legend .is-median { opacity: .95; }
.dps-tierlist__legend .is-top { opacity: .48; }
.dps-tierlist__legend .is-max { opacity: .2; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }

.dps-tierlist__summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem .2rem .55rem;
  color: #817d84;
  font-size: .73rem;
}

.dps-tierlist__head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 224px;
  gap: 9px;
  padding: 0 7px .45rem 0;
  color: #6f6b71;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dps-tierlist__head span:last-child { text-align: right; }

.dps-tierlist__list {
  display: grid;
  gap: 7px;
}

.dps-tierlist__row {
  display: grid;
  grid-template-columns: 38px 48px minmax(0, 1fr) 224px;
  align-items: stretch;
  gap: 9px;
  min-width: 0;
}

.dps-tierlist__rank {
  display: grid;
  place-items: center;
  color: #a29da5;
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.dps-tierlist__icon {
  position: relative;
  align-self: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--spec-color), #111 30%);
  border-radius: 4px;
  background: #111;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}

.dps-tierlist__icon img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.dps-tierlist__icon span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  background: var(--spec-color);
  font-size: .68rem;
  font-weight: 900;
}

.dps-tierlist__bar {
  position: relative;
  min-width: 0;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid #2b2b2b;
  border-radius: 3px;
  background: #191919;
}

.dps-tierlist__layer {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
  background: var(--bar-color);
  transition: width .4s ease;
}

.dps-tierlist__layer.is-max {
  opacity: .2;
  box-shadow: inset -1px 0 rgba(255, 255, 255, .28);
}

.dps-tierlist__layer.is-top { opacity: .48; }

.dps-tierlist__layer.is-median {
  opacity: .93;
  box-shadow: 10px 0 18px color-mix(in srgb, var(--bar-color), transparent 75%);
}

.dps-tierlist__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  padding: .4rem .75rem;
  min-width: 0;
}

.dps-tierlist__copy strong {
  display: block;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95);
  white-space: nowrap;
  font-size: .86rem;
  font-weight: 850;
}

.dps-tierlist__copy span {
  display: block;
  overflow: hidden;
  margin-top: .15rem;
  color: rgba(255, 255, 255, .68);
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
  white-space: nowrap;
  font-size: .62rem;
  font-weight: 600;
}

.dps-tierlist__values {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  margin: 0;
  padding: .35rem .45rem;
  border: 1px solid #292929;
  border-radius: 3px;
  background: #1b1b1b;
}

.dps-tierlist__values > div {
  min-width: 0;
  text-align: right;
}

.dps-tierlist__values dt {
  margin: 0;
  color: #716e73;
  font-size: .53rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.dps-tierlist__values dd {
  overflow: hidden;
  margin: .1rem 0 0;
  padding: 0;
  border: 0;
  color: #c9c5cb;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .7rem;
  font-weight: 800;
}

.dps-tierlist__values .is-primary dt { color: var(--dps-accent); }
.dps-tierlist__values .is-primary dd { color: #fff; font-size: .88rem; }

.dps-tierlist__empty {
  padding: 2.5rem 1rem;
  border: 1px dashed #3a3a3a;
  color: #98949b;
  text-align: center;
}

.dps-tierlist__source {
  margin: 1.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #292929;
  color: #77737a;
  font-size: .69rem;
  line-height: 1.6;
  text-align: center;
}

.dps-tierlist__skeleton {
  height: 52px;
  margin-left: 47px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 42%, #1a1a1a 62%);
  background-size: 300% 100%;
  animation: dps-tierlist-loading 1.35s ease infinite;
}

@keyframes dps-tierlist-loading {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.gadget .dps-tierlist__explanation {
  padding: 1rem;
}

.dps-tierlist__explanation h2 {
  margin: 0 0 .8rem;
  color: var(--dps-accent);
  font-family: "Nata Sans", sans-serif;
  font-size: 1.25rem;
}

.dps-tierlist__explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.dps-tierlist__explanation-grid > div {
  padding: .85rem;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  background: #1b1b1b;
}

.dps-tierlist__explanation-grid strong {
  color: #fff;
}

.dps-tierlist__explanation-grid p {
  margin: .3rem 0 0;
  color: #99959c;
  font-size: .82rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .dps-tierlist__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .dps-tierlist__toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dps-tierlist__actions {
    width: 100%;
  }

  .dps-tierlist__period-picker {
    flex: 1;
  }

  .dps-tierlist__head { display: none; }

  .dps-tierlist__row {
    grid-template-columns: 32px 45px minmax(0, 1fr);
  }

  .dps-tierlist__values {
    grid-column: 3;
    margin-top: -3px;
  }
}

@media (max-width: 700px) {
  .gadget .dps-tierlist__panel { padding: .85rem; }

  .dps-tierlist__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dps-tierlist__period-picker { width: 100%; min-width: 0; }
  .dps-tierlist__tabs { width: 100%; }
  .gadget .dps-tierlist__tab { flex: 1; }

  .dps-tierlist__summary {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }

  .dps-tierlist__row {
    grid-template-columns: 27px 40px minmax(0, 1fr);
    gap: 6px;
  }

  .dps-tierlist__rank { font-size: .95rem; }
  .dps-tierlist__bar, .dps-tierlist__copy { min-height: 48px; }
  .dps-tierlist__copy { padding-left: .55rem; }
  .dps-tierlist__copy span { font-size: .58rem; }
  .dps-tierlist__values { grid-column: 2 / -1; margin: -2px 0 .25rem; }
  .dps-tierlist__explanation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .dps-tierlist__standalone { width: 100%; }
  .dps-tierlist__legend { gap: .55rem .8rem; }
  .dps-tierlist__row { grid-template-columns: 23px 37px minmax(0, 1fr); }
  .dps-tierlist__copy span { display: none; }
  .dps-tierlist__values dd { font-size: .65rem; }
  .dps-tierlist__values .is-primary dd { font-size: .78rem; }
}
