:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Readability bump */
  font-size: 15px;

  /* Calm dark palette */
  --bg: #0b1220;
  --topbar: rgba(11, 18, 32, 0.92);

  --panel: rgba(255, 255, 255, 0.02);
  --panel-hover: rgba(255, 255, 255, 0.03);

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);
  --divider: rgba(255, 255, 255, 0.045);

  --text: rgba(255, 255, 255, 0.90);
  --muted: rgba(255, 255, 255, 0.74);
  --faint: rgba(255, 255, 255, 0.58);

  --radius: 14px;
  --pad: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

/* ===== Top bar ===== */
.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--topbar);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.topNav {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  flex: 1 1 280px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  color: var(--text);
  outline: none;
}

.search::placeholder { color: var(--faint); }
.search:focus { border-color: var(--border-strong); }

.topLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.topLink:hover {
  background: rgba(255,255,255,0.06);
}

.topLinkActive {
  background: rgba(90, 170, 255, 0.16);
  border-color: rgba(111, 188, 255, 0.55);
}

/* ===== Layout ===== */
.layout {
  display: grid;
  grid-template-columns: clamp(300px, 24vw, 350px) 1fr;
  height: calc(100vh - 58px);
}

.list {
  border-right: 1px solid var(--border);
  overflow: auto;
  background: rgba(255,255,255,0.01);
}

.detail {
  overflow: auto;
  padding: 16px;
}

/* ===== List rows ===== */
.meta {
  padding: 10px 16px;
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.row:hover { background: rgba(255,255,255,0.02); }
.row.active { background: rgba(90, 170, 255, 0.08); }
.row > :first-child { min-width: 0; }
.row > :last-child {
  min-width: 86px;
  white-space: nowrap;
}

/* ===== Text helpers ===== */
.small {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.35;
}

/* ===== Cards ===== */
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  padding: var(--pad);
}

.card + .card { margin-top: 12px; }

/* ===== Hero header (NEW STRUCTURE) ===== */
.heroHeader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.heroHeaderLeft {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.heroPortrait {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  background: #0e1626;
}

.heroMainSkillIcon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.heroHeaderText {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.heroName {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}

.heroMeta {
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.heroHeaderRight {
  text-align: right;
}

.heroDps {
  font-size: 20px;
  font-weight: 800;
}

/* Shared bullet separator (header + elsewhere) */
.sep {
  display: inline-block;
  margin: 0 6px;
  transform: translateY(-0.5px);
  color: rgba(255,255,255,0.35);
}

/* ===== Sections ===== */
.section {
  margin-top: 12px;
}

.sectionTitle {
  margin: 18px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--divider);
  padding-bottom: 4px;
}

.sectionBody {
  padding-left: 12px; /* tweak: 10–16px depending on taste */
}

/* ===== Active Skills: ALWAYS vertical ===== */
.grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.miniCard {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  border-radius: 12px;
  padding: 10px 12px;
}

.miniTitle {
  font-weight: 800;
  margin-bottom: 4px;
}

/* ===== Inline dot-separated lists ===== */
.inlineDots {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  line-height: 1.35;
}

.inlineDots li {
  display: inline;
  white-space: normal;
}

.tlidbLinkImg {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
}

.tlidbLinkImg--pactspirits {
  height: 64px;
}

.tlidbLinkImg--unique_items {
  width: 64px;
  height: 64px;
}

.inlineDots.inlineDotsImages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.inlineDots.inlineDotsImages li {
  display: inline-flex;
}

.inlineDots.inlineDotsImages li:not(:last-child)::after {
  content: none;
}

.inlineDots li:not(:last-child)::after {
  content: "•";
  display: inline-block;
  margin: 0 6px;
  transform: translateY(-0.5px);
  color: rgba(255,255,255,0.35);
}

.tlidbLink {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.tlidbLink:visited {
  color: inherit;
}

.tlidbLink:hover,
.tlidbLink:focus-visible {
  color: #9ecfff;
  border-bottom-color: rgba(158, 207, 255, 0.55);
}

.tlidbImageLink {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  border: 0;
  text-decoration: none;
}

.tlidbImageLink:hover,
.tlidbImageLink:focus-visible {
  border: 0;
  text-decoration: none;
}

/* ===== Scrollbars ===== */
.list, .detail {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

/* ===== Sidebar config ===== */
.listConfig {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 26, 0.9);
  backdrop-filter: blur(8px);
}

.cfgCollapseBtn {
  width: auto;
  min-width: 86px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 0.84rem;
}

.cfgArrow {
  transition: transform 120ms ease;
}

.listConfig.collapsed .cfgArrow {
  transform: rotate(-90deg);
}

.cfgBody {
  margin-top: 10px;
}

.cfgBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 18, 0.65);
  z-index: 1300;
}

.cfgLabel {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--faint);
}

.cfgSelect {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.cfgSelect option {
  color: #0b1220;
  background: #ffffff;
}

.cfgToggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cfgToggleBottom {
  margin-top: 4px;
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .topbar {
    gap: 10px;
  }

  .topNav {
    order: 3;
    width: 100%;
  }

  .search {
    order: 2;
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .list {
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .detail {
    min-height: 60vh;
    padding: 12px;
  }

  .listConfig {
    z-index: 30;
    overflow: visible;
  }

  .listConfig.mobile-open .cfgBody {
    position: fixed;
    left: 10px;
    right: 10px;
    top: var(--cfg-overlay-top, 120px);
    margin-top: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(13, 17, 26, 0.98);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    z-index: 1200;
    max-height: calc(100vh - var(--cfg-overlay-top, 120px) - 10px);
    overflow: auto;
  }

  .listConfig:not(.mobile-open) .cfgBody {
    position: static;
  }

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

  .heroHeaderLeft {
    width: 100%;
  }

  .heroHeaderRight {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .topLink {
    padding: 9px 10px;
    min-height: 36px;
  }

  .list {
    max-height: 32vh;
  }

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

  .heroDps {
    font-size: 18px;
  }
}
