:root {
    color-scheme: dark;
    --bg: #050607;
    --bg-2: #0a0d12;
    --panel: #10151d;
    --panel-2: #151b25;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f5f7fb;
    --muted: #9aa6b8;
    --muted-2: #6f7b8d;
    --accent: #42e8c3;
    --accent-2: #5ca8ff;
    --danger: #ff5c7a;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --radius: 8px;
    --container: 1180px;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 18% 0%, rgba(66, 232, 195, 0.1), transparent 28rem),
        radial-gradient(circle at 82% 8%, rgba(92, 168, 255, 0.1), transparent 30rem),
        linear-gradient(180deg, #050607 0%, #080a0f 42%, #050607 100%);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

.site-container {
    width: min(var(--container), calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(5, 6, 7, 0.84);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    transition: transform 180ms ease;
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    min-height: 72px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    height: 72px;
    min-width: 0;
}

.site-brand-image {
    width: auto;
    height: 100%;
    max-height: 72px;
    object-fit: contain;
}

.site-brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(66, 232, 195, 0.18), rgba(92, 168, 255, 0.16));
    color: var(--accent);
    font-weight: 900;
}

.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.site-nav a:hover,
.site-nav a.is-active {
    background: transparent;
    color: var(--text);
}

.site-nav a i {
    color: var(--accent);
}

.site-auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site-icon-button,
.site-menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
}

.site-icon-button:hover,
.site-menu-toggle:hover {
    border-color: rgba(66, 232, 195, 0.55);
    color: var(--accent);
}

.site-menu-toggle {
    display: none;
}

.site-logout-form {
    margin: 0;
}

.site-main {
    min-height: 60vh;
}

.game-hero {
    position: relative;
    min-height: clamp(430px, 70vh, 690px);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #030405;
}

.game-hero-track {
    display: flex;
    height: clamp(430px, 70vh, 690px);
    transition: transform 420ms ease;
}

.game-hero-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
}

.game-hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 6, 7, 0.92) 0%, rgba(5, 6, 7, 0.72) 44%, rgba(5, 6, 7, 0.25) 100%),
        linear-gradient(180deg, rgba(5, 6, 7, 0.12), #050607 100%);
    pointer-events: none;
}

.game-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
}

.game-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    padding: 76px 0 118px;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(66, 232, 195, 0.28);
    border-radius: var(--radius);
    background: rgba(66, 232, 195, 0.08);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.game-hero h1,
.page-hero h1,
.section-heading h2 {
    margin: 14px 0 12px;
    color: var(--text);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: 0;
}

.game-hero h1 {
    max-width: 760px;
    font-size: clamp(3rem, 7vw, 6.8rem);
}

.game-hero p {
    max-width: 620px;
    margin: 0 0 26px;
    color: #d6dce7;
    font-size: 1.14rem;
}

.site-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(66, 232, 195, 0.35);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #42e8c3, #5ca8ff);
    color: #041013;
    font-weight: 950;
}

.site-button.is-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.game-hero-controls {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(-50%);
}

.game-hero-controls button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(5, 6, 7, 0.74);
    color: var(--text);
    cursor: pointer;
}

.game-hero-dots {
    display: flex;
    gap: 7px;
}

.game-hero-dots button {
    width: 10px;
    height: 10px;
    min-width: 10px;
    padding: 0;
    border-radius: 999px;
}

.game-hero-dots button.is-active {
    background: var(--accent);
    border-color: var(--accent);
}

.catalog-filter {
    position: relative;
    z-index: 5;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 10, 15, 0.92);
}

.catalog-filter-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin: 0 0 14px;
}

.catalog-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
}

.catalog-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.catalog-search input::placeholder {
    color: var(--muted-2);
}

.game-category-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.game-category-filter a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.game-category-filter a:hover,
.game-category-filter a.is-active {
    border-color: rgba(66, 232, 195, 0.5);
    color: var(--accent);
}

.game-catalog,
.jackplay-catalog,
.page-hero {
    padding: 52px 0;
}

.page-hero.compact {
    padding: 76px 0 34px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(92, 168, 255, 0.08), transparent),
        #07090d;
}

.page-hero h1,
.section-heading h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.page-hero p,
.section-heading p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.section-heading {
    margin-bottom: 24px;
}

.game-card-grid,
.jackplay-game-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.game-card,
.jackplay-game-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
    box-shadow: var(--shadow);
}

.game-card-media,
.jackplay-game-media {
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--panel-2);
}

.game-card-media img,
.jackplay-game-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.game-card:hover img,
.jackplay-game-card:hover img {
    transform: scale(1.04);
}

.game-card-placeholder,
.jackplay-game-placeholder,
.home-article-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(66, 232, 195, 0.18), rgba(92, 168, 255, 0.12)),
        #121923;
    color: var(--accent);
    font-size: 2rem;
}

.game-card-body,
.jackplay-game-body {
    padding: 12px;
}

.game-card-body span,
.jackplay-game-body small {
    display: block;
    color: var(--accent-2);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.game-card-body h3,
.jackplay-game-body h3 {
    min-height: 48px;
    margin: 6px 0 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
}

.jackplay-game-body p {
    color: var(--muted);
    font-size: 0.9rem;
}

.jackplay-hero {
    padding: 88px 0 46px;
    background: linear-gradient(180deg, rgba(66, 232, 195, 0.08), transparent);
}

.jackplay-hero h1 {
    margin: 12px 0;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.02;
}

.jackplay-hero p {
    max-width: 680px;
    color: var(--muted);
}

.home-section-heading {
    margin-bottom: 24px;
}

.home-gradient-title {
    margin: 10px 0;
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.06;
}

.blog-category-strip,
.jackplay-category-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.blog-category-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-weight: 800;
}

.blog-category-pill.is-active,
.blog-category-pill:hover {
    border-color: rgba(66, 232, 195, 0.48);
    color: var(--accent);
}

.jackplay-game-shell {
    padding: 62px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.jackplay-game-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.jackplay-game-head h1 {
    margin: 10px 0;
    font-size: clamp(2.4rem, 5vw, 5.4rem);
    line-height: 1;
}

.jackplay-game-head p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.jackplay-play-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.jackplay-frame-panel,
.jackplay-info-card,
.jackplay-ranking-card,
.jackplay-ad,
.jackplay-description {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: var(--shadow);
}

.jackplay-frame-panel {
    overflow: hidden;
}

.jackplay-frame-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 6, 7, 0.74);
}

.jackplay-frame-toolbar span {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jackplay-info-card,
.jackplay-ranking-card {
    padding: 18px;
}

.jackplay-game-side {
    display: grid;
    gap: 14px;
}

.jackplay-info-card h2,
.jackplay-ranking-card h3 {
    margin: 0 0 10px;
}

.jackplay-info-card p,
.jackplay-ranking-card p,
.prose {
    color: var(--muted);
}

.jackplay-description {
    margin-top: 18px;
}

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

.jackplay-ranking-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.jackplay-ranking-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.jackplay-ranking-list strong {
    color: var(--accent);
}

.jackplay-ad-row {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.jackplay-ad {
    display: grid;
    place-items: center;
    min-height: 86px;
    overflow: hidden;
}

.jackplay-ad img {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
}

.empty-card,
.article-body,
.contact-form-card,
.contact-sidebar-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    padding: 24px;
}

.game-play-shell,
.jackplay-game-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.jackplay-game-frame,
.game-frame {
    width: 100%;
    min-height: 680px;
    border: 0;
    border-radius: var(--radius);
    background: #050607;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #050607;
}

.site-footer-top {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 360px);
    gap: 28px;
    padding: 42px 0 24px;
}

.site-footer-brand h2,
.site-footer-contact h3 {
    margin: 0 0 10px;
}

.site-footer-brand p,
.site-footer-contact span,
.site-footer-legal a {
    color: var(--muted);
}

.site-social-links {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.site-social-links a,
.site-footer-contact a,
.site-footer-contact div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
}

.site-social-links a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
}

.site-footer-contact {
    display: grid;
    gap: 10px;
}

.site-footer-contact a,
.site-footer-contact div {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
}

.site-footer-contact strong {
    color: var(--text);
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 0 30px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer-legal {
    display: flex;
    gap: 16px;
}

.site-footer-seal img {
    max-height: 34px;
    opacity: 0.8;
}

.site-alert,
.site-toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
}

.site-alert {
    position: relative;
    max-width: 360px;
    padding: 12px 42px 12px 14px;
    border: 1px solid rgba(255, 92, 122, 0.35);
    border-radius: var(--radius);
    background: #211018;
    color: #ffd7df;
}

.site-alert-success {
    border-color: rgba(66, 232, 195, 0.35);
    background: #0f221d;
    color: #c7fff3;
}

.site-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

[data-card-motion] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 360ms ease, transform 360ms ease;
}

[data-card-motion].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .site-header-inner {
        grid-template-columns: auto auto 1fr;
    }

    .site-menu-toggle {
        display: inline-grid;
        order: 3;
        justify-self: end;
    }

    .site-auth-actions {
        justify-self: end;
    }

    .site-nav {
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(100% + 8px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(8, 10, 15, 0.98);
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        justify-content: center;
    }

    .game-card-grid,
    .jackplay-game-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .jackplay-play-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .site-container {
        width: min(100% - 22px, var(--container));
    }

    .site-header-inner {
        min-height: 66px;
        gap: 10px;
    }

    .site-icon-button,
    .site-menu-toggle {
        width: 38px;
        height: 38px;
    }

    .game-hero,
    .game-hero-track {
        min-height: 520px;
        height: 520px;
    }

    .game-hero-slide::after {
        background:
            linear-gradient(180deg, rgba(5, 6, 7, 0.45) 0%, rgba(5, 6, 7, 0.96) 72%),
            linear-gradient(90deg, rgba(5, 6, 7, 0.76), rgba(5, 6, 7, 0.35));
    }

    .game-hero-content {
        padding: 120px 0 110px;
    }

    .game-hero h1 {
        font-size: 3rem;
    }

    .catalog-filter-bar {
        grid-template-columns: 1fr 42px;
    }

    .game-card-grid,
    .jackplay-game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .game-card-body,
    .jackplay-game-body {
        padding: 10px;
    }

    .game-card-body h3,
    .jackplay-game-body h3 {
        font-size: 0.94rem;
    }

    .site-footer-top,
    .site-footer-bottom {
        display: grid;
        grid-template-columns: 1fr;
    }

    .jackplay-game-head {
        display: grid;
    }

    .jackplay-game-frame {
        min-height: 620px;
    }

    .jackplay-rankings {
        grid-template-columns: 1fr;
    }
}
