/* Игромета — тёмная тема, крупные поля, тир-таблицы. */
:root {
  --bg: #232746;
  --bg-deep: #151136;
  --bg-card: #2c274e;
  --bg-card-2: #322c5a;
  --line: #3a3170;
  --text: #ffffff;
  --muted: #b3b4d0;
  --accent: #8556da;
  --accent-2: #3173f9;
  --accent-soft: rgba(133, 86, 218, 0.16);
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;
  --gap: clamp(20px, 4vw, 40px);
  --section: clamp(40px, 7vw, 76px);
  --shadow: 0 18px 40px rgba(8, 5, 30, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(133, 86, 218, 0.22), transparent 60%),
    radial-gradient(800px 420px at 92% 0%, rgba(49, 115, 249, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: #c9b6ff; text-decoration: none; }
p a, li a, .sources a, .note a, .related a, .crumbs a {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(21, 17, 54, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 32px);
  min-height: 68px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-name { font-weight: 800; letter-spacing: -0.02em; font-size: 1.15rem; }

.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 999px;
  font-weight: 600; font-size: 0.94rem; white-space: nowrap;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.nav a.active { color: #fff; background: var(--accent-soft); }

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

.lang-switch { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.lang-current {
  color: #151136; background: var(--muted); font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.lang-switch a { color: var(--muted); font-weight: 600; }
.lang-switch a:hover { color: #fff; }

/* ---------- Typography ---------- */

h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 18px 0 20px;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 2.4em 0 0.7em;
  padding-left: 16px;
  border-left: 4px solid var(--accent);
}

h3 {
  font-size: 1.18rem;
  margin: 1.8em 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0.6em 0 1em; }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: #d9d9ec;
  max-width: 74ch;
  line-height: 1.7;
}

.kicker {
  display: inline-block; margin: 28px 0 0;
  color: var(--accent-2); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}

.page-meta {
  color: var(--muted); font-size: 0.86rem; margin: 0 0 6px;
}

.updated-note {
  color: var(--muted); font-size: 0.86rem; margin: 0 0 28px;
}

.crumbs {
  margin: 24px 0 0; color: var(--muted); font-size: 0.85rem;
}
.crumbs a { color: var(--muted); }

main > * + * { margin-top: 0; }

/* ---------- Cards ---------- */

.cards {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 28px 0 var(--section);
}

.game-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card-cover {
  display: flex; align-items: center; justify-content: center;
  height: 132px; position: relative; overflow: hidden;
}
.card-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 20% 0%, rgba(255, 255, 255, 0.22), transparent 55%);
}
.card-initial {
  font-size: 3.4rem; font-weight: 800; color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.04em;
}

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.card-text { color: var(--muted); font-size: 0.95rem; }
.card-foot { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.card-tag {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #d9cbff; background: var(--accent-soft);
  padding: 3px 8px; border-radius: 999px; font-weight: 700;
}
.card-meta { color: var(--muted); font-size: 0.82rem; }

/* ---------- Stats ---------- */

.game-stats { margin: 18px 0 6px; }
.game-stats-label {
  display: block; color: var(--muted); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px;
}
.stats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 26px 0 10px;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.stat-value {
  display: block; font-size: clamp(1rem, 3.4vw, 1.35rem); font-weight: 800;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stat-label { display: block; color: var(--muted); font-size: 0.8rem; }

/* ---------- Tier board ---------- */

.tierboard {
  display: flex; flex-direction: column; gap: 10px;
  margin: 28px 0 var(--section);
}

.tier-row {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.tier-label {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px;
  border-radius: var(--radius-sm);
  color: #151136; font-weight: 900; font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.tier-items {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  align-content: center;
}

.tier-items li {
  display: flex; flex-direction: column; justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 0;
}
.tier-items li:hover { background: rgba(255, 255, 255, 0.09); }
.ent { font-weight: 700; font-size: 0.95rem; }
.ent a { color: var(--text); }
.ent-note {
  color: var(--muted); font-size: 0.74rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tier-legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  color: var(--muted); font-size: 0.85rem; margin: -18px 0 32px;
}
.tier-legend span::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  border-radius: 3px; margin-right: 6px; background: var(--dot, #888);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0 30px;
  background: var(--bg-card);
}

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.94rem;
  min-width: 520px;
}
.data-table th, .data-table td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th {
  background: rgba(21, 17, 54, 0.55);
  color: var(--muted); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; position: sticky; top: 0;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.data-table a { color: #c9b6ff; }

.codes-table td:first-child { white-space: nowrap; }

.code-copy {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; color: var(--text);
  font: inherit;
}
.code-copy:hover { border-color: var(--accent); background: var(--accent-soft); }
.code-copy code { font-size: 0.95rem; letter-spacing: 0.02em; }
.copy-hint { color: var(--muted); font-size: 0.72rem; }
.code-copy.copied .copy-hint { color: #7ee2a8; }

/* ---------- Notes, lists ---------- */

.note {
  border-left: 4px solid var(--accent-2);
  background: rgba(49, 115, 249, 0.1);
  padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 22px 0; color: #e6e6f5; font-size: 0.95rem;
}

ul, ol { padding-left: 1.3em; margin: 0.6em 0 1.2em; }
li { margin: 0.35em 0; }

/* ---------- Figures ---------- */

.infographic, .article-image {
  margin: 30px 0; padding: 0;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.infographic img, .article-image img {
  display: block; width: 100%; height: auto;
}
.infographic figcaption, .article-image figcaption {
  padding: 12px 16px; color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

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

.faq { margin: var(--section) 0; }
.faq details {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 18px; margin: 10px 0;
}
.faq summary {
  cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 1.02rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: #dedeee; margin: 0 0 18px; }

/* ---------- Sources ---------- */

.sources {
  margin: var(--section) 0 0;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.sources h2 {
  border: 0; padding: 0; font-size: 1rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin: 0 0 12px;
}
.sources ul { list-style: none; padding: 0; margin: 0; }
.sources li { margin: 8px 0; font-size: 0.9rem; }
.sources a { color: #a9c4ff; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--section);
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
}
.footer-top {
  display: grid; gap: 28px;
  grid-template-columns: 1.4fr repeat(2, minmax(140px, 1fr));
}
.footer-brand p { color: var(--muted); font-size: 0.92rem; max-width: 34ch; }
.footer-logo { color: #fff; font-weight: 800; font-size: 1.1rem; }
.footer-col-title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0 0 12px; font-weight: 700;
}
.footer-col a { display: block; color: #cfd0e6; font-size: 0.92rem; margin: 7px 0; }
.footer-bottom {
  margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem;
}
.footer-legal a { color: var(--muted); }
.footer-copy { margin: 6px 0 0; }

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

.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 720px; margin: 0 auto;
  background: var(--bg-card-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.cookie-banner p { margin: 0 0 12px; font-size: 0.92rem; color: #e4e4f2; }
.cookie-banner p span[lang="en"] { display: none; }
html[lang="en"] .cookie-banner p span[lang="ru"] { display: none; }
html[lang="en"] .cookie-banner p span[lang="en"] { display: inline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-actions button {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 10px 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff;
}
.cookie-actions button.secondary {
  background: transparent; border-color: var(--line); color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 4px; row-gap: 2px; }
  .nav {
    order: 3; flex: 1 0 100%; width: 100%;
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    padding-bottom: 8px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .header-right { margin-left: auto; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .tier-row { grid-template-columns: 54px 1fr; padding: 10px; }
  .tier-label { min-height: 54px; font-size: 1.1rem; }
  .tier-items li { min-width: 0; padding: 6px 10px; }
  .card-initial { font-size: 2.6rem; }
  .game-stats { margin: 18px 0 6px; }
.game-stats-label {
  display: block; color: var(--muted); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px;
}
.stats { grid-template-columns: 1fr 1fr; }
  h2 { padding-left: 12px; }
  .data-table { min-width: 460px; }
}

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

/* ---------- Related ---------- */

.related {
  margin: var(--section) 0 0; padding: 26px 28px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.related h2 {
  margin: 0 0 14px; padding: 0; border: 0; font-size: 1.05rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 10px 0; }
.related a { font-weight: 700; }
.related span { display: block; color: var(--muted); font-size: 0.85rem; }
