:root {
    --link-primary-color: #00ffff;
    --link-secondary-color: #00bfff;
}

body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
}

.main-container {
    display: flex;
    min-height: 100%;
}

/* ========== ПРАВАЯ КОЛОНКА (Контент) ========== */
.content-area {
    flex-grow: 1;
    padding: 0;
}

.site-header {
    text-align: center;
    background: #000;
    overflow: hidden;
}

.header-banner-crop {
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 2560 / 423;
    overflow: hidden;
    transition: all 0.4s ease;
}

.header-banner-crop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ========== СЕТКА МОДОВ ========== */
.mods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 0 40px;
}

.mod-card {
    min-width: 0;
    max-width: 400px;
    background-color: #0a0a0a;
    border: 1px solid #222;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.mod-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 25px rgba(0, 255, 255, 0.22);
    border-color: #00ffff44;
}

.mod-image-placeholder {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: #111;
    cursor: pointer;
    border-radius: 14px 14px 0 0;
}

.mod-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.65s cubic-bezier(0.22, 0.81, 0.33, 1);
    transform: scale(1.02);
    border-radius: 14px 14px 0 0;
}

.mod-card:hover .mod-image-placeholder img {
    transform: scale(1.18);
}

.mod-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.meta {
    font-size: 11px;
    color: #777;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.views {
    color: #777;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.mod-card h3 {
    font-size: 16px;
    margin: 8px 0 12px 0;
    color: #eee;
    flex-grow: 1;
}

.mod-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    font-size: 12px;
    border-top: 1px solid #222;
}

.btn-share {
    color: var(--link-secondary-color);
    text-decoration: none;
}

.read-more {
    color: var(--link-primary-color);
    font-weight: bold;
}

@media (max-width: 900px) {
    .mods-grid {
        padding: 0 10px;
        grid-template-columns: repeat(2, 1fr);
    }

    .mod-card h3 {
        font-size: 14px;
    }

    .meta {
        font-size: 10px;
    }
}

/* ========== СТРАНИЦА ПОСТА ========== */
.mod-wrapper {
    max-width: 900px;
    margin: auto;
    padding: 25px;
    background: #111;
    color: #eee;
    border-radius: 15px;
    box-shadow: 0 0 20px #000;
}

.back-link {
    color: #00f7ff;
    text-decoration: none;
    font-size: 14px;
}

.mod-header {
    margin-top: 10px;
    margin-bottom: 20px;
}

.mod-title {
    margin: 0;
    font-size: 32px;
    color: #fff;
}

.mod-meta {
    margin-top: 10px;
    color: #bbb;
    line-height: 1.5;
}

.preview-box {
    text-align: center;
    margin: 25px 0;
}

.preview-img {
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    border: 2px solid #222;
    box-shadow: 0 0 10px #000;
}

.section-title {
    font-size: 26px;
    margin-bottom: 10px;
    color: #fff;
    border-left: 4px solid #4de0ff;
    padding-left: 10px;
}

.description-text {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #222;
    white-space: pre-line;
}

.links-block {
    background: #0f0f0f;
    border: 1px solid #222;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.description-text a,
.links-block a {
    color: #d9ab21;
    font-weight: bold;
    text-decoration: underline;
}

.description-text a:hover,
.links-block a:hover {
    color: #b28c1b;
}

.buttons-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.gameplay-wrap {
    text-align: center;
    margin-top: 25px;
}

.youtube-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 22px rgba(255, 0, 0, 0.9);
}

.download-wrap {
    text-align: center;
    margin-top: 25px;
}

.download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #00d4ff;
}

.youtube-btn,
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    text-decoration: none;
    color: white;
    transition: .2s;
}

.youtube-btn {
    background: linear-gradient(90deg, #ff0000, #ff5353);
    box-shadow: 0 0 15px #ff0000;
}

.download-btn {
    background: linear-gradient(90deg, #0077ff, #00d4ff);
    box-shadow: 0 0 15px #0077ff;
}

@media (max-width: 900px) {
    .back-link {
        margin-left: 50px;
    }
}

/* ========== МОДАЛЬНОЕ ОКНО (Pop-up) ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1600;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.85);
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background-color: #1a1a1a;
    width: 70vmin;
    /* 70% от меньшего из (Viewport Width или Viewport Height) */
    height: 70vmin;

    margin: 15% auto;
    padding: 3vmin;

    border: 1px solid var(--link-primary-color);

    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    transition: transform 0.3s ease-in-out;
    transform: translateY(20px);

    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal.is-open .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    color: var(--link-primary-color);
    margin-bottom: 2vmin;
    border-bottom: 1px solid #333;
    padding-bottom: 1vmin;
    font-size: 4vmin;
}

.modal-content p {
    font-size: 2.3vmin;
    line-height: 1.4;
    flex-shrink: 0;
}

.close-btn {
    color: var(--link-primary-color);
    float: right;
    font-size: 3.5vmin;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #ff0000;
}

/* ========== ПАНЕЛЬ УПРАВЛЕНИЯ ========== */
.controls-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 40px;
    gap: 10px;
    margin: 30px 0 25px;
}

.sort-controls label {
    font-size: 14px;
    color: #aaa;
    margin-right: 10px;
}

.sort-controls,
.search-wrapper {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

#sort-selector,
#search-input {
    background-color: #000000;
    color: var(--link-primary-color);
    border: 1px solid var(--link-primary-color);
    padding: 5px 10px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#sort-selector {
    cursor: pointer;
}

#search-input {
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--link-primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.35);
    background: #0a0a0a;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #777;
    font-size: 18px;
}

@media (max-width: 900px) {
    .controls-bar {
        padding: 0 15px;
    }
}

/* ========== САЙДБАР ========== */
.sidebar {
    width: 200px;
    background-color: #000000;
    border-right: 1px solid #222;
    padding: 20px;
    flex-shrink: 0;
    transform: translateX(0%);
    transition: transform 0.3s ease;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 15px;
    border: 2px solid var(--link-primary-color);
}

.hacker-name {
    text-align: center;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: normal;
}

.btn-profile {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid var(--link-primary-color);
    color: var(--link-primary-color);
    padding: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 30px;
}

.links-title {
    color: #fff;
    font-size: 14px;
    margin-top: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.menu-links a {
    display: block;
    color: var(--link-secondary-color);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 8px;
}

.menu-links a:hover {
    text-decoration: underline;
}

/* Панель языка */
.language-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.language-dropdown select {
    background-color: #000000;
    color: var(--link-primary-color);
    border: 1px solid var(--link-primary-color);
    width: 100%;
    padding: 5px 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0);
  pointer-events: none;
  transition: background-color 0.4s ease;
  z-index: 9999;
}

#page-transition-overlay.active {
  background-color: rgba(255, 255, 255, 1);
}

/* Затемнение основного контента */
.sidebar-overlay,
.sidebar-overlay.visible {
    visibility: hidden;
    opacity: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.sidebar-toggle {
    display: none;
}

/* Адаптация для экранов до 900px */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        background: #000;
        padding: 20px;
        border-right: 1px solid #222;
        transform: translateX(-100%);
        z-index: 1400;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Бургер-кнопка */
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1500;
        background: none;
        border: none;
        cursor: pointer;
        width: 35px;
        height: 30px;
    }

    .sidebar-toggle span,
    .sidebar-toggle span::before,
    .sidebar-toggle span::after {
        position: absolute;
        left: 0;
        width: 35px;
        height: 4px;
        background: var(--link-primary-color);
        border-radius: 3px;
        transition: 0.3s;
    }

    .sidebar-toggle span {
        top: 50%;
        transform: translateY(-50%);
    }

    .sidebar-toggle span::before {
        content: "";
        top: -10px;
    }

    .sidebar-toggle span::after {
        content: "";
        top: 10px;
    }

    /* Анимация превращения в крестик */
    .sidebar-toggle.active span {
        background: transparent;
    }

    .sidebar-toggle.active span::before {
        top: 0;
        transform: rotate(45deg);
    }

    .sidebar-toggle.active span::after {
        top: 0;
        transform: rotate(-45deg);
    }

    /* Затемнение основного контента */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.35s ease,
            backdrop-filter 0.35s ease,
            -webkit-backdrop-filter 0.35s ease,
            visibility 0.35s ease;
        z-index: 1300;
    }

    .sidebar-overlay.visible {
        visibility: visible;
        opacity: 1;
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
}