/* Retro Games — 16-bit Arcade Theme & Custom 3-Column Layout */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Roboto+Mono:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #000000;
    --surface: #060c18;
    --surface-2: #0b1526;
    --surface-3: #10213d;
    --text: #f4f7ff;
    --muted: #8ca5c8;
    --blue: #00aaff;
    --blue-bright: #24c7ff;
    --blue-dark: #0757ad;
    --yellow: #ffe600;
    --green: #00e653;
    --green-dark: #008731;
    --red: #ff3355;
    --border: #00aaff;
    --pixel-font: "Press Start 2P", "Courier New", monospace;
    --body-font: "Roboto Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #000000;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: var(--body-font);
    font-size: 13px;
    line-height: 1.5;
    background: #000000;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: .08;
    background-image:
        linear-gradient(rgba(0, 170, 255, .25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, .25) 1px, transparent 1px);
    background-size: 20px 20px;
}

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

button {
    cursor: pointer;
}

a {
    color: var(--blue-bright);
    text-decoration: none;
}

/* ==========================================================================
   3-Column Site Layout (Left: Themes, Center: Portal, Right: Genres)
   ========================================================================== */
.site-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 840px) 195px;
    justify-content: center;
    gap: 22px;
    max-width: 1420px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ==========================================================================
   Left Sidebar: Themes (Квадратные слоты тематик - 3 в ряд)
   ========================================================================== */
.sidebar-col {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #0e2a4a transparent;
}

.sidebar-col::-webkit-scrollbar {
    width: 4px;
}

.sidebar-col::-webkit-scrollbar-thumb {
    background: #0e2a4a;
    border-radius: 2px;
}

.sidebar-title {
    font-family: var(--pixel-font);
    font-size: 12px;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    text-align: center;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 10px;
    justify-content: center;
}

.theme-slot {
    position: relative;
    width: 72px;
    height: 72px;
    background: #050a14;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 3px 3px 0 #02050a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: visible;
    transition: transform .15s ease, border-color .15s ease;
}

.theme-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    display: block;
}

.slot-placeholder-icon {
    font-size: 26px;
    user-select: none;
}

.theme-slot:hover {
    border-color: var(--yellow);
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px #000, 4px 4px 0 #02050a;
    z-index: 20;
}

.theme-slot.active {
    border-color: var(--yellow) !important;
    box-shadow: 0 0 0 2px #000, 4px 4px 0 #02050a !important;
    transform: scale(1.04);
}

/* Всплывающий текст с названием тематики при наведении */
.theme-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #091322;
    border: 1px solid var(--blue);
    color: #ffffff;
    font-family: var(--pixel-font);
    font-size: 9px;
    line-height: 1.4;
    padding: 5px 9px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

.theme-slot:hover .theme-tooltip {
    opacity: 1;
}

.btn-theme-edit-gear {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    background: rgba(0,0,0,0.9);
    border: 1px solid var(--blue);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
    cursor: pointer;
    z-index: 5;
}

.theme-slot:hover .btn-theme-edit-gear {
    opacity: 1;
}

/* Кнопка добавления новой тематики [+] */
.theme-slot-add {
    background: #060b16;
    border: 2px dashed #ffe600;
}

.theme-slot-add .plus-icon {
    font-family: var(--pixel-font);
    font-size: 30px;
    color: #ffe600;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.7);
    transition: transform .15s;
}

.theme-slot-add:hover .plus-icon {
    transform: scale(1.2);
}

/* ==========================================================================
   Right Sidebar: Genres (Жанры)
   ========================================================================== */
.sidebar-right .genres-title {
    font-size: 18px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.genres-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.genre-item {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050a14;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 2px 2px 0 #02050a;
    color: #d8e8ff;
    font-family: var(--pixel-font);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all .15s ease;
    border-radius: 0;
}

.genre-item:hover {
    border-color: var(--yellow);
    color: var(--yellow);
    background: #0d1a30;
    transform: translateX(-2px);
    box-shadow: 0 0 0 2px #000, 2px 2px 0 #02050a;
}

.genre-item.active {
    border-color: var(--yellow) !important;
    background: var(--yellow) !important;
    color: #03060c !important;
    font-weight: bold;
    box-shadow: 0 0 14px rgba(255, 230, 0, 0.6) !important;
}

/* ==========================================================================
   Center Main Portal
   ========================================================================== */
.main-portal {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Верхняя ретро-шапка */
.retro-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    margin-bottom: 20px;
    background: #040812;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 3px 3px 0 #02050a;
}

.retro-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 20px;
}

.brand-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 6px rgba(0, 217, 255, 0.6));
    border-radius: 4px;
}

.brand-name {
    font-family: var(--pixel-font);
    font-size: 14px;
    color: var(--yellow);
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
}

.retro-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #b0d2ff;
    padding: 6px 10px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .15s ease;
    background: transparent;
}

.nav-item:hover,
.nav-item.active {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(255, 230, 0, 0.08);
}

.retro-header-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.retro-slogan {
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #e2eeff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.heart-icon {
    font-size: 11px;
}

.header-quick-btns {
    display: flex;
    gap: 8px;
}

/* Статус эмулятора */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    background: #060d19;
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue-bright);
    font-size: 11px;
    color: #cfeaff;
}

.status-badge.ready {
    color: var(--green);
    font-weight: bold;
}

.status-badge.warning {
    color: var(--yellow);
}

/* ==========================================================================
   Smooth 3D Retro Carousel (Прямоугольные вертикальные обложки)
   ========================================================================== */
.featured-slider {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 470px;
    padding: 18px 12px 24px;
    margin-bottom: 24px;
    background: #03060e;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 3px 3px 0 #02050a;
    overflow: hidden;
    isolation: isolate;
}

.featured-carousel-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    perspective: 1100px;
}

.featured-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Прямоугольный вертикальный слайд (как на примере пользователя) */
.featured-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 310px;
    user-select: none;
    will-change: transform, opacity;
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1),
                opacity 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    cursor: pointer;
}

.featured-slide .featured-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000000;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 0 10px 24px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    border-radius: 4px;
    transition: border-color .25s, box-shadow .25s;
}

.featured-slide .featured-cover-wrap {
    flex: 1 1 auto;
    width: 100%;
    overflow: hidden;
    background: #040710;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-slide .featured-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    display: block;
}

.featured-slide .featured-caption {
    flex: 0 0 auto;
    padding: 8px 6px;
    background: #000000;
    border-top: 2px solid #091526;
    text-align: center;
}

.featured-slide .featured-title {
    margin: 0 0 4px;
    font-family: var(--pixel-font);
    font-size: 10px;
    line-height: 1.35;
    color: #ffffff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-slide .featured-subtitle {
    font-family: var(--pixel-font);
    font-size: 7px;
    color: #00e5ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Активный центральный слайд: золотистая подсветка и крупнее */
.featured-slide[data-pos="0"] {
    transform: translate3d(-50%, -50%, 0) scale(1.08);
    opacity: 1;
    z-index: 10;
}

.featured-slide[data-pos="0"] .featured-card {
    border: 3px solid var(--yellow);
    box-shadow: 0 0 0 2px #000, 0 0 26px rgba(255, 230, 0, 0.5);
}

.featured-slide[data-pos="0"] .featured-title {
    color: var(--yellow);
}

/* Боковые слайды */
.featured-slide[data-pos="-1"] {
    transform: translate3d(calc(-50% - 210px), -50%, -60px) scale(0.85);
    opacity: 0.7;
    z-index: 5;
}

.featured-slide[data-pos="1"] {
    transform: translate3d(calc(-50% + 210px), -50%, -60px) scale(0.85);
    opacity: 0.7;
    z-index: 5;
}

.featured-slide[data-pos="-2"] {
    transform: translate3d(calc(-50% - 360px), -50%, -140px) scale(0.68);
    opacity: 0.3;
    z-index: 2;
}

.featured-slide[data-pos="2"] {
    transform: translate3d(calc(-50% + 360px), -50%, -140px) scale(0.68);
    opacity: 0.3;
    z-index: 2;
}

.featured-slide[data-pos="hidden"] {
    transform: translate3d(-50%, -50%, -200px) scale(0.5);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

/* Стрелки слайдера */
.featured-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    width: 36px;
    height: 48px;
    background: #040914;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 2px 2px 0 #02050a;
    color: var(--blue-bright);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}

.featured-arrow:hover {
    background: #0c182c;
    border-color: var(--yellow);
    color: var(--yellow);
    box-shadow: 0 0 0 2px #000, 0 0 14px rgba(255, 230, 0, 0.4);
}

.featured-arrow-left { left: 8px; }
.featured-arrow-right { right: 8px; }

/* Пагинация (квадратные ретро-точки) */
.featured-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 16px;
    z-index: 10;
}

.featured-pagination button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid var(--blue);
    background: #07101c;
    cursor: pointer;
    transition: all .15s;
    border-radius: 0;
}

.featured-pagination button.active {
    background: var(--yellow);
    border-color: var(--yellow);
    box-shadow: 0 0 8px rgba(255, 230, 0, 0.8);
    transform: scale(1.15);
}

/* Большая зеленая кнопка "▶ ИГРАТЬ" со стрелками */
.featured-play-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.pixel-arrow-deco {
    font-family: var(--pixel-font);
    font-size: 16px;
    color: #00e5ff;
    letter-spacing: 2px;
    user-select: none;
}

.featured-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 36px;
    background: var(--green);
    border: 3px solid #b8ffcb;
    box-shadow: 0 5px 0 var(--green-dark), 0 0 18px rgba(0, 230, 83, 0.4);
    color: #031206;
    font-family: var(--pixel-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, filter .12s, box-shadow .12s;
    border-radius: 2px;
}

.featured-play:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--green-dark), 0 0 24px rgba(0, 230, 83, 0.6);
}

.featured-play:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--green-dark);
}

/* ==========================================================================
   Разделитель секции "ВСЕ ИГРЫ"
   ========================================================================== */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 32px 0 20px;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: #00aaff;
}

.section-heading {
    font-family: var(--pixel-font);
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   Панель поиска и фильтров
   ========================================================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #050a14;
    border: 2px solid #0d3257;
    box-shadow: 0 0 0 2px #000;
}

.toolbar-search {
    flex: 1;
}

.toolbar-search input,
.toolbar-group select {
    width: 100%;
    padding: 9px 12px;
    background: #03060d;
    border: 1px solid var(--blue);
    color: #fff;
    font-size: 12px;
    outline: none;
    border-radius: 0;
}

.toolbar-search input:focus,
.toolbar-group select:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 8px rgba(255, 230, 0, 0.4);
}

/* Активные фильтры */
.active-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    margin-bottom: 16px;
    background: #091728;
    border: 1px solid var(--yellow);
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.2);
}

.filter-indicator {
    font-family: var(--pixel-font);
    font-size: 9px;
    color: var(--yellow);
    letter-spacing: 1px;
}

.btn-clear-filter {
    padding: 4px 10px;
    background: #20080e;
    border: 1px solid var(--red);
    color: #ff8095;
    font-family: var(--pixel-font);
    font-size: 8px;
    cursor: pointer;
}

.btn-clear-filter:hover {
    background: var(--red);
    color: #fff;
}

/* ==========================================================================
   Сетка игр и карточки
   ========================================================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.game-card {
    position: relative;
    background: #040812;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 3px 3px 0 #02050a;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: visible;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn-fav-star {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 20;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #142a4a;
    color: #6884a8;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: all .15s ease;
}

.btn-fav-star:hover {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(10, 20, 36, 0.95);
    transform: scale(1.15);
}

.btn-fav-star.is-fav {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(0, 0, 0, 0.85);
}

.game-card:hover {
    border-color: var(--yellow);
    transform: translateY(-4px);
    box-shadow: 0 0 0 2px #000, 4px 6px 0 #02050a;
    z-index: 10;
}

.game-card.has-menu-open {
    z-index: 60 !important;
    border-color: var(--yellow) !important;
}

.game-card .game-cover-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #020409;
    border-bottom: 2px solid #0d223c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card .game-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    display: block;
}

.game-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--pixel-font);
    text-align: center;
    padding: 10px;
}

.game-info {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-title {
    margin: 0 0 6px;
    color: #ffffff;
    font-family: var(--pixel-font);
    font-size: 10px;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.game-meta-line {
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #00e5ff;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Хэштеги */
.game-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 10px;
}

.hashtag-chip {
    font-size: 10px;
    color: #72aeff;
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid #14355a;
    padding: 2px 6px;
    cursor: pointer;
    transition: all .12s;
    user-select: none;
}

.hashtag-chip:hover {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(255, 230, 0, 0.15);
}

.hashtag-chip.active {
    color: #000;
    background: var(--yellow);
    border-color: var(--yellow);
    font-weight: bold;
}

.btn-add-tag-chip {
    font-size: 10px;
    color: #4a75a0;
    background: transparent;
    border: 1px dashed #1d4068;
    padding: 2px 6px;
    cursor: pointer;
    transition: all .12s;
    user-select: none;
    line-height: 1.2;
    border-radius: 2px;
}

.btn-add-tag-chip:hover {
    color: var(--yellow);
    border-color: var(--yellow);
    background: rgba(255, 230, 0, 0.1);
}

.btn-add-tag-empty {
    color: #6da2db;
    border-style: solid;
    border-color: #1a3b63;
    background: #061122;
    padding: 3px 8px;
    font-size: 9.5px;
}

.btn-add-tag-empty:hover {
    color: #ffffff;
    border-color: var(--yellow);
    background: #0d223f;
}

/* Подсказки тегов в форме добавления/редактирования */
.tag-suggestions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag-suggestion-chip {
    display: inline-block;
    padding: 2px 6px;
    background: #071324;
    border: 1px solid #14355a;
    color: #8bb6e8;
    font-size: 10px;
    cursor: pointer;
    transition: all .12s;
    border-radius: 2px;
}

.tag-suggestion-chip:hover {
    color: var(--yellow);
    border-color: var(--yellow);
    background: #0f2444;
}

/* Модальное окно управления тегами */
.tag-manager-game-title {
    font-family: var(--pixel-font);
    font-size: 11px;
    color: var(--yellow);
    margin-bottom: 14px;
    line-height: 1.4;
}

.current-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
    padding: 10px;
    background: #030711;
    border: 1px solid #14355a;
    margin-bottom: 16px;
    align-items: center;
}

.tag-removable-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: #0a1f38;
    border: 1px solid var(--blue);
    color: #d8eaff;
    font-size: 11px;
    border-radius: 2px;
}

.tag-remove-btn {
    background: none;
    border: none;
    color: #ff647f;
    font-weight: bold;
    cursor: pointer;
    padding: 0 2px;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.tag-remove-btn:hover {
    color: #ff1a40;
}

.quick-tags-picker {
    margin-bottom: 16px;
}

.quick-tags-picker-title {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 8px;
}

.quick-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-tag-btn {
    padding: 4px 9px;
    background: #061224;
    border: 1px solid #163e6e;
    color: #8bb6e8;
    font-size: 11px;
    cursor: pointer;
    transition: all .12s;
    border-radius: 2px;
}

.quick-tag-btn:hover {
    border-color: var(--yellow);
    color: var(--yellow);
    background: #0e223d;
}

.add-tag-input-group {
    display: flex;
    gap: 8px;
}

.add-tag-input-group input {
    flex: 1;
    padding: 8px 12px;
    background: #03060d;
    border: 1px solid var(--blue);
    color: #fff;
    font-size: 12px;
    outline: none;
    border-radius: 0;
}

.add-tag-input-group input:focus {
    border-color: var(--yellow);
}

/* Панель кнопок Играть / ⋮ */
.game-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    position: relative;
}

.btn {
    border-radius: 0;
    font-family: var(--pixel-font);
    cursor: pointer;
    text-align: center;
    transition: all .15s ease;
}

.btn-primary {
    background: var(--green);
    border: 2px solid #94ffb2;
    color: #031206;
    font-weight: bold;
    box-shadow: 0 3px 0 var(--green-dark);
}

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

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--green-dark);
}

.btn-secondary {
    background: #081220;
    border: 2px solid var(--blue);
    color: var(--blue-bright);
    box-shadow: 0 3px 0 #020710;
}

.btn-secondary:hover {
    background: #102138;
    border-color: var(--yellow);
    color: var(--yellow);
}

.btn-danger {
    background: #870e23;
    border: 2px solid #ff5974;
    color: #ffffff;
    box-shadow: 0 3px 0 #3d050f;
}

.btn-danger:hover {
    background: #aa1530;
}

.btn-small {
    padding: 6px 10px;
    font-size: 8px;
}

.btn-play {
    flex: 1;
    min-height: 34px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.game-menu-wrap {
    position: relative;
}

.btn-dots {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07101c;
    border: 2px solid var(--blue);
    color: var(--blue-bright);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 0 #02050a;
}

.btn-dots:hover,
.btn-dots.active {
    background: #0f223a;
    border-color: var(--yellow);
    color: var(--yellow);
}

/* Выпадающее меню ⋮ */
.game-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 100;
    min-width: 175px;
    background: #060c18;
    border: 2px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 0 8px 24px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: #e2eeff;
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #102444;
    color: #fff;
}

.dropdown-item-danger {
    color: #ff7688;
    border-top: 1px solid #0f2038;
}

.dropdown-item-danger:hover {
    background: #500f1c;
    color: #ffabb6;
}

/* ==========================================================================
   Модальные окна
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow-y: auto;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden,
.hidden {
    display: none !important;
}

.modal-content,
.player-modal-content {
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    color: var(--text);
    background: #050a14;
    border: 3px solid var(--blue);
    box-shadow: 0 0 0 2px #000, 8px 8px 0 #02050a;
    border-radius: 0;
}

.modal-header,
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #081324;
    border-bottom: 2px solid var(--blue);
}

.modal-header h2,
.player-header h3 {
    margin: 0;
    color: var(--yellow);
    font-family: var(--pixel-font);
    font-size: 12px;
    line-height: 1.6;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: #14080e;
    border: 2px solid var(--red);
    color: var(--red);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--red);
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--pixel-font);
    font-size: 8px;
    color: var(--blue-bright);
    letter-spacing: 1px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    background: #020409;
    border: 1px solid var(--border);
    color: #ffffff;
    font-size: 13px;
    border-radius: 0;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--yellow);
    box-shadow: 0 0 8px rgba(255, 230, 0, 0.35);
}

.auto-fetch-box {
    margin: 10px 0 16px;
    padding: 12px;
    background: #07101e;
    border: 1px dashed var(--blue);
    font-size: 12px;
}

.preview-cover {
    width: 90px;
    height: 110px;
    object-fit: cover;
    background: #02050a;
    border: 2px solid var(--blue);
}

.preview-theme-slot-wrap {
    width: 78px;
    height: 78px;
    border: 2px solid var(--blue);
    background: #020409;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-theme-slot-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

/* Игровой плеер */
.player-modal-content {
    width: min(1200px, 100%);
    height: min(840px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
}

.player-frame-wrap {
    flex: 1;
    background: #000;
}

#player-frame {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    border: 2px dashed #0c2b4d;
    background: #040812;
}

.empty-state h3 {
    font-family: var(--pixel-font);
    font-size: 11px;
    color: var(--yellow);
}

/* ==========================================================================
   Адаптивность (Responsive Media Queries)
   ========================================================================== */
@media (max-width: 1200px) {
    .site-layout {
        grid-template-columns: 1fr;
        max-width: 900px;
    }

    .sidebar-col {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-bottom: 0;
    }

    .sidebar-left {
        order: 2;
        margin-top: 20px;
    }

    .themes-grid {
        grid-template-columns: repeat(auto-fill, 78px);
    }

    .sidebar-right {
        order: 3;
        margin-top: 20px;
    }

    .genres-menu {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 768px) {
    .retro-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .retro-header-meta {
        flex-wrap: wrap;
    }

    .featured-slider {
        min-height: 380px;
        padding: 12px 6px;
    }

    .featured-carousel-wrap {
        height: 270px;
    }

    .featured-slide {
        width: 170px;
        height: 240px;
    }

    .featured-slide[data-pos="-1"] {
        transform: translate3d(calc(-50% - 130px), -50%, -40px) scale(0.78);
    }

    .featured-slide[data-pos="1"] {
        transform: translate3d(calc(-50% + 130px), -50%, -40px) scale(0.78);
    }

    .featured-slide[data-pos="-2"],
    .featured-slide[data-pos="2"] {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
