
        :root {
            /* --- COLOR PALETTE --- */
            --bg-body: #f7f4ef;          
            --primary: #264653;          
            --accent: #2a9d8f;            
            --highlight: #e9c46a;        
            --action: #e76f51;            
            --text-main: #2b2d42;
            --text-light: #5f6c7b;
            --card-bg: #ffffff;
            
            --shadow-card: 0 10px 20px rgba(0,0,0,0.04);
            --shadow-hover: 0 15px 30px rgba(42, 157, 143, 0.15);
            --radius: 16px;
        }

        body {
            font-family: 'Montserrat', sans-serif;
            color: var(--text-main);
            margin: 0;
            padding: 0;
            background-color: var(--bg-body);
            background-image: 
                linear-gradient(rgba(247, 244, 239, 0.92), rgba(247, 244, 239, 0.92)),
                url('bg2.jpg'); 
            background-attachment: fixed;
            background-size: cover;
            background-position: center;
        }

#game_flash {width: 100%; height: 100%}

        /* --- HEADER --- */
        header {
            background-color: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 0;
            box-shadow: 0 4px 20px rgba(0,0,0,0.03);
            position: sticky;
            top: 0;
            z-index: 100;
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }

        .header-main {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1200px;
            margin: 0 auto;
            padding: 12px 20px;
            gap: 20px;
        }

        .logo {
            font-family: 'Potta One', cursive;
            font-size: 24px;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 12px;
            letter-spacing: 0.5px;
            flex-shrink: 0;
        }

        .logo span { color: var(--accent); }

        .logo-icon {
            background: var(--action);
            color: white;
            width: 42px;
            height: 42px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            box-shadow: 3px 3px 0 var(--primary);
        }

        .nav-links {
            display: flex;
            gap: 20px;
            margin-right: auto;
            margin-left: 30px;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--text-main);
            font-family: 'Potta One', cursive; 
            font-size: 14px; 
            letter-spacing: 0.5px;
            position: relative;
            transition: color 0.3s;
            padding: 5px 0;
        }

        .nav-links a:hover { color: var(--accent); }
        
        .nav-links a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 3px; 
            bottom: 0;
            left: 0;
            background-color: var(--accent);
            border-radius: 2px;
            transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            opacity: 0.6;
        }
        
        .nav-links a:hover::after { width: 100%; }

        /* --- SEARCH BAR --- */
        .search-box {
            position: relative;
            display: flex;
            align-items: center;
            background: #f1f3f5;
            border-radius: 50px;
            padding: 5px 5px 5px 15px;
            border: 1px solid transparent;
            transition: 0.3s;
            width: 200px;
        }

        .search-box:focus-within {
            background: #fff;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
        }

        .search-box input {
            border: none;
            background: transparent;
            outline: none;
            font-family: 'Montserrat', sans-serif;
            font-size: 14px;
            color: var(--text-main);
            width: 100%;
        }

        .search-box button {
            background: var(--primary);
            color: white;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.2s;
        }

        .search-box button:hover { background: var(--accent); }

        .container {
            max-width: 1200px;
            margin: 30px auto;
            padding: 0 20px;
        }

        /* --- HERO BANNER (With Interactive Player) --- */
        .hero-banner {
            background: linear-gradient(120deg, var(--primary) 0%, #203a43 100%);
            border-radius: var(--radius);
            padding: 35px;
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 50px; 
            box-shadow: 0 20px 40px rgba(38, 70, 83, 0.25);
            margin-bottom: 40px;
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.1);
            min-height: 250px;
            transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        /* Expanded State (Playing) */
        .hero-banner.is-playing {
            flex-direction: column;
            align-items: stretch;
            padding: 0;
            background: #000;
            height: 600px; /* Adjust height for the game */
        }
        
        .hero-banner::before {
            content: '🀄';
            position: absolute;
            right: -30px;
            bottom: -50px;
            font-size: 250px;
            opacity: 0.07;
            transform: rotate(-10deg);
            z-index: 1;
            transition: opacity 0.3s;
        }
        
        .hero-banner.is-playing::before { opacity: 0; }

        .hero-content-wrap {
            display: flex;
            align-items: center;
            gap: 50px;
            width: 100%;
            z-index: 2;
            transition: opacity 0.3s;
        }

        .hero-banner.is-playing .hero-content-wrap {
            opacity: 0;
            pointer-events: none;
            position: absolute;
        }

        .hero-image {
            width: 320px;
            height: 200px;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 15px 30px rgba(0,0,0,0.3);
            border: 4px solid rgba(255,255,255,0.2);
            object-fit: cover;
            flex-shrink: 0; 
        }

        .hero-text { flex: 1; }
        
        .hero-text span { 
            margin: 0 0 10px 0; 
            font-family: 'Potta One', cursive; 
            font-size: 28px;
            letter-spacing: 1px; 
            line-height: 1.2;
            color: #fff;
            text-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        
        .hero-text p { 
            margin: 0 0 25px 0; 
            font-family: 'Potta One', cursive; 
            font-size: 15px;
            opacity: 0.9; 
            line-height: 1.6;
            letter-spacing: 0.5px;
            color: #d8e6e5;
        }

        .btn-play {
            display: inline-block;
            background-color: var(--highlight);
            color: var(--primary);
            padding: 14px 40px;
            border-radius: 50px;
            font-family: 'Montserrat', sans-serif;
            font-weight: 800;
            font-size: 13px;
            text-transform: uppercase;
            text-decoration: none;
            box-shadow: 0 8px 15px rgba(0,0,0,0.2);
            transition: all 0.2s;
            border: 2px solid transparent;
            cursor: pointer;
        }

        .btn-play:hover {
            transform: translateY(-3px);
            box-shadow: 0 15px 25px rgba(0,0,0,0.3);
            background-color: #fff;
            color: var(--action);
        }

        /* Iframe Container (Hidden by default) */
        .hero-game-container {
            display: none;
            width: 100%;
            height: 100%;
            position: relative;
            z-index: 10;
        }

        .hero-banner.is-playing .hero-game-container { display: block; }

        .hero-iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .close-hero-game {
            position: absolute;
            top: 20px;
            right: 20px;
            background: rgba(0,0,0,0.6);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 24px;
            transition: 0.2s;
            border: 2px solid rgba(255,255,255,0.2);
            z-index: 20;
        }
        .close-hero-game:hover { background: var(--action); border-color: white; }

        /* --- CATEGORIES --- */
        .categories-wrapper { margin-bottom: 50px; }
        .categories-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 18px;
        }

        .cat-btn {
            background-color: var(--card-bg);
            color: var(--text-main);
            padding: 20px 10px;
            border-radius: 14px;
            text-align: center;
            font-weight: 700;
            text-decoration: none;
            box-shadow: var(--shadow-card);
            border: 1px solid rgba(0,0,0,0.03);
            transition: 0.3s;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            position: relative;
            overflow: hidden;
        }

        .cat-btn span.icon { font-size: 28px; transition: transform 0.3s; }
        .cat-btn span.label { font-size: 14px; font-family: 'Montserrat', sans-serif; }
        .cat-btn:hover {
            background-color: var(--primary);
            color: white;
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }
        .cat-btn:hover span.icon { transform: scale(1.2) rotate(10deg); }

        /* --- SECTIONS --- */
        .section-header {
            display: flex;
            align-items: center;
            margin-bottom: 30px;
            border-bottom: 2px solid rgba(38, 70, 83, 0.1);
            padding-bottom: 15px;
        }
        .section-title {
            font-family: 'Potta One', cursive;
            font-size: 24px;
            color: var(--primary);
            margin: 0;
            padding-right: 25px;
            background: var(--bg-body);
            margin-bottom: -17px;
            letter-spacing: 0.5px;
        }

        /* --- GAMES GRID --- */
        .games-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
            gap: 25px;
            margin-bottom: 60px;
        }

        .game-card {
            background-color: var(--card-bg);
            border-radius: var(--radius);
            overflow: hidden;
            text-decoration: none;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            box-shadow: var(--shadow-card);
            border: 1px solid rgba(0,0,0,0.03);
            position: relative;
            top: 0;
            display: flex;
            flex-direction: column;
        }

        .game-card::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: var(--accent);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .game-card:hover {
            top: -8px;
            box-shadow: var(--shadow-hover);
        }
        
        .game-card:hover::after { opacity: 1; }

        .card-img-wrap {
            height: 165px;
            overflow: hidden;
            position: relative;
        }

        .card-img-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.6s;
        }
        
        .game-card:hover .card-img-wrap img { transform: scale(1.08); }

        .card-badge {
            position: absolute;
            top: 12px;
            right: 12px;
            background: var(--highlight);
            color: var(--primary);
            font-size: 11px;
            font-weight: 800;
            padding: 5px 10px;
            border-radius: 6px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.15);
            z-index: 10;
        }

        .card-body { padding: 18px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
        
        .card-title { 
            font-weight: 700; 
            font-size: 16px;
            color: var(--text-main); 
            margin-bottom: 8px; 
            display: block; 
        }
        
        .card-meta { 
            font-size: 13px; 
            color: var(--text-light); 
            display: flex; 
            justify-content: space-between;
            align-items: center;
            font-weight: 600;
        }

        /* --- TECH LABELS --- */
        .tech-tag {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            font-weight: 800;
            letter-spacing: 0.5px;
            margin-right: 5px;
        }
        
        .tag-html5 {
            background-color: #e6f4ea;
            color: #1e8e3e;
            border: 1px solid #1e8e3e;
        }
        
        .tag-flash {
            background-color: #fce8e6;
            color: #c5221f;
            border: 1px solid #c5221f;
        }
        
        .meta-left { display: flex; align-items: center; }

        /* --- HOW TO PLAY BLOCK (Added & Translated) --- */
        .how-to-play {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 30px;
            margin-bottom: 40px;
        }
        
        .htp-column {
            background: rgba(255, 255, 255, 0.7);
            padding: 25px;
            border-radius: var(--radius);
            border: 1px solid rgba(0,0,0,0.05);
        }
        
        .htp-column h3 {
            font-family: 'Potta One', cursive;
            color: var(--primary);
            margin-top: 0;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .htp-column p { font-size: 14px; line-height: 1.6; color: #555; margin-bottom: 0; }
        .htp-icon { font-size: 24px; }

        /* --- SEO TEXT BLOCK --- */
        .seo-block {
            background: white; 
            padding: 50px; 
            border-radius: 20px; 
            margin-top: 40px; 
            border: 1px solid rgba(0,0,0,0.03);
            text-align: left;
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
            box-shadow: var(--shadow-card);
            line-height: 1.8;
            color: #555;
            font-size: 15px;
        }
        
        .seo-block h1 {
            color: var(--primary); 
            font-family: 'Potta One', cursive; 
            margin-top: 0;
            font-size: 24px;
        }

        .seo-block h2 {
            color: var(--primary); 
            font-family: 'Potta One', cursive; 
            margin-top: 0;
            font-size: 24px;
        }

        .seo-block a { color: var(--accent); text-decoration: none; font-weight: bold; }
        .seo-block a:hover { text-decoration: underline; }

        /* --- FOOTER --- */
        footer {
            background-color: var(--primary);
            color: white;
            padding: 50px 0 30px;
            margin-top: 80px;
            text-align: center;
            border-top: 5px solid var(--accent);
        }
        
        .footer-logo {
            font-family: 'Potta One', cursive;
            font-size: 24px;
            margin-bottom: 20px;
            opacity: 0.9;
        }
        
        .footer-links a { color: #a5b1c2; text-decoration: none; margin: 0 10px; font-size: 14px; transition: 0.2s; }
        .footer-links a:hover { color: white; }

        .footer-international {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid rgba(255,255,255,0.1);
            font-size: 13px;
            color: #a5b1c2;
        }
        .footer-international a { color: #a5b1c2; text-decoration: none; margin: 0 5px; }
        .footer-international a:hover { color: white; text-decoration: underline; }

        #back-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 99;
        }
        #back-top a {
            width: 40px;
            height: 40px;
            display: block;
            background: var(--accent);
            border-radius: 5px;
            transition: 0.3s;
            position: relative;
        }
        #back-top a:hover { background: var(--action); }
        #back-top span {
            width: 10px;
            height: 10px;
            border-top: 2px solid white;
            border-left: 2px solid white;
            display: block;
            position: absolute;
            top: 16px;
            left: 15px;
            transform: rotate(45deg);
        }

        /* --- MOBILE ADAPTIVE --- */
        @media (max-width: 900px) {
            .hero-banner { 
                flex-direction: column; 
                text-align: center; 
                gap: 25px;
                padding: 30px 20px;
                height: auto !important; /* Force auto height on mobile if not playing */
            }
            .hero-banner.is-playing {
                 height: 400px !important; /* Smaller height for player on mobile */
            }
            .hero-image { 
                width: 100%; 
                height: 200px; 
                order: -1; 
            }
            .hero-text { max-width: 100%; }
            .nav-links { display: none; }
            .search-box { width: 100%; }
            .categories-grid { grid-template-columns: repeat(3, 1fr); }
            .games-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
            .how-to-play { grid-template-columns: 1fr; }
        }
        
        @media (max-width: 600px) {
            .categories-grid { grid-template-columns: repeat(2, 1fr); }
            .games-grid { grid-template-columns: 1fr; }
        }

/* =========================================
   2. GAME PAGE SPECIFIC STYLES (ORIGINAL TEMPLATE)
   ========================================= */

/* Layout Grid */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* Sidebar width */
    gap: 30px;
}

.breadcrumbs { grid-column: 1 / -1; font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.breadcrumbs a { text-decoration: none; color: var(--text-light); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 5px; opacity: 0.5; }

.game-stage { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); }
.game-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.game-title h1 { font-family: 'Potta One', cursive; font-size: 28px; color: var(--primary); margin: 0 0 5px 0; }

.game-tags span { font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 700; margin-right: 5px; }
.tag-tech { background: #e6f4ea; color: #1e8e3e; border: 1px solid #1e8e3e; }
.tag-cat { background: #f1f3f5; color: var(--text-light); border: 1px solid #ddd; }

/* GAME PLAYER */

.game-frame-wrapper {
    position: relative;
    width: 100%;
    
    height: 640px; 
    
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}
.force-fullscreen { position: fixed !important; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh; z-index: 99999; background: #000; border-radius: 0; padding: 0; margin: 0; }
.force-fullscreen iframe { height: 100% !important; width: 100% !important; }
.game-placeholder { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
#game-iframe { width: 100%; height: 100%; border: none; display: none; }

.play-overlay-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--action); color: white; border: none; padding: 15px 40px;
    border-radius: 50px; font-family: 'Potta One', cursive; font-size: 20px;
    cursor: pointer; box-shadow: 0 0 0 5px rgba(231, 111, 81, 0.3); transition: 0.2s; z-index: 10;
}
.play-overlay-btn:hover { transform: translate(-50%, -53%); background: #ff8a65; }

/* CONTROLS BAR */
.game-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
.control-group { display: flex; gap: 10px; }
.control-btn {
    background: #f8f9fa; border: 1px solid #eee; color: var(--text-main);
    padding: 8px 15px; border-radius: 8px; font-weight: 600; font-size: 13px;
    cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s;
}
.control-btn:hover { background: var(--bg-body); border-color: var(--accent); color: var(--accent); }
.control-btn svg { width: 16px; height: 16px; fill: currentColor; }
.control-btn.vote-up:hover { color: #2e7d32; border-color: #2e7d32; background: #e8f5e9; }
.control-btn.vote-down:hover { color: #c62828; border-color: #c62828; background: #ffebee; }
.rating-box { display: flex; align-items: center; gap: 10px; }
.stars { color: #f4a261; font-size: 18px; letter-spacing: 1px; }

/* GAME DESCRIPTION */
.game-description { margin-top: 30px; background: white; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.game-description h2 { font-family: 'Potta One', cursive; color: var(--primary); margin-top: 0; }
.game-description p { line-height: 1.7; color: #555; font-size: 15px; }
.xml-content p { margin-bottom: 15px; }

/* SIDEBAR & ADS */
.ad-box { background-color: #e0e0e0; border: 1px solid #ccc; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #888; font-weight: 600; font-size: 11px; letter-spacing: 1px; border-radius: 8px; overflow: hidden; margin: 0 auto; }
.ad-label { margin-bottom: 5px; opacity: 0.6; font-size: 9px; text-transform: uppercase; }
.ad-leaderboard { width: 100%; height: 90px; margin-top: 25px; margin-bottom: 25px; }
.ad-sidebar { width: 300px; height: 250px; margin-bottom: 30px; }

.sidebar { position: relative; }
.game-sidebar { /* position: sticky;*/ top: 90px; }
.sidebar-title { font-family: 'Potta One', cursive; color: var(--primary); font-size: 18px; margin-bottom: 15px; border-left: 4px solid var(--accent); padding-left: 10px; }

.sidebar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.mini-card-grid {
    display: block; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 4/3; border: 2px solid transparent;
}
.mini-card-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-card-grid:hover { transform: scale(1.05); box-shadow: 0 8px 12px rgba(0,0,0,0.15); border-color: var(--accent); }

/* =========================================
   3. MODAL STYLES (ZEN THEME)
   ========================================= */
.zen-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(38, 70, 83, 0.6) !important;
    z-index: 9999 !important;
    justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.zen-modal-content {
    background: #ffffff !important;
    width: 90%; max-width: 420px;
    border-radius: 20px; padding: 40px 30px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25) !important;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid rgba(255,255,255,0.8);
}
.zen-close-btn {
    position: absolute; top: 15px; right: 20px;
    font-size: 32px; cursor: pointer; color: #a5b1c2;
    transition: 0.2s; line-height: 1;
}
.zen-close-btn:hover { color: var(--action); transform: rotate(90deg); }
.zen-modal-title { 
    font-family: 'Potta One', cursive; font-size: 26px; margin-bottom: 30px; margin-top: 0; color: var(--primary) !important;
}
.zen-social-row { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; }
.zen-social-icon {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.zen-social-icon:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.zen-social-icon svg { width: 28px; height: 28px; fill: white; }
.icon-fb { background: #1877F2; }
.icon-x { background: #000; }
.icon-wa { background: #25D366; }
.zen-link-container {
    background: #f8f9fa; border-radius: 12px; padding: 8px;
    display: flex; align-items: center; border: 2px solid #e9ecef; transition: 0.2s;
}
.zen-link-container:focus-within { border-color: var(--accent); }
.zen-link-input {
    background: transparent; border: none; outline: none;
    font-family: 'Montserrat', sans-serif; flex-grow: 1; padding: 5px 15px; font-size: 14px;
    color: var(--text-light); font-weight: 600;
}
.zen-copy-btn {
    background: var(--action) !important; color: white; border: none;
    padding: 12px 24px; border-radius: 10px; font-weight: 700; cursor: pointer;
    transition: 0.2s; font-family: 'Montserrat', sans-serif;
    text-transform: uppercase; font-size: 12px; letter-spacing: 1px;
}
.zen-copy-btn:hover { background: var(--accent) !important; transform: translateY(-1px); }

/* =========================================
   4. SHARED GRID STYLES (TOP 12 GAMES)
   ========================================= */

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    margin-top: 50px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
}

.section-title {
    font-family: 'Potta One', cursive;
    font-size: 24px;
    color: var(--primary);
    margin: 0;
    padding-right: 20px;
    background: var(--bg-body); /* Перекрывает линию */
    margin-bottom: -17px; /* Сдвиг вниз на линию */
}

/* СЕТКА */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* КАРТОЧКА */
.game-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    top: 0;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    top: -8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* КАРТИНКА */
.card-img-wrap {
    height: 175px;
    overflow: hidden;
    position: relative;
    background: #eee;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.game-card:hover .card-img-wrap img {
    transform: scale(1.1);
}

/* БЕЙДЖИК (HOT) */
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--highlight);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ТЕЛО КАРТОЧКИ */
.card-body {
    padding: 12px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 5px;
}

.card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.3;
    display: block;
    /* Обрезаем длинный текст */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.card-meta {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
}

.stars {
    color: #f4a261; /* Оранжевый цвет звезд */
    font-size: 14px;
    letter-spacing: 1px;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 900px) {
    .games-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .games-grid { grid-template-columns: repeat(2, 1fr); }
}
/* =========================================
   5. RESPONSIVE LOGIC
   ========================================= */
@media (max-width: 1279px) {
    .ad-sidebar { display: none; } /* Remove Ad */
    .game-layout { grid-template-columns: 1fr 200px; gap: 20px; }
    .sidebar-grid { grid-template-columns: 1fr; } 
    .mini-card-grid { aspect-ratio: 16/9; }
}
@media (max-width: 1081px) {
    .game-layout { grid-template-columns: 1fr; } /* Full width content */
    .sidebar { display: none; } /* Completely hide sidebar */
    .nav-links { display: none; }
    .search-box { display: none; }
    .games-grid, .similar-games-grid { grid-template-columns: repeat(2, 1fr); }
    .zen-modal-content { width: 85%; padding: 30px 20px; }
}

@media (max-width: 600px) {
    .games-grid, .similar-games-grid { grid-template-columns: 1fr; }
}


/* =========================================
   CONTROLS BAR & RATING STYLES
   ========================================= */

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.control-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.control-btn:hover {
    background: white;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor; /* Иконка принимает цвет текста */
    transition: fill 0.2s;
}

/* Стили для кнопок голосования */
.btn-vote svg {
    fill: currentColor; /* Чтобы иконка красилась вместе с текстом */
    margin-right: 5px;
    vertical-align: middle;
}

/* При наведении */
.btn-up:hover { color: #2a9d8f; border-color: #2a9d8f; } /* Зеленый */
.btn-down:hover { color: #e76f51; border-color: #e76f51; } /* Красный */

/* Активное состояние (когда проголосовал) */
.btn-up.active {
    background-color: #2a9d8f;
    color: white !important;
    border-color: #2a9d8f;
}

.btn-down.active {
    background-color: #e76f51;
    color: white !important;
    border-color: #e76f51;
}

/* Специфичные цвета при наведении */
.control-btn.btn-share:hover { color: #1877F2; border-color: #1877F2; }
.control-btn.btn-like:hover { color: #e76f51; border-color: #e76f51; }
.control-btn.btn-full:hover { color: #264653; border-color: #264653; }

.rating-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.stars {
    color: #f4a261;
    font-size: 20px;
    letter-spacing: 2px;
}

.rating-score {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

/* Мобильная адаптация кнопок */
@media (max-width: 600px) {
    .game-controls { flex-direction: column; gap: 15px; }
    .control-group { width: 100%; justify-content: space-between; }
    .control-btn { flex: 1; justify-content: center; padding: 10px; }
    .control-btn span { display: none; } /* Скрываем текст, оставляем иконки на мобильном */
    .control-btn svg { width: 20px; height: 20px; }
    .rating-box { width: 100%; justify-content: center; background: #f9f9f9; }
}


/* =========================================
   FULLSCREEN FIXES
   ========================================= */

/* Стандартный режим Fullscreen */
#gameContainer:fullscreen #game-content,
#gameContainer:fullscreen #game_flash,
#gameContainer:fullscreen iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: absolute !important;
    top: 0;
    left: 0;
}

/* Для Safari и Chrome (WebKit) */
#gameContainer:-webkit-full-screen #game-content,
#gameContainer:-webkit-full-screen #game_flash,
#gameContainer:-webkit-full-screen iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    position: absolute !important;
    top: 0;
    left: 0;
}

/* Гарантируем, что сам контейнер растянут */
#gameContainer:fullscreen,
#gameContainer:-webkit-full-screen {
    background: #000;
    display: flex !important;
    align-items: center;
    justify-content: center;
}





//
/* =========================
   SEO Preview (before seo-block)
========================= */

.seo-preview{
  margin: 10px 0 30px;
}

.seo-preview__grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* game card preview */
.seo-preview__card{
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
}

/* image at the left side + play button */
.seo-preview__media{
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-preview__img{
  display: block;
  border-radius: 16px;
  overflow: hidden;
}

.seo-preview__img img{
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.seo-preview__play{
  width: 220px;
  display: block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.06);
  text-decoration: none;
  font-weight: 800;
}

/* text at the right side */
.seo-preview__body{
  flex: 1 1 auto;
  min-width: 0;
}

.seo-preview__title{
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
}

.seo-preview__title a{
  text-decoration: none;
}

.seo-preview__desc{
  margin: 0;
  opacity: .9;
  line-height: 1.5;
}

/* 1 колонка на узких */
@media (max-width: 900px){
  .seo-preview__grid{
    grid-template-columns: 1fr;
  }
}

/* mobiles */
@media (max-width: 640px){
  .seo-preview__media{ flex-basis: 160px; }
  .seo-preview__img img{ width: 160px; height: 110px; }
  .seo-preview__play{ width: 160px; }
  .seo-preview__title{ font-size: 16px; }
}
