/* Anime Adventures Гид — светлая «манга».
   Бумага + чернила + вермильон. Без внешних шрифтов и библиотек. */

:root {
  --paper: #fbf9f4;
  --paper-2: #f2ede3;
  --card: #ffffff;
  --ink: #17181c;
  --ink-2: #3a3d46;
  --muted: #5b5f6b;
  --line: #17181c;
  --line-soft: #ded8cb;
  --accent: #d1442f;
  --accent-dark: #a83222;
  --indigo: #2f4a7d;
  --tier-splus: #d1442f;
  --tier-s: #e2762b;
  --tier-a: #c9a227;
  --tier-b: #5f7f6a;
  --tier-c: #8a8f98;
  --tier-d: #b9bec6;
  --radius: 4px;
  --shadow: 6px 6px 0 rgba(23, 24, 28, .12);
  --wrap: 1060px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", "PT Serif", serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(23px, 3.2vw, 30px); margin-top: 1.9em; }
h3 { font-size: 20px; margin-top: 1.5em; }

p { margin: 0 0 1.05em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.35em; }
li { margin-bottom: .35em; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95em;
}

.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* ---------- Шапка ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}

.header-inner {
  display: flex; align-items: center; gap: 22px;
  min-height: 68px; padding-top: 8px; padding-bottom: 8px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo:hover { color: var(--ink); }

.logo img { width: 38px; height: 38px; }

.logo-name {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700; font-size: 19px; letter-spacing: -.01em;
}

.nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px;
  margin-left: auto;
}

.nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 8px 2px; border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--line-soft); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

.header-right { flex: none; display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.lang-current {
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 2px 8px; font-weight: 700; color: var(--ink); background: var(--card);
}
.lang-switch a { text-decoration: none; font-weight: 600; }

/* ---------- Основное ---------- */

main { padding: 30px 0 60px; }

.crumbs {
  font-size: 13px; color: var(--muted); margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-dark); }

.kicker {
  display: inline-block; margin: 0 0 12px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 2px;
}

.page-meta {
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0; margin: 0 0 26px;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}

.lead, p.lead {
  font-size: 19px; line-height: 1.55; color: var(--ink-2);
  border-left: 4px solid var(--indigo);
  padding-left: 16px; margin: 0 0 28px;
}

.updated-note {
  background: var(--paper-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 10px 14px; font-size: 14px;
  color: var(--ink-2); margin: 0 0 22px;
}

main > * + h2 { margin-top: 2em; }

/* ---------- Таблицы ---------- */

.table-wrap {
  overflow-x: auto; margin: 0 0 1.5em;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}

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

.data-table thead th {
  text-align: left; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink);
  background: var(--paper-2);
  border-bottom: 2px solid var(--line);
  padding: 10px 12px; white-space: nowrap;
}

.data-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fdf7ee; }
.data-table td:first-child { font-weight: 600; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table a { text-decoration: none; border-bottom: 1px solid rgba(209, 68, 47, .35); }

/* ---------- Тир-борд ---------- */

.tierboard { margin: 0 0 1.8em; display: grid; gap: 8px; }

.tier-row {
  display: grid; grid-template-columns: 68px 1fr; gap: 0;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
}

.tier-label {
  display: flex; align-items: center; justify-content: center;
  position: sticky; top: 76px; align-self: start; height: 100%;
  min-height: 56px;
  font-family: Georgia, serif; font-weight: 700; font-size: 22px;
  color: #fff; letter-spacing: .02em;
  border-right: 2px solid var(--line);
}

.tier-items {
  list-style: none; margin: 0; padding: 10px 12px;
  display: flex; flex-wrap: wrap; gap: 6px 10px;
}

.tier-items li {
  margin: 0; display: inline-flex; flex-direction: column;
  background: var(--paper-2); border: 1px solid var(--line-soft);
  border-radius: 3px; padding: 4px 9px; font-size: 14px; font-weight: 600;
}

.tier-items .ent-note {
  font-weight: 400; font-size: 11.5px; color: var(--muted); margin-top: 1px;
}

/* ---------- Карточки ---------- */

.cards {
  display: grid; gap: 16px; margin: 0 0 1.8em;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.game-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.game-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(23, 24, 28, .16);
  color: var(--ink);
}

.card-cover {
  display: flex; align-items: center; justify-content: center;
  height: 74px; border-bottom: 2px solid var(--line);
  background: var(--paper-2) !important;
}

.card-initial {
  font-family: Georgia, serif; font-size: 30px; font-weight: 700;
  color: var(--ink); opacity: .85;
}

.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.card-title { font-weight: 700; font-size: 17px; }
.card-text { font-size: 14px; color: var(--muted); }
.card-foot { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.card-tag, .card-meta {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 2px;
}
.card-tag { background: var(--ink); color: #fff; }
.card-meta { background: var(--paper-2); color: var(--ink-2); }

/* ---------- Статистика ---------- */

.stats {
  display: grid; gap: 1px; margin: 0 0 1.6em;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: var(--line); border: 2px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}

.stat { background: var(--card); padding: 14px 16px; }
.stat-value {
  display: block; font-family: Georgia, serif; font-size: 26px;
  font-weight: 700; line-height: 1.1;
}
.stat-label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-top: 4px;
}

.game-stats { margin: 0 0 1.6em; }
.game-stats-label {
  display: inline-block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--indigo); color: #fff; padding: 3px 9px;
  border-radius: 2px 2px 0 0;
}
.game-stats .stats { border-radius: 0 var(--radius) var(--radius) var(--radius); }

/* ---------- Коды ---------- */

.codes-table td:first-child { width: 42%; }

.code-copy {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  gap: 1px; background: var(--paper-2); border: 1.5px solid var(--line);
  border-radius: 3px; padding: 5px 10px; cursor: pointer;
  font: inherit; color: var(--ink);
}
.code-copy code { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.code-copy .copy-hint { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.code-copy:hover { background: #fdf7ee; }
.code-copy.copied { background: #e8f3ea; border-color: #2f6b3a; }

/* ---------- Заметки, источники, связанное ---------- */

.note {
  border-left: 4px solid var(--tier-a);
  background: #fdf6e6; padding: 12px 16px; margin: 0 0 1.5em;
  font-size: 15px; color: var(--ink-2);
}

section.sources {
  margin: 2.2em 0 0; padding-top: 14px;
  border-top: 1px dashed var(--line-soft);
  font-size: 14px; color: var(--muted);
}
section.sources h2 {
  font-family: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin: 0 0 8px;
}
section.sources ul { margin: 0; padding-left: 18px; }
section.sources a { color: var(--ink-2); }

section.related {
  margin: 2em 0 0; padding: 16px 18px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius);
}
section.related h2 {
  font-family: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  margin: 0 0 10px;
}
section.related ul { list-style: none; margin: 0; padding: 0; }
section.related li {
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
}
section.related li:last-child { border-bottom: 0; }
section.related a { font-weight: 700; text-decoration: none; }
section.related span { font-size: 13px; color: var(--muted); }

/* ---------- FAQ ---------- */

.faq { margin: 2.2em 0 0; }
.faq h2 { margin-top: 0; }

.faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 0;
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 16px;
  list-style: none; display: flex; gap: 10px; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; color: var(--accent); font-weight: 700; font-size: 20px;
  line-height: 1; flex: none;
}
.faq details[open] summary::before { content: "–"; }
.faq details p { margin: 8px 0 4px; color: var(--ink-2); }

/* ---------- Инфографика ---------- */

figure.infographic, figure.article-image {
  margin: 1.6em 0; border: 2px solid var(--line);
  border-radius: var(--radius); background: var(--card); overflow: hidden;
}
figure.infographic img, figure.article-image img { width: 100%; }
figure figcaption {
  font-size: 13px; color: var(--muted); padding: 8px 12px;
  border-top: 1px solid var(--line-soft); background: var(--paper-2);
}

/* ---------- Вкладки ---------- */

.tabs { margin: 0 0 1.6em; }

.tabs-nav {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 2px solid var(--line);
}

.tabs-nav button {
  font: inherit; font-size: 14px; font-weight: 700;
  background: var(--paper-2); color: var(--ink-2);
  border: 2px solid var(--line); border-bottom: 0; border-right: 0;
  border-radius: 4px 4px 0 0; padding: 8px 14px;
  cursor: pointer; margin-bottom: -2px;
}
.tabs-nav button:last-child { border-right: 2px solid var(--line); }
.tabs-nav button[aria-selected="true"] {
  background: var(--card); color: var(--ink);
  border-bottom: 2px solid var(--card); margin-bottom: -2px;
  box-shadow: inset 0 3px 0 var(--accent);
}
.tabs-nav button:hover { color: var(--ink); }

.tabs-pane { display: block; padding: 16px 2px 0; }
html.js .tabs-pane[hidden] { display: none; }

/* ---------- Таблица юнитов с фильтром ---------- */

.unit-table { margin: 0 0 1.6em; }

.unit-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 12px;
}

.unit-filters input[type="search"] {
  font: inherit; font-size: 14px; padding: 7px 10px;
  border: 1.5px solid var(--line); border-radius: 3px;
  background: var(--card); color: var(--ink); min-width: 200px;
}

.chip {
  font: inherit; font-size: 13px; font-weight: 600;
  background: var(--card); color: var(--ink-2);
  border: 1.5px solid var(--line-soft); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

.unit-count { font-size: 13px; color: var(--muted); margin-left: auto; }

.unit-table tbody tr[hidden] { display: none; }

.rarity-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle; background: var(--tier-c);
}

/* ---------- Подвал ---------- */

.site-footer {
  background: var(--paper-2);
  border-top: 2px solid var(--line);
  padding: 34px 0 26px; margin-top: 40px;
}

.footer-top {
  display: grid; gap: 26px;
  grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(160px, 1fr));
  padding-bottom: 22px; border-bottom: 1px solid var(--line-soft);
}

.footer-logo {
  font-family: Georgia, serif; font-size: 20px; font-weight: 700;
  color: var(--ink); text-decoration: none;
}
.footer-brand p { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

.footer-col { display: flex; flex-direction: column; gap: 7px; }
.footer-col-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink); margin-bottom: 2px;
}
.footer-col a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--accent-dark); text-decoration: underline; }

.footer-bottom { padding-top: 18px; font-size: 13px; color: var(--muted); }
.footer-bottom p { margin: 0 0 6px; }
.footer-legal a { color: var(--ink-2); }
.footer-copy { font-size: 12px; }

/* ---------- Cookie ---------- */

.cookie-banner {
  position: fixed; left: 18px; bottom: 18px; z-index: 120;
  max-width: 360px; background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 8px 8px 0 rgba(23, 24, 28, .18);
  padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.cookie-banner p { margin: 0 0 10px; }
.cookie-banner span[lang="en"] { display: none; }
.cookie-banner .cookie-actions { display: flex; gap: 10px; }

.cookie-banner button {
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 3px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--ink); color: #fff;
}
.cookie-banner button.secondary { background: var(--card); color: var(--ink); }
.cookie-banner button:hover { transform: translateY(-1px); }

/* ---------- Мелочи ---------- */

.page-meta span + span::before { content: "·"; margin-right: 8px; color: var(--line-soft); }

.error-page { text-align: center; padding: 60px 0; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 14px; }
  .nav a { font-size: 12.5px; }
  .header-right { margin-left: auto; }
  .tier-row { grid-template-columns: 52px 1fr; }
  .tier-label { font-size: 17px; }
  .lead { font-size: 17px; }
  main { padding-top: 20px; }
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; max-width: none; }
}

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
