/* ppuzzl.party - Retro Arcade Party */
/* Palette: CRT Black #0C0C0C, Signal Red #FF3333, Signal Green #33FF33, Signal Blue #3333FF, Static Gray #AAAAAA, Phosphor White #E0E0E0 */

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

html {
    background: #0C0C0C;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    color: #AAAAAA;
    background: #0C0C0C;
    height: 100%;
    overflow: hidden;
}

/* ========================================
   VHS Tracking Lines Overlay
   ======================================== */
.vhs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
}

/* ========================================
   Scanline Overlay
   ======================================== */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ========================================
   Horizontal Scroll Container
   ======================================== */
.channel-strip {
    display: flex;
    width: 500vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Channel (Panel)
   ======================================== */
.channel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ========================================
   CRT Screen Frame
   ======================================== */
.crt-screen {
    width: min(90vw, 800px);
    max-height: 85vh;
    background: #0C0C0C;
    border: 3px solid #AAAAAA;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 0 30px rgba(51, 255, 51, 0.1),
        0 0 60px rgba(51, 51, 255, 0.05),
        inset 0 0 80px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Color Bars (Test Pattern Headers)
   ======================================== */
.color-bars {
    display: flex;
    width: 100%;
    height: 8px;
    flex-shrink: 0;
}

.color-bars-bottom {
    margin-top: auto;
}

.bar {
    flex: 1;
}

.bar-red {
    background: #FF3333;
}

.bar-green {
    background: #33FF33;
}

.bar-blue {
    background: #3333FF;
}

/* ========================================
   Screen Content
   ======================================== */
.screen-content {
    padding: 2.5rem 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ========================================
   Typography
   ======================================== */
.title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: #E0E0E0;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 0.5rem;
}

.title-accent {
    color: #33FF33;
}

.tagline {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.1rem;
    color: #AAAAAA;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.channel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #E0E0E0;
    margin-bottom: 1.5rem;
}

h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #E0E0E0;
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

/* ========================================
   Title Screen
   ======================================== */
.title-screen {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.scroll-hint {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: #AAAAAA;
    margin-top: 2rem;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========================================
   Content Block
   ======================================== */
.content-block p {
    margin-bottom: 1rem;
    color: #AAAAAA;
    line-height: 1.65;
}

.content-block p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Game Grid (Channel 3)
   ======================================== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.game-card {
    background: rgba(224, 224, 224, 0.04);
    border: 1px solid rgba(170, 170, 170, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    border-color: #33FF33;
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.15);
}

.game-icon {
    margin-bottom: 1rem;
}

.game-card p {
    color: #AAAAAA;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ========================================
   Leaderboard (Channel 4)
   ======================================== */
.leaderboard {
    width: 100%;
    max-width: 500px;
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(170, 170, 170, 0.15);
}

.lb-header {
    border-bottom: 2px solid #AAAAAA;
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.lb-header span {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #E0E0E0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lb-rank {
    width: 3rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #AAAAAA;
    font-size: 1.1rem;
}

.rank-gold {
    color: #FF3333;
}

.rank-silver {
    color: #33FF33;
}

.rank-bronze {
    color: #3333FF;
}

.lb-name {
    flex: 1;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #E0E0E0;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.lb-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #33FF33;
    font-size: 1rem;
}

/* ========================================
   Join Screen (Channel 5)
   ======================================== */
.join-screen {
    align-items: center;
    text-align: center;
}

.cta-area {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-button {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #0C0C0C;
    background: #33FF33;
    padding: 0.9rem 2.5rem;
    border-radius: 4px;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: inline-block;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    background: #FF3333;
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.4);
}

.cta-sub {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: #AAAAAA;
    margin-top: 1rem;
    animation: hintPulse 2s ease-in-out infinite;
}

/* ========================================
   Channel Indicator
   ======================================== */
.channel-indicator {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 500;
    padding: 0.5rem 1rem;
    background: rgba(12, 12, 12, 0.85);
    border: 1px solid rgba(170, 170, 170, 0.2);
    border-radius: 20px;
}

.ch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #AAAAAA;
    opacity: 0.35;
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.ch-dot.active {
    opacity: 1;
    background: #33FF33;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(51, 255, 51, 0.5);
}

/* ========================================
   Spring Animation for Content Entrance
   ======================================== */
.screen-content > * {
    opacity: 0;
    transform: translateY(30px);
}

.channel.in-view .screen-content > * {
    animation: springIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.channel.in-view .screen-content > *:nth-child(1) { animation-delay: 0.05s; }
.channel.in-view .screen-content > *:nth-child(2) { animation-delay: 0.12s; }
.channel.in-view .screen-content > *:nth-child(3) { animation-delay: 0.19s; }
.channel.in-view .screen-content > *:nth-child(4) { animation-delay: 0.26s; }
.channel.in-view .screen-content > *:nth-child(5) { animation-delay: 0.33s; }
.channel.in-view .screen-content > *:nth-child(6) { animation-delay: 0.40s; }

@keyframes springIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px);
    }
    80% {
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .screen-content {
        padding: 1.5rem 1.5rem;
    }

    .crt-screen {
        width: 95vw;
        max-height: 90vh;
    }

    .channel {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .channel-title {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .screen-content {
        padding: 1.2rem 1rem;
    }
}
