:root {
  color-scheme: dark;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #15161a;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #15161a;
  color: #fff;
  font-size: 16px;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

h1,
p {
  margin: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 0 calc((100vw - 952px) / 2);
  border-bottom: 1px solid #1f2025;
  background: linear-gradient(#0f0f12 0 35px, #1a1b1f 35px 80px);
}

h1 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.subtitle {
  margin-top: 6px;
  color: hsla(0, 0%, 100%, 0.6);
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.header-actions button,
.class-tab {
  min-height: 35px;
  border-radius: 5px;
  background: #26272d;
  color: hsla(0, 0%, 100%, 0.8);
  padding: 0 15px;
  font-size: 14px;
  font-weight: 600;
}

.header-actions button:hover,
.class-tab:hover {
  background: #444757;
  color: #fff;
}

#resolve-button {
  background: rgba(105, 115, 178, 0.439);
  color: #fff;
}

#resolve-button:disabled,
#suggest-order-button:disabled {
  opacity: 0.45;
  cursor: default;
}

#suggest-order-button {
  background: transparent;
  color: hsla(0, 0%, 100%, 0.85);
  border: 1px solid rgba(105, 115, 178, 0.5);
}

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 20px auto 40px;
}

aside,
.workspace {
  width: 100%;
  border-radius: 5px;
  background: #1a1b1f;
}

aside {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 952px;
  margin: 0 auto;
  padding: 10px;
}

.panel-title,
.field-label {
  color: hsla(0, 0%, 100%, 0.6);
  font-size: 14px;
  font-weight: 600;
}

.panel-title--spaced {
  margin-top: 4px;
}

.class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: auto;
  text-transform: none;
}

.class-tab[aria-selected="true"] {
  background: #1f2025;
  color: #fff;
  box-shadow: inset 0 -2px 0 #7c2b2b;
}

.class-tab[aria-disabled="true"] {
  opacity: 0.45;
}

.class-tab-icon {
  width: 18px;
  height: 18px;
  color: #d1a781;
  font-size: 11px;
  font-weight: 700;
}

.data-lineage {
  color: hsla(0, 0%, 100%, 0.45);
  font-size: 12px;
  line-height: 1.45;
}

.board-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.board-slot {
  display: grid;
  gap: 5px;
}

.board-slot span {
  color: hsla(0, 0%, 100%, 0.55);
  font-size: 12px;
}

.board-slot select {
  width: 100%;
  height: 35px;
  border: 1px solid #444757;
  border-radius: 3px;
  background: #26272d;
  color: #fff;
  padding: 0 10px;
}

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

.board-card {
  min-height: 54px;
  border-radius: 5px;
  background: #26272d;
  color: hsla(0, 0%, 100%, 0.8);
  padding: 8px 10px;
  cursor: grab;
}

.board-card--locked {
  background: #1f2025;
  box-shadow: inset 0 0 0 1px #7c2b2b;
  cursor: default;
}

.board-card strong,
.board-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-card strong {
  font-size: 14px;
  font-weight: 600;
}

.board-card span {
  margin-top: 5px;
  color: hsla(0, 0%, 100%, 0.55);
  font-size: 12px;
}

.workspace {
  position: relative;
  height: min(980px, calc(100vh - 300px));
  min-height: 760px;
  overflow: hidden;
  border-radius: 0;
}

.solution-status {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  background: #26272d;
  color: hsla(0, 0%, 100%, 0.8);
  font-size: 14px;
  font-weight: 600;
}

.solution-status-points {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #444757;
  border-radius: 3px;
  background: #1f2025;
  color: #d1a781;
  padding: 0 8px;
}

.solution-status-error {
  display: inline-flex;
  max-width: min(960px, calc(100% - 32px));
  min-height: 30px;
  align-items: center;
  border: 1px solid #7c2b2b;
  border-radius: 3px;
  background: #1f2025;
  color: #f0b7a4;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paragon-planner {
  position: relative;
  height: calc(100% - 50px);
  overflow: hidden;
  cursor: grab;
  background: #15161a;
}

.paragon-planner:active {
  cursor: grabbing;
}

.paragon__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 3000px;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 1;
}

.paragon__stage::before {
  content: "";
  position: absolute;
  width: 500vw;
  height: 500vh;
  transform: translate(-100vw, -100vh);
  background: transparent;
  opacity: 0.4;
  z-index: -5;
}

.paragon__board {
  position: absolute;
  border: 3px solid #7c2b2b;
  background-image: url("/assets/d4builds/board_bg.png");
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 1s ease;
}

.paragon__board__label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  max-width: 640px;
  min-height: 42px;
  border-radius: 5px;
  background: #26272d;
  color: hsla(0, 0%, 100%, 0.8);
  padding: 8px;
  font-size: 16px;
  pointer-events: auto;
}

.paragon__board__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 25px;
  margin-right: 10px;
  border: 1px solid #444757;
  border-radius: 3px;
  background: #1f2025;
  color: #fff;
}

.paragon__board__title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.paragon__board__stats {
  display: inline-flex;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #444757;
  color: hsla(0, 0%, 100%, 0.6);
  font-size: 16px;
}

.paragon__board__tiles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.paragon__board__tile {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  border: 1px solid transparent;
  background: url("/assets/d4builds/tile_bg.png") center / contain no-repeat;
  pointer-events: auto;
}

.paragon__tile__wrapper {
  position: relative;
  width: 35px;
  height: 35px;
  min-width: 35px;
  min-height: 35px;
  border: 2px solid transparent;
  border-radius: 50%;
  opacity: 0.3;
}

.paragon__board__tile:hover .paragon__tile__wrapper,
.paragon__board__tile.active .paragon__tile__wrapper,
.paragon__board__tile.paragon__tile--selected .paragon__tile__wrapper {
  opacity: 1;
}

.paragon__board__tile.active {
  border-color: #444757;
}

.paragon__board__tile__icon,
.paragon__board__tile__bg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.paragon__board__tile__icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 1;
  z-index: 5;
  filter: grayscale(0.15) brightness(0.65);
}

.paragon__board__tile__icon.active {
  opacity: 0;
  filter: brightness(1.3) saturate(1.25) drop-shadow(0 0 5px rgba(209, 167, 129, 0.9));
}

.paragon__board__tile.active .paragon__board__tile__icon {
  opacity: 0;
}

.paragon__board__tile.active .paragon__board__tile__icon.active {
  opacity: 1;
}

.paragon__board__tile__bg {
  display: block;
  width: 32px;
  object-fit: contain;
  z-index: 4;
}

.paragon__board__tile__bg.glyph {
  width: 50px;
}

.paragon__tile--glyph .paragon__board__tile__icon,
.paragon__tile--gate .paragon__board__tile__icon,
.paragon__tile--legendary .paragon__board__tile__icon {
  width: 30px;
  height: 30px;
}

.paragon__tile--glyph .paragon__board__tile__bg,
.paragon__tile--gate .paragon__board__tile__bg,
.paragon__tile--legendary .paragon__board__tile__bg {
  width: 40px;
}

.paragon__tile:focus-visible {
  outline: 2px solid #d1a781;
  outline-offset: 2px;
}

.node-tooltip {
  position: absolute;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: 320px;
  max-width: calc(100% - 40px);
  border: 1px solid #444757;
  border-radius: 5px;
  background: #15161a;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.23), 0 3px 6px rgba(0, 0, 0, 0.16);
  color: hsla(0, 0%, 100%, 0.8);
  font-size: 14px;
  padding: 15px;
  opacity: 0;
  pointer-events: none;
}

.node-tooltip[data-visible="true"] {
  opacity: 1;
}

.node-tooltip strong {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.node-tooltip span {
  color: #d1a781;
  font-size: 13px;
}

.node-tooltip p {
  display: grid;
  gap: 4px;
  color: hsla(0, 0%, 100%, 0.8);
  font-size: 15px;
  line-height: 1.7;
}

.node-tooltip b {
  color: hsla(0, 0%, 100%, 0.55);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.node-tooltip code {
  color: hsla(0, 0%, 100%, 0.45);
  font-size: 12px;
}

@media (max-width: 991px) {
  header,
  main {
    width: calc(100% - 32px);
    padding-left: 0;
    padding-right: 0;
  }

  header {
    margin: 0 auto;
  }

  main {
    margin-top: 24px;
  }

  .board-slots {
    grid-template-columns: 1fr;
  }

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

  .workspace {
    height: 720px;
    min-height: 720px;
  }

  .paragon-planner {
    height: 670px;
  }
}

@media (max-width: 520px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(56px, 0.65fr) minmax(0, 1.8fr) minmax(0, 1.25fr);
    width: 100%;
    gap: 8px;
  }

  .header-actions button {
    min-height: 44px;
    padding: 0 8px;
    font-size: 13px;
    line-height: 1.1;
  }

  aside {
    gap: 12px;
  }

  .class-tabs {
    gap: 7px;
  }

  .class-tab {
    min-height: 44px;
    padding: 0 10px;
  }

  .board-slot select {
    height: 44px;
  }

  .board-order {
    grid-template-columns: 1fr;
  }

  .workspace {
    height: 760px;
  }
}
