* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0b1120;
    color: #e2e8f0;
    padding: 2rem;
}

#playBody {
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container-hub {
    max-width: 1300px;
    margin: 0 auto;
}

#gameContainer {
    max-width: 1000px;
    margin: 0 auto;
    background: #1e293b;
    border-radius: 2rem;
    padding: 1rem;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
}

.game-card {
    background: #1e293b;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4);
}

footer {
    margin-top: 2rem;
    text-align: center;
    color: #475569;
    font-size: 0.8rem;
}

.btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6, #2257ac);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
    width: 100%;
}

.btn:hover {
    filter: brightness(1.05);
    transform: scale(1.01);
}

.back-link {
    display: inline-block;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
}

.back-link-game {
    margin-bottom: 1.5rem;
}

.back-link:hover {
    color: #60a5fa;
}

.not-found {
    text-align: center;
    padding: 3rem;
}

.game-info {
    padding: 1.2rem;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.game-author {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #a855f7;
}

.game-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.card-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.card-buttons .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
}

.btn-play {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-play:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Video container */
.game-video-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #0f172a;
}

.game-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.game-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    display: none;
}

.game-video-container[data-has-video="true"]:hover .game-cover {
    opacity: 0;
}

.game-video-container[data-has-video="true"]:hover .game-video {
    display: block;
}

/* Game page header */
.game-header {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    align-items: center;
}

.screenshot {
    border-radius: 1.5rem;
    width: 280px;
    height: 200px;
    object-fit: cover;
    border: 1px solid #334155;
}

.game-logo {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.title-box {
    flex: 1;
}

.title-box .game-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.description {
    line-height: 1.6;
    margin: 1.5rem 0;
    background: #0f172a;
    padding: 1.2rem;
    border-radius: 1rem;
}

/* Other games section */
.other-games-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #334155;
}

.other-games-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #a855f7;
}

.other-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.other-game-card {
    background: #1e293b;
    border-radius: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    padding: 1rem;
}

.other-game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.other-game-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.other-game-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.other-game-author {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Play page top bar */
.top-bar {
    background: #0f172a;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}

.play-nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    background: linear-gradient(135deg, #3b82f6, #2257ac);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: transform 0.2s, brightness 0.2s;
}

.nav-btn:hover {
    filter: brightness(1.05);
    transform: scale(1.01);
}

.game-title-header {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Play page layout - баннер справа */
.game-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
}

.game-area {
    flex: 3;
    background: #000000;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.ad-sidebar {
    flex: 0.8;
    min-width: 200px;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    border: 1px dashed #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #5b6e8c;
    margin-bottom: 1rem;
}

.banner-content {
    background: #0a0f1c;
    border-radius: 1rem;
    width: 100%;
    padding: 1.5rem 0.5rem;
    color: #cbd5e6;
    font-weight: bold;
}

.fake-ad {
    background: #111827;
    border-radius: 0.8rem;
    padding: 1rem;
    font-size: 0.9rem;
    border: 1px solid #2563eb;
}

.fake-ad button {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    margin-top: 0.5rem;
    cursor: pointer;
    font-size: 0.7rem;
}

/* Мобильная версия - баннер уезжает наверх */
@media (max-width: 700px) {
    .game-layout {
        flex-direction: column;
    }
    
    .ad-sidebar {
        flex-direction: row;
        min-height: 120px;
        gap: 1rem;
    }
    
    .ad-sidebar .banner-content {
        padding: 0.5rem;
    }
    
    .game-area {
        min-height: 300px;
    }
}

/* Gallery styles */
.game-gallery-full {
    margin: 1rem 0;
    background: #0f172a;
    border-radius: 1rem;
    padding: 1rem;
}

.full-gallery-main {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 0.8rem;
    background: #000;
}

.full-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.full-gallery-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.full-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.full-gallery-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
}

.full-gallery-arrow.prev {
    left: 10px;
}

.full-gallery-arrow.next {
    right: 10px;
}

.full-gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.full-gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
}

.full-gallery-thumb:hover {
    transform: scale(1.05);
}

.full-gallery-thumb.active {
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
}

.video-thumb {
    width: 80px;
    height: 80px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 2rem;
}
/* Кликабельный автор */
.game-author {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #a855f7;
    cursor: pointer;
    transition: color 0.2s;
}

.game-author:hover {
    color: #c084fc;
    text-decoration: underline;
}

/* Анимация загрузки */
.loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}