/*
 * Golden Crown — шаблон casino-sidebar («лобби»-приложение: боковое меню + сайдбар).
 * Все цвета только через CSS-переменные темы (--c-*), их печатает includes/head.php
 * из config/site.php → theme. Схема (dark/light) — атрибут data-scheme на <html>.
 *
 * Раскладка:
 *   ≥1280px — боковое меню (подписи) | контент | правый сайдбар;
 *   768–1279 — узкая полоса иконок | контент, сайдбар под контентом;
 *   <768 — меню выезжает по бургеру.
 * Блоки внутри колонки контента подстраиваются под её ширину (container queries),
 * поэтому одинаково ведут себя в колонке, в сайдбаре и в редакторе.
 */

/* ---------- Tokens ---------- */
:root {
    --c-accent-soft: color-mix(in srgb, var(--c-accent) 14%, transparent);
    --c-accent-line: color-mix(in srgb, var(--c-accent) 45%, transparent);
    --c-accent2-soft: color-mix(in srgb, var(--c-accent-2) 16%, transparent);
    --c-hover: color-mix(in srgb, var(--c-text) 6%, transparent);
    --c-line: color-mix(in srgb, var(--c-border) 88%, transparent);
    --c-chip: color-mix(in srgb, var(--c-text) 6%, transparent);
    --c-overlay: color-mix(in srgb, var(--c-bg) 70%, transparent);
    --c-logo-plate: var(--c-bg);
    --radius-sm: max(6px, calc(var(--radius) - 4px));
    --radius-lg: calc(var(--radius) + 6px);
    --side-w: 252px;
    --rail-w: 76px;
    --aside-w: 318px;
    --top-h: 60px;
    --pad: clamp(16px, 2.2vw, 32px);
    --page-max: 1480px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --shadow: 0 1px 3px rgb(0 0 0 / .2);
    --shadow-pop: 0 4px 12px rgb(0 0 0 / .3);
    color-scheme: dark;
}

html[data-scheme="light"] {
    --c-hover: color-mix(in srgb, var(--c-text) 5%, transparent);
    --c-chip: color-mix(in srgb, var(--c-text) 5%, transparent);
    --c-overlay: color-mix(in srgb, var(--c-text) 45%, transparent);
    --c-logo-plate: var(--c-text);
    --shadow: 0 1px 3px rgb(0 0 0 / .1);
    --shadow-pop: 0 4px 12px rgb(0 0 0 / .14);
    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--top-h) + 16px);
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
}

p { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { flex: none; }
button { font: inherit; color: inherit; }

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

.icon { width: 20px; height: 20px; }

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-weight: 700;
    transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

/* ---------- Buttons ---------- */
.btn {
    --btn-pad: .68rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: var(--btn-pad);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn--primary { background: var(--c-accent); color: var(--c-accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--c-accent) 86%, var(--c-text)); }

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

.btn--soft { border-color: var(--c-line); background: var(--c-surface-2); color: var(--c-text); }
.btn--soft:hover { border-color: var(--c-accent-line); }

.btn--sm { --btn-pad: .5rem .85rem; font-size: .875rem; }
.btn--lg { --btn-pad: .85rem 1.35rem; font-size: 1rem; }
.btn--block { width: 100%; white-space: normal; text-align: center; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--c-chip);
    color: var(--c-muted);
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
}

.eyebrow {
    display: inline-block;
    color: var(--c-accent);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.age-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--c-danger);
    border-radius: 50%;
    color: var(--c-text);
    font-size: .7rem;
    font-weight: 800;
}

.age-mark--lg { width: 38px; height: 38px; font-size: .82rem; }

/* ---------- Stars ---------- */
.stars { position: relative; display: inline-flex; vertical-align: middle; line-height: 0; }
.stars__base, .stars__fill { display: flex; gap: 2px; }
.stars__base { color: var(--c-border); }
.stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--c-accent); }
.stars svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- App shell ---------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    min-height: 100vh;
}

.app-frame {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---------- Side navigation ---------- */
.side-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100vh;
    height: 100dvh;
    padding: 16px 14px 18px;
    border-right: 1px solid var(--c-line);
    background: var(--c-surface);
    overflow-y: auto;
    scrollbar-width: thin;
}

.side-nav__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding-inline: 4px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--c-text);
    text-decoration: none;
}

.brand-link:hover { text-decoration: none; }
.brand-link__mark { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: contain; }
.brand-link__text {
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.brand-link__wordmark { display: block; width: auto; height: 40px; max-width: 196px; object-fit: contain; object-position: left center; }
.side-nav .brand-link--wordmark .brand-link__mark { display: none; }

.side-nav__close {
    display: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.side-nav__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.side-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: var(--c-muted);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s var(--ease), color .15s var(--ease);
}

.side-nav__link:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }

.side-nav__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--c-chip);
    transition: background-color .15s var(--ease), color .15s var(--ease);
}

.side-nav__icon .icon { width: 19px; height: 19px; }
.side-nav__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-nav__link.is-current { background: var(--c-accent-soft); color: var(--c-text); }
.side-nav__link.is-current .side-nav__icon { background: var(--c-accent); color: var(--c-accent-ink); }

.side-nav__foot { display: grid; gap: 14px; margin-top: auto; }
.side-nav__actions { display: grid; gap: 8px; }

.side-nav__note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-inline: 4px;
    color: var(--c-muted);
    font-size: .8rem;
}

.side-nav-backdrop { display: none; }

/* ---------- Top bar ---------- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--top-h);
    padding: 0 var(--pad);
    border-bottom: 1px solid var(--c-line);
    background: var(--c-bg);
    transition: box-shadow .2s var(--ease);
}

.top-bar.is-scrolled { box-shadow: var(--shadow); }

.top-bar__burger {
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: -6px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.top-bar__burger .icon { width: 24px; height: 24px; }
.top-bar__burger:hover { background: var(--c-hover); }

.brand-link--top { display: none; }
.brand-link--top .brand-link__mark { width: 32px; height: 32px; }
.brand-link--top .brand-link__wordmark { height: 34px; max-width: 160px; }

.top-bar__search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(340px, 40%);
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-muted);
    font-size: .9rem;
    text-decoration: none;
}

.top-bar__search:hover { border-color: var(--c-accent-line); color: var(--c-text); text-decoration: none; }
.top-bar__search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.top-bar__promo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-left: auto;
    padding: 5px 14px 5px 5px;
    border: 1px solid var(--c-accent-line);
    border-radius: 999px;
    background: var(--c-accent-soft);
    color: var(--c-text);
    font-size: .875rem;
    text-decoration: none;
}

.top-bar__promo:hover { text-decoration: none; background: color-mix(in srgb, var(--c-accent) 22%, transparent); }

.top-bar__promo-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.top-bar__promo-icon .icon { width: 17px; height: 17px; }
.top-bar__promo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar__promo-text > span { color: var(--c-muted); }

.top-bar__actions { display: none; align-items: center; gap: 8px; margin-left: auto; }
.top-bar__promo + .top-bar__actions { margin-left: 0; }

/* ---------- Main & columns ---------- */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--page-max);
    margin-inline: auto;
    padding: 14px var(--pad) 8px;
    container: page / inline-size;
}

.crumbs { margin-bottom: 10px; color: var(--c-muted); font-size: .82rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--c-border); }
.crumbs a { color: var(--c-muted); }
.crumbs a:hover { color: var(--c-text); }

.page-cols__main { min-width: 0; container: content / inline-size; }

/* ---------- Sections ---------- */
.block-sec { padding-block: clamp(14px, 1.8vw, 24px); }
.block-sec--tight { padding-block: clamp(8px, 1.2vw, 14px); }

.section-head { display: grid; gap: 6px; margin-bottom: 16px; }
.section-head__title { font-size: clamp(1.35rem, 1.05rem + 1vw, 1.75rem); }
.section-head__intro { max-width: 68ch; color: var(--c-muted); }

.rail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 20px;
    margin-bottom: 16px;
}

.rail-head .section-head { margin-bottom: 0; }

.rail-head__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 2px;
    font-size: .9rem;
    font-weight: 700;
    white-space: nowrap;
}

.rail-head__link .icon { width: 17px; height: 17px; }

.block-foot { display: flex; justify-content: flex-start; margin-top: 18px; }

/* ---------- Hero (лобби) ---------- */
.b-hero { padding-block: 4px 14px; }

.b-hero__panel {
    position: relative;
    display: grid;
    grid-template-areas: "text";
    gap: 22px 32px;
    align-items: center;
    padding: clamp(20px, 3vw, 36px);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c-accent) 12%, transparent) 0%, transparent 55%),
        radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--c-accent-2) 14%, transparent) 0%, transparent 60%),
        var(--c-surface);
    overflow: hidden;
}

.b-hero__text { grid-area: text; display: grid; gap: 14px; justify-items: start; min-width: 0; }

.b-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    background: var(--c-chip);
    color: var(--c-muted);
    font-size: .8rem;
    font-weight: 600;
}

.b-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-success);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-success) 22%, transparent);
}

/* Один размер H1 на всех страницах (и в compact) */
.b-hero__title {
    max-width: 22ch;
    font-size: clamp(1.9rem, 1.35rem + 1.9vw, 2.75rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.b-hero__subtitle { max-width: 60ch; color: var(--c-muted); font-size: 1.04rem; }

.b-hero__rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--c-muted); font-size: .9rem; }
.b-hero__rating strong { color: var(--c-text); }
.b-hero__buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.b-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.b-hero__badges li {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 9px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--c-bg) 40%, transparent);
    color: var(--c-muted);
    font-size: .84rem;
    font-weight: 500;
    white-space: nowrap;
}

.b-hero__badges .icon { width: 16px; height: 16px; color: var(--c-accent); }

/* Купон бонуса */
.coupon {
    grid-area: coupon;
    display: grid;
    min-width: 0;
    border: 1px solid var(--c-accent-line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--c-bg) 72%, var(--c-surface));
    box-shadow: var(--shadow);
}

.coupon__main { display: grid; gap: 4px; justify-items: start; padding: 20px 22px 18px; }

.coupon__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--c-accent-soft);
    color: var(--c-accent);
}

.coupon__icon .icon { width: 22px; height: 22px; }

.coupon__label { color: var(--c-muted); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.coupon__value {
    font-family: var(--font-heading);
    font-size: clamp(1.45rem, 1.1rem + 1.1vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
}

.coupon__note { color: var(--c-muted); font-size: .84rem; }

.coupon__action {
    display: grid;
    align-items: center;
    padding: 16px 22px 20px;
    border-top: 1.5px dashed var(--c-accent-line);
}

.b-hero:not(.b-hero--plain):not(.b-hero--lobby) .b-hero__panel {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    grid-template-areas: "text coupon";
}

/* Главная: текст + купон слева, мозаика игр справа */
.b-hero--lobby .b-hero__panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas: "text mosaic" "coupon coupon";
}

.b-hero--lobby .coupon { grid-template-columns: minmax(0, 1fr) auto; }
.b-hero--lobby .coupon__main { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; }
.b-hero--lobby .coupon__icon { grid-row: span 3; margin: 0; width: 52px; height: 52px; }
.b-hero--lobby .coupon__action { border-top: 0; border-left: 1.5px dashed var(--c-accent-line); padding: 20px 26px; }

/* Мозаика обложек: одна крупная 2×2 и четыре малых, все квадратные */
.mosaic {
    grid-area: mosaic;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-self: center;
}

.mosaic__tile {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c-accent) 30%, transparent), transparent 60%),
        linear-gradient(140deg, var(--c-surface-2), color-mix(in srgb, var(--c-accent-2) 30%, var(--c-surface-2)));
    color: var(--c-text);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow);
}

.mosaic__tile:hover { text-decoration: none; }
.mosaic__tile:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.mosaic__tile:hover img { transform: scale(1.04); }
.mosaic__glyph .icon { width: 34px; height: 34px; opacity: .55; }
.mosaic__tile:first-child .mosaic__glyph .icon { width: 64px; height: 64px; }
.mosaic__mono { position: absolute; right: 10px; bottom: 8px; font-family: var(--font-heading); font-weight: 800; opacity: .4; }

.mosaic__name {
    position: absolute;
    inset: auto 0 0;
    display: none;
    padding: 28px 14px 12px;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c-bg) 85%, transparent));
    font-family: var(--font-heading);
    font-weight: 700;
}

.mosaic__tile:first-child .mosaic__name { display: block; }

/* 404 и подобные: всё по центру, без купона */
.b-hero--center .b-hero__panel { justify-items: center; padding-block: clamp(32px, 6vw, 72px); text-align: center; }
.b-hero--center .b-hero__text { justify-items: center; max-width: 720px; }
.b-hero--center .b-hero__title,
.b-hero--center .b-hero__subtitle { margin-inline: auto; }
.b-hero--center .b-hero__buttons,
.b-hero--center .b-hero__badges,
.b-hero--center .b-hero__rating { justify-content: center; }

@container page (max-width: 900px) {
    .b-hero--lobby .b-hero__panel,
    .b-hero:not(.b-hero--plain):not(.b-hero--lobby) .b-hero__panel {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "text" "coupon" "mosaic";
    }

    .b-hero--lobby .coupon,
    .b-hero--lobby .coupon__main { grid-template-columns: minmax(0, 1fr); }
    .b-hero--lobby .coupon__icon { grid-row: auto; margin-bottom: 8px; width: 42px; height: 42px; }
    .b-hero--lobby .coupon__action { border-left: 0; border-top: 1.5px dashed var(--c-accent-line); padding: 16px 22px 20px; }

    /* Мозаика — лента обложек */
    .mosaic {
        display: flex;
        gap: 10px;
        margin-inline: calc(clamp(20px, 3vw, 36px) * -1);
        padding-inline: clamp(20px, 3vw, 36px);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mosaic::-webkit-scrollbar { display: none; }
    .mosaic__tile, .mosaic__tile:first-child { flex: none; width: 104px; }
    .mosaic__tile:first-child .mosaic__name { display: none; }
    .mosaic__tile:first-child .mosaic__glyph .icon { width: 34px; height: 34px; }
}

@container page (max-width: 560px) {
    /* Бейджи — одной строкой с горизонтальной прокруткой */
    .b-hero__badges {
        flex-wrap: nowrap;
        width: calc(100% + 2 * clamp(20px, 3vw, 36px));
        max-width: none;
        margin-inline: calc(clamp(20px, 3vw, 36px) * -1);
        padding-inline: clamp(20px, 3vw, 36px);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .b-hero__badges::-webkit-scrollbar { display: none; }
    .b-hero--center .b-hero__badges { justify-content: flex-start; }
    .b-hero__buttons { width: 100%; }
    .b-hero__buttons .btn { flex: 1 1 auto; }
}

/* ---------- Article (rich-text) ---------- */
.article__title { font-size: clamp(1.35rem, 1.05rem + 1vw, 1.75rem); }
.article__title + .article__body { margin-top: 12px; }

.prose, .rt__html { color: var(--c-text); font-size: 1.02rem; line-height: 1.7; }
.rt__html > * + * { margin-top: 1em; }
.rt__html > :first-child { margin-top: 0; }
.prose > * + * { margin-top: .9em; }
.prose > :first-child { margin-top: 0; }
.rt__html h3, .prose h3 { margin-top: 1.5em; font-size: 1.18rem; }
.rt__html h2, .prose h2 { margin-top: 1.6em; font-size: 1.4rem; }
.rt__html ul, .rt__html ol, .prose ul, .prose ol { padding-left: 1.3em; }
.rt__html li + li, .prose li + li { margin-top: .4em; }
.rt__html ul li::marker, .prose ul li::marker { color: var(--c-accent); }
.rt__html a, .prose a { text-decoration: underline; text-decoration-color: var(--c-accent-line); text-underline-offset: 3px; }
.rt__html strong, .prose strong { color: var(--c-text); }
.rt__html blockquote { margin-inline: 0; padding: 12px 18px; border-left: 3px solid var(--c-accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--c-surface); color: var(--c-muted); }
.rt__html table { display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .94rem; }
.rt__html th, .rt__html td { padding: .65rem .85rem; border-bottom: 1px solid var(--c-line); text-align: left; }
.rt__html th { background: var(--c-surface); }

/* Иллюстрация раздела — по центру, целиком (без обрезки) */
.rt__figure { max-width: 820px; margin: 1.5em auto; }
.rt__html > .rt__figure { margin-top: 1.5em; margin-bottom: 1.5em; }
.rt__html > .rt__figure:first-child { margin-top: .2em; }
.rt__figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

/* ---------- TOC ---------- */
.toc-box {
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.toc-box__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    list-style: none;
    cursor: pointer;
}

.toc-box__head::-webkit-details-marker { display: none; }

.toc-box__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--c-accent-soft);
    color: var(--c-accent);
}

.toc-box__icon .icon { width: 18px; height: 18px; }
.toc-box__title { flex: 1; font-family: var(--font-heading); font-weight: 700; }
.toc-box__count { padding: 2px 9px; border-radius: 999px; background: var(--c-chip); color: var(--c-muted); font-size: .78rem; font-weight: 700; }
.toc-box__chevron { display: grid; color: var(--c-muted); transition: transform .2s var(--ease); }
.toc-box[open] .toc-box__chevron { transform: rotate(180deg); }

.toc-box__nav { padding: 0 10px 12px; }

.toc-box__list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--c-line);
    counter-reset: toc;
    list-style: none;
}

.toc-box__list a {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--c-muted);
    font-size: .92rem;
    line-height: 1.4;
    counter-increment: toc;
}

.toc-box__list a::before { content: counter(toc, decimal-leading-zero); min-width: 2ch; color: var(--c-border); font-weight: 700; font-variant-numeric: tabular-nums; }
.toc-box__list a:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }
.toc-box__list a.is-active { background: var(--c-accent-soft); color: var(--c-text); }
.toc-box__list a.is-active::before { color: var(--c-accent); }

@container content (min-width: 700px) {
    .toc-box__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
}

/* ---------- Quick info ---------- */
.fact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    overflow: hidden;
}

.fact-grid__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--c-line);
}

.fact-grid__item:last-child { border-bottom: 0; }
.fact-grid dt { color: var(--c-muted); font-size: .88rem; }
.fact-grid dd { margin: 0; font-weight: 700; text-align: right; }

@container (min-width: 520px) {
    .fact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        border: 0;
        background: transparent;
    }

    .fact-grid__item {
        flex-direction: column;
        gap: 4px;
        padding: 14px 16px;
        border: 1px solid var(--c-line);
        border-radius: var(--radius);
        background: var(--c-surface);
    }

    .fact-grid__item:last-child { border-bottom: 1px solid var(--c-line); }
    .fact-grid dt { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
    .fact-grid dd { font-family: var(--font-heading); font-size: 1.08rem; text-align: left; }
}

@container (min-width: 760px) {
    .fact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Games grid ---------- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@container (min-width: 480px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 660px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 980px) { .game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.game-tile { display: flex; flex-direction: column; min-width: 0; color: var(--c-text); text-decoration: none; }
.game-tile:hover { text-decoration: none; }

.game-tile__cover {
    --play: clamp(50px, 36%, 76px);
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    background: var(--c-surface-2);
    overflow: hidden;
}

.game-tile__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.game-tile__cover--blank {
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c-accent) 26%, transparent), transparent 60%),
        linear-gradient(150deg, var(--c-surface-2), color-mix(in srgb, var(--c-accent-2) 28%, var(--c-surface-2)));
}

.game-tile__glyph .icon { width: 38%; height: auto; min-width: 34px; opacity: .55; }
.game-tile__glyph { display: grid; place-items: center; width: 100%; }
.game-tile__mono { position: absolute; right: 10px; bottom: 8px; font-family: var(--font-heading); font-weight: 800; opacity: .4; }

.game-tile__tag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Наведение: затемнение и крупная круглая кнопка ровно по центру обложки */
.game-tile__hover {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--c-bg) 62%, transparent);
    opacity: 0;
    transition: opacity .2s var(--ease);
}

.game-tile__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: var(--play);
    height: var(--play);
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    transform: translate(-50%, -50%) scale(.82);
    transition: transform .25s var(--ease);
}

.game-tile__play .icon { width: 46%; height: 46%; }

.game-tile__label {
    position: absolute;
    top: calc(50% + var(--play) / 2 + 8px);
    left: 0;
    right: 0;
    color: var(--c-text);
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
}

.game-tile:hover .game-tile__hover,
.game-tile:focus-visible .game-tile__hover { opacity: 1; }

.game-tile:hover .game-tile__play,
.game-tile:focus-visible .game-tile__play { transform: translate(-50%, -50%) scale(1); }

.game-tile__name {
    margin-top: 8px;
    overflow: hidden;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-tile__provider { overflow: hidden; color: var(--c-muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }

@media (hover: none) {
    .game-tile__hover { display: none; }
}

/* ---------- Providers ---------- */
.rail-head__arrows { display: flex; gap: 8px; }

.rail-arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--c-line);
    border-radius: 50%;
    background: var(--c-surface);
    cursor: pointer;
}

.rail-arrow:hover { border-color: var(--c-accent-line); }
.rail-arrow[disabled] { opacity: .35; cursor: default; }
.rail-arrow--prev .icon { transform: rotate(90deg); }
.rail-arrow--next .icon { transform: rotate(-90deg); }

.provider-strip {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.provider-strip::-webkit-scrollbar { display: none; }

.provider-chip {
    display: flex;
    flex: none;
    align-items: center;
    gap: 10px;
    padding: 7px 16px 7px 7px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    background: var(--c-surface);
    scroll-snap-align: start;
}

.provider-chip__logo,
.provider-chip__mono {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

/* Логотипы библиотеки рассчитаны на тёмный фон — подложка тёмная и в светлой теме */
.provider-chip__logo { padding: 5px; background: var(--c-logo-plate); object-fit: contain; }
.provider-chip__mono { background: var(--c-accent2-soft); color: var(--c-text); font-size: .78rem; font-weight: 800; }
.provider-chip__name { font-size: .9rem; font-weight: 600; white-space: nowrap; }

@media (hover: none), (max-width: 767px) {
    .rail-head__arrows { display: none; }
}

/* ---------- Bonus cards ---------- */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }

.promo-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    overflow: hidden;
}

.promo-card--featured {
    border-color: var(--c-accent-line);
    background: linear-gradient(180deg, var(--c-accent-soft), transparent 55%), var(--c-surface);
}

.promo-card--featured::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--c-accent);
}

.promo-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }

.promo-card__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--c-accent2-soft);
    color: var(--c-text);
}

.promo-card--featured .promo-card__icon { background: var(--c-accent); color: var(--c-accent-ink); }
.promo-card__amount { font-family: var(--font-heading); font-size: 1.45rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.promo-card__title { color: var(--c-muted); font-family: var(--font-body); font-size: .95rem; font-weight: 600; }
.promo-card__text { color: var(--c-muted); font-size: .93rem; }
.promo-card__foot { display: grid; gap: 8px; margin-top: auto; padding-top: 10px; }
.promo-card__terms { color: var(--c-muted); font-size: .75rem; line-height: 1.45; }

/* ---------- Steps ---------- */
.stepper {
    position: relative;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stepper__item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.stepper__item:last-child { padding-bottom: 0; }

/* Линия между шагами (вертикальная на узкой колонке) */
.stepper__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 48px;
    bottom: 4px;
    left: 21px;
    width: 2px;
    border-radius: 2px;
    background: var(--c-line);
}

.stepper__num {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--c-accent-line);
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-accent);
    font-family: var(--font-heading);
    font-weight: 800;
}

.stepper__item:first-child .stepper__num { background: var(--c-accent); color: var(--c-accent-ink); border-color: var(--c-accent); }
.stepper__body { padding-top: 9px; }
.stepper__title { font-size: 1.04rem; }
.stepper__text { margin-top: 4px; color: var(--c-muted); font-size: .93rem; }

@container (min-width: 640px) {
    .stepper { grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 16px; }
    .stepper__item { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0; }
    .stepper__item:not(:last-child)::after { top: 21px; bottom: auto; left: 56px; right: -8px; width: auto; height: 2px; }
    .stepper__body { padding-top: 0; }
}

/* ---------- Payments ---------- */
.pay-table {
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    overflow: hidden;
}

.pay-table table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.pay-table th, .pay-table td { padding: 12px 16px; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: middle; }
.pay-table thead th { background: var(--c-surface-2); color: var(--c-muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pay-table tbody tr:last-child th, .pay-table tbody tr:last-child td { border-bottom: 0; }
.pay-table tbody tr:hover { background: var(--c-hover); }
.pay-table td { color: var(--c-text); font-weight: 600; }

.pay-method { display: flex; align-items: center; gap: 12px; }
.pay-method > span:last-child { display: grid; }

.pay-method__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--c-accent2-soft);
    color: var(--c-text);
}

.pay-method__name { font-weight: 700; }
.pay-method__type { color: var(--c-muted); font-size: .8rem; font-weight: 400; }

@container (max-width: 579px) {
    .pay-table { border: 0; background: transparent; }
    .pay-table thead { display: none; }
    .pay-table table, .pay-table tbody { display: grid; gap: 10px; }
    .pay-table tr { display: grid; padding: 4px 14px; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
    .pay-table th, .pay-table td { padding: 9px 0; }
    .pay-table tbody tr th { border-bottom: 1px solid var(--c-line); }
    .pay-table td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 0; }
    .pay-table td::before { content: attr(data-label); color: var(--c-muted); font-weight: 400; }
    .pay-table tbody tr:last-child th { border-bottom: 1px solid var(--c-line); }
}

/* ---------- Pros & cons ---------- */
.verdict {
    display: grid;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
    overflow: hidden;
}

.verdict__col { padding: 20px 22px; }
.verdict__col + .verdict__col { border-top: 1px solid var(--c-line); }
.verdict__title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 1.05rem; }

.verdict__badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.verdict__badge .icon { width: 17px; height: 17px; }
.verdict__col--pros .verdict__badge { background: color-mix(in srgb, var(--c-success) 18%, transparent); color: var(--c-success); }
.verdict__col--cons .verdict__badge { background: color-mix(in srgb, var(--c-danger) 18%, transparent); color: var(--c-danger); }

.verdict__list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.verdict__list li { display: flex; gap: 10px; color: var(--c-muted); }
.verdict__list li .icon { width: 18px; height: 18px; margin-top: 3px; }
.verdict__col--pros li .icon { color: var(--c-success); }
.verdict__col--cons li .icon { color: var(--c-danger); }

@container (min-width: 600px) {
    .verdict { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
    .verdict__col + .verdict__col { border-top: 0; border-left: 1px solid var(--c-line); }
}

/* ---------- Reviews ---------- */
.score-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    background: var(--c-surface);
}

.score-pill__value {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
}

.score-pill__meta { display: grid; gap: 2px; }
.score-pill__count { color: var(--c-muted); font-size: .8rem; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }

.review-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.review-card__author { display: flex; align-items: center; gap: 10px; }
.review-card__author { flex-wrap: wrap; }
.review-card__author .stars { order: -1; flex-basis: 100%; margin-bottom: 4px; }

.review-card__avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-accent2-soft);
    font-size: .8rem;
    font-weight: 800;
}

.review-card__who { display: grid; min-width: 0; line-height: 1.3; }
.review-card__who strong { font-size: .93rem; }
.review-card__who small { color: var(--c-muted); font-size: .78rem; }
.review-card__text { margin: 0; color: var(--c-muted); font-size: .95rem; }

/* ---------- CTA banner ---------- */
.cta-strip {
    display: flex;
    align-items: center;
    gap: 18px 22px;
    padding: 20px 22px;
    border: 1px solid var(--c-accent-line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(100deg, var(--c-accent-soft), transparent 70%),
        var(--c-surface);
}

.cta-strip__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-ink);
}

.cta-strip__icon .icon { width: 26px; height: 26px; }
.cta-strip__body { flex: 1; display: grid; gap: 4px; min-width: 0; }
.cta-strip__title { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
.cta-strip__text { color: var(--c-muted); }
.cta-strip__action { display: grid; flex: none; gap: 6px; justify-items: center; }
.cta-strip__note { color: var(--c-muted); font-size: .75rem; }

@container (max-width: 620px) {
    .cta-strip { flex-direction: column; align-items: flex-start; }
    .cta-strip__action { width: 100%; justify-items: stretch; }
}

/* ---------- App ---------- */
.app-panel {
    display: grid;
    gap: 24px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(80% 100% at 100% 0%, var(--c-accent2-soft), transparent 70%),
        var(--c-surface);
    overflow: hidden;
}

.app-panel__body { display: grid; gap: 14px; justify-items: start; }
.app-panel__title { font-size: clamp(1.35rem, 1.05rem + 1vw, 1.75rem); }
.app-panel__text { color: var(--c-muted); }
.app-panel__stores { display: flex; flex-wrap: wrap; gap: 10px; }
.app-panel__note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--c-muted); font-size: .88rem; }
.app-panel__visual { display: none; }

.tick-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tick-list li { display: flex; gap: 10px; }
.tick-list .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--c-success); }

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-bg);
    color: var(--c-text);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.store-btn:hover { border-color: var(--c-accent-line); text-decoration: none; }
.store-btn .icon { width: 24px; height: 24px; }
.store-btn small { display: block; color: var(--c-muted); font-size: .7rem; font-weight: 500; }

.handset {
    width: 190px;
    padding: 9px;
    border: 1px solid var(--c-border);
    border-radius: 34px;
    background: var(--c-bg);
    box-shadow: var(--shadow-pop);
}

.handset__screen { display: grid; gap: 10px; padding: 14px 12px; border-radius: 26px; background: var(--c-surface-2); }
.handset__bar { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; }
.handset__logo { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--c-accent); color: var(--c-accent-ink); }
.handset__logo .icon { width: 15px; height: 15px; }
.handset__brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handset__promo { display: grid; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, var(--c-accent-soft), var(--c-accent2-soft)); font-size: .68rem; }
.handset__promo strong { font-family: var(--font-heading); font-size: 1.3rem; }
.handset__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.handset__tiles i { aspect-ratio: 1; border-radius: 9px; background: color-mix(in srgb, var(--c-text) 10%, transparent); }
.handset__tiles i:nth-child(3n + 1) { background: var(--c-accent-soft); }
.handset__nav { display: flex; justify-content: space-around; padding-top: 6px; border-top: 1px solid var(--c-line); }
.handset__nav i { width: 16px; height: 16px; border-radius: 5px; background: color-mix(in srgb, var(--c-text) 14%, transparent); }
.handset__nav i:first-child { background: var(--c-accent); }

@container (min-width: 640px) {
    .app-panel { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .app-panel__visual { display: block; padding-right: 8px; }
}

/* ---------- FAQ ---------- */
.faq-list {
    padding-inline: 18px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.faq-item + .faq-item { border-top: 1px solid var(--c-line); }

.faq-item__q {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 0;
    list-style: none;
    cursor: pointer;
}

.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__num { min-width: 2ch; color: var(--c-accent); font-family: var(--font-heading); font-size: .82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.faq-item__q h3 { flex: 1; margin: 0; font-size: 1.02rem; font-weight: 600; line-height: 1.4; }
.faq-item__q:hover h3 { color: var(--c-accent); }

.faq-item__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c-chip);
    transition: transform .25s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}

.faq-item__icon .icon { width: 17px; height: 17px; }
.faq-item[open] .faq-item__icon { transform: rotate(180deg); background: var(--c-accent); color: var(--c-accent-ink); }

/* Обёртка без отступов — её высоту анимирует main.js; отступы — у вложенного ответа */
.faq-item__body { overflow: hidden; }
.faq-item__a { padding: 0 44px 18px calc(2ch + 14px); color: var(--c-muted); font-size: .98rem; }

/* ---------- Author ---------- */
.author-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px 18px;
    padding: 20px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.author-card__avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
    color: var(--c-accent-ink);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    overflow: hidden;
}

.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__body { display: grid; gap: 3px; align-content: start; }
.author-card__label { color: var(--c-muted); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.author-card__name { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; }
.author-card__name a { color: var(--c-text); text-decoration: underline; text-decoration-color: var(--c-accent-line); text-underline-offset: 4px; }
.author-card__name a:hover { color: var(--c-accent); }
.author-card__role { color: var(--c-accent); font-size: .88rem; font-weight: 600; }
.author-card__bio { margin-top: 6px; color: var(--c-muted); font-size: .94rem; }

.author-card__meta {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 8px;
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--c-line);
    list-style: none;
}

.author-card__meta li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--c-chip); color: var(--c-muted); font-size: .82rem; }
.author-card__meta .icon { width: 16px; height: 16px; color: var(--c-accent); }

@container (min-width: 720px) {
    .author-card { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    .author-card__avatar { width: 76px; height: 76px; }
    .author-card__meta { flex-direction: column; grid-column: auto; padding: 0 0 0 18px; border-top: 0; border-left: 1px solid var(--c-line); }
}

/* ---------- Sidebar ---------- */
.page-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
    padding-bottom: 8px;
    container: aside / inline-size;
}

.page-aside__flow, .page-aside__sticky { display: grid; gap: 16px; align-content: start; min-width: 0; }
.page-aside__slot:empty { display: none; }

.aside-card {
    padding: 16px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.aside-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.aside-card__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 700; }
.aside-card__title .icon { width: 18px; height: 18px; color: var(--c-accent); }
.aside-card__more { color: var(--c-muted); font-size: .8rem; font-weight: 600; }
.aside-card__more:hover { color: var(--c-accent); }

.aside-games__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin: 0; padding: 0; list-style: none; }
.aside-game { display: grid; min-width: 0; color: var(--c-text); text-decoration: none; }
.aside-game:hover { text-decoration: none; }

.aside-game__art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    background: linear-gradient(150deg, var(--c-surface-2), color-mix(in srgb, var(--c-accent-2) 28%, var(--c-surface-2)));
    overflow: hidden;
}

.aside-game__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.aside-game__glyph .icon { width: 30px; height: 30px; opacity: .55; }

.aside-game__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--c-bg) 60%, transparent);
    opacity: 0;
    transition: opacity .2s var(--ease);
}

.aside-game__play .icon { width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: var(--c-accent); color: var(--c-accent-ink); }
.aside-game:hover .aside-game__play { opacity: 1; }
.aside-game__name { margin-top: 6px; overflow: hidden; font-size: .84rem; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.aside-game__provider { overflow: hidden; color: var(--c-muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }

.aside-bonus {
    display: grid;
    gap: 6px;
    border-color: var(--c-accent-line);
    background:
        radial-gradient(120% 90% at 100% 0%, var(--c-accent-soft), transparent 70%),
        var(--c-surface);
}

.aside-bonus__label { display: flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.aside-bonus__label .icon { width: 18px; height: 18px; color: var(--c-accent); }
.aside-bonus__value { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.aside-bonus__note { color: var(--c-muted); font-size: .82rem; }
.aside-bonus .btn { margin-top: 8px; }

/* Блоки страницы, перенесённые в сайдбар (toc, quick-info) */
.page-aside .block-sec { padding: 0; }
.page-aside .section-head { gap: 2px; margin-bottom: 10px; }
.page-aside .section-head .eyebrow, .page-aside .section-head__intro { display: none; }
.page-aside .section-head__title { font-size: 1rem; }
.page-aside .b-quick-info { padding: 16px; border: 1px solid var(--c-line); border-radius: var(--radius-lg); background: var(--c-surface); }
.page-aside .fact-grid { border: 0; border-radius: 0; background: transparent; }
.page-aside .fact-grid__item { padding: 8px 0; }
.page-aside .fact-grid dt { font-size: .84rem; }
.page-aside .fact-grid dd { font-size: .9rem; }
.page-aside .toc-box__head { padding: 12px 14px; }
.page-aside .toc-box__nav { max-height: calc(100vh - var(--top-h) - 330px); padding-inline: 8px; overflow-y: auto; scrollbar-width: thin; }
.page-aside .toc-box__list a { padding: 6px 8px; font-size: .86rem; }

@container page (min-width: 700px) {
    .page-aside { flex-direction: row; align-items: flex-start; }
    .page-aside__flow, .page-aside__sticky { flex: 1 1 0; }
    .page-aside .aside-games__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Узкие экраны: игры в сайдбаре не дублируют сетку игр самой страницы */
.page-aside--own-games .page-aside__flow:not(:has(.page-aside__slot:not(:empty))) { display: none; }

@media (min-width: 1280px) {
    .page-cols {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--aside-w);
        gap: 28px;
        align-items: stretch;
    }

    .page-aside { flex-direction: column; align-items: stretch; margin-top: 0; padding-block: clamp(14px, 1.8vw, 24px); }
    .page-aside__flow, .page-aside__sticky { flex: none; }
    .page-aside--own-games .page-aside__flow { display: grid; }
    .page-aside .aside-games__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-aside__sticky { position: sticky; top: calc(var(--top-h) + 16px); }
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 24px;
    padding: 30px var(--pad) 22px;
    border-top: 1px solid var(--c-line);
    background: var(--c-surface);
}

.site-footer > * { max-width: calc(var(--page-max) - 2 * var(--pad)); margin-inline: auto; }

.site-footer__top {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px 40px;
    padding-bottom: 24px;
}

/* Текст обтекает логотип: начинается рядом с ним и продолжается ниже */
.site-footer__brand::after { content: ""; display: block; clear: both; }
.site-footer__brand .brand-link { float: left; margin: 2px 16px 8px 0; }
.site-footer__brand .brand-link__mark { width: 40px; height: 40px; }
.site-footer__brand .brand-link__wordmark { height: 40px; }
.site-footer__text { color: var(--c-muted); font-size: .92rem; line-height: 1.7; }

.site-footer__title { margin-bottom: 12px; color: var(--c-text); font-family: var(--font-body); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.15; }
.site-footer__col ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer__col a { color: var(--c-muted); font-size: .93rem; }
.site-footer__col a:hover { color: var(--c-text); }

.site-footer__payments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    margin-inline: auto;
    padding: 20px 0;
    border-top: 1px solid var(--c-line);
    list-style: none;
}

/* Одинаковые светлые плитки, логотипы — в фирменных цветах (как на кассе) */
.site-footer__payments li {
    display: grid;
    flex: none;
    place-items: center;
    width: 74px;
    height: 44px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: #fff;
}

.site-footer__payments img { width: auto; height: auto; max-width: 100%; max-height: 28px; object-fit: contain; }

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--c-line);
}

.site-footer__badges { display: flex; align-items: center; gap: 14px; }
.rg-link { display: inline-flex; align-items: center; gap: 8px; color: var(--c-muted); font-size: .88rem; font-weight: 600; }
.rg-link .icon { width: 18px; height: 18px; color: var(--c-success); }
.rg-link:hover { color: var(--c-text); }
.site-footer__copy { color: var(--c-muted); font-size: .82rem; }

/* ---------- Responsive: планшет — полоса иконок ---------- */
@media (max-width: 1279px) {
    .top-bar__actions { display: flex; }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .app-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

    .side-nav { align-items: center; padding: 12px 10px; overflow: visible; }
    .side-nav__top { justify-content: center; padding: 0; }
    .side-nav .brand-link__text { display: none; }
    .side-nav .brand-link--wordmark .brand-link__wordmark { display: none; }
    .side-nav .brand-link--wordmark .brand-link__mark { display: block; }
    /* Вордмарк без отдельного знака — уменьшенная картинка */
    .side-nav .brand-link--wordmark .brand-link__wordmark:only-child { display: block; height: auto; max-width: 52px; }
    .side-nav__nav { width: 100%; }
    .side-nav__link { justify-content: center; padding: 6px; }

    .side-nav__label {
        position: absolute;
        top: 50%;
        left: calc(100% + 12px);
        z-index: 50;
        padding: 6px 10px;
        border: 1px solid var(--c-line);
        border-radius: var(--radius-sm);
        background: var(--c-surface-2);
        box-shadow: var(--shadow-pop);
        color: var(--c-text);
        font-size: .84rem;
        opacity: 0;
        pointer-events: none;
        transform: translate(-4px, -50%);
        transition: opacity .15s var(--ease), transform .15s var(--ease);
    }

    .side-nav__link:hover .side-nav__label,
    .side-nav__link:focus-visible .side-nav__label { opacity: 1; transform: translate(0, -50%); }
    .side-nav__icon { width: 40px; height: 40px; }
    .side-nav__foot { width: 100%; }
    .side-nav__actions { display: none; }
    .side-nav__note { justify-content: center; padding: 0; }
    .side-nav__note > span:last-child { display: none; }
}

@media (max-width: 1023px) {
    .top-bar__promo { display: none; }
    .top-bar__search { width: min(320px, 50%); }
}

/* ---------- Responsive: телефон — меню выезжает по бургеру ---------- */
@media (max-width: 767px) {
    :root { --top-h: 56px; }

    .app-shell { display: block; }

    .side-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: min(300px, 86vw);
        border-right: 1px solid var(--c-border);
        box-shadow: var(--shadow-pop);
        transform: translateX(-104%);
        visibility: hidden;
        transition: transform .28s var(--ease), visibility 0s linear .28s;
    }

    body.nav-open .side-nav { transform: none; visibility: visible; transition: transform .28s var(--ease); }
    .side-nav__close { display: grid; }
    .side-nav .brand-link__wordmark { height: 34px; }

    .side-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: var(--c-overlay);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s var(--ease);
    }

    body.nav-open .side-nav-backdrop { opacity: 1; pointer-events: auto; }

    .top-bar { gap: 10px; }
    .top-bar__burger { display: grid; }
    .brand-link--top { display: inline-flex; }
    .top-bar__search { display: none; }
    .top-bar__login { display: none; }

    .site-footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .site-footer__brand { grid-column: 1 / -1; }

    /* Платёжки — одной строкой с прокруткой */
    .site-footer__payments {
        flex-wrap: nowrap;
        margin-inline: calc(var(--pad) * -1);
        padding-inline: var(--pad);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-footer__payments::-webkit-scrollbar { display: none; }
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
    .faq-list { padding-inline: 14px; }
    .faq-item__a { padding-right: 0; }
}

@media (max-width: 400px) {
    .brand-link--top .brand-link__text { max-width: 130px; }
    .top-bar__actions .btn { --btn-pad: .5rem .7rem; }
}

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