.page-tier-lists-working .app {
  width: min(100%, 1480px);
}

.tier-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tier-preview-banner {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: -34px auto 24px;
  padding: 9px 15px;
  border: 1px solid rgba(226, 162, 112, 0.3);
  border-radius: 999px;
  color: var(--parchment);
  background: rgba(193, 125, 79, 0.08);
  font-size: 0.74rem;
  text-align: center;
}

.tier-preview-banner > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--copper-light);
  box-shadow: 0 0 0 4px rgba(226, 162, 112, 0.1);
}

.tier-preview-banner strong {
  color: var(--copper-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-preview-banner b {
  font-weight: 600;
}

.tier-hero {
  max-width: 980px;
  margin-bottom: 30px;
}

.tier-hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.tier-command,
.tier-board,
.tier-method {
  width: min(100%, 1320px);
  margin-inline: auto;
  border: 1px solid var(--copper-frame);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(10, 27, 21, 0.94), rgba(3, 13, 10, 0.97));
  box-shadow: var(--shadow-soft);
}

.tier-command {
  margin-bottom: 18px;
  padding: 18px;
}

.tier-command-primary,
.tier-command-secondary {
  display: flex;
  align-items: end;
  gap: 18px;
}

.tier-command-primary {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(201, 195, 184, 0.12);
}

.tier-command-secondary {
  padding-top: 16px;
}

.tier-control-block {
  min-width: 0;
}

.tier-format-control,
.tier-role-control {
  flex: 1;
}

.tier-control-label {
  display: block;
  margin-bottom: 7px;
  color: var(--bark);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.tier-segmented {
  display: flex;
  gap: 6px;
}

.tier-format-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tier-format-tabs button {
  width: 100%;
}

.tier-segmented button {
  width: auto;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid rgba(201, 195, 184, 0.16);
  border-radius: 9px;
  color: var(--parchment);
  background: rgba(2, 10, 7, 0.56);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
  transition: 150ms ease;
}

.tier-segmented button:hover {
  border-color: rgba(98, 194, 180, 0.4);
  color: var(--limestone);
}

.tier-segmented button[aria-selected="true"] {
  border-color: rgba(98, 194, 180, 0.65);
  color: #d8fff8;
  background: rgba(23, 107, 98, 0.28);
  box-shadow: inset 0 0 0 1px rgba(98, 194, 180, 0.07);
}

.tier-role-tabs button {
  flex: 1;
}

.tier-board {
  padding: clamp(18px, 3vw, 30px);
}

.tier-kicker {
  margin: 0 0 7px;
  color: var(--copper-light);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tier-method h2 {
  margin: 0;
  color: var(--limestone);
  font-size: clamp(1.55rem, 2.7vw, 2.35rem);
  line-height: 1.08;
}

.tier-lanes {
  display: grid;
  gap: 12px;
}

.tier-lane {
  --tier-accent-rgb: 201, 195, 184;
  --tier-accent-text: #c9c3b8;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(201, 195, 184, 0.13);
  border-radius: 14px;
  background: rgba(2, 10, 7, 0.44);
}

.tier-lane-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 8px;
  border-right: 1px solid rgba(201, 195, 184, 0.11);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tier-accent-text);
  background: linear-gradient(160deg, rgba(var(--tier-accent-rgb), 0.3), rgba(var(--tier-accent-rgb), 0.06));
}

.tier-lane-heading strong {
  font-size: 2rem;
  line-height: 1;
}

.tier-lane[data-tier="S"] {
  --tier-accent-rgb: 213, 70, 70;
  --tier-accent-text: #ffaaa2;
}

.tier-lane[data-tier="A"] {
  --tier-accent-rgb: 212, 111, 50;
  --tier-accent-text: #ffbd78;
}

.tier-lane[data-tier="B"] {
  --tier-accent-rgb: 205, 170, 54;
  --tier-accent-text: #f4dc7b;
}

.tier-lane[data-tier="C"] {
  --tier-accent-rgb: 57, 144, 91;
  --tier-accent-text: #8fd5a5;
}

.tier-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
}

.tier-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  min-width: 0;
  min-height: 84px;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 12px;
  border: 1px solid rgba(201, 195, 184, 0.12);
  border-radius: 11px;
  color: inherit;
  background: radial-gradient(circle at 90% 8%, rgba(98, 194, 180, 0.07), transparent 35%), rgba(5, 19, 14, 0.76);
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}

.tier-card:hover {
  border-color: rgba(var(--tier-accent-rgb), 0.58);
  background: radial-gradient(circle at 90% 8%, rgba(var(--tier-accent-rgb), 0.18), transparent 42%), rgba(8, 29, 22, 0.94);
  box-shadow: 0 8px 22px rgba(var(--tier-accent-rgb), 0.09);
  transform: translateY(-2px);
}

.tier-card:focus-visible {
  outline: 3px solid var(--copper-light);
  outline-offset: 2px;
}

.tier-sprite-shell {
  display: flex;
  width: 78px;
  height: 70px;
  align-items: center;
  justify-content: center;
}

.tier-sprite-shell .owned-build-sprite {
  display: block;
  width: 78px;
  height: 78px;
  max-width: none;
  object-fit: contain;
}

.tier-card-copy {
  min-width: 0;
  text-align: center;
}

.tier-card-name {
  display: block;
  overflow: hidden;
  color: var(--limestone);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-card-meta {
  display: block;
  margin-top: 6px;
  color: var(--copper-light);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.tier-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--bark);
  text-align: center;
}

.tier-empty strong {
  color: var(--parchment);
}

.tier-empty[hidden] {
  display: none;
}

.tier-method {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  margin-top: 18px;
  padding: clamp(20px, 3vw, 30px);
}

.tier-method-copy {
  display: grid;
  gap: 12px;
}

.tier-method-copy p {
  margin: 0;
  color: var(--parchment);
  line-height: 1.65;
}

.tier-reference-note {
  width: min(100%, 1320px);
  margin: 16px auto 0;
  color: var(--bark);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

.tier-detail {
  width: min(94vw, 720px);
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--copper-frame);
  border-radius: 18px;
  color: var(--limestone);
  background: linear-gradient(155deg, #10231b, #050d0a 72%);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.65);
}

.tier-detail::backdrop {
  background: rgba(0, 5, 3, 0.78);
  backdrop-filter: blur(4px);
}

.tier-detail-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(201, 195, 184, 0.18);
  border-radius: 50%;
  color: var(--parchment);
  background: rgba(2, 10, 7, 0.7);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}

.tier-detail-inner {
  padding: clamp(22px, 4vw, 36px);
}

.tier-detail-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-inline: 42px;
}

.tier-detail-identity .tier-sprite-shell {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
}

.tier-detail-identity .owned-build-sprite {
  width: 106px;
  height: 106px;
}

.tier-detail-identity h2 {
  margin: 2px 0 7px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1;
}

.tier-detail-rankline {
  margin: 0;
  color: var(--copper-light);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tier-detail-inventory {
  margin: 0;
  color: var(--verdigris-300);
  font-size: 0.72rem;
  font-weight: 800;
}

.tier-detail-inventory a {
  color: inherit;
  text-underline-offset: 3px;
}

.tier-detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 195, 184, 0.12);
}

.tier-detail-section h3 {
  margin: 0 0 11px;
  color: var(--parchment);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tier-build-summary {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: 22px;
  align-items: start;
}

.tier-build-type {
  align-self: stretch;
  padding-right: 22px;
  border-right: 1px solid rgba(201, 195, 184, 0.18);
}

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

.tier-role-score-grid div {
  padding: 10px;
  border: 1px solid rgba(201, 195, 184, 0.1);
  border-radius: 9px;
  background: rgba(2, 10, 7, 0.45);
  text-align: center;
}

.tier-rank-summary > h3 {
  text-align: center;
}

.tier-role-score-grid span,
.tier-role-score-grid strong {
  display: block;
}

.tier-role-score-grid span {
  color: var(--bark);
  font-size: 0.59rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tier-role-score-grid strong {
  margin-top: 2px;
  color: var(--limestone);
  font-size: 0.85rem;
}

.tier-move-list,
.tier-type-value-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tier-move-list span,
.tier-type-value-list span {
  padding: 7px 9px;
  border: 1px solid rgba(201, 195, 184, 0.12);
  border-radius: 8px;
  color: var(--parchment);
  background: rgba(2, 10, 7, 0.45);
  font-size: 0.73rem;
  font-weight: 750;
}

.tier-move-list span[data-type],
.tier-type-value-list span[data-type] {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--type-text, #07100d);
  background: linear-gradient(135deg, var(--type-dark), var(--type-light));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 850;
}

[data-type="bug"] { --type-dark: #9bc231; --type-light: #aec92c; }
[data-type="dark"] { --type-dark: #52505e; --type-light: #6e7681; --type-text: #ffffff; }
[data-type="dragon"] { --type-dark: #1065b6; --type-light: #067fc4; --type-text: #ffffff; }
[data-type="electric"] { --type-dark: #f3d43e; --type-light: #fedf6b; }
[data-type="fairy"] { --type-dark: #eb8de1; --type-light: #f6a7e8; }
[data-type="fighting"] { --type-dark: #ce3d64; --type-light: #e34448; --type-text: #ffffff; }
[data-type="fire"] { --type-dark: #fe9d59; --type-light: #feb04b; }
[data-type="flying"] { --type-dark: #91a8de; --type-light: #a7c1f2; }
[data-type="ghost"] { --type-dark: #5069ac; --type-light: #7571d0; --type-text: #ffffff; }
[data-type="grass"] { --type-dark: #5fbb50; --type-light: #59c079; }
[data-type="ground"] { --type-dark: #d87b40; --type-light: #d2976b; }
[data-type="ice"] { --type-dark: #74d3bd; --type-light: #94ddd6; }
[data-type="normal"] { --type-dark: #909aa3; --type-light: #a3a49e; }
[data-type="poison"] { --type-dark: #c662d6; --type-light: #a662c7; --type-text: #ffffff; }
[data-type="psychic"] { --type-dark: #f2726f; --type-light: #fda194; }
[data-type="rock"] { --type-dark: #c7b98c; --type-light: #d7cd90; }
[data-type="steel"] { --type-dark: #50879c; --type-light: #5aafb4; }
[data-type="water"] { --type-dark: #4f91db; --type-light: #6ac7e9; }

.tier-editor-notes h3 a {
  color: inherit;
  text-decoration-color: rgba(98, 194, 180, 0.6);
  text-underline-offset: 3px;
}

.tier-editor-notes h3 a:hover,
.tier-editor-notes h3 a:focus-visible {
  color: var(--aqua);
}

.tier-detail-note {
  margin: 0;
  color: var(--parchment);
  line-height: 1.6;
}

.tier-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
}

.tier-detail-actions a,
.tier-detail-actions button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(98, 194, 180, 0.45);
  border-radius: 9px;
  color: #d8fff8;
  background: rgba(23, 107, 98, 0.25);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.tier-detail-actions a {
  min-width: 150px;
  text-align: center;
}

.tier-mobile-menu {
  display: none;
}

@media (max-width: 1120px) {
  .tier-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tier-command-primary,
  .tier-command-secondary {
    flex-wrap: wrap;
  }

  .tier-role-control {
    flex-basis: 100%;
  }
}

@media (max-width: 820px) {
  .page-tier-lists-working .site-nav > nav {
    display: none;
  }

  .tier-mobile-menu {
    position: relative;
    display: block;
  }

  .tier-mobile-menu summary {
    color: var(--parchment);
    font-weight: 850;
    cursor: pointer;
  }

  .tier-mobile-menu > div {
    position: absolute;
    z-index: 5;
    top: 34px;
    right: 0;
    display: grid;
    min-width: 180px;
    gap: 3px;
    padding: 9px;
    border: 1px solid var(--copper-frame);
    border-radius: 10px;
    background: #07130f;
    box-shadow: var(--shadow-soft);
  }

  .tier-mobile-menu a {
    padding: 8px 10px;
    color: var(--parchment);
    text-decoration: none;
  }

  .tier-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier-method {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tier-role-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .tier-preview-banner {
    align-items: flex-start;
    border-radius: 13px;
  }

  .tier-preview-banner b {
    display: none;
  }

  .tier-hero h1 {
    font-size: clamp(2.45rem, 14vw, 4rem);
  }

  .tier-segmented,
  .tier-role-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tier-role-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier-lane {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .tier-lane-heading strong {
    font-size: 1.55rem;
  }

  .tier-card-grid {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .tier-role-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tier-detail-identity {
    gap: 10px;
  }

  .tier-build-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tier-build-type {
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(201, 195, 184, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tier-card,
  .tier-segmented button {
    transition: none;
  }
}
