/* ===== Base Reset & Global ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0505;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Progress Bar ===== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #e50019, #ff2d42);
    z-index: 9999;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(229, 0, 25, 0.5);
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #0d0808;
    border-bottom: 1px solid #2a1818;
    height: 56px;
}

.header-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.header-login {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: color 0.2s;
}

.header-login:hover {
    color: #e50019;
}

/* ===== Hamburger ===== */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    gap: 5px;
    position: relative;
    z-index: 201;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Side Menu ===== */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #0d0808;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.side-menu::-webkit-scrollbar {
    width: 4px;
}

.side-menu::-webkit-scrollbar-track {
    background: #0d0808;
}

.side-menu::-webkit-scrollbar-thumb {
    background: #2a1818;
    border-radius: 4px;
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-buttons {
    display: flex;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid #2a1818;
}

.btn-register {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #e50019;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    text-align: center;
}

.btn-register:hover {
    background: #ff1a33;
    box-shadow: 0 0 20px rgba(229, 0, 25, 0.3);
}

.btn-login {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #2a1515;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.btn-login:hover {
    background: #3a2020;
}

/* Side Menu Navigation */
.side-menu-navigation {
    padding: 8px 0;
    flex: 1;
}

.side-menu-navigation > a {
    display: block;
    padding: 12px 20px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.side-menu-navigation > a:hover {
    background: rgba(229, 0, 25, 0.05);
    color: #e50019;
    border-left-color: #e50019;
}

.side-menu-navigation > a.disabled-link {
    color: #475569;
    pointer-events: none;
}

/* Toggle Sections */
.side-menu-navigation-toggle {
    border-left: 3px solid transparent;
}

.toggle-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-link:hover {
    background: rgba(229, 0, 25, 0.05);
    color: #e50019;
}

.toggle-arrow {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.toggle-arrow.rotated {
    transform: rotate(180deg);
}

.toggle-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.toggle-content.open {
    max-height: 2000px;
}

.toggle-content .games-category {
    display: block;
    padding: 8px 20px 8px 32px;
    color: #94a3b8;
    font-size: 13px;
    transition: all 0.2s;
}

.toggle-content .games-category:hover {
    color: #e50019;
    background: rgba(229, 0, 25, 0.05);
}

/* Locale Block */
.locale-block {
    padding: 16px;
    border-top: 1px solid #1e293b;
}

.locale-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #120a0a;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #cbd5e1;
    transition: background 0.2s;
}

.locale-current:hover {
    background: #2a1515;
}

.locale-current img {
    border-radius: 2px;
}

.locale-current svg {
    margin-left: auto;
}

.locale-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 4px;
}

.locale-dropdown.open {
    max-height: 400px;
}

.locale-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #94a3b8;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
}

.locale-item:hover {
    background: #2a1515;
    color: #e2e8f0;
}

.locale-item img {
    border-radius: 2px;
}

/* ===== Search Form ===== */
.search-form-block {
    padding: 72px 15px 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.search-form {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 20px 15px;
}

.search-form__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-form__label {
    background-color: #280000;
    border: 1px solid #385454;
    border-radius: 0.6em;
    display: block;
    margin: 0;
    width: 100%;
}

.search-input {
    -webkit-appearance: none;
    width: 100%;
    padding: 8px 40px 8px 2em;
    background: transparent;
    border: 0;
    border-radius: 0.6em;
    box-sizing: border-box;
    color: #fff;
    display: block;
    font-size: 14px;
    line-height: 1.4em;
    min-height: 2.2em;
    outline: 0;
    text-align: left;
    text-shadow: 0 1px 0 #444;
    transition: box-shadow 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-shadow: none;
}

.search-input:active,
.search-input:focus {
    box-shadow: 0 0 12px #38c;
}

/* Search icon (magnifying glass) */
.search-form__icon {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20style%3D%22fill%3A%23FFFFFF%22%20d%3D%22M10.171%2C8.766c0.617-0.888%2C0.979-1.964%2C0.979-3.126c0-3.037-2.463-5.5-5.5-5.5s-5.5%2C2.463-5.5%2C5.5%20s2.463%2C5.5%2C5.5%2C5.5c1.152%2C0%2C2.223-0.355%2C3.104-0.962l3.684%2C3.683l1.414-1.414L10.171%2C8.766z%20M5.649%2C9.14c-1.933%2C0-3.5-1.567-3.5-3.5%20c0-1.933%2C1.567-3.5%2C3.5-3.5c1.933%2C0%2C3.5%2C1.567%2C3.5%2C3.5C9.149%2C7.572%2C7.582%2C9.14%2C5.649%2C9.14z%22%2F%3E%3C%2Fsvg%3E");
    background-position: 50%;
    background-repeat: no-repeat;
    height: 14px;
    left: 7px;
    opacity: 0.5;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    z-index: 2;
    pointer-events: none;
}

/* Close/clear search button */
.close-search {
    align-items: center;
    background: linear-gradient(180deg, #9c2c05 0%, #280000 100%);
    border: none;
    border-radius: 1em;
    color: #fff;
    cursor: pointer;
    display: none;
    height: 28px;
    justify-content: center;
    min-height: 28px;
    min-width: 28px;
    position: absolute;
    right: 6px;
    text-shadow: 0 0 0 #444;
    width: 28px;
    z-index: 2;
    transition: opacity 0.2s;
}

.close-search:after {
    background-color: rgba(0, 0, 0, 0.15);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C%21DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C3%2011%2C0%207%2C4%203%2C0%200%2C3%204%2C7%200%2C11%203%2C14%207%2C10%2011%2C14%2014%2C11%2010%2C7%20%22%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3C%2Fsvg%3E");
    background-position: 50%;
    background-repeat: no-repeat;
    border-radius: 50%;
    content: "";
    height: 22px;
    min-height: 22px;
    min-width: 22px;
    position: absolute;
    width: 22px;
}

.close-search.show {
    display: flex;
}

.close-search:hover {
    opacity: 0.85;
}

/* No games found message */
.no-games-message {
    border-bottom: 1px solid #fff;
    color: #e2e8f0;
    display: none;
    padding: 1em 0;
    text-align: center;
    font-size: 14px;
}

/* ===== Games Block ===== */
.games-block {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 480px) {
    .games-block {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (min-width: 640px) {
    .games-block {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) {
    .games-block {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1100px) {
    .games-block {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1300px) {
    .games-block {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* Game Card */
.games-block__game {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1a0e0e;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.games-block__game:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(229, 0, 25, 0.1);
}

.games-block__game a {
    display: block;
    width: 100%;
    height: 100%;
}

.games-block__game .game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.game-labels-wrapper {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.game-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 30px 8px 8px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
    pointer-events: none;
}

.games-block__game:hover .game-hover {
    opacity: 1;
}

.game-hover .game-title {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.games-block__game > .game-title {
    display: none;
}

/* ===== Load More Button ===== */
.btn-load-games {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 32px);
    max-width: 400px;
    margin: 20px auto 40px;
    padding: 14px 24px;
    background: #2a1515;
    border: 1px solid #3a2020;
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-games:hover {
    background: #3a2020;
    border-color: #4a2a2a;
}

.btn-load-games__text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== SEO Block ===== */
.seo-block {
    background: #0d0808;
    border-top: 1px solid #2a1818;
    padding: 40px 0;
}

.seo-block__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.seo-block__title {
    color: #e2e8f0;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.seo-block__content {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.8;
}

.seo-block__content p {
    margin-bottom: 14px;
}

.seo-block__content p:last-child {
    margin-bottom: 0;
}

@media (min-width: 640px) {
    .seo-block__title {
        font-size: 24px;
    }

    .seo-block__content {
        font-size: 14px;
    }
}

@media (min-width: 900px) {
    .seo-block__content {
        columns: 2;
        column-gap: 32px;
    }

    .seo-block__content p {
        break-inside: avoid;
    }
}

/* ===== Footer ===== */
.footer {
    background: #080404;
    border-top: 1px solid #2a1818;
}

.footer-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 16px;
}

.footer-logo {
    display: inline-flex;
    margin-bottom: 24px;
}

.footer-logo img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.footer-navigation {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (min-width: 640px) {
    .footer-navigation {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-navigation-block-title {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-navigation-block-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-navigation-block-list a {
    color: #64748b;
    font-size: 13px;
    transition: color 0.2s;
    line-height: 1.5;
}

.footer-navigation-block-list a:hover {
    color: #e50019;
}

.footer-license {
    border-top: 1px solid #2a1818;
    padding: 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.footer-license-image {
    flex-shrink: 0;
}

.footer-license-image img {
    width: 60px;
    height: 60px;
}

.footer-license-text {
    color: #475569;
    font-size: 11px;
    line-height: 1.6;
}

/* ===== Scroll Top Button ===== */
.scroll-top-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: #2a1515;
    border: 1px solid #3a2020;
    border-radius: 10px;
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.scroll-top-button::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-left: 2px solid #e2e8f0;
    border-top: 2px solid #e2e8f0;
    transform: rotate(45deg) translateY(3px);
}

.scroll-top-button.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-button:hover {
    background: #3a2020;
    border-color: #e50019;
}

.scroll-top-button:hover::before {
    border-color: #e50019;
}

/* ===== Loader ===== */
.loader-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0505;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.loader-background.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-ring {
    position: relative;
    width: 60px;
    height: 60px;
}

.loader-ring__light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #e50019;
    animation: spin 1s linear infinite;
}

.loader-ring__track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #2a1818;
}

.loader-image {
    width: 40px;
    height: 40px;
    margin-top: 16px;
    background: url('https://r.mqcdex.com/build/images/manifest/512x512.png?v10189') center/contain no-repeat;
    border-radius: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Index Page ===== */
.index-page {
    min-height: calc(100vh - 56px);
    padding-bottom: 20px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.games-block__game {
    animation: fadeInUp 0.4s ease both;
}

/* Stagger animation */
.games-block__game:nth-child(1) { animation-delay: 0.02s; }
.games-block__game:nth-child(2) { animation-delay: 0.04s; }
.games-block__game:nth-child(3) { animation-delay: 0.06s; }
.games-block__game:nth-child(4) { animation-delay: 0.08s; }
.games-block__game:nth-child(5) { animation-delay: 0.10s; }
.games-block__game:nth-child(6) { animation-delay: 0.12s; }
.games-block__game:nth-child(7) { animation-delay: 0.14s; }
.games-block__game:nth-child(n+8) { animation-delay: 0.16s; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .side-menu {
        width: 280px;
    }

    .search-form-block {
        padding-top: 68px;
    }

    .footer-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .footer-license {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}