@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Orbitron:wght@400;700&display=swap');

:root {
    --bg: #0d001a;
    --terminal: #00ff00;
    --arcade-pink: #ff00ff;
    --arcade-cyan: #00ffff;
    --arcade-gold: #ffd700;
    --vhs-gray: #333;
    --crt-bg: rgba(13, 0, 26, 0.95);
    --border-pixel: 4px solid #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.25rem;
    overflow-x: hidden;
    position: relative;
    background-image:
        linear-gradient(rgba(255, 0, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ===== CRT SCANLINES ===== */
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.1) 50%), linear-gradient(90deg,
            rgba(255, 0, 0, 0.03),
            rgba(0, 255, 0, 0.01),
            rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 10000;
}

/* Flickering Effect */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    5% {
        opacity: 0.95;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.93;
    }

    20% {
        opacity: 0.98;
    }

    25% {
        opacity: 0.95;
    }

    100% {
        opacity: 1;
    }
}

.crt-flicker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.02);
    pointer-events: none;
    z-index: 9999;
    animation: flicker 0.1s infinite;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== MASTHEAD ===== */
.arcade-header {
    text-align: center;
    padding: 60px 0 40px;
    border-bottom: 8px double var(--arcade-pink);
    margin-bottom: 40px;
    position: relative;
}

.arcade-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 3.5rem;
    color: var(--arcade-cyan);
    text-shadow:
        4px 4px 0 var(--arcade-pink),
        0 0 20px rgba(0, 255, 255, 0.5);
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.arcade-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    color: var(--arcade-gold);
    letter-spacing: 4px;
    word-spacing: 10px;
}

.marquee-meta {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #000;
    border: 4px solid var(--arcade-pink);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    margin-top: 20px;
    color: #fff;
}

/* ===== CATEGORY SLIDER ===== */
.cat-nav-container {
    background: #000;
    border-bottom: 4px solid var(--arcade-cyan);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.cat-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
}

.cat-nav::-webkit-scrollbar {
    display: none;
}

.cat-nav-item {
    color: #fff;
    padding: 15px 30px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    text-transform: uppercase;
    border-right: 2px solid #333;
    white-space: nowrap;
    text-decoration: none;
    transition: 0.2s;
}

.cat-nav-item:hover {
    background: var(--arcade-cyan);
    color: #000;
}

/* ===== TOPLIST HIGH SCORE TABLE ===== */
.toplist-cabinet {
    background: rgba(0, 0, 0, 0.8);
    border: 6px solid var(--arcade-pink);
    padding: 30px;
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.2);
}

.cabinet-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--arcade-gold);
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 4px solid var(--arcade-gold);
    padding-bottom: 10px;
}

.score-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    border-bottom: 2px dashed #444;
    text-decoration: none;
    color: #fff;
    transition: 0.2s;
}

.score-row:hover {
    background: var(--arcade-pink);
    color: #fff;
    transform: scale(1.02);
}

.score-rank {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    width: 60px;
    color: var(--arcade-cyan);
}

.score-thumb {
    width: 80px;
    height: 60px;
    border: 3px solid #fff;
    object-fit: cover;
    image-rendering: pixelated;
}

.score-name {
    flex: 1;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.score-points {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--arcade-gold);
}

/* ===== ADSENSE CABINETS ===== */
.adsense-box {
    margin: 30px auto;
    background: #111;
    border: 4px solid var(--arcade-cyan);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.adsense-box::before {
    content: "INSERT COIN FOR AD";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: #333;
    z-index: 0;
}

.ad-leader {
    width: 728px;
    height: 90px;
}

.ad-side {
    width: 300px;
    height: 600px;
}

.ad-rect {
    width: 336px;
    height: 280px;
}

/* ===== LAYOUT GRID ===== */
.arcade-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

/* ===== SIDEBAR ELEMENTS ===== */
.sidebar-panel {
    background: #000;
    border: 4px solid var(--arcade-cyan);
    padding: 20px;
    margin-bottom: 40px;
}

.panel-header {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--arcade-cyan);
    margin-bottom: 20px;
    text-align: center;
}

/* Retro Tags */
.pixel-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pixel-tag {
    font-size: 1rem;
    color: var(--arcade-gold);
    text-decoration: underline;
}

.pixel-tag:hover {
    color: var(--arcade-pink);
}

/* ===== FOOTER ===== */
.arcade-footer {
    text-align: center;
    padding: 60px 0;
    border-top: 8px double var(--arcade-pink);
    margin-top: 80px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #444;
}

/* ===== VIEW PAGE / PLAYER ===== */
.newsreel-frame {
    background: #000;
    border: 20px solid #222;
    border-radius: 40px;
    position: relative;
    box-shadow: 0 0 100px rgba(0, 0, 0, 1);
    overflow: hidden;
}

.newsreel-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(#444, transparent);
    z-index: 5;
    pointer-events: none;
}

/* Loading Bar */
.arcade-loading {
    width: 300px;
    height: 40px;
    border: 4px solid #fff;
    position: relative;
    background: #000;
}

.arcade-loading-bar {
    height: 100%;
    background: var(--arcade-pink);
    width: 0%;
    animation: arcadeLoad 2s steps(10) forwards;
}

@keyframes arcadeLoad {
    to {
        width: 100%;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
    .arcade-layout {
        grid-template-columns: 1fr;
    }

    .arcade-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .arcade-title {
        font-size: 1.5rem;
    }

    .score-thumb {
        display: none;
    }

    .newsreel-frame {
        border-width: 10px;
        border-radius: 10px;
    }
}