:root {
    --bg-color: #0d0211;
    --text-color: #e0e0e0;
    --accent-color: #ff00ff;
    /* Neon Magenta */
    --secondary-accent: #00ffff;
    /* Neon Cyan */
    --grid-gap: 20px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* VHS Scanlines Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Noise/Grain Effect */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9998;
}

header {
    background: rgba(20, 0, 30, 0.8);
    border-bottom: 2px solid var(--accent-color);
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 0 15px var(--accent-color);
}

header h1 {
    color: var(--secondary-accent);
    text-shadow: 0 0 5px var(--secondary-accent), 0 0 10px var(--accent-color);
    margin: 0;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 5px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--grid-gap);
    margin-bottom: 60px;
}

.game-card {
    background: rgba(40, 0, 60, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
}

.game-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.game-card .info {
    padding: 10px;
    text-align: center;
}

.game-card h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer Section */
footer {
    background: rgba(10, 0, 20, 0.9);
    padding: 40px 20px;
    border-top: 1px solid rgba(255, 0, 255, 0.2);
    margin-top: 60px;
}

.footer-tags {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--secondary-accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}

.tag:hover {
    background: var(--accent-color);
    color: #fff;
    cursor: default;
}

.seo-text {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    max-width: 900px;
    margin: 20px auto 0;
    line-height: 1.6;
}

.copyright {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 20px;
}

/* ========== TWO-COLUMN LAYOUT ========== */
.two-col-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* LEFT SIDEBAR */
.sidebar-search {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.sidebar-block {
    background: rgba(15, 5, 25, 0.85);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.sidebar-heading {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.sidebar-link {
    display: block;
    padding: 7px 10px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--secondary-accent);
    text-decoration: none;
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(0, 255, 255, 0.1);
    border-left-color: var(--secondary-accent);
    padding-left: 14px;
}

.sidebar-link.hot {
    color: #ff6ec7;
}

.sidebar-link.hot:hover {
    background: rgba(255, 110, 199, 0.1);
    border-left-color: #ff6ec7;
}

.sidebar-link.fire {
    color: #ff073a;
}

.sidebar-link.fire:hover {
    background: rgba(255, 7, 58, 0.1);
    border-left-color: #ff073a;
}

/* ========== TOPLIST SECTION ========== */
.toplist-section {
    flex: 1;
}

.toplist-frame {
    background: rgba(15, 5, 25, 0.85);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.1), inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.toplist-title {
    text-align: center;
    font-family: 'Press Start 2P', 'Inter', monospace;
    font-size: 1.1rem;
    color: #ffd700;
    text-shadow: 0 0 8px #ffd700, 0 0 20px rgba(255, 215, 0, 0.5);
    margin: 0 0 25px;
    letter-spacing: 2px;
}

.toplist-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(30, 10, 50, 0.6);
    border-left: 4px solid var(--item-color);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.toplist-item:hover {
    transform: translateX(5px);
    box-shadow: 0 0 15px var(--item-color);
    background: rgba(50, 15, 80, 0.7);
}

.toplist-num {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.3rem;
    color: var(--item-color);
    text-shadow: 0 0 10px var(--item-color);
    min-width: 40px;
    text-align: center;
}

.toplist-info {
    flex: 1;
}

.toplist-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 3px;
}

.toplist-item-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.toplist-btn {
    background: var(--item-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 0 8px var(--item-color);
}

/* ========== PLAY MORE BUTTON ========== */
.play-more-btn {
    display: none;
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-color);
    text-decoration: none;
    margin-top: 20px;
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px var(--accent-color);
    }

    to {
        box-shadow: 0 0 30px var(--accent-color);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Loading Page (view.php) */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
}

.vhs-loader {
    width: 200px;
    height: 20px;
    background: #333;
    position: relative;
    border: 2px solid var(--secondary-accent);
    margin-bottom: 20px;
}

.vhs-loader-fill {
    height: 100%;
    width: 0;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 3s linear;
}

.loading-text {
    font-family: monospace;
    color: var(--secondary-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Game View Flex Layout with Banners */
.game-viewport-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.banner-sidebar {
    width: 350px;
    height: 250px;
    background: rgba(40, 0, 60, 0.6);
    border: 1px dashed var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    position: sticky;
    top: 20px;
}

.game-main-area {
    flex: 1;
    max-width: 900px;
    display: flex;
    flex-direction: column;
}

.game-container {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    background: #000;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

/* Responsive sidebars */
@media (max-width: 1400px) {
    .banner-sidebar {
        width: 160px;
        /* Slimmer for medium screens if needed, but requested 350x250 */
    }
}

@media (max-width: 1200px) {
    .game-viewport-container {
        flex-direction: column;
        align-items: center;
    }

    .banner-sidebar {
        width: 350px;
        height: 250px;
        position: static;
        margin: 10px 0;
    }

    .banner-left {
        order: 2;
    }

    .game-main-area {
        order: 1;
        width: 100%;
    }

    .banner-right {
        order: 3;
    }
}

@media (max-width: 600px) {
    .banner-sidebar {
        width: 100%;
        max-width: 350px;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    header h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    .two-col-layout {
        flex-direction: column;
    }

    .sidebar-search {
        width: 100%;
        position: static;
    }
}

@media (max-width: 900px) {
    .two-col-layout {
        flex-direction: column;
    }

    .sidebar-search {
        width: 100%;
        position: static;
    }
}