@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --teal-900: #042f2e;
    --teal-700: #0f766e;
    --teal-500: #14b8a6;
    --teal-200: #99f6e4;
    --slate-900: #0f172a;
    --slate-100: #f1f5f9;
    --header-h: 70px;
    --radius: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    max-width: 100%;
}

iframe {
    max-width: none;
}

html,
body {
    overflow-x: hidden !important;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    margin: 0;
    font-family: Roboto, system-ui, sans-serif;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--slate-100);
    min-height: 100vh;
    background: linear-gradient(125deg, var(--teal-900) 0%, var(--slate-900) 35%, #134e4a 70%, var(--teal-900) 100%);
    background-size: 320% 320%;
    animation: gradient-flow 22s ease infinite;
}

h1,
h2,
h3,
h4 {
    font-family: Inter, system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

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

.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.9rem;
}

.lead {
    font-size: 1.08rem;
    line-height: 1.55;
}

.opacity-90 {
    opacity: 0.9;
}

.max-w-prose {
    max-width: 42rem;
}

.max-w-wide {
    max-width: 1140px;
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.rounded {
    border-radius: var(--radius);
}

.rounded-lg {
    border-radius: 18px;
}

.shadow-lg {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.bg-panel {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(20, 184, 166, 0.25);
    backdrop-filter: blur(12px);
}

.bg-panel-soft {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(4, 47, 46, 0.94);
    border-bottom: 1px solid rgba(45, 212, 191, 0.2);
    backdrop-filter: blur(10px);
}

.top-bar-inner {
    height: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--teal-200);
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.nav-link {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--slate-100);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--teal-500);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.burger-line {
    width: 24px;
    height: 2px;
    background: var(--teal-200);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.burger.is-active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger.is-active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger.is-active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
    .burger {
        display: flex;
    }

    .nav-main {
        position: fixed;
        top: calc(var(--header-h) - 1px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 0;
        background: rgba(4, 47, 46, 0.98);
        border-bottom: 1px solid rgba(45, 212, 191, 0.15);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .nav-main.is-active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        padding: 0.85rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
}

.cookie-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    max-width: 420px;
    margin: 1rem;
    padding: 1rem 1.2rem;
    z-index: 1100;
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(20, 184, 166, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.cookie-bar p {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cookie-bar.is-hidden {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, transform 0.12s ease;
}

.btn:focus-visible {
    outline: 2px solid var(--teal-500);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--teal-500), var(--teal-700));
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    color: var(--teal-200);
    border: 1px solid rgba(153, 246, 228, 0.4);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.page-hero {
    padding-top: calc(var(--header-h) + 2.5rem);
    padding-bottom: 1.5rem;
}

.games-section {
    padding-bottom: 3rem;
}

/* minmax(0, 1fr): без нуля grid-колонка держит min-width:auto по картинке и рвёт вёрстку */
.games-section .max-w-wide {
    width: 100%;
    min-width: 0;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
    min-width: 0;
    width: 100%;
}

.games-grid > .game-card--tile {
    min-width: 0;
    max-width: 100%;
}

.game-card--tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    isolation: isolate;
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.game-card h2,
.game-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.08rem;
    color: var(--teal-200);
}

/* Не <img>: у картинки нет intrinsic size — grid не разъезжается. Высота слота — padding-hack (16:10). */
.game-tile__thumb-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
    height: 0;
    padding-bottom: 62.5%;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: #020617;
    contain: paint;
}

.game-tile__thumb {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.game-tile__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    min-height: 0;
}

.game-tile__text {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
    opacity: 0.88;
    flex: 1;
}

.game-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.game-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.game-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    cursor: pointer;
}

.game-modal__dialog {
    position: relative;
    z-index: 1;
    /* Wrapper layout: portrait iframe viewport avoids empty side columns in embed. */
    width: min(100%, 40rem);
    height: min(94dvh, 900px);
    max-height: min(94dvh, 900px);
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: 1px solid rgba(45, 212, 191, 0.35);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.game-modal__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(4, 47, 46, 0.5);
}

.game-modal__title {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--teal-200);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-modal__close {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--slate-100);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.game-modal__close:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
}

.game-modal__frame-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    align-self: stretch;
    background: #020617;
}

.game-modal__frame-wrap iframe {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    display: block;
}

.features-section {
    padding: 1rem 0 3rem;
}

.features-heading {
    text-align: center;
    margin: 0 auto 3.5rem;
    max-width: 36rem;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    color: var(--teal-200);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: var(--teal-500);
}

.feature-card p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.faq-section {
    padding: 1rem 0 3rem;
}

.faq-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--teal-200);
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1rem 0;
    background: none;
    border: none;
    color: var(--slate-100);
    font-family: Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.faq-question::after {
    content: '+';
    color: var(--teal-500);
    font-size: 1.2rem;
}

.faq-item.is-active .faq-question::after {
    content: '−';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-item.is-active .faq-answer {
    max-height: 380px;
}

.faq-answer p {
    margin: 0 0 0.85rem;
    opacity: 0.88;
}

.site-footer {
    padding: 2rem 0 1.5rem;
    border-top: 1px solid rgba(20, 184, 166, 0.2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-heading {
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: var(--teal-200);
    font-size: 0.88rem;
}

.footer-link {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

.footer-link:hover {
    color: var(--teal-500);
}

.footer-bottom {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.84rem;
    opacity: 0.7;
}

.page-main {
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 2.5rem;
}

.content-block {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.35rem;
    border-radius: var(--radius);
}

.content-block h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    color: var(--teal-200);
}

.blog-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 880px;
}

.blog-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius);
}

@media (max-width: 520px) {
    .blog-card {
        grid-template-columns: 1fr;
    }
}

.blog-icon {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
}

.category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--teal-500);
    color: var(--slate-900);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
}

.blog-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.12rem;
}

.blog-meta {
    display: flex;
    gap: 0.85rem;
    font-size: 0.82rem;
    opacity: 0.75;
    margin: 0.5rem 0 0.85rem;
}

.form-grid {
    display: grid;
    gap: 0.85rem;
    max-width: 500px;
}

.form-grid label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.88rem;
}

.form-grid input,
.form-grid textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--slate-100);
    font-family: inherit;
    font-size: 1rem;
}

.form-grid input:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: var(--teal-500);
}

.form-success {
    display: none;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.45);
    font-weight: 600;
    margin-top: 0.35rem;
}

.article-page {
    padding-top: calc(var(--header-h) + 1.5rem);
    padding-bottom: 2.5rem;
}

.article-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 0.75rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.86rem;
    opacity: 0.78;
}

.article-content h2 {
    color: var(--teal-200);
    font-size: 1.18rem;
    margin: 1.5rem 0 0.5rem;
}

.article-content p {
    margin: 0 0 0.85rem;
    opacity: 0.9;
}

.article-content code {
    font-size: 0.88em;
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.article-cta {
    margin-top: 1.75rem;
    padding: 1.35rem;
    border-radius: var(--radius);
    text-align: center;
}

.article-cta h3 {
    margin: 0 0 0.75rem;
}

.article-footer {
    margin-top: 1.75rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.article-nav a:hover {
    color: var(--teal-500);
}
