.lol-builds-page .lol-hero {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.build-workspace {
  position: relative;
  border: 1px solid var(--lol-line);
  background: rgb(7 22 31 / 92%);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 25%);
}

.build-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(16rem, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  align-items: end;
  border-bottom: 1px solid var(--lol-line);
  background: linear-gradient(135deg, rgb(20 43 56 / 88%), rgb(8 25 35 / 96%));
}

.build-search-panel h2,
.build-result-header h2,
.build-section h3 {
  margin: 0;
  color: #fff8df;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
}

.build-search-panel h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.build-search-panel .eyebrow,
.build-result-header .eyebrow,
.build-section-heading .eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.build-combobox {
  position: relative;
  min-width: 0;
}

.build-combobox label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--lol-gold-light);
  font-size: 0.82rem;
  font-weight: 750;
}

#build-search {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--lol-line);
  border-radius: 0;
  background: var(--lol-night);
  color: #fff8df;
  font: inherit;
}

#build-search:disabled {
  opacity: 0.65;
}

#build-search:focus-visible {
  outline: 0.2rem solid var(--lol-gold-light);
  outline-offset: 0.16rem;
}

#build-search-list {
  position: absolute;
  z-index: 4;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  max-height: 24rem;
  overflow-y: auto;
  border: 1px solid var(--lol-gold);
  background: var(--lol-night);
  box-shadow: 0 1rem 2rem rgb(0 0 0 / 45%);
}

.build-search-option {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--lol-line);
  background: transparent;
  color: var(--lol-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.build-search-option:last-child {
  border-bottom: 0;
}

.build-search-option[aria-selected="true"],
.build-search-option:hover {
  background: var(--lol-panel-soft);
  color: #fff8df;
}

.build-search-option img {
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.build-state {
  margin: 0;
  padding: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--lol-muted);
}

.build-state--error {
  color: #ffd3c9;
}

.build-suggestions {
  display: flex;
  padding: 0 clamp(1.25rem, 3vw, 2rem) clamp(1.6rem, 4vw, 2.5rem);
  flex-wrap: wrap;
  gap: 0.65rem;
}

.build-suggestions[hidden],
.build-section[hidden] {
  display: none;
}

.build-suggestion {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--lol-gold);
  background: transparent;
  color: var(--lol-gold-light);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
}

.build-suggestion:hover {
  background: rgb(200 155 60 / 12%);
}

.build-suggestion:focus-visible {
  outline: 0.2rem solid var(--lol-gold-light);
  outline-offset: 0.16rem;
}

.build-suggestion img {
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.build-result-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(12rem, auto);
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
  border-bottom: 1px solid var(--lol-line);
}

.build-result-header > img {
  width: 5rem;
  height: 5rem;
  border: 2px solid var(--lol-gold);
  border-radius: 50%;
  object-fit: cover;
}

.build-result-header h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

#build-summary {
  margin: 0.45rem 0 0;
  color: var(--lol-muted);
  font-size: 0.88rem;
}

#build-source {
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--lol-gold);
  color: var(--lol-gold-light);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

#build-source:hover {
  background: rgb(200 155 60 / 12%);
}

.build-low-sample {
  margin: 0;
  padding: 0.9rem clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--lol-line);
  background: rgb(200 155 60 / 10%);
  color: var(--lol-gold-light);
  font-size: 0.85rem;
}

.build-roster-note {
  margin: 0;
  padding: 0.8rem clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--lol-line);
  color: var(--lol-muted);
  font-size: 0.82rem;
}

.build-position-tabs {
  display: flex;
  padding: 0.85rem clamp(1.25rem, 3vw, 2rem);
  overflow-x: auto;
  gap: 0.5rem;
  border-bottom: 1px solid var(--lol-line);
  scrollbar-width: thin;
}

.build-position-tabs [role="tab"] {
  min-width: 5.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  flex: none;
  border: 1px solid var(--lol-line);
  background: transparent;
  color: var(--lol-muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.build-position-tabs [role="tab"][aria-selected="true"] {
  border-color: var(--lol-gold);
  background: rgb(200 155 60 / 12%);
  color: var(--lol-gold-light);
}

.build-position-tabs [role="tab"]:focus-visible {
  outline: 0.2rem solid var(--lol-gold-light);
  outline-offset: 0.12rem;
}

.build-section {
  display: grid;
  grid-template-columns: minmax(8rem, 0.28fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--lol-line);
}

.build-section:last-child {
  border-bottom: 0;
}

.build-section h3 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.first-recall-list,
.boots-list {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
}

.recall-card,
.boots-choice {
  display: flex;
  min-width: 0;
  padding: 0.85rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--lol-line);
  background: var(--lol-panel);
}

.item-combination {
  display: flex;
  min-width: 0;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
}

.build-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
}

.build-item img {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border: 1px solid var(--lol-gold);
  object-fit: cover;
}

.build-item [data-item-name] {
  color: #fff8df;
  font-size: 0.82rem;
}

.item-quantity {
  flex: none;
  color: var(--lol-gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.build-frequency {
  flex: none;
  color: var(--lol-gold-light);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.show-recalls {
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--lol-gold);
  background: transparent;
  color: var(--lol-gold-light);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.show-recalls:hover {
  background: rgb(200 155 60 / 12%);
}

.build-zero {
  margin: 0;
  color: var(--lol-muted);
}

.build-section--core {
  min-height: 8rem;
}

.build-section--early {
  align-items: start;
}

.early-row {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.early-row > section {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--lol-line);
  background: rgb(3 15 23 / 52%);
}

.early-row h4 {
  margin: 0 0 0.7rem;
  color: var(--lol-gold-light);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.early-choice-list {
  display: grid;
  gap: 0.55rem;
}

.early-choice {
  display: grid;
  min-width: 0;
  padding: 0.6rem;
  gap: 0.5rem;
  border: 1px solid var(--lol-line);
  background: var(--lol-panel);
}

.early-choice .item-combination {
  display: grid;
  gap: 0.35rem;
}

.early-choice .build-frequency {
  white-space: normal;
}

#core-tree {
  min-width: 0;
  max-width: 100%;
}

.core-tree-controls {
  display: flex;
  margin-bottom: 0.65rem;
  justify-content: flex-end;
}

.core-tree-scroll {
  max-width: 100%;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--lol-line);
  background: rgb(3 15 23 / 72%);
  scrollbar-color: var(--lol-gold) var(--lol-night);
}

.core-tree-list,
.core-tree-children {
  display: flex;
  width: max-content;
  min-width: 100%;
  padding: 0;
  margin: 0;
  justify-content: center;
  gap: clamp(0.65rem, 2vw, 1.25rem);
  list-style: none;
}

.core-tree-list > li,
.core-tree-children > li {
  position: relative;
  display: grid;
  justify-items: center;
}

.core-tree-children {
  position: relative;
  padding-top: 2.6rem;
}

.core-tree-children::before,
.core-tree-children > li::before {
  position: absolute;
  content: "";
  border-color: var(--lol-gold);
  opacity: 0.65;
}

.core-tree-children::before {
  top: 0;
  left: 50%;
  height: 1.3rem;
  border-left: 2px solid var(--lol-gold);
}

.core-tree-children > li::before {
  top: -1.3rem;
  width: 100%;
  height: 1.3rem;
  border-top: 2px solid var(--lol-gold);
  border-left: 2px solid var(--lol-gold);
}

.core-tree-children > li:first-child::before {
  width: 50%;
  left: 50%;
}

.core-tree-children > li:last-child::before {
  width: 50%;
  right: 50%;
  border-right: 2px solid var(--lol-gold);
  border-left: 0;
}

.core-tree-children > li:only-child::before {
  left: 50%;
  width: 0;
  border-right: 0;
  border-left: 2px solid var(--lol-gold);
}

.core-tree-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: 9.5rem;
  min-height: 4.4rem;
  padding: 0.6rem;
  place-content: center;
  gap: 0.35rem;
  border: 1px solid var(--lol-gold);
  background: var(--lol-panel);
  box-shadow: 0 0.65rem 1.5rem rgb(0 0 0 / 28%);
}

.core-tree-card--start {
  width: 5rem;
  min-height: 3rem;
  border-radius: 999rem;
  color: var(--lol-gold-light);
  text-align: center;
}

.core-tree-card .build-item {
  display: grid;
  justify-items: center;
  text-align: center;
}

.core-tree-card .build-item [data-item-name] {
  overflow-wrap: anywhere;
}

.core-tree-frequency {
  color: var(--lol-muted);
  font-size: 0.7rem;
  text-align: center;
}

#core-graph {
  min-width: 0;
  max-width: 100%;
}

.core-graph-controls {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.core-graph-hint {
  display: none;
  margin: 0;
  color: var(--lol-muted);
  font-size: 0.78rem;
}

.show-rare-builds {
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--lol-gold);
  background: transparent;
  color: var(--lol-gold-light);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.show-rare-builds:hover,
.show-rare-builds[aria-pressed="true"] {
  background: rgb(200 155 60 / 12%);
}

.show-rare-builds:focus-visible,
.core-graph-scroll:focus-visible {
  outline: 0.2rem solid var(--lol-gold-light);
  outline-offset: 0.16rem;
}

.core-graph-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--lol-gold) var(--lol-night);
}

.core-graph-canvas {
  position: relative;
  display: grid;
  /* Size to content so only the graph viewport scrolls sideways when a wide
     branching level cannot fit; the page never scrolls horizontally. */
  width: max-content;
  min-width: 100%;
  min-height: 14rem;
  padding: 1.25rem;
  /* Purchase depth maps to rows so the page provides the primary scrolling. */
  grid-auto-rows: minmax(4.75rem, auto);
  column-gap: clamp(0.75rem, 2vw, 1.5rem);
  row-gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
  justify-items: stretch;
  overflow: hidden;
  border: 1px solid var(--lol-line);
  background: rgb(3 15 23 / 72%);
  box-sizing: border-box;
  isolation: isolate;
}

.core-graph-connectors {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: visible;
  color: var(--lol-gold);
  pointer-events: none;
}

.core-graph-path {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  opacity: 0.72;
  transition: opacity 160ms ease;
  vector-effect: non-scaling-stroke;
}

.core-graph-path[hidden],
.core-graph-edge-label[hidden] {
  display: none;
}

.core-graph-node {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  min-height: 4.75rem;
  padding: 0.65rem;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--lol-gold);
  background: var(--lol-panel);
  box-shadow: 0 0.65rem 1.5rem rgb(0 0 0 / 28%);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.core-graph-node--start {
  justify-content: center;
  border-radius: 50%;
  text-align: center;
}

.core-graph-node img {
  width: 3rem;
  height: 3rem;
  flex: none;
  border: 1px solid var(--lol-gold);
  object-fit: cover;
}

.core-graph-node-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.core-graph-node-copy strong {
  overflow-wrap: anywhere;
  color: #fff8df;
  font-size: 0.82rem;
  line-height: 1.12;
}

.core-graph-node-copy span {
  color: var(--lol-muted);
  font-size: 0.72rem;
}

.core-graph-edge-label {
  position: absolute;
  z-index: 3;
  display: block;
  max-width: 7rem;
  padding: 0.2rem 0.35rem;
  translate: -50% -50%;
  border: 1px solid var(--lol-line);
  background: var(--lol-night);
  color: var(--lol-gold-light);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease;
  white-space: nowrap;
}

.core-graph-other {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  color: var(--lol-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

@media (max-width: 48rem) {
  .build-search-panel,
  .build-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .build-result-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #build-source {
    grid-column: 1 / -1;
  }

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

@media (max-width: 44rem) {
  .core-graph-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .core-graph-hint {
    display: block;
  }

  .show-rare-builds {
    width: 100%;
  }
}

@media (max-width: 32rem) {
  .lol-builds-page .shell {
    width: min(100% - 1.25rem, var(--shell));
  }

  .build-result-header > img {
    width: 3.75rem;
    height: 3.75rem;
  }

  .recall-card,
  .boots-choice {
    align-items: flex-start;
    flex-direction: column;
  }

  .build-frequency {
    white-space: normal;
  }

  .early-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .build-search-option,
  .build-suggestion,
  .show-recalls,
  .show-rare-builds,
  .build-position-tabs [role="tab"],
  .core-tree-card,
  .core-graph-node,
  .core-graph-edge-label,
  .core-graph-path,
  #build-source {
    scroll-behavior: auto;
    transition: none;
  }
}

@media (forced-colors: active) {
  .build-workspace,
  .build-search-panel,
  #build-search-list,
  .build-search-option,
  .build-suggestion,
  .recall-card,
  .boots-choice,
  .core-graph-canvas,
  .core-graph-node,
  .core-graph-edge-label,
  .show-rare-builds,
  .build-position-tabs [role="tab"],
  .early-row > section,
  .early-choice,
  .core-tree-scroll,
  .core-tree-card,
  #build-source,
  .show-recalls {
    border-color: CanvasText;
    background: Canvas;
    color: CanvasText;
    forced-color-adjust: auto;
  }

  .core-graph-path {
    stroke: LinkText;
    opacity: 1;
  }

  .core-graph-node img {
    border-color: CanvasText;
  }

  .build-search-option[aria-selected="true"] {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
}
