:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #11151a;
  --surface-raised: #151a21;
  --surface-soft: #0f1318;
  --line: #252c35;
  --line-strong: #343d49;
  --text: #f1f4f8;
  --muted: #a2abb7;
  --faint: #737e8c;
  --accent: #e35a4f;
  --accent-soft: rgba(227, 90, 79, 0.14);
  --blue: #6da7e8;
  --green: #66bf86;
  --amber: #e4b35d;
  --violet: #aa8de8;
  --cyan: #63bdc8;
  --radius: 7px;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 270px minmax(260px, 1fr) minmax(280px, 420px) auto;
  gap: 18px;
  align-items: center;
  min-height: 82px;
  padding: 14px 22px;
  background: #0b0d10;
  border-bottom: 1px solid var(--line);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0f1318;
}

.language-switch button {
  min-width: 38px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.language-switch button:hover,
.language-switch button:focus-visible {
  color: var(--text);
  outline: none;
}

.language-switch button.active {
  background: var(--accent-soft);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #171c23;
}

.brand-mark::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-left-color: transparent;
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.1;
}

.header-summary p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.search-shell {
  position: relative;
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 0.76rem;
  font-weight: 700;
}

.search-input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: #0f1318;
  color: var(--text);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, 92vw);
  max-height: 520px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #10141a;
  box-shadow: var(--shadow);
}

.search-result {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.search-result strong {
  display: block;
  margin-bottom: 2px;
}

.search-result span {
  color: var(--muted);
  font-size: 0.84rem;
}

.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 82px);
}

.sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  height: calc(100vh - 82px);
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #0d1015;
  overflow: auto;
}

.main-nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  width: 100%;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: #151a21;
  color: var(--text);
  outline: none;
}

.nav-button.active {
  border-color: rgba(227, 90, 79, 0.5);
  background: var(--accent-soft);
  color: var(--text);
}

.nav-button span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.78rem;
  line-height: 1.35;
}

.content-shell {
  min-width: 0;
  padding: 22px;
}

.content-panel {
  max-width: 1280px;
  margin: 0 auto;
}

.wiki-front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.article-lead,
.infobox,
.guide-card,
.stat-card,
.build-card,
.equipment-card,
.race-card,
.transform-card,
.timeline-card,
.notice,
.source-card,
details,
.check-card,
.table-wrap,
.filter-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-lead {
  padding: 24px;
  background: #12171e;
}

.article-breadcrumb {
  margin-bottom: 12px;
  color: var(--faint);
  font-size: 0.82rem;
}

.article-lead h2 {
  max-width: 850px;
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.98;
  text-wrap: balance;
}

.article-lead p {
  max-width: 790px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.infobox {
  overflow: hidden;
  background: #10141a;
}

.infobox h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #151a21;
  font-size: 0.95rem;
}

.infobox dl {
  margin: 0;
}

.infobox div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.infobox div:last-child {
  border-bottom: 0;
}

.infobox dt {
  color: var(--muted);
}

.infobox dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.action-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #171c23;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.action-button:hover,
.action-button:focus-visible {
  border-color: var(--accent);
  background: #1d232b;
  outline: none;
}

.section {
  margin-top: 16px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 10px;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2vw, 1.72rem);
  text-wrap: balance;
}

.section-header p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.index-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.index-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.index-item:last-child {
  border-bottom: 0;
}

.index-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.index-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
  text-wrap: pretty;
}

.index-item .badge-row {
  justify-content: flex-end;
  margin-top: 0;
}

.guide-card,
.stat-card,
.race-card,
.transform-card,
.timeline-card,
.source-card {
  padding: 14px;
}

.guide-card h3,
.stat-card h3,
.race-card h3,
.transform-card h3,
.timeline-card h3,
.source-card h3 {
  margin-bottom: 7px;
  font-size: 1rem;
}

.guide-card p,
.stat-card p,
.race-card p,
.transform-card p,
.timeline-card p,
.source-card p {
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}

.card-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.list-clean {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-clean li {
  color: var(--muted);
  line-height: 1.45;
  text-wrap: pretty;
}

.list-clean strong {
  color: var(--text);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #11161c;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.common {
  border-color: #596473;
  color: #d6dde7;
}

.badge.rare {
  border-color: #477ebc;
  color: #9fc9f8;
}

.badge.legendary {
  border-color: #aa8439;
  color: #efc879;
}

.badge.godly {
  border-color: #8067c4;
  color: #c3b1f1;
}

.badge.exotic {
  border-color: #4695a0;
  color: #9ce0e7;
}

.badge.strength {
  border-color: #b64b44;
  color: #f09a94;
}

.badge.spirit {
  border-color: #8067c4;
  color: #cab8f5;
}

.badge.hybrid {
  border-color: #4695a0;
  color: #9ce0e7;
}

.badge.agility {
  border-color: #4e9b69;
  color: #a5dfb8;
}

.badge.vitality,
.badge.tank {
  border-color: #aa8439;
  color: #efc879;
}

.filter-bar {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-soft);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-title {
  min-width: 86px;
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #11161c;
  color: var(--muted);
  cursor: pointer;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  background: var(--surface-soft);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #151a21;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

td {
  color: #d9e0e8;
  line-height: 1.43;
}

tr:last-child td {
  border-bottom: 0;
}

.details-stack {
  display: grid;
  gap: 8px;
}

details {
  background: var(--surface);
}

summary {
  min-height: 46px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.details-body {
  padding: 0 14px 14px;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 8px;
  counter-reset: step;
}

.timeline-item {
  position: relative;
  padding: 13px 14px 13px 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.timeline-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 13px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(227, 90, 79, 0.55);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #f2aaa4;
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.timeline-item h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.build-card {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.build-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.build-card h3 {
  margin: 0;
  font-size: 1.05rem;
  text-wrap: balance;
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-line strong {
  color: var(--text);
}

.equipment-card {
  padding: 14px;
}

.equipment-card h3 {
  margin-bottom: 8px;
}

.notice {
  padding: 13px 15px;
  color: var(--muted);
  line-height: 1.5;
}

.notice strong {
  color: var(--text);
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-card {
  padding: 15px;
}

.check-card h3 {
  margin-bottom: 12px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.check-row:first-of-type {
  border-top: 0;
}

.check-row input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .app-header {
    grid-template-columns: 1fr;
    position: static;
  }

  .language-switch {
    width: max-content;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #0b0d10;
  }

  .main-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-button {
    min-width: 150px;
  }

  .nav-button span {
    display: none;
  }

  .wiki-front,
  .grid.two,
  .grid.three,
  .grid.four,
  .checklist-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 14px;
  }

  .content-shell {
    padding: 14px;
  }

  .article-lead {
    padding: 18px;
  }

  .article-lead h2 {
    font-size: 2rem;
  }

  .index-item {
    grid-template-columns: 1fr;
  }

  .index-item .badge-row {
    justify-content: flex-start;
  }

  .section-header {
    display: block;
  }

  .filter-title {
    width: 100%;
  }

  .stat-list {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 760px;
  }
}
