:root {
  color-scheme: dark;
  --bg: #07131f;
  --bg-deep: #02070d;
  --bg-gradient-highlight: #123047;
  --bg-card: rgba(8, 24, 38, 0.82);
  --line: rgba(120, 180, 210, 0.18);
  --text: #e8f4ff;
  --muted: #8eb3c9;
  --accent: #d4a853;
  --accent-soft: rgba(212, 168, 83, 0.15);
  --entry-bg: rgba(255, 255, 255, 0.04);
  --entry-fg: #e8f4ff;
  --button-bg: #333333;
  --button-hover: #4d4d4d;
  --button-fg: #ffffff;
  --good: #6fd3a0;
  --danger: #ff8a80;
  --backdrop-glow-1: rgba(212, 168, 83, 0.08);
  --backdrop-glow-2: rgba(80, 160, 220, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --content-max: 1040px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(
    circle at 20% 0%,
    var(--bg-gradient-highlight) 0%,
    var(--bg) 42%,
    var(--bg-deep) 100%
  );
  color: var(--text);
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 80% 20%, var(--backdrop-glow-1), transparent 30%),
    radial-gradient(circle at 10% 80%, var(--backdrop-glow-2), transparent 35%);
}

.site-header {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__right {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 1rem 1.25rem;
  margin-left: auto;
}

.site-logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.wiki-nav {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
}

.wiki-nav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.wiki-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.wiki-nav a:hover,
.wiki-nav a.is-active {
  color: var(--accent);
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

.theme-field {
  min-width: 10rem;
}

select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--entry-bg);
  color: var(--entry-fg);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  cursor: pointer;
  padding-right: 2rem;
  width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 12px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.shell {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.loading {
  color: var(--muted);
  text-align: center;
}

.page-head {
  margin-bottom: 1.5rem;
}

.page-head h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  color: var(--accent);
}

.page-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.search-input {
  flex: 1 1 14rem;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--entry-bg);
  color: var(--entry-fg);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font: inherit;
}

.search-input::placeholder {
  color: var(--muted);
}

.meta-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.entry-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.entry-link:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.entry-link h2,
.entry-link h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text);
}

.appendix-category h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.appendix-body p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.appendix-body p:last-child {
  margin-bottom: 0;
}

.entry-link .entry-icon {
  font-size: 1.35rem;
  margin-right: 0.35rem;
}

.entry-link p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
}

.detail-header {
  margin-bottom: 1.25rem;
}

.detail-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  color: var(--accent);
}

.detail-header .detail-icon {
  margin-right: 0.35rem;
}

.primary-attribute {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-attribute__icon {
  font-size: 1.05em;
  line-height: 1;
}

.primary-attribute-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 48rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.back-link:hover {
  text-decoration: underline;
}

.section {
  margin-bottom: 1.5rem;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--text);
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.stat-table th,
.stat-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.stat-table th {
  color: var(--muted);
  font-weight: 600;
  width: 42%;
}

.stat-table-wrap {
  overflow-x: auto;
}

.skill-list {
  display: grid;
  gap: 0.85rem;
}

.skill-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.skill-card p {
  margin: 0 0 0.45rem;
  color: var(--muted);
  line-height: 1.5;
}

.skill-card p:last-child {
  margin-bottom: 0;
}

.skill-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.skill-tag--damage {
  color: #ffb4a8;
}

.skill-tag--buff,
.skill-tag--recovery {
  color: #9fd3ff;
}

.skill-tag--passive,
.skill-tag--ultimate {
  color: var(--accent);
}

.skill-tag--racial {
  color: var(--good);
}

.skill-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.skill-meta span + span::before {
  content: " · ";
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.home-cards a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.home-cards a:hover {
  text-decoration: underline;
}

.footer {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  margin: 0.35rem 0;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 520px) {
  .site-header__right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .theme-field {
    width: 100%;
  }
}
