/* ==========================================================================
   Общие стили сайта: подвал, информационные страницы, SEO-блок
   Подключается после styles.css и responsive.css на всех страницах.
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:target {
    scroll-margin-top: 24px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   SEO-текст под игрой
   -------------------------------------------------------------------------- */

.seo-block {
    width: 100%;
    max-width: 900px;
    margin: 36px auto 0;
    padding: 0 2px;
    color: var(--text-color);
}

.seo-block h1 {
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--text-color);
}

.seo-block h2 {
    font-size: 1rem;
    line-height: 1.35;
    margin: 20px 0 8px;
    color: var(--text-color);
}

.seo-block h3 {
    font-size: 0.98rem;
    line-height: 1.35;
    margin: 18px 0 8px;
    color: var(--text-color);
}

.seo-block p {
    font-size: 0.94rem;
    line-height: 1.68;
    color: var(--text-light);
    margin-bottom: 10px;
}

.seo-block ul {
    margin: 0 0 12px 20px;
}

.seo-block li {
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 4px;
}

.seo-block a {
    color: var(--primary-color);
    text-underline-offset: 2px;
}

.seo-block a:hover {
    color: var(--primary-dark);
}

.dark-theme .seo-block a {
    color: #a7b0ff;
}

/* --------------------------------------------------------------------------
   Подвал сайта
   -------------------------------------------------------------------------- */

.site-footer {
    width: 100%;
    margin-top: 48px;
    background: linear-gradient(180deg, #f1f3fb 0%, #e7ebf7 100%);
    border-top: 1px solid #dce1f0;
    color: #52576b;
}

.dark-theme .site-footer {
    background: linear-gradient(180deg, #171724 0%, #101018 100%);
    border-top-color: #262636;
    color: #b7b7c9;
}

.footer-inner {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 36px 20px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 32px;
    align-items: start;
}

.footer-logo {
    display: inline-block;
    line-height: 0;
}

.footer-logo img {
    height: 30px;
    width: auto;
}

.footer-brand p {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 38ch;
}

.footer-heading {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 12px;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.footer-col a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.35;
    transition: color 0.2s ease;
}

.footer-col a:hover,
.footer-col a:focus-visible {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dark-theme .footer-col a:hover,
.dark-theme .footer-col a:focus-visible {
    color: #a7b0ff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding: 16px 0 22px;
    border-top: 1px solid var(--light-border);
    font-size: 0.82rem;
}

.footer-bottom .footer-note {
    color: var(--text-light);
}

/* --------------------------------------------------------------------------
   Информационные страницы (статьи)
   -------------------------------------------------------------------------- */

.site-header {
    width: 100%;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--light-border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 20px;
}

.site-header-logo {
    display: inline-block;
    line-height: 0;
    flex: 0 0 auto;
}

.site-header-logo img {
    height: 40px;
    width: auto;
}

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

.site-nav a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.site-nav a[aria-current="page"] {
    background-color: var(--primary-color);
    color: #fff;
}

.site-theme-btn {
    flex: 0 0 auto;
    border-radius: 50%;
}

.page-main {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 26px 20px 0;
    flex: 1;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.breadcrumbs .sep {
    opacity: 0.6;
}

.article {
    width: 100%;
    background-color: var(--light-color);
    border: 1px solid var(--light-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: clamp(20px, 4vw, 44px);
}

.article h1 {
    font-size: clamp(1.6rem, 4vw, 2.15rem);
    line-height: 1.2;
    margin-bottom: 14px;
    color: var(--text-color);
}

.article .lead {
    font-size: 1.06rem;
    line-height: 1.65;
    color: var(--text-light);
    margin-bottom: 22px;
}

.article h2 {
    font-size: clamp(1.22rem, 2.6vw, 1.5rem);
    line-height: 1.3;
    margin: 32px 0 12px;
    color: var(--text-color);
}

.article h3 {
    font-size: 1.06rem;
    line-height: 1.4;
    margin: 22px 0 10px;
    color: var(--text-color);
}

.article p {
    font-size: 1rem;
    line-height: 1.72;
    margin-bottom: 14px;
    color: var(--text-color);
}

.article ul,
.article ol {
    margin: 0 0 16px 22px;
}

.article li {
    font-size: 1rem;
    line-height: 1.68;
    margin-bottom: 7px;
    color: var(--text-color);
}

.article a {
    color: var(--primary-color);
    text-underline-offset: 2px;
}

.article a:hover {
    color: var(--primary-dark);
}

.dark-theme .article a,
.dark-theme .breadcrumbs a:hover {
    color: #a7b0ff;
}

.article strong {
    font-weight: 700;
}

.article .callout {
    background-color: rgba(63, 81, 181, 0.07);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 0.97rem;
    line-height: 1.62;
    color: var(--text-color);
}

.dark-theme .article .callout {
    background-color: rgba(120, 132, 255, 0.12);
}

.article .table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 8px 0 20px;
}

.article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.article th,
.article td {
    border: 1px solid var(--light-border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    line-height: 1.45;
}

.article th {
    background-color: var(--light-bg);
    font-weight: 700;
    color: var(--text-color);
}

.article td {
    color: var(--text-light);
}

.steps {
    counter-reset: step;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.steps li {
    position: relative;
    padding-left: 42px;
    margin-bottom: 14px;
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq {
    margin-top: 8px;
}

.faq details {
    border: 1px solid var(--light-border);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
    background-color: var(--light-bg);
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--text-color);
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    font-size: 1.25rem;
    line-height: 1;
    color: var(--primary-color);
    flex: 0 0 auto;
}

.faq details[open] summary::after {
    content: "−";
}

.faq details p {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-light);
}

.article-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 30px;
    padding: 20px 22px;
    border-radius: 14px;
    background-color: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.35);
}

.article-cta p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text-color);
}

.article-cta .cta-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    background-color: var(--secondary-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.article-cta .cta-btn:hover {
    background-color: var(--secondary-dark);
    color: #fff;
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Страница 404
   -------------------------------------------------------------------------- */

.page-404 .error-code {
    font-size: clamp(3.2rem, 12vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    margin: 0 0 8px;
}

.dark-theme .page-404 .error-code {
    color: #a7b0ff;
}

.page-404 .article h1 {
    margin-top: 0;
}

.page-404 .error-links {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
}

.page-404 .error-links a {
    font-weight: 600;
}

@media (max-width: 520px) {
    .page-404 .error-links {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Адаптивность общих блоков
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 26px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-brand p {
        max-width: 52ch;
    }
}

@media (max-width: 700px) {
    .site-header-inner {
        flex-wrap: wrap;
        gap: 10px 14px;
        padding: 12px 14px;
    }

    .site-header-logo img {
        height: 34px;
    }

    .page-main {
        padding: 20px 14px 0;
    }

    .footer-inner {
        padding: 28px 14px 0;
    }

    .site-theme-btn {
        margin-left: auto;
        order: 2;
    }

    .site-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        gap: 2px;
        border-top: 1px solid var(--light-border);
        padding-top: 8px;
    }

    .site-nav a {
        padding: 7px 8px;
        font-size: 0.82rem;
    }

    .article {
        border-radius: 14px;
    }

    .article-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-cta .cta-btn {
        width: 100%;
        text-align: center;
    }

    .footer-bottom {
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 430px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .site-nav a {
        font-size: 0.78rem;
        padding: 7px 6px;
    }

    .article-cta {
        padding: 16px;
    }
}
