/* ============================================================
   Valheim Guide — graphite / ember / bone
   Дизайн-система: 4 цвета, два типа поверхностей, без радуги.
   ============================================================ */

:root {
  --bg: #0b0c0e;
  --bg-deep: #070809;
  --panel: #14171b;
  --panel-2: #191c21;
  --panel-3: #20242a;
  --line: rgba(242, 236, 226, 0.1);
  --line-strong: rgba(242, 236, 226, 0.22);

  --text: #f2ece2;
  --muted: #a49d92;
  --dim: #8b847b;

  --accent: #ff6a2b;
  --accent-strong: #ff4f14;
  --accent-soft: #ff8a52;
  --accent-ink: #170b05;

  --brass: #d5a24a;
  --danger: #e85a3a;
  --ash: #8b939d;
  --safe: #97a28f;

  --tone-low: var(--safe);
  --tone-mid: var(--brass);
  --tone-high: var(--danger);

  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Unbounded", "Manrope", sans-serif;

  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.tone-low { --tone: var(--tone-low); }
.tone-mid { --tone: var(--tone-mid); }
.tone-high { --tone: var(--tone-high); }

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--bg); }
body::-webkit-scrollbar-thumb {
  background: #34383e;
  border: 2px solid var(--bg);
  border-radius: 8px;
}
body::-webkit-scrollbar-thumb:hover { background: var(--accent); }

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

[hidden] { display: none !important; }

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

button,
input,
select {
  font: inherit;
}

button { color: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── иконки Phosphor (маски, наследуют currentColor) ── */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon--compass { --icon: url("../assets/icons/compass.svg"); }
.icon--lightbulb { --icon: url("../assets/icons/lightbulb.svg"); }
.icon--skull { --icon: url("../assets/icons/skull.svg"); }
.icon--sword { --icon: url("../assets/icons/sword.svg"); }
.icon--shield { --icon: url("../assets/icons/shield.svg"); }
.icon--shield-check { --icon: url("../assets/icons/shield-check.svg"); }
.icon--magnifying-glass { --icon: url("../assets/icons/magnifying-glass.svg"); }
.icon--x { --icon: url("../assets/icons/x.svg"); }
.icon--caret-left { --icon: url("../assets/icons/caret-left.svg"); }
.icon--caret-right { --icon: url("../assets/icons/caret-right.svg"); }
.icon--arrow-up-right { --icon: url("../assets/icons/arrow-up-right.svg"); }
.icon--arrow-left { --icon: url("../assets/icons/arrow-left.svg"); }
.icon--arrow-right { --icon: url("../assets/icons/arrow-right.svg"); }
.icon--map-trifold { --icon: url("../assets/icons/map-trifold.svg"); }
.icon--paw-print { --icon: url("../assets/icons/paw-print.svg"); }
.icon--flame { --icon: url("../assets/icons/flame.svg"); }
.icon--snowflake { --icon: url("../assets/icons/snowflake.svg"); }
.icon--drop { --icon: url("../assets/icons/drop.svg"); }
.icon--lightning { --icon: url("../assets/icons/lightning.svg"); }
.icon--sparkle { --icon: url("../assets/icons/sparkle.svg"); }
.icon--squares-four { --icon: url("../assets/icons/squares-four.svg"); }
.icon--list-dashes { --icon: url("../assets/icons/list-dashes.svg"); }
.icon--crosshair { --icon: url("../assets/icons/crosshair.svg"); }
.icon--bug { --icon: url("../assets/icons/bug.svg"); }
.icon--books { --icon: url("../assets/icons/books.svg"); }
.icon--info { --icon: url("../assets/icons/info.svg"); }
.icon--warning-circle { --icon: url("../assets/icons/warning-circle.svg"); }
.icon--user-circle { --icon: url("../assets/icons/user-circle.svg"); }
.icon--target { --icon: url("../assets/icons/target.svg"); }
.icon--hammer { --icon: url("../assets/icons/hammer.svg"); }
.icon--mountains { --icon: url("../assets/icons/mountains.svg"); }
.icon--waves { --icon: url("../assets/icons/waves.svg"); }
.icon--leaf { --icon: url("../assets/icons/leaf.svg"); }
.icon--castle-turret { --icon: url("../assets/icons/castle-turret.svg"); }
.icon--dna { --icon: url("../assets/icons/dna.svg"); }
.icon--seal-check { --icon: url("../assets/icons/seal-check.svg"); }
.icon--sketch-logo { --icon: url("../assets/icons/sketch-logo.svg"); }

/* ── фон ── */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.aurora__blob--accent {
  top: -26vw;
  left: -16vw;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(circle, rgba(255, 106, 43, 0.19) 0%, rgba(255, 79, 20, 0.05) 45%, transparent 68%);
  animation: drift 34s ease-in-out infinite alternate;
}

.aurora__blob--ash {
  right: -22vw;
  bottom: -30vw;
  width: 58vw;
  height: 58vw;
  background: radial-gradient(circle, rgba(139, 147, 157, 0.1) 0%, transparent 66%);
  animation: drift 42s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, 2vw, 0) scale(1.06); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ── шапка ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(16px, 3.4vw, 48px);
  background: rgba(11, 12, 14, 0.84);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  background: rgba(9, 10, 12, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand__rune {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(23, 11, 5, 0.16);
}

.brand__text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand__slash {
  color: var(--accent);
  padding: 0 2px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 auto;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.tab .icon { font-size: 14px; }
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.version-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.12);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s ease;
}

.menu-toggle.is-open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle.is-open span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ── каркас ── */
.main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: clamp(30px, 4.6vw, 58px) clamp(16px, 3.6vw, 48px) clamp(70px, 9vw, 120px);
  min-height: calc(100vh - 220px);
}

.view { display: none; }
.view.is-active {
  display: block;
  animation: viewIn 0.35s ease both;
}

@keyframes viewIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reveal {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.reveal.is-in { opacity: 1; }

/* ── типографика ── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow__line {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: 0 0 auto;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent-soft) 0%, var(--accent) 55%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ── кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn .icon { font-size: 14px; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 28px rgba(255, 106, 43, 0.14);
}

.btn--primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ── обзор ── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  gap: clamp(30px, 5vw, 76px);
  align-items: center;
  padding-top: clamp(8px, 2.4vw, 28px);
}

.hero__copy { max-width: 760px; }

.hero__title {
  margin: 18px 0 22px;
  font-size: clamp(2.9rem, 6.4vw, 5.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.hero__lead {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.2vw, 1.1rem);
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 22px;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero__tags span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* панель пути — сплошная графитовая поверхность */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hero__panel {
  position: relative;
  padding: 18px 18px 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 106, 43, 0.05));
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.panel__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel__label .icon { color: var(--accent); font-size: 13px; }

.panel__progress {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.path {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 5px 0;
  list-style: none;
}

.path__item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 7px;
  border-left: 2px solid transparent;
  border-radius: 5px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.path__item:hover {
  background: var(--panel-2);
  border-left-color: var(--tone);
}

.path__num {
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.path__name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.path__name small {
  margin-top: 1px;
  color: var(--dim);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.path__danger {
  display: inline-flex;
  gap: 2px;
}

.path__danger i {
  width: 5px;
  height: 12px;
  border-radius: 1.5px;
  background: rgba(242, 236, 226, 0.09);
}

.path__danger i.on {
  background: var(--tone, var(--accent));
}

.panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.legend__dot {
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-radius: 50%;
}

.legend__dot--low { background: var(--tone-low); }
.legend__dot--mid { background: var(--tone-mid); }
.legend__dot--high { background: var(--tone-high); }

/* ── статистика ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: clamp(34px, 5vw, 58px);
}

.stat {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat strong {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat--accent {
  background: var(--accent);
  border-color: var(--accent);
}

.stat--accent strong,
.stat--accent span { color: var(--accent-ink); }

/* ── заголовки секций ── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: clamp(42px, 6vw, 74px) 0 20px;
}

.section-head h2 {
  margin-top: 9px;
  font-size: clamp(1.65rem, 2.8vw, 2.55rem);
}

.section-head__note {
  max-width: 350px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  text-align: right;
}

.section-head--spaced { margin-top: clamp(48px, 7vw, 86px); }

/* ── биомы ── */
.biome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.biome-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 214px;
  padding: 19px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--tone);
  border-radius: var(--radius);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.biome-card:hover {
  background: var(--panel-2);
  border-right-color: var(--line-strong);
  border-bottom-color: var(--line-strong);
  border-left-color: var(--line-strong);
}

.biome-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.biome-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 21px;
  line-height: 1;
}

.biome-card__danger {
  display: inline-flex;
  gap: 2px;
  padding-top: 4px;
}

.biome-card__danger i {
  width: 5px;
  height: 12px;
  border-radius: 1.5px;
  background: rgba(242, 236, 226, 0.09);
}

.biome-card__danger i.on { background: var(--tone); }

.biome-card h3 {
  margin: 15px 0 1px;
  font-size: 17px;
  font-weight: 600;
}

.biome-card__en {
  margin: 0;
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.biome-card > p:not(.biome-card__en) {
  margin: 9px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.biome-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9px;
  line-height: 1.4;
}

.biome-card__foot span:last-child {
  text-align: right;
}

.biome-card__boss { color: var(--tone); font-weight: 700; }

/* ── акцентный блок с рунами ── */
.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  margin-top: clamp(46px, 7vw, 84px);
  padding: clamp(26px, 5vw, 52px);
  overflow: hidden;
  background: var(--accent);
  border-radius: var(--radius-lg);
  color: var(--accent-ink);
}

.feature::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 70%;
  height: 200%;
  background: radial-gradient(circle, rgba(23, 11, 5, 0.12), transparent 60%);
  pointer-events: none;
}

.feature__copy { position: relative; z-index: 1; }

.feature .eyebrow { color: rgba(23, 11, 5, 0.66); }
.feature .eyebrow__line { background: var(--accent-ink); }

.feature h2 {
  margin: 11px 0 14px;
  font-size: clamp(1.85rem, 3.4vw, 3.1rem);
}

.feature .grad-text {
  background: none;
  color: var(--accent-ink);
  -webkit-text-fill-color: var(--accent-ink);
}

.feature p {
  max-width: 540px;
  color: rgba(23, 11, 5, 0.78);
  font-size: 13px;
  line-height: 1.7;
}

.feature .btn--primary {
  margin-top: 20px;
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent);
  box-shadow: none;
}

.feature .btn--primary:hover { background: #2b160a; border-color: #2b160a; }

.feature__rune {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 58px);
  justify-content: end;
  justify-self: end;
  gap: 8px;
}

.feature__rune span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(23, 11, 5, 0.3);
  border-radius: 9px;
  color: rgba(23, 11, 5, 0.62);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.feature__rune span:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent);
  transform: translateY(-6px) rotate(-3deg);
}

.feature__rune span:nth-child(even):hover { transform: translateY(-6px) rotate(3deg); }

/* ── заголовки страниц ── */
.page-head {
  max-width: 960px;
  padding-top: clamp(8px, 2vw, 20px);
}

.page-head h1 {
  margin: 14px 0 16px;
  font-size: clamp(2.65rem, 5.3vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.page-head__lead {
  max-width: 690px;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.1vw, 1.04rem);
  line-height: 1.72;
}

.page-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(22px, 4vw, 56px);
  max-width: none;
}

.page-head--row > div:first-child { max-width: 820px; }

/* боковые панели заголовков */
.side-note,
.bestiary-aside,
.damage-key,
.armor-formula {
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.side-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 300px;
  padding: 17px;
  border-top: 2px solid var(--accent);
}

.side-note__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  color: var(--accent-ink);
  font-size: 19px;
}

.side-note__kicker {
  display: block;
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.side-note strong {
  display: block;
  margin: 2px 0 5px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.side-note p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.bestiary-aside {
  position: relative;
  width: 326px;
  padding: 17px 18px 18px;
  overflow: hidden;
  border-top: 2px solid var(--accent);
}

.bestiary-aside__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.bestiary-aside__count {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.bestiary-aside__count > span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 3vw, 2.9rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.bestiary-aside__count small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bestiary-aside__mark {
  position: absolute;
  top: 8px;
  right: 12px;
  color: rgba(255, 106, 43, 0.1);
  font-size: 76px;
  line-height: 1;
  pointer-events: none;
}

.bestiary-aside__rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 13px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.bestiary-aside__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 9px 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10px;
}

.bestiary-aside__row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.bestiary-aside__row .icon { color: var(--accent); font-size: 12px; }

.bestiary-aside__row b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
}

.damage-key {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 15px;
  width: 330px;
  padding: 16px 17px;
  border-left: 3px solid var(--accent);
}

.damage-key__title {
  width: 100%;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.dmg-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dmg-dot--blunt { background: var(--accent); }
.dmg-dot--slash { background: var(--text); }
.dmg-dot--pierce { background: var(--brass); }
.dmg-dot--magic { background: var(--danger); }

.armor-formula {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 344px;
  padding: 16px 18px;
  border-left: 3px solid var(--brass);
}

.armor-formula > span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.armor-formula code {
  padding: 8px 9px;
  overflow-wrap: anywhere;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--brass);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 10px;
  line-height: 1.5;
}

.armor-formula small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* ── панель фильтров ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 9px;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 106, 43, 0.1);
}

.search__icon { color: var(--dim); font-size: 15px; }

.search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search input::placeholder { color: var(--dim); }

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search kbd {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--dim);
  font-family: var(--font-body);
  font-size: 9px;
  line-height: 1.5;
}

.toolbar__group {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.select {
  height: 42px;
  padding: 0 30px 0 11px;
  appearance: none;
  -webkit-appearance: none;
  background-color: #0d0f12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%23a49d92' d='M213.7 101.7l-80 80a8 8 0 0 1-11.4 0l-80-80a8 8 0 0 1 11.4-11.4L128 164.7l74.3-74.4a8 8 0 0 1 11.4 11.4Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.select:hover { border-color: var(--line-strong); }
.select:focus { border-color: var(--accent); outline: none; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.filter-row--scroll {
  flex-wrap: wrap;
  overflow: visible;
}

@media (max-width: 720px) {
  .filter-row--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .filter-row--scroll::-webkit-scrollbar { display: none; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip__count {
  padding-left: 6px;
  margin-left: 1px;
  border-left: 1px solid rgba(242, 236, 226, 0.2);
  color: var(--dim);
  font-size: 8px;
}

.chip.is-active .chip__count {
  border-left-color: rgba(23, 11, 5, 0.28);
  color: var(--accent-ink);
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 10px;
}

.result-line__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.view-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.view-switch__btn .icon { font-size: 12px; }
.view-switch__btn:hover { color: var(--text); }
.view-switch__btn.is-active { background: var(--accent); color: var(--accent-ink); }

.reset-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.16s ease;
}

.reset-btn:hover { color: var(--accent); }

/* ── проводник существ ── */
.explorer {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 544px;
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.explorer__rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel-2);
  border-right: 1px solid var(--line);
}

.explorer__rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.explorer__count {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0;
}

.explorer__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 566px;
  padding: 7px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3e44 transparent;
}

.explorer__list::-webkit-scrollbar { width: 7px; }
.explorer__list::-webkit-scrollbar-thumb {
  background: #3a3e44;
  border-radius: 8px;
}
.explorer__list::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.rail-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rail-item:hover {
  background: var(--panel);
  color: var(--text);
}

.rail-item.is-active {
  background: var(--panel);
  border-color: var(--line);
  border-left-color: var(--accent);
  color: var(--text);
}

.rail-item__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 16px;
  line-height: 1;
}

.rail-item__name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.rail-item__name strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item__name small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--dim);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item__hp {
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 9px;
}

.rail-item.is-active .rail-item__hp { color: var(--accent); }

.explorer__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 544px;
  padding: clamp(20px, 3vw, 32px);
  background:
    radial-gradient(circle at 89% 2%, rgba(255, 106, 43, 0.08), transparent 32%),
    var(--panel);
}

.stage__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage__index {
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.stage__index em {
  color: rgba(242, 236, 226, 0.35);
  font-style: normal;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.type-badge .icon { font-size: 10px; }

.type-badge--boss {
  background: rgba(255, 106, 43, 0.12);
  border-color: rgba(255, 106, 43, 0.3);
  color: var(--accent);
}

.type-badge--miniboss {
  background: rgba(213, 162, 74, 0.1);
  border-color: rgba(213, 162, 74, 0.3);
  color: var(--brass);
}

.type-badge--hostile {
  background: rgba(224, 74, 47, 0.1);
  border-color: rgba(224, 74, 47, 0.28);
  color: var(--danger);
}

.type-badge--passive {
  background: rgba(151, 162, 143, 0.1);
  border-color: rgba(151, 162, 143, 0.3);
  color: var(--safe);
}

.type-badge--minion {
  background: rgba(139, 147, 157, 0.1);
  border-color: rgba(139, 147, 157, 0.28);
  color: var(--ash);
}

.type-badge--npc {
  background: rgba(242, 236, 226, 0.07);
  border-color: var(--line-strong);
  color: var(--text);
}

.stage__identity {
  display: flex;
  align-items: center;
  gap: 17px;
  margin: clamp(20px, 3vw, 32px) 0 22px;
}

.stage__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 38px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(242, 236, 226, 0.03);
}

.stage__biome {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage__biome .icon { font-size: 11px; }

.stage__identity h2 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 600;
}

.stage__en {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.stage__stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  background: var(--panel-2);
}

.stage__stats span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage__stats strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.stage__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}

.stage__note {
  max-width: 72ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.stage__hint {
  margin-top: 13px;
  padding: 10px 12px;
  background: rgba(255, 106, 43, 0.05);
  border-left: 2px solid var(--accent);
  border-radius: 0 5px 5px 0;
}

.stage__hint span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage__hint p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.stage__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stage__nav {
  display: flex;
  gap: 5px;
}

.stage-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.stage-nav-btn .icon { font-size: 12px; }
.stage-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.stage-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.stage__more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 106, 43, 0.4);
  border-radius: 5px;
  background: rgba(255, 106, 43, 0.09);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.stage__more .icon { font-size: 11px; }
.stage__more:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ── сетка существ ── */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.creature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 14px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--tone);
  border-radius: 9px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.creature-card:hover {
  background: var(--panel-2);
  border-right-color: var(--line-strong);
  border-bottom-color: var(--line-strong);
  border-left-color: var(--line-strong);
}

.creature-card.is-boss {
  background: linear-gradient(155deg, rgba(255, 106, 43, 0.07), transparent 55%), var(--panel);
}

.creature-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
}

.creature-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.creature-card h2 {
  margin: 11px 0 1px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.creature-card__en {
  overflow: hidden;
  max-width: 100%;
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.creature-card__hp {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 9px;
}

.creature-card__hp b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.creature-card__hp span {
  color: var(--dim);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.creature-card__dmg {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.creature-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: 100%;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.creature-card__open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--dim);
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.creature-card:hover .creature-card__open { color: var(--accent); opacity: 1; }

/* ── мини-теги ── */
.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.mini-tag .icon { font-size: 9px; }

.mini-tag--weak {
  background: rgba(255, 106, 43, 0.08);
  border-color: rgba(255, 106, 43, 0.24);
  color: var(--accent);
}

.mini-tag--resist {
  background: rgba(213, 162, 74, 0.07);
  border-color: rgba(213, 162, 74, 0.24);
  color: var(--brass);
}

/* ── советы ── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tip-card {
  position: relative;
  padding: 17px 17px 30px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--tc, var(--accent));
  border-radius: 9px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.tip-card:hover {
  background: var(--panel-2);
  border-top-color: var(--line-strong);
  border-right-color: var(--line-strong);
  border-bottom-color: var(--line-strong);
}

.tip-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tip-card__icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
}

.tip-card__cat {
  color: var(--tc, var(--accent));
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tip-card h2 {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.tip-card p {
  padding-right: 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.tip-card__index {
  position: absolute;
  right: 11px;
  bottom: 7px;
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
}

/* ── таймлайн ── */
.timeline {
  position: relative;
  margin-left: 14px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

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

.tl-item::before {
  content: "";
  position: absolute;
  top: 19px;
  left: -26px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 4px var(--bg);
}

.tl-item__biome {
  color: var(--tone);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.tl-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl-item__main strong {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}

.tl-item__main span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.tl-item__resource {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.55;
}

/* ── таблицы ── */
.table-wrap {
  margin-top: 8px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 13px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(242, 236, 226, 0.025); }

.weapon-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.weapon-name__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
  line-height: 1;
}

.weapon-name > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.weapon-name strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.weapon-name small {
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dmg-cell {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.dmg-blunt { color: var(--accent); }
.dmg-slash { color: var(--text); }
.dmg-pierce { color: var(--brass); }
.dmg-magic { color: var(--danger); }

.dmg-cell em {
  margin: 0 2px;
  color: var(--dim);
  font-style: normal;
}

.tier-cell {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.table-note {
  display: block;
  min-width: 170px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.tag-pill {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.tag-pill--meta {
  background: rgba(255, 106, 43, 0.1);
  border-color: rgba(255, 106, 43, 0.26);
  color: var(--accent);
}

.tag-pill--start {
  background: rgba(151, 162, 143, 0.1);
  border-color: rgba(151, 162, 143, 0.26);
  color: var(--safe);
}

.tag-pill--aoe {
  background: rgba(213, 162, 74, 0.1);
  border-color: rgba(213, 162, 74, 0.26);
  color: var(--brass);
}

.tag-pill--support {
  background: rgba(139, 147, 157, 0.1);
  border-color: rgba(139, 147, 157, 0.26);
  color: var(--ash);
}

/* ── броня ── */
.armor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.armor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 30px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--tone);
  border-radius: 9px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.armor-card:hover {
  background: var(--panel-2);
  border-right-color: var(--line-strong);
  border-bottom-color: var(--line-strong);
  border-left-color: var(--line-strong);
}

.armor-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.armor-card__biome {
  margin: 0;
  color: var(--tone);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.armor-card h2 {
  margin: 4px 0 1px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.armor-card__en {
  margin: 0;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.armor-card__value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 14px 0 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.armor-card__value b {
  color: var(--tone);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.armor-card__value span {
  color: var(--dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.armor-card__bonus {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.armor-card__bonus b { color: var(--text); }

.armor-card__note {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.6;
}

.armor-card__type {
  position: absolute;
  right: 11px;
  bottom: 9px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── пустое состояние ── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
  padding: 52px 20px;
  background: rgba(20, 23, 27, 0.45);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

.empty__rune {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1;
  opacity: 0.72;
}

.empty h3 {
  margin: 12px 0 5px;
  font-size: 20px;
}

.empty p {
  color: var(--muted);
  font-size: 11px;
}

.empty .btn { margin-top: 14px; }

/* ── подвал ── */
.site-footer {
  position: relative;
  z-index: 2;
  margin-top: clamp(64px, 8vw, 100px);
  padding: 38px clamp(16px, 3.6vw, 48px) 22px;
  background: var(--bg-deep);
  border-top: 1px solid rgba(255, 106, 43, 0.35);
}

.footer__top,
.footer__bottom {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
}

.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer__top > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 10px;
  max-width: 430px;
}

.footer__top .brand__rune {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.footer__top strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.footer__top p {
  grid-column: 2;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  transition: color 0.16s ease;
}

.footer__links a:hover { color: var(--accent); }
.footer__links .icon { font-size: 9px; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9px;
  line-height: 1.6;
}

/* ── модальное окно ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.76);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.modal__panel {
  position: relative;
  width: min(540px, 100%);
  max-height: 90vh;
  padding: 26px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transform: translateY(10px) scale(0.99);
  transition: transform 0.2s ease;
}

.modal.is-open .modal__panel { transform: none; }

.modal__close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.modal__close .icon { font-size: 14px; }
.modal__close:hover { color: var(--accent); border-color: var(--accent); }

.modal__hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-right: 28px;
}

.modal__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  background: #0d0f12;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 31px;
  line-height: 1;
}

.modal__type {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.modal__hero h2 {
  margin: 2px 0 0;
  font-size: 27px;
  font-weight: 600;
}

.modal__hero p {
  margin: 3px 0 0;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 19px 0 13px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.modal__stats > div {
  padding: 10px 12px;
  background: var(--panel-2);
}

.modal__stats span {
  display: block;
  color: var(--dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.modal__stats strong {
  display: block;
  margin-top: 1px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 13px;
}

.modal__note {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.modal__hint {
  padding: 11px 13px;
  background: rgba(255, 106, 43, 0.06);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.modal__hint span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal__hint p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

/* ── адаптив ── */
@media (max-width: 1220px) {
  .tips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head--row > div:first-child { max-width: 700px; }
}

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr); }
  .hero__title { font-size: clamp(2.8rem, 6.6vw, 4.8rem); }
  .bestiary-aside { width: 300px; }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero__copy { max-width: 700px; }
  .hero__panel { max-width: 620px; }

  .page-head--row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-head--row > div:first-child { max-width: 100%; }

  .side-note,
  .bestiary-aside,
  .damage-key,
  .armor-formula {
    width: 100%;
    max-width: 460px;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .feature__rune {
    justify-content: start;
    justify-self: start;
  }

  .explorer {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .explorer__rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .explorer__list {
    flex-direction: row;
    gap: 5px;
    max-height: none;
    padding: 7px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .rail-item {
    grid-template-columns: 30px minmax(0, 1fr);
    min-width: 176px;
    border-left-width: 2px;
  }

  .rail-item__hp {
    display: none;
  }

  .explorer__stage { min-height: 0; }

  .tl-item {
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 6px 16px;
  }

  .tl-item__resource {
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  .site-header { padding: 11px 16px; }

  .tabs {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    z-index: 70;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    margin: 0;
    padding: 7px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  .tabs.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .tab {
    justify-content: flex-start;
    padding: 12px 11px;
    font-size: 13px;
  }

  .tab .icon { font-size: 16px; }

  .header-meta { margin-left: auto; }
  .version-pill { display: none; }
  .menu-toggle { display: flex; }

  .biome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biome-grid .biome-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .creature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-head__note {
    max-width: none;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }

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

  .timeline { margin-left: 6px; }
}

@media (max-width: 720px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar__group { width: 100%; }
  .select { flex: 1 1 0; min-width: 0; }
  .search kbd { display: none; }

  .tips-grid { grid-template-columns: 1fr; }
  .armor-grid { grid-template-columns: 1fr; }

  .result-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .stage__stats { grid-template-columns: 1fr; }
  .stage__identity { gap: 13px; }
  .stage__icon { width: 64px; height: 64px; font-size: 31px; }

  .feature__rune span {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .feature__rune { grid-template-columns: repeat(3, 48px); }

  .tl-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }

  .tl-item__resource { grid-column: auto; }

  .footer__bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 620px) {
  .main {
    padding-top: 26px;
    padding-bottom: 64px;
  }

  .biome-grid { grid-template-columns: 1fr; }
  .biome-grid .biome-card:last-child:nth-child(odd) { grid-column: auto; }
  .creature-grid { grid-template-columns: 1fr; }
  .creature-card { padding: 15px; }

  .hero__title { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }

  .page-head h1 { font-size: clamp(2.25rem, 10.5vw, 3.2rem); }

  .explorer__stage { padding: 16px; }
  .stage__top { align-items: flex-start; }
  .stage__identity { align-items: flex-start; }

  .stage__footer { align-items: stretch; }
  .stage__nav { flex: 1 1 auto; }
  .stage-nav-btn { flex: 1 1 0; justify-content: center; }
  .stage__more { flex: 1 1 100%; justify-content: center; }

  .modal { padding: 10px; }
  .modal__panel { padding: 20px; max-height: 94vh; }
  .modal__hero { align-items: flex-start; }
  .modal__icon { width: 52px; height: 52px; font-size: 26px; }
  .modal h2 { font-size: 22px; }

  .footer__top { flex-direction: column; gap: 18px; }
}

@media (max-width: 430px) {
  .brand__text { font-size: 11px; }
  .brand__rune { width: 36px; height: 36px; font-size: 18px; }
  .tabs { top: 60px; }

  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 15px; }

  .bestiary-aside__rows { grid-template-columns: 1fr; }
  .bestiary-aside__mark { font-size: 60px; }

  .view-switch__btn { font-size: 8px; }
  .reset-btn { font-size: 8px; }

  .rail-item { min-width: 158px; }
  .stage__stats strong { font-size: 11px; }

  .modal__stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; }
}
