:root {
    --bg-0: #101319;
    --bg-1: #161b24;
    --bg-2: #222833;
    --surface: rgba(24, 30, 40, 0.9);
    --surface-strong: rgba(28, 35, 47, 0.96);
    --border: rgba(160, 170, 188, 0.28);
    --border-strong: rgba(255, 255, 255, 0.38);
    --text-main: #f3f4f6;
    --text-soft: #c2cad9;
    --text-muted: #98a2b7;
    --accent: #ffffff;
    --accent-strong: #e9eef5;
    --good: #3dd598;
    --danger: #fb7185;
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
    --radius-lg: 20px;
    --radius-md: 14px;
    --maxw: 1180px;
    --font-main: "M PLUS Rounded 1c", sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    position: relative;
    font-family: var(--font-main);
    color: var(--text-main);
    background: linear-gradient(155deg, #171c25 0%, #11151c 48%, #0f1218 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -15% -20%;
    pointer-events: none;
    z-index: -2;
    background:
        linear-gradient(122deg, transparent 0 34%, rgba(255, 255, 255, 0.12) 45%, transparent 56%),
        linear-gradient(300deg, transparent 0 47%, rgba(255, 255, 255, 0.05) 50%, transparent 56%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent 22%),
        linear-gradient(to top, rgba(0, 0, 0, 0.38), transparent 40%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.2));
    animation: gridDrift 28s linear infinite;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    max-width: var(--maxw);
    margin: 20px auto 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    background: rgba(16, 20, 27, 0.84);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    position: sticky;
    top: 10px;
    z-index: 20;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-header.scrolled {
    border-color: var(--border-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    background: rgba(15, 19, 25, 0.6);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-main);
    white-space: nowrap;
}

.brand__mark {
    color: var(--accent);
    letter-spacing: 1px;
}

.brand__name {
    font-weight: 700;
}

.main-nav {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.main-nav a,
.lang-switch a {
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--text-soft);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.main-nav a:hover,
.lang-switch a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.main-nav a.active,
.lang-switch a.active {
    color: #111723;
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    font-weight: 700;
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-radius: 10px;
    padding: 8px 12px;
}

.page-shell {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 20px 70px;
}

.hero,
.panel,
.game-card,
.news-card,
.detail-grid > article,
.contact-card,
.about-card {
    background: linear-gradient(158deg, var(--surface-strong) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero {
    padding: clamp(24px, 4vw, 50px);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: linear-gradient(to bottom, var(--accent-strong), var(--accent));
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.62), transparent 75%);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.44);
    color: #f4f7ff;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    margin-bottom: 14px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 56px);
    font-family: var(--font-main);
    line-height: 1.08;
}

.hero p {
    margin: 0;
    max-width: 72ch;
    color: var(--text-soft);
    font-size: clamp(16px, 1.8vw, 19px);
}

.hero-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.btn--primary {
    color: #111723;
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.16);
}

.btn--ghost {
    color: var(--text-main);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.section-title {
    margin: 30px 0 12px;
    font-size: clamp(22px, 2.5vw, 30px);
    font-family: var(--font-main);
}

.section-heading {
    margin: 30px 0 12px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading .section-title {
    margin: 0;
}

.section-heading .page-intro {
    margin-top: 6px;
}

.section-heading__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.panel,
.about-card,
.contact-card,
.detail-grid > article {
    padding: 18px;
}

.panel,
.game-card,
.news-card,
.about-card,
.contact-card {
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.panel:hover,
.game-card:hover,
.news-card:hover,
.about-card:hover,
.contact-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
}

.panel h3,
.about-card h3,
.contact-card h3 {
    margin-top: 0;
    font-family: var(--font-main);
}

.panel p,
.about-card p,
.contact-card p {
    margin-bottom: 0;
    color: var(--text-soft);
}

.games-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.game-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-card__media {
    background: #1a2029;
    border-bottom: 1px solid var(--border);
}

.game-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-card__body {
    padding: 16px;
}

.game-card__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-family: var(--font-main);
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.pill {
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d7deed;
    background: rgba(255, 255, 255, 0.03);
}

.pill--good {
    border-color: rgba(61, 213, 152, 0.42);
    color: #b4f2da;
}

.pill--warning {
    border-color: rgba(255, 255, 255, 0.44);
    color: #f4f7ff;
}

.game-card__text,
.page-intro,
.source-note {
    color: var(--text-soft);
}

.game-card__text {
    margin: 0 0 14px;
}

.page-intro {
    margin: 8px 0 0;
}

.news-carousel {
    margin-top: 14px;
}

.news-carousel__viewport {
    overflow: hidden;
    margin: 0 -2px;
    padding: 2px;
}

.news-carousel__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, calc((100% - 32px) / 3));
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.news-carousel__track::-webkit-scrollbar {
    display: none;
}

.news-carousel__button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.news-carousel__button:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.news-carousel__button:disabled {
    cursor: default;
    opacity: 0.38;
    transform: none;
}

.news-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.news-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}

.news-card::after {
    content: "";
    position: absolute;
    inset: auto 18px 0 18px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), transparent);
    opacity: 0.6;
}

.news-card--carousel {
    scroll-snap-align: start;
}

.news-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.news-card__meta time {
    color: var(--text-muted);
    font-size: 13px;
}

.news-card h2,
.news-card h3 {
    margin: 0 0 10px;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.18;
}

.news-card p {
    margin: 0 0 16px;
    color: var(--text-soft);
    line-height: 1.55;
}

.news-card__link {
    margin-top: auto;
    color: var(--text-main);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.source-note {
    font-size: 14px;
    margin-top: 8px;
}

.detail-hero {
    display: grid;
    gap: 16px;
}

.detail-cover {
    margin-top: 14px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.detail-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.detail-grid {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.data-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.data-list strong {
    display: block;
    margin-bottom: 2px;
    color: #dce3f0;
}

.data-list span,
.data-list a {
    color: var(--text-soft);
}

.screenshot-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.screenshot-thumb {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.screenshot-thumb img {
    width: 100%;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.screenshot-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
}

.screenshot-modal[hidden] {
    display: none !important;
}

.screenshot-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 18, 0.84);
    backdrop-filter: blur(4px);
}

.screenshot-modal__dialog {
    position: relative;
    width: min(92vw, 1200px);
    height: min(90vh, 760px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.screenshot-modal__stage {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(18, 24, 34, 0.9);
    overflow: hidden;
    padding: 10px;
}

.screenshot-modal__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 1;
    transition: opacity 150ms linear;
}

.screenshot-modal__image.is-fading {
    opacity: 0;
}

.screenshot-modal__close,
.screenshot-modal__nav {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(13, 18, 27, 0.92);
    color: var(--text-main);
    border-radius: 12px;
    cursor: pointer;
}

.screenshot-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    z-index: 2;
    font-size: 18px;
}

.screenshot-modal__nav {
    width: 48px;
    height: 64px;
    font-size: 24px;
    line-height: 1;
}

.screenshot-modal__close:hover,
.screenshot-modal__nav:hover {
    border-color: var(--border-strong);
    background: rgba(22, 28, 40, 0.98);
}

body.modal-open {
    overflow: hidden;
}

.about-grid,
.contacts-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.team-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.team-card {
    background: linear-gradient(158deg, var(--surface-strong) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.team-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
}

.team-card__photo {
    background: #1a2029;
    border-right: 1px solid var(--border);
    min-height: 220px;
}

.team-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.team-card__body {
    padding: 16px 16px 18px;
}

.team-card__name {
    margin: 0 0 8px;
    font-size: 20px;
}

.team-card__capsule {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
}

.team-card__capsule-title {
    margin: 0 0 10px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.team-card__facts {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 9px;
}

.team-card__facts li {
    display: grid;
    gap: 3px;
}

.team-card__facts strong {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.team-card__facts span {
    color: var(--text-soft);
    line-height: 1.4;
}

.team-card__facts li:first-child span {
    color: var(--text-main);
    font-weight: 700;
}

.history-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 18px;
    align-items: start;
}

.history-timeline,
.history-section {
    background: linear-gradient(158deg, var(--surface-strong) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.history-timeline {
    position: sticky;
    top: 96px;
    padding: 18px;
}

.history-timeline h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.history-timeline ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.history-timeline li {
    display: grid;
    gap: 4px;
    padding-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.32);
}

.history-timeline strong {
    color: var(--text-main);
}

.history-timeline span {
    color: var(--text-soft);
    line-height: 1.45;
}

.history-article {
    display: grid;
    gap: 16px;
}

.history-section {
    padding: 22px;
}

.history-section h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.history-section p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.history-section p + p {
    margin-top: 12px;
}

.site-footer {
    max-width: var(--maxw);
    margin: 0 auto 24px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.footer-socials a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.animate-in {
    opacity: 0;
    transform: translateY(12px);
    transition: transform 0.45s ease, opacity 0.45s ease;
}

.animate-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes gridDrift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 46px 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-grid {
        animation: none;
    }

    .animate-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .panel,
    .game-card,
    .news-card,
    .team-card,
    .about-card,
    .contact-card,
    .news-carousel__button,
    .btn {
        transition: none;
    }
}

@media (max-width: 1180px) {
    .site-header {
        margin: 14px 12px 8px;
    }

    .page-shell,
    .site-footer {
        padding-inline: 14px;
    }
}

@media (max-width: 980px) {
    .cards,
    .about-grid,
    .contacts-grid,
    .games-grid,
    .news-grid,
    .detail-grid,
    .history-layout {
        grid-template-columns: 1fr;
    }

    .news-carousel__track {
        grid-auto-columns: minmax(260px, 72vw);
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .history-timeline {
        position: static;
    }
}

@media (max-width: 760px) {
    .site-header {
        flex-wrap: wrap;
        border-radius: 14px;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        width: 100%;
        display: none;
        margin: 8px 0 0;
        order: 4;
        flex-direction: column;
    }

    .main-nav.open {
        display: flex;
    }

    .lang-switch {
        margin-left: auto;
    }

    .hero h1 {
        font-size: clamp(24px, 9vw, 36px);
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading__actions {
        width: 100%;
    }

    .section-heading__actions .btn {
        flex: 1;
    }

    .news-carousel__track {
        grid-auto-columns: minmax(240px, 88vw);
    }

    .screenshot-grid {
        grid-template-columns: 1fr;
    }

    .screenshot-modal__dialog {
        width: 95vw;
        height: min(88vh, 720px);
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        gap: 8px;
    }

    .screenshot-modal__stage {
        min-height: 0;
    }

    .screenshot-modal__nav {
        width: 100%;
        height: 44px;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-card {
        grid-template-columns: minmax(120px, 38vw) 1fr;
    }

    .team-card__photo {
        min-height: 170px;
    }
}
