:root {
  --bg: #111111;
  --bg-warm: #18120e;
  --panel: #1d1d1d;
  --panel-strong: #27231f;
  --line: rgba(236, 224, 217, 0.12);
  --line-strong: rgba(255, 183, 125, 0.34);
  --text: #f1e9e2;
  --muted: #cdbdb1;
  --soft: #8d8179;
  --amber: #ff8c00;
  --amber-soft: #ffb77d;
  --cyan: #85cfff;
  --green: #74e2a8;
  --danger: #ff8b78;
  --radius: 8px;
  --radius-sm: 4px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --container: 1240px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(24, 18, 14, 0.82), rgba(17, 17, 17, 1) 44%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

body.xw-template-home,
body.xw-template-game,
body.xw-template-guide {
  color: var(--text);
}

body.xw-template-home a,
body.xw-template-game a,
body.xw-template-guide a {
  color: inherit;
  text-decoration: none;
}

body.xw-template-home h1,
body.xw-template-home h2,
body.xw-template-home h3,
body.xw-template-home h4,
body.xw-template-game h1,
body.xw-template-game h2,
body.xw-template-game h3,
body.xw-template-game h4,
body.xw-template-guide h1,
body.xw-template-guide h2,
body.xw-template-guide h3,
body.xw-template-guide h4 {
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 13, 0.86);
  backdrop-filter: blur(16px);
}

.xw-template-home .site-header,
.xw-template-game .site-header,
.xw-template-guide .site-header {
  background: rgba(13, 13, 13, 0.86);
}

.nav {
  width: min(100% - 48px, 1440px);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--amber);
  background: rgba(255, 140, 0, 0.1);
  font-size: 11px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links .active {
  color: var(--amber-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lang-switch {
  color: var(--soft);
  font-family: var(--font-display);
  font-size: 12px;
}

.menu-toggle {
  display: none;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}

.container {
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
}

.section {
  padding: var(--space-8) 0;
}

.section-tight {
  padding: var(--space-7) 0;
}

.eyebrow {
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.hero {
  min-height: 620px;
  display: flex;
  align-items: end;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.94), rgba(17, 17, 17, 0.58) 54%, rgba(17, 17, 17, 0.94)),
    var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  opacity: 0.42;
  filter: saturate(0.88);
}

.xw-template-home .hero::before {
  background-position: top center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 220px;
  background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 48px, var(--container));
  margin: 0 auto;
  padding: 120px 0 var(--space-8);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: var(--space-7);
  align-items: end;
}

.hero h1,
.page-title {
  margin: var(--space-4) 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1.02;
  font-weight: 800;
}

.hero p,
.lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
}

.search-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 29, 29, 0.82);
  padding: var(--space-4);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
}

.search-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #101010;
  color: var(--text);
  padding: 0 var(--space-4);
}

.search-input:focus {
  outline: 1px solid var(--amber);
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 0 var(--space-4);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  border-color: var(--amber);
  background: var(--amber);
  color: #241000;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-3);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.badge-hot {
  border-color: rgba(255, 140, 0, 0.48);
  color: var(--amber-soft);
  background: rgba(255, 140, 0, 0.1);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.section-head h2,
.article-section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.2;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.card,
.card:hover,
.card:focus,
.btn,
.btn:hover,
.btn:focus {
  color: var(--text);
  text-decoration: none;
}

.card-body {
  padding: var(--space-5);
}

.media {
  aspect-ratio: 16 / 9;
  background: var(--panel-strong);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card h3,
.card h4,
.module h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  line-height: 1.25;
}

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

.small {
  color: var(--soft);
  font-size: 13px;
}

.section-head h2,
.article-section h2,
.article-section h3 {
  color: inherit;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--space-4);
}

.stat strong {
  display: block;
  color: var(--amber-soft);
  font-family: var(--font-display);
  font-size: 22px;
}

.portal-hero {
  min-height: 520px;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-5);
  align-items: start;
}

.portal-layout > *,
.article-layout > *,
.module-stack,
.module,
.card,
.article-section,
article {
  min-width: 0;
}

.meta-panel,
.toc-panel {
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 29, 29, 0.92);
  padding: var(--space-5);
}

.meta-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-3);
}

.module-stack {
  display: grid;
  gap: var(--space-5);
}

.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(29, 29, 29, 0.86);
  padding: var(--space-5);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.module-boss-index {
  border-left: 3px solid var(--danger);
}

.module-build-index {
  border-left: 3px solid var(--amber);
}

.module-equipment-table {
  border-left: 3px solid var(--cyan);
}

.module-recipe-index {
  border-left: 3px solid var(--green);
}

.compact-list {
  display: grid;
  gap: var(--space-3);
}

.compact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  padding: var(--space-4);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

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

th {
  color: var(--amber-soft);
  font-family: var(--font-display);
  font-size: 12px;
}

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

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 820px) 300px;
  gap: var(--space-7);
  align-items: start;
}

.article-header {
  padding: var(--space-8) 0 var(--space-6);
}

.article-cover {
  aspect-ratio: 21 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  margin: var(--space-5) 0 var(--space-6);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-section {
  scroll-margin-top: 100px;
  margin-bottom: var(--space-8);
}

.quick-answer {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 140, 0, 0.08);
  padding: var(--space-5);
}

.callout {
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  background: var(--panel);
  padding: var(--space-5);
}

.toc-toggle {
  display: none;
  width: 100%;
  margin-bottom: var(--space-4);
}

.toc-list {
  display: grid;
  gap: var(--space-2);
}

.toc-list a {
  color: var(--muted);
  font-size: 14px;
  padding: var(--space-2) 0;
}

.toc-list a.active,
.toc-list a:hover {
  color: var(--amber-soft);
}

.footer {
  border-top: 1px solid var(--line);
  padding: var(--space-7) 0;
  color: var(--soft);
}

.admin-bar .site-header {
  top: 32px;
}

.xw-template-home,
.xw-template-game,
.xw-template-guide {
  background:
    linear-gradient(180deg, rgba(24, 18, 14, 0.82), rgba(17, 17, 17, 1) 44%),
    var(--bg);
}

.xw-template-home .site,
.xw-template-game .site,
.xw-template-guide .site {
  background: transparent;
}

.article-section .wp-block-heading,
.article-section h2,
.article-section h3 {
  font-family: var(--font-display);
}

.article-section p {
  color: var(--muted);
}

.article-section ul,
.article-section ol {
  color: var(--muted);
}

.article-section a {
  color: var(--amber-soft);
}

@media (max-width: 1100px) {
  .hero-grid,
  .portal-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .meta-panel,
  .toc-panel {
    position: static;
  }

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

@media (max-width: 820px) {
  .nav {
    width: min(100% - 32px, 1440px);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--line);
    background: #101010;
    padding: var(--space-3) var(--space-4);
  }

  .nav-links.open {
    display: flex;
  }

  .container,
  .hero-content {
    width: min(100% - 32px, var(--container));
  }

  .hero {
    min-height: 560px;
  }

  .hero h1,
  .page-title {
    font-size: 44px;
  }

  .hero p,
  .lead {
    font-size: 16px;
  }

  .section {
    padding: var(--space-7) 0;
  }

  .grid-3,
  .grid-4,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .toc-toggle {
    display: inline-flex;
  }

  .toc-panel .toc-list {
    display: none;
  }

  .toc-panel.open .toc-list {
    display: grid;
  }

  .admin-bar .site-header {
    top: 46px;
  }
}
