/*
  Superec Games — вариант дизайна «showcase» (витрина), по мотивам apple.com.
  Что взято: светлый фон по умолчанию и чёрный в тёмной теме, один шрифт без декоративных,
  крупные короткие заголовки по центру, у каждой игры своя плитка с двумя кнопками-«таблетками»
  и большой картинкой, плитки во всю ширину и сеткой по две с узким зазором, горизонтальные
  ленты со стрелками, тонкая полупрозрачная шапка, мелкий серый подвал. Никаких градиентов и свечения.
*/
:root {
  --bg: #f0f0f3;
  --tile: #ffffff;
  --tile-2: #e8e8ed;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #dcdce1;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --link: #0066cc;
  --on-accent: #fff;
  --header-bg: rgb(255 255 255 / .88);
  /* плитка саги «Бу»: в светлой теме сиреневый туман, в тёмной ночная */
  --dark-tile: #f1ecff;
  --dark-line: #e2d9fb;
  --dark-text: #1d1d1f;
  --dark-muted: #6b6580;
  --saga-glow: #dccdff;
  --saga-ghost: rgb(100 70 200 / .16);
  --saga-nav: rgb(60 30 140 / .08);
  --saga-label: var(--link);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 28px rgb(0 0 0 / .06);
  --art-shadow: 0 10px 30px rgb(0 0 0 / .14);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --max: 1040px;
  --wide: 1240px;
  --gap: 16px;
  --radius: 28px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #000; --tile: #1c1c1e; --tile-2: #2c2c2e;
    --text: #f5f5f7; --muted: #98989d; --line: #333336;
    --link: #2997ff;
    --header-bg: rgb(22 22 24 / .88);
    --dark-tile: #120f1c; --dark-line: #2e2840;
    --dark-text: #f5f5f7; --dark-muted: #a1a1a6;
    --saga-glow: #2a1f4a; --saga-ghost: rgb(190 170 255 / .22); --saga-nav: rgb(255 255 255 / .14); --saga-label: #2997ff;
    --shadow: none;
    --art-shadow: 0 10px 30px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-scheme="dark"] {
  --bg: #000; --tile: #1c1c1e; --tile-2: #2c2c2e;
  --text: #f5f5f7; --muted: #98989d; --line: #333336;
  --link: #2997ff;
  --header-bg: rgb(22 22 24 / .88);
  --dark-tile: #120f1c; --dark-line: #2e2840;
  --dark-text: #f5f5f7; --dark-muted: #a1a1a6;
  --saga-glow: #2a1f4a; --saga-ghost: rgb(190 170 255 / .22); --saga-nav: rgb(255 255 255 / .14); --saga-label: #2997ff;
  --shadow: none;
  --art-shadow: 0 10px 30px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.47 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-weight: 600; line-height: 1.07; letter-spacing: -.028em; margin: 0 0 .3em; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.8rem); font-weight: 700; letter-spacing: -.035em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3 { font-size: 1.1rem; line-height: 1.25; letter-spacing: -.016em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.hl { color: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding-inline: 22px; }
.section { padding-block: 72px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.section-head p { margin: 8px 0 0; max-width: 560px; }
.eyebrow, .kicker { display: block; font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: -.01em; margin-bottom: 8px; }

/* ---------- Кнопки ---------- */
.btn, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px; border-radius: 980px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: 400 1.0625rem/1 var(--font); letter-spacing: -.01em; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover, .pill:hover { background: var(--accent-hover); }
.btn-ghost, .pill-line { background: transparent; color: var(--link); border-color: var(--link); }
.btn-ghost:hover, .pill-line:hover { background: var(--link); color: #fff; }
.pills { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.count { font-size: .85em; opacity: .8; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 20; height: 52px; border-bottom: 1px solid var(--line);
  background: var(--header-bg); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
}
.header .container { max-width: var(--max); height: 100%; }
.header-inner { display: flex; align-items: center; gap: 8px; height: 100%; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; }
.logo-mark { width: 24px; height: 24px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 6px 12px; text-decoration: none; color: var(--text); opacity: .8; font-size: .8rem; white-space: nowrap; transition: opacity .15s; }
.nav a:hover, .nav a.active { opacity: 1; }
.nav a.active { font-weight: 600; }
.theme-toggle { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); opacity: .8; cursor: pointer; border-radius: 50%; }
.theme-toggle:hover { opacity: 1; background: var(--tile); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
:root[data-scheme="dark"] .theme-toggle .sun { display: block; }
:root[data-scheme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-scheme="light"]) .theme-toggle .moon { display: none; }
}
@media (max-width: 640px) {
  .logo-text { display: none; }
  .nav .nav-contact { display: none; }
}

/* ---------- Плитки главной ---------- */
/* Каждая плитка — отдельная карточка с рамкой и скруглением на сером (или чёрном) фоне страницы */
.stile, .sgrid { width: calc(100% - 2 * var(--gap)); max-width: var(--wide); margin: 0 auto var(--gap); }
.stile {
  position: relative; overflow: hidden; text-align: center;
  background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 44px 40px;
  display: flex; flex-direction: column; align-items: center;
}
.stile .sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.3; color: var(--muted); max-width: 620px; margin: 0 auto; letter-spacing: -.015em; }
.stile .kicker { margin-bottom: 6px; }
.stile-art { display: block; width: 100%; margin-top: 28px; border-radius: 16px; overflow: hidden; box-shadow: var(--art-shadow); background: var(--tile-2); }
.stile-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.stile-art:hover img { transform: scale(1.03); }

/* Главная игра: текст слева, обложка справа целиком, весь блок помещается в первый экран */
.stile-hero { margin-top: var(--gap); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; text-align: left; padding: 48px; }
.stile-hero h1 { font-size: clamp(2.4rem, 4.6vw, 4rem); margin-bottom: .15em; }
.stile-hero .sub { margin: 0; }
.stile-hero .pills { justify-content: flex-start; margin-top: 24px; }
.stile-hero .stile-art { margin: 0; }

.stile-dark { background: var(--dark-tile); border-color: var(--dark-line); color: var(--dark-text); padding: 44px 0 32px; }
.stile-dark > :not(.srail-wrap) { padding-inline: 24px; }
.stile-dark .sub { color: var(--dark-muted); }
.stile-dark .kicker, .stile-dark .rcard-sub { color: var(--dark-muted); }
.stile-dark .srail-wrap { width: 100%; margin-top: 32px; text-align: left; }
.stile-dark .srail { padding-inline: 40px; scroll-padding-inline: 40px; }
.stile-dark .srail-nav { max-width: none; padding-inline: 40px; }
.stile-dark .srail-nav button { background: var(--saga-nav); color: var(--dark-text); }

.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.sgrid .stile { width: auto; max-width: none; margin: 0; padding: 40px 36px 36px; }
.sgrid .stile h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.sgrid .stile .sub { font-size: 1.02rem; }
.sgrid .stile-art { margin-top: 26px; }

@media (max-width: 900px) {
  .stile-hero { grid-template-columns: 1fr; gap: 28px; text-align: center; padding: 36px 24px 24px; }
  .stile-hero .pills { justify-content: center; }
  .stile-hero .stile-art { order: 2; }
}
@media (max-width: 760px) {
  :root { --gap: 12px; --radius: 22px; }
  .sgrid { grid-template-columns: 1fr; }
  .stile, .sgrid .stile { padding: 32px 20px 20px; }
  .stile-dark { padding: 32px 0 24px; }
  .stile-dark .srail { padding-inline: 20px; scroll-padding-inline: 20px; }
  .stile-dark .srail-nav { padding-inline: 20px; }
  .pills { gap: 10px; }
  .pill { min-height: 40px; padding: 9px 18px; font-size: 1rem; }
}

/* студия и мелкие плитки */
.stile-studio { justify-content: center; }
.stile-studio h2 { max-width: 520px; }
.stile-studio .sub { max-width: 520px; }
.facts { display: flex; justify-content: center; gap: 36px; margin: 28px 0 14px; padding: 0; flex-wrap: wrap; }
.facts div { min-width: 90px; }
.facts dt { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.facts dd { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.plat-line { color: var(--muted); font-size: .9rem; margin: 0; }
.sgrid .stile-stack { background: transparent; border: 0; box-shadow: none; padding: 0; gap: var(--gap); }
.mini-tile {
  position: relative; flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 24px; text-decoration: none; text-align: center; transition: border-color .2s;
}
a.mini-tile:hover { border-color: var(--link); }
.mini-tile b { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -.028em; }
.mini-tile > span { color: var(--muted); max-width: 380px; }
.mini-tile .cat .logo-mark { width: 56px; height: 56px; margin-bottom: 6px; transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
a.mini-tile:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.mini-tile i { font-style: normal; color: var(--link); font-size: 1.4rem; }

/* ---------- Горизонтальная лента ---------- */
.srail-wrap { position: relative; }
.srail {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 28vw, 340px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px max(22px, calc((100% - var(--max)) / 2 + 22px)) 8px;
  scroll-padding-inline: max(22px, calc((100% - var(--max)) / 2 + 22px));
}
.srail::-webkit-scrollbar { display: none; }
.rcard { scroll-snap-align: start; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.rcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin-bottom: 10px; background: var(--tile-2); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.rcard:hover img { transform: scale(1.03); }
.rcard-label { font-size: .75rem; font-weight: 600; color: var(--link); }
.stile-dark .rcard-label { color: var(--saga-label); }
.rcard b { font-size: 1.05rem; font-weight: 600; letter-spacing: -.016em; line-height: 1.25; }
.rcard-sub { font-size: .85rem; color: var(--muted); }
.srail-nav { display: flex; justify-content: flex-end; gap: 12px; max-width: var(--max); margin: 18px auto 0; padding-inline: 22px; }
.srail-nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tile-2); color: var(--text); font: 400 1.4rem/1 var(--font); display: grid; place-items: center; padding-bottom: 3px;
  transition: opacity .2s;
}
.srail-nav button:hover { opacity: .75; }
.sblock { width: calc(100% - 2 * var(--gap)); max-width: var(--wide); margin: 0 auto var(--gap); padding-block: 44px 36px; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sblock .container { max-width: none; padding-inline: 40px; }
.sblock .srail { padding-inline: 40px; scroll-padding-inline: 40px; }
.sblock .srail-nav { max-width: none; padding-inline: 40px; }
@media (max-width: 760px) { .sblock { padding-block: 32px 24px; } .sblock .container, .sblock .srail, .sblock .srail-nav { padding-inline: 20px; scroll-padding-inline: 20px; } }
.shead { font-size: clamp(1.8rem, 3.6vw, 2.8rem); margin-bottom: 28px; max-width: 760px; }
.shead span { color: var(--muted); }
.link-more { display: inline-block; margin-top: 20px; color: var(--link); text-decoration: none; font-size: 1.05rem; }
.link-more:hover { text-decoration: underline; }

/* ---------- Карточка игры (каталог, похожие игры, друзья) ---------- */
.grid { display: grid; gap: 36px 20px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; text-decoration: none; }
.card[hidden] { display: none; }
.card-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: var(--tile); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.card:hover .card-cover img { transform: scale(1.04); }
.sticker { position: absolute; top: 10px; left: 10px; background: var(--bg); color: var(--text); border-radius: 980px; padding: 3px 10px; font-size: .72rem; font-weight: 600; }
.age { position: absolute; top: 10px; right: 10px; background: rgb(0 0 0 / .55); backdrop-filter: blur(8px); color: #fff; border-radius: 980px; padding: 2px 8px; font-size: .72rem; font-weight: 600; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 2px 0; }
.card-body h3 { margin-bottom: 2px; }
.card-body p { font-size: .9rem; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.plats { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: auto; padding: 0; list-style: none; }
.plats li { font-size: .75rem; color: var(--muted); }
.plats li:not(:last-child)::after { content: '·'; margin-left: 10px; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 20px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail .card { scroll-snap-align: start; }

/* ---------- Кнопки площадок ---------- */
.pgroups { display: grid; gap: 18px; }
.pkind { font-size: .8rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.pbuttons { display: grid; gap: 1px; border-radius: 14px; overflow: hidden; background: var(--line); }
.pbuttons a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--tile-2); color: var(--text); text-decoration: none; font-weight: 500; transition: background .15s;
}
.pbuttons a::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.pbuttons a::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.pbuttons a:hover { background: var(--tile); }
.pbuttons small { font-weight: 400; color: var(--muted); font-size: .8rem; }

/* ---------- Каталог ---------- */
.page-head { padding-block: 56px 8px; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.filters { display: inline-flex; gap: 2px; padding: 3px; border-radius: 980px; background: var(--tile-2); flex-wrap: wrap; }
.filters button { font: 500 .9rem/1 var(--font); padding: 9px 16px; border-radius: 980px; cursor: pointer; border: 0; background: transparent; color: var(--text); }
.filters button.active { background: var(--tile); box-shadow: 0 1px 4px rgb(0 0 0 / .14); }

/* ---------- Страница игры ---------- */
.game-hero { position: relative; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); width: calc(100% - 2 * var(--gap)); max-width: var(--wide); margin: var(--gap) auto 0; overflow: hidden; }
.game-hero-bg { display: none; }
.game-hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 44px; }
.game-hero-inner > div:first-child { max-width: 760px; }
.game-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.game-hero .lead { font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.3; letter-spacing: -.02em; }
.game-hero-cover { width: min(100%, 720px); margin-top: 32px; border-radius: 16px; overflow: hidden; box-shadow: var(--art-shadow); }
.game-hero-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.back { display: inline-flex; gap: 6px; color: var(--link); text-decoration: none; font-size: .95rem; margin-bottom: 18px; }
.back:hover { text-decoration: underline; }
.tags { display: flex; gap: 6px 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
.tag { font-weight: 500; }
.tag-soon { color: #bf4800; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.game-aside { position: sticky; top: 76px; background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.game-aside h2 { font-size: 1.3rem; }
.game-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; font-size: .85rem; }
.game-legal a { color: var(--link); text-decoration: none; }
.video { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.shots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 28px; }
.shots a { border-radius: 14px; overflow: hidden; }
.shots img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-aside { position: static; }
}

.prose { max-width: 68ch; font-size: 1.06rem; }
.prose a { color: var(--link); }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .3em; }

/* ---------- Друзья ---------- */
.lead { font-size: 1.25rem; line-height: 1.35; }
.friend { margin-top: var(--gap); padding: 36px; border-radius: var(--radius); background: var(--tile); border: 1px solid var(--line); box-shadow: var(--shadow); }
.friend-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.friend-head .tag { color: var(--muted); font-size: .9rem; }
.friend-head h2 { margin: 6px 0 4px; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.friend-head h2 a { text-decoration: none; }
.friend-head p { margin: 0 0 8px; }
.friend-pages { display: flex; gap: 10px; flex-wrap: wrap; }
.card.mini .card-body { padding-top: 10px; }
.card.mini h3 { font-size: .95rem; margin: 0; }
@media (max-width: 720px) { .friend { padding: 24px 18px; } }

/* ---------- Соцсети ---------- */
.socials { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.socials a { color: var(--link); text-decoration: none; font-size: .95rem; }
.socials a:hover { text-decoration: underline; }
.socials.sm a { font-size: .85rem; }

/* ---------- Подвал ---------- */
.footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--tile); padding-block: 0 20px; font-size: .8rem; color: var(--muted); }
.cta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; padding-block: 56px 36px; border-bottom: 1px solid var(--line); }
.cta h2 { color: var(--text); font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 8px; }
.cta p { margin: 0; font-size: 1rem; }
.cta-mail { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mail { display: flex; align-items: center; gap: 12px; max-width: 100%; color: var(--text); font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600; letter-spacing: -.02em; user-select: all; overflow-wrap: anywhere; }
.copy { font: 400 .9rem/1 var(--font); background: transparent; color: var(--link); border: 1px solid var(--link); border-radius: 980px; padding: 7px 14px; cursor: pointer; flex: none; }
.copy:hover { background: var(--link); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding-top: 16px; }
.footer-bottom nav { display: flex; gap: 0; }
.footer-bottom nav a + a { border-left: 1px solid var(--line); }
.footer-bottom nav a { padding: 0 10px; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--text); text-decoration: underline; }
.langs { display: flex; gap: 12px; }
.langs a.active { color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; padding-top: 40px; } }

/* ---------- Появление ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
/* первый экран показывается сразу, без анимации появления: так страницы открываются мгновенно */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* шапка и подвал по ширине плиток */
.header .container, .footer .container { max-width: calc(var(--wide) + 44px); }

/* =====================================================================
   Характер: фирменный жёлтый кота, игривые заголовки, цветные плитки,
   наклоны и подпрыгивания при наведении, бегущая лента, призраки у саги.
   Структура остаётся «витринной», меняется настроение.
   ===================================================================== */
:root {
  --brand: #ffd23f; --ink: #141217;
  --tone-0: #fff3c4; --tone-1: #ffe1ec; --tone-2: #d8f6e8; --tone-3: #e7e1ff;
  --font-display: 'Rubik', 'Inter', system-ui, sans-serif;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) { --tone-0: #2a2410; --tone-1: #2b1520; --tone-2: #0f2a20; --tone-3: #1e1a38; }
}
:root[data-scheme="dark"] { --tone-0: #2a2410; --tone-1: #2b1520; --tone-2: #0f2a20; --tone-3: #1e1a38; }

h1, h2, .shead, .mini-tile b, .facts dt { font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em; }
.logo { font-family: var(--font-display); font-weight: 800; }
.logo-mark { transition: transform .4s var(--bounce); }
.logo:hover .logo-mark { transform: rotate(-12deg) scale(1.15); }

/* кнопки: жёлтая «таблетка» с пружинкой */
.pill, .btn { background: var(--brand); color: var(--ink); border: 0; font-weight: 600; transition: transform .35s var(--bounce), box-shadow .2s, background .2s; }
.pill:hover, .btn:hover { background: var(--brand); transform: translateY(-3px) rotate(-2deg); box-shadow: 0 8px 0 -2px color-mix(in srgb, var(--brand) 45%, #000); }
.pill:active, .btn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.pill-line, .btn-ghost { background: transparent; color: var(--text); border: 1.5px solid currentColor; }
.pill-line:hover, .btn-ghost:hover { background: var(--text); color: var(--bg); box-shadow: none; transform: translateY(-3px) rotate(2deg); }
.copy { color: var(--text); border-color: var(--text); }
.copy:hover { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.nav a:hover { color: var(--text); }
.nav a.active { background: var(--brand); color: var(--ink); opacity: 1; border-radius: 980px; }

/* главная игра: жёлтая плитка-наклейка с котом */
.stile-hero { background: var(--brand); border-color: transparent; color: var(--ink); overflow: visible; }
.stile-hero .sub { color: rgb(20 18 23 / .72); }
.stile-hero .kicker { display: inline-block; background: var(--ink); color: var(--brand); padding: 5px 12px; border-radius: 980px; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; }
.stile-hero .pill { background: var(--ink); color: #fff; }
.stile-hero .pill:hover { box-shadow: 0 8px 0 -2px rgb(0 0 0 / .25); }
.stile-hero .pill-line { background: transparent; color: var(--ink); }
.stile-hero .pill-line:hover { background: var(--ink); color: var(--brand); }
.mascot { display: block; width: 84px; height: 84px; margin-bottom: 14px; animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.mascot svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 0 rgb(0 0 0 / .12)); }
.mascot .pupil { transition: transform .12s linear; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.hero-art { position: relative; }
.stile-hero .stile-art { transform: rotate(2.5deg); box-shadow: 0 18px 40px -12px rgb(0 0 0 / .4); border: 4px solid var(--ink); transition: transform .5s var(--bounce); }
.stile-hero .stile-art:hover { transform: rotate(0) scale(1.02); }
.burst {
  position: absolute; top: -26px; right: -18px; width: 108px; height: 108px; display: grid; place-items: center; z-index: 2;
  background: #ff4f8b; color: #fff; font: 800 .95rem/1.05 var(--font-display); text-align: center; text-transform: uppercase;
  clip-path: polygon(50% 0, 61% 12%, 77% 6%, 80% 22%, 96% 25%, 90% 40%, 100% 52%, 89% 63%, 94% 79%, 78% 81%, 73% 97%, 59% 89%, 46% 100%, 37% 86%, 21% 93%, 19% 77%, 3% 72%, 10% 58%, 0 46%, 11% 36%, 6% 20%, 22% 18%, 27% 3%, 41% 11%);
  animation: spin 14s linear infinite;
}
.burst span { display: block; max-width: 70px; animation: spin 14s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .mascot { margin-inline: auto; width: 72px; height: 72px; } .burst { width: 84px; height: 84px; top: -18px; right: -8px; font-size: .78rem; } }

/* бегущая лента названий, чуть наискосок, как наклейка */
.sticker-band { width: calc(100% - 2 * var(--gap)); max-width: var(--wide); margin: 6px auto calc(var(--gap) + 6px); background: var(--ink); color: var(--brand); border-radius: 18px; overflow: hidden; transform: rotate(-1deg); }
:root[data-scheme="dark"] .sticker-band { background: var(--brand); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) .sticker-band { background: var(--brand); color: var(--ink); } }
.ticker-track { display: flex; width: max-content; animation: ticker 70s linear infinite; }
.ticker-track span { font: 800 1.1rem/1 var(--font-display); letter-spacing: -.01em; padding: 16px 0; white-space: nowrap; }
.ticker-track span::after { content: '✦'; margin: 0 20px; }
.sticker-band:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* сага: призраки и жутковатое мерцание */
.stile-dark { background: radial-gradient(700px 300px at 50% 0%, var(--saga-glow), transparent 70%), var(--dark-tile); }
.stile-dark h2 { animation: flicker 6s infinite; }
@keyframes flicker { 0%, 92%, 96%, 100% { opacity: 1; } 93%, 95% { opacity: .35; } 94% { opacity: .8; } }
.ghost { position: absolute; width: 44px; color: var(--saga-ghost); pointer-events: none; animation: float 7s ease-in-out infinite; }
.ghost.g1 { top: 28px; left: 7%; }
.ghost.g2 { top: 90px; right: 9%; width: 60px; animation-delay: -2s; animation-duration: 9s; }
.ghost.g3 { top: 190px; left: 16%; width: 30px; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(14px, -16px) rotate(6deg); } }
@media (max-width: 760px) { .ghost.g3 { display: none; } .ghost.g1 { left: 4%; } .ghost.g2 { right: 4%; top: 20px; } }

/* карточки в лентах: наклон при наведении */
.rcard img { transition: transform .45s var(--bounce), box-shadow .3s; }
.rcard:nth-child(odd):hover img { transform: rotate(-2.5deg) scale(1.04); box-shadow: 0 16px 30px -12px rgb(0 0 0 / .5); }
.rcard:nth-child(even):hover img { transform: rotate(2.5deg) scale(1.04); box-shadow: 0 16px 30px -12px rgb(0 0 0 / .5); }
.rcard-label { color: inherit; display: inline-block; width: fit-content; background: var(--brand); color: var(--ink) !important; padding: 2px 8px; border-radius: 980px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.srail-nav button { transition: transform .3s var(--bounce), background .2s; }
.srail-nav button:hover { background: var(--brand); color: var(--ink); transform: scale(1.12); opacity: 1; }

/* цветные плитки игр */
.tone { border-color: transparent; }
.tone-0 { background: var(--tone-0); } .tone-1 { background: var(--tone-1); } .tone-2 { background: var(--tone-2); } .tone-3 { background: var(--tone-3); }
.tone .sub { color: var(--text); opacity: .7; }
.sgrid .stile-art { transition: transform .5s var(--bounce), box-shadow .3s; }
.sgrid .tone:nth-child(odd) .stile-art:hover { transform: rotate(-1.5deg) translateY(-6px); }
.sgrid .tone:nth-child(even) .stile-art:hover { transform: rotate(1.5deg) translateY(-6px); }
.stile-art:hover img { transform: none; }

/* студия: цифры с маркером */
.facts dt { background: linear-gradient(transparent 62%, var(--brand) 62%, var(--brand) 92%, transparent 92%); padding: 0 4px; display: inline-block; }
:root[data-scheme="dark"] .facts dt { color: var(--brand); background: none; }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) .facts dt { color: var(--brand); background: none; } }
a.mini-tile:hover { border-color: var(--brand); }
a.mini-tile:hover .logo-mark { animation: wiggle .5s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-10deg) scale(1.1); } 50% { transform: rotate(10deg) scale(1.1); } }
.mini-tile i { color: var(--text); }

/* каталог и прочие страницы: тот же характер */
.card .card-cover { transition: transform .45s var(--bounce), box-shadow .3s; }
.card:nth-child(odd):hover .card-cover { transform: rotate(-1.5deg) translateY(-4px); box-shadow: 0 14px 28px -12px rgb(0 0 0 / .35); }
.card:nth-child(even):hover .card-cover { transform: rotate(1.5deg) translateY(-4px); box-shadow: 0 14px 28px -12px rgb(0 0 0 / .35); }
.card:hover .card-cover img { transform: none; }
.sticker { background: var(--brand); color: var(--ink); }
.filters button.active { background: var(--brand); color: var(--ink); box-shadow: none; }
.game-hero { background: var(--brand); border-color: transparent; color: var(--ink); }
.game-hero .lead, .game-hero .tags { color: rgb(20 18 23 / .72); }
.game-hero .back { color: var(--ink); font-weight: 600; }
.game-hero-cover { border: 4px solid var(--ink); transform: rotate(-1.5deg); transition: transform .5s var(--bounce); }
.game-hero-cover:hover { transform: rotate(0) scale(1.02); }
.pbuttons a { transition: background .15s, padding .25s var(--bounce); }
.pbuttons a:hover { padding-left: 22px; background: var(--tone-0); }
.friend:nth-of-type(4n+1) { background: var(--tone-0); } .friend:nth-of-type(4n+2) { background: var(--tone-1); }
.friend:nth-of-type(4n+3) { background: var(--tone-2); } .friend:nth-of-type(4n+4) { background: var(--tone-3); }
.friend { border-color: transparent; }

/* появление при прокрутке (только когда работает скрипт) */
.reveal.pending { opacity: 0; transform: translateY(24px); }
.reveal.shown { transition: opacity .45s ease, transform .5s var(--bounce); }
.sgrid .reveal.shown:nth-child(2) { transition-delay: .06s; }

/* смена темы — мгновенно, без плавных переходов цвета */
.switching *, .switching *::before, .switching *::after { transition: none !important; }

/* значки площадок и соцсетей */
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.socials a { display: inline-flex; align-items: center; gap: 7px; }
.pbuttons a.has-ico::before { display: none; }
.pbuttons a.has-ico .ico { width: 26px; height: 26px; }
.socials { --ico-cut: var(--bg); }
.footer .socials, .mini-tile .socials { --ico-cut: var(--tile); }
.footer .socials { gap: 8px; margin-top: 4px; }
.footer .socials a { padding: 8px 14px 8px 11px; border: 1.5px solid var(--line); border-radius: 980px; color: var(--text); font-weight: 500; transition: transform .3s var(--bounce), background .2s, border-color .2s; }
.footer .socials a:hover { text-decoration: none; background: var(--brand); border-color: var(--brand); color: var(--ink); --ico-cut: var(--brand); transform: translateY(-2px) rotate(-2deg); }
.footer .socials .ico { width: 1.3em; height: 1.3em; }

/* ---------- Пара игр: компактные плитки, картинка слева, текст справа ---------- */
.sgrid .stile-pair { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; align-items: center; padding: 16px; text-align: left; }
.sgrid .stile-pair .stile-art { margin: 0; }
.stile-pair .pair-body { padding: 0; }
.sgrid .stile-pair h2 { font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.15; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sgrid .stile-pair .sub { font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sgrid .stile-pair .pills { justify-content: flex-start; margin-top: 14px; gap: 10px; }
.sgrid .stile-pair .pill { min-height: 38px; padding: 8px 16px; font-size: .95rem; }
@media (max-width: 560px) {
  .sgrid .stile-pair { grid-template-columns: 1fr; gap: 0; }
  .stile-pair .pair-body { padding: 14px 4px 4px; }
}

/* Плитки появляются только прозрачностью, без сдвига и без задержки — ничего не «едет» */
.reveal.pending { transform: none; }
.reveal.shown { transition: opacity .35s ease; }
.sgrid .reveal.shown:nth-child(2) { transition-delay: 0s; }
.sgrid .tone:nth-child(odd) .stile-art:hover, .sgrid .tone:nth-child(even) .stile-art:hover { transform: translateY(-4px); }
.ico-tile { border-radius: 27%; object-fit: cover; }

/* Официальные описания из сторов бывают длинными: в карточках показываем две строки */
.card-body p, .rcard-sub, .stile-hero .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 404: «страница испугалась и убежала» ---------- */
[data-l] { display: none; }
html:not([data-nf]) [data-l="en"], html[data-nf="en"] [data-l="en"], html[data-nf="ru"] [data-l="ru"] { display: revert; }
.nf { margin-top: var(--gap); min-height: min(72vh, 640px); justify-content: center; padding: 64px 24px; }
.nf-code { display: flex; align-items: center; gap: clamp(8px, 2vw, 20px); font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 22vw, 12rem); line-height: 1; letter-spacing: -.04em; margin-bottom: 18px; }
.nf-code > span:not(.nf-cat) { display: inline-block; animation: nf-shiver 4s ease-in-out infinite; }
.nf-code > span:last-child { animation-delay: -1.3s; }
.nf .nf-cat { width: clamp(5.5rem, 19vw, 10.5rem); height: clamp(5.5rem, 19vw, 10.5rem); margin: 0; animation: nf-peek 3.6s ease-in-out infinite; }
.nf h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0 0 .3em; animation: flicker 6s infinite; }
.nf .sub { max-width: 560px; }
.nf .pills { margin-top: 26px; }
.nf .pill:not([data-l]) { display: inline-flex; }
@keyframes nf-shiver { 0%, 86%, 100% { transform: none; } 88% { transform: translate(-3px, 1px) rotate(-3deg); } 90% { transform: translate(3px, -1px) rotate(3deg); } 92% { transform: translate(-2px, 0) rotate(-1deg); } }
@keyframes nf-peek { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .nf-code > span, .nf .nf-cat, .nf h1 { animation: none; } }
.nf .ghost { width: 64px; }
.nf .ghost.g1 { top: 12%; left: 8%; }
.nf .ghost.g2 { top: 18%; right: 9%; width: 84px; }
.nf .ghost.g3 { top: auto; bottom: 14%; left: 14%; width: 46px; }
.nf { --saga-ghost: rgb(120 90 220 / .35); }
@media (prefers-color-scheme: dark) { :root:not([data-scheme="light"]) .nf { --saga-ghost: rgb(190 170 255 / .35); } }
:root[data-scheme="dark"] .nf { --saga-ghost: rgb(190 170 255 / .35); }
