/* Chiptune Challenge 2026 - February Theme: Arcade Valentine */
/* Immersive arcade cabinet experience with neon pink, cyan, and purple */

:root {
    /* Primary Colors */
    --chiptune-primary: #ff6b9d;
    --chiptune-primary-hover: #ff4785;
    --chiptune-secondary: #00d4ff;
    --chiptune-accent: #b967ff;

    /* Backgrounds */
    --chiptune-bg: #0a0a1a;
    --chiptune-header-bg: rgba(10, 10, 26, 0.9);
    --chiptune-card-bg: rgba(0, 0, 0, 0.6);
    --chiptune-surface: rgba(255, 107, 157, 0.1);
    --chiptune-player-bg: rgba(10, 10, 26, 0.95);

    /* Text */
    --chiptune-text: #ffffff;
    --chiptune-text-secondary: rgba(255, 255, 255, 0.7);

    /* Borders & Effects */
    --chiptune-border: rgba(255, 107, 157, 0.3);
    --chiptune-glow: rgba(255, 107, 157, 0.4);
    --chiptune-secondary-glow: rgba(0, 212, 255, 0.4);

    /* Player Handle - Valentine Heart */
    --chiptune-handle-size: 20px;
    --chiptune-handle-bg: linear-gradient(135deg, #ff6b9d, #ff4785);
    --chiptune-handle-radius: 4px;
    --chiptune-handle-icon-size: 12px;
    --chiptune-handle-icon-color: #fff;
    --chiptune-handle-icon-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    --chiptune-handle-glow: rgba(255, 107, 157, 0.6);

    /* Volume Handle - Smaller heart */
    --chiptune-volume-handle-size: 16px;
    --chiptune-volume-handle-bg: linear-gradient(135deg, #ff6b9d, #ff4785);
    --chiptune-volume-handle-radius: 3px;
    --chiptune-volume-handle-icon-size: 10px;
    --chiptune-volume-handle-icon-color: #fff;
    --chiptune-volume-handle-icon-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    --chiptune-volume-handle-glow: rgba(255, 107, 157, 0.6);

    /* Cabinet Frame Sizes */
    --cabinet-bezel-width: 60px;
    --cabinet-top-height: 80px;
    --cabinet-bottom-height: 60px;
}

/* =============================================================================
   FULL-SCREEN ARCADE BACKGROUND
   ============================================================================= */

/* Fixed full-page background image */
.chiptune-theme-february {
    background:
        /* CRT scanlines overlay */
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 3px
        ),
        /* Dark overlay for text readability */
        linear-gradient(
            135deg,
            rgba(10, 10, 26, 0.6) 0%,
            rgba(26, 10, 46, 0.55) 50%,
            rgba(10, 26, 46, 0.6) 100%
        ),
        /* Main background image */
        url('/static/sites/zimventures/chiptune/images/arcade-valentine-bg.png');
    background-size: auto, auto, cover;
    background-position: center, center, center;
    background-repeat: repeat, no-repeat, no-repeat;
    background-attachment: scroll, scroll, scroll;
}

/* Make the app container transparent so body background shows through */
.chiptune-theme-february .chiptune-app {
    background: transparent;
}

/* =============================================================================
   ARCADE CABINET BEZELS
   ============================================================================= */

/* Left Bezel */
.arcade-bezel-left {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--cabinet-bezel-width);
    height: 100%;
    background:
        linear-gradient(90deg,
            #1a1a2e 0%,
            #2d2d44 80%,
            #1a1a2e 100%
        );
    border-right: 3px solid #333;
    z-index: 100;
    box-shadow:
        inset -5px 0 15px rgba(0, 0, 0, 0.5),
        3px 0 10px rgba(0, 0, 0, 0.8);
}

/* Right Bezel */
.arcade-bezel-right {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--cabinet-bezel-width);
    height: 100%;
    background:
        linear-gradient(270deg,
            #1a1a2e 0%,
            #2d2d44 80%,
            #1a1a2e 100%
        );
    border-left: 3px solid #333;
    z-index: 100;
    box-shadow:
        inset 5px 0 15px rgba(0, 0, 0, 0.5),
        -3px 0 10px rgba(0, 0, 0, 0.8);
}

/* Bezel decorations - pixel art hearts */
.arcade-bezel-left::before,
.arcade-bezel-right::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 21px;
    background:
        /* Pixel heart shape */
        linear-gradient(90deg, transparent 0 4px, #ff6b9d 4px 8px, transparent 8px 16px, #ff6b9d 16px 20px, transparent 20px),
        linear-gradient(90deg, #ff6b9d 0 24px);
    background-size: 24px 3px, 24px 3px;
    background-position: 0 0, 0 3px;
    background-repeat: no-repeat;
    opacity: 0.6;
    animation: bezelHeartPulse 2s ease-in-out infinite;
}

@keyframes bezelHeartPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Bezel decorative lights */
.arcade-bezel-left::after,
.arcade-bezel-right::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 200px;
    background: repeating-linear-gradient(
        180deg,
        #ff6b9d 0px,
        #ff6b9d 8px,
        transparent 8px,
        transparent 24px
    );
    opacity: 0.3;
    animation: bezelLightChase 3s linear infinite;
}

@keyframes bezelLightChase {
    0% { background-position: 0 0; }
    100% { background-position: 0 24px; }
}

/* =============================================================================
   MARQUEE HEADER
   ============================================================================= */

.arcade-marquee {
    position: fixed;
    top: 0;
    left: var(--cabinet-bezel-width);
    right: var(--cabinet-bezel-width);
    height: var(--cabinet-top-height);
    background:
        linear-gradient(180deg,
            #2d1a3e 0%,
            #1a0a2e 50%,
            #0a0a1a 100%
        );
    border-bottom: 4px solid #ff6b9d;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 5px 20px rgba(255, 107, 157, 0.3),
        inset 0 -10px 30px rgba(0, 0, 0, 0.5);
}

/* Marquee light bulbs */
.arcade-marquee::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 20px;
    right: 20px;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        #ffd700 0px,
        #ffd700 6px,
        transparent 6px,
        transparent 20px
    );
    border-radius: 50%;
    animation: marqueeLights 1s ease-in-out infinite alternate;
}

@keyframes marqueeLights {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Marquee title text */
.arcade-marquee-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    color: #ff6b9d;
    text-shadow:
        0 0 10px #ff6b9d,
        0 0 20px #ff6b9d,
        0 0 40px #ff6b9d,
        2px 2px 0 #00d4ff;
    animation: neonFlicker 3s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

/* 2 PLAYER MODE indicator */
.arcade-marquee-mode {
    position: absolute;
    right: 30px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: #00d4ff;
    text-shadow: 0 0 5px #00d4ff;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =============================================================================
   BOTTOM PANEL (COIN SLOT AREA)
   ============================================================================= */

.arcade-bottom-panel {
    position: fixed;
    bottom: 0;
    left: var(--cabinet-bezel-width);
    right: var(--cabinet-bezel-width);
    height: var(--cabinet-bottom-height);
    background:
        linear-gradient(0deg,
            #1a1a2e 0%,
            #2d2d44 100%
        );
    border-top: 3px solid #333;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 -5px 15px rgba(0, 0, 0, 0.5),
        inset 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Coin slot decoration */
.arcade-bottom-panel::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 8px;
    background: linear-gradient(90deg, #1a1a1a, #333, #1a1a1a);
    border: 2px solid #444;
    border-radius: 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* =============================================================================
   P1 + P2 PLAYER BADGE
   ============================================================================= */

.player-badge {
    position: fixed;
    bottom: 120px; /* Above the audio player */
    left: 2rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.65rem;
    color: #ffd700;
    background: linear-gradient(135deg, #ff6b9d, #b967ff);
    padding: 0.75rem 1.25rem;
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.75rem;
    z-index: 102;
    text-shadow: 0 0 5px #ffd700;
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.8),
        0 6px 0 rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 107, 157, 0.5),
        0 0 60px rgba(255, 107, 157, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    animation: playerBadgeFloat 3s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-badge:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.8),
        0 12px 0 rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 107, 157, 0.7),
        0 0 80px rgba(0, 212, 255, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

@keyframes playerBadgeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.player-badge .p1 {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

.player-badge .p2 {
    color: #00d4ff;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.6));
}

/* Stack past-champion badge above the P1/P2 player badge in February */
.chiptune-theme-february .past-champion-badge {
    bottom: 185px;
    left: 2rem;
}

@media (max-width: 768px) {
    .chiptune-theme-february .past-champion-badge {
        bottom: 170px;
    }
}

@media (max-width: 480px) {
    .chiptune-theme-february .past-champion-badge {
        bottom: 155px;
        left: 1.5rem;
    }
}

/* =============================================================================
   INSERT COIN TEXT
   ============================================================================= */

.insert-coin {
    position: fixed;
    bottom: calc(var(--cabinet-bottom-height) + 15px);
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    color: #ffd700;
    text-shadow:
        0 0 10px #ffd700,
        0 0 20px #ffd700;
    z-index: 102;
    animation: insertCoinBlink 1s step-end infinite;
    cursor: pointer;
    user-select: none;
}

@keyframes insertCoinBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.insert-coin:hover {
    color: #fff;
    text-shadow:
        0 0 10px #fff,
        0 0 20px #ffd700,
        0 0 30px #ffd700;
}

/* =============================================================================
   COMBO COUNTER
   ============================================================================= */

.combo-counter {
    position: fixed;
    top: 120px;
    right: 20px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: #ff6b9d;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border: 2px solid #ff6b9d;
    border-radius: 4px;
    z-index: 102;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
    text-align: center;
}

.combo-counter.active {
    opacity: 1;
    transform: scale(1);
}

.combo-counter.milestone {
    animation: comboMilestone 0.5s ease-out;
    border-color: #ffd700;
    color: #ffd700;
}

@keyframes comboMilestone {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.combo-counter .combo-label {
    font-size: 0.5rem;
    color: #00d4ff;
    display: block;
    margin-bottom: 4px;
}

.combo-counter .combo-value {
    font-size: 1.2rem;
}

/* =============================================================================
   CRT SCREEN EFFECTS
   ============================================================================= */

/* CRT screen effect on main content */
.chiptune-theme-february .chiptune-main {
    position: relative;
}

/* Phosphor glow around edges */
.chiptune-theme-february .chiptune-main::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow:
        inset 0 0 100px rgba(255, 107, 157, 0.1),
        inset 0 0 50px rgba(0, 212, 255, 0.05);
    z-index: 50;
}

/* Screen flicker removed for GPU performance - the 2% opacity change was
   imperceptible but forced full-page recompositing every frame */

/* =============================================================================
   CONTENT CARD ADJUSTMENTS
   ============================================================================= */

/* More visible cards with solid background (no backdrop-filter for GPU perf) */
.chiptune-theme-february .song-card,
.chiptune-theme-february .stat-card,
.chiptune-theme-february .hof-card {
    background: rgba(10, 10, 26, 0.92);
    border: 1px solid rgba(255, 107, 157, 0.4);
}

/* Header background */
.chiptune-theme-february .chiptune-header {
    background: rgba(10, 10, 26, 0.95);
}

/* Neon glow text effect */
.chiptune-theme-february .chiptune-logo .logo-text {
    text-shadow:
        0 0 10px var(--chiptune-primary),
        0 0 20px var(--chiptune-primary),
        0 0 30px var(--chiptune-primary);
}

/* Page headers with glow */
.chiptune-theme-february .page-header h1 {
    text-shadow:
        0 0 10px var(--chiptune-primary),
        0 0 20px var(--chiptune-primary);
}

/* Card hover with neon border glow */
.chiptune-theme-february .song-card:hover {
    box-shadow:
        0 0 20px var(--chiptune-glow),
        inset 0 0 20px rgba(255, 107, 157, 0.1);
}

.chiptune-theme-february .song-card.is-playing {
    box-shadow:
        0 0 20px var(--chiptune-secondary-glow),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow:
            0 0 20px var(--chiptune-secondary-glow),
            inset 0 0 20px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 30px var(--chiptune-secondary-glow),
            inset 0 0 30px rgba(0, 212, 255, 0.15);
    }
}

/* Buttons with arcade style */
.chiptune-theme-february .vote-btn,
.chiptune-theme-february .song-card .vote-btn {
    background: linear-gradient(135deg, var(--chiptune-secondary), #00b8e0);
    border-color: var(--chiptune-secondary);
    color: #000;
    box-shadow: 0 4px 0 #008ba3;
    transform: translateY(0);
    transition: all 0.1s;
}

.chiptune-theme-february .vote-btn:hover:not(:disabled),
.chiptune-theme-february .song-card .vote-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00b8e0, #009ac4);
    transform: translateY(2px);
    box-shadow: 0 2px 0 #008ba3;
    color: #000;
}

.chiptune-theme-february .vote-btn.voted,
.chiptune-theme-february .song-card .vote-btn.voted {
    background: linear-gradient(135deg, var(--chiptune-accent), #9945d4);
    border-color: var(--chiptune-accent);
    color: #fff;
    box-shadow: 0 4px 0 #7a35ab;
}

/* Like button heart animation */
.chiptune-theme-february .like-btn.liked .like-icon {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1); }
}

/* Play button with neon effect */
.chiptune-theme-february .song-cover .play-btn {
    background: rgba(255, 107, 157, 0.8);
}

.chiptune-theme-february .player-btn.play-pause {
    background: linear-gradient(135deg, var(--chiptune-primary), #ff4785);
    box-shadow: 0 0 20px var(--chiptune-glow);
}

/* Progress bar with gradient */
.chiptune-theme-february .player-progress-fill {
    background: linear-gradient(90deg, var(--chiptune-primary), var(--chiptune-secondary));
}

/* Week navigation with pixel borders */
.chiptune-theme-february .week-nav {
    background: linear-gradient(
        90deg,
        rgba(255, 107, 157, 0.1),
        rgba(0, 212, 255, 0.1),
        rgba(185, 103, 255, 0.1)
    );
}

/* Vote banner with gradient */
.chiptune-theme-february .vote-banner {
    background: linear-gradient(
        90deg,
        var(--chiptune-primary),
        var(--chiptune-accent)
    );
}

/* Trophy badges */
.chiptune-theme-february .trophy-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Winner announcements */
.chiptune-theme-february .winner-banner,
.chiptune-theme-february .month-winner-banner {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.2),
        rgba(255, 107, 157, 0.1)
    );
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.chiptune-theme-february .winner-icon {
    font-size: 2rem;
}

/* Pixel font for stats */
.chiptune-theme-february .stat-card h3,
.chiptune-theme-february .stat-value {
    font-family: 'Press Start 2P', monospace;
}

/* Discord login button */
.chiptune-theme-february .discord-login-btn {
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.4);
}

.chiptune-theme-february .discord-login-btn:hover {
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.6);
}

/* Hall of Fame cards */
.chiptune-theme-february .hof-card {
    background: var(--chiptune-card-bg);
    border: 1px solid var(--chiptune-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
}

.chiptune-theme-february .hof-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px var(--chiptune-glow);
}

.chiptune-theme-february .hof-card.year-card {
    border-color: gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.chiptune-theme-february .hof-card.month-card {
    border-color: var(--chiptune-accent);
}

/* Stats page styling */
.chiptune-theme-february .stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.chiptune-theme-february .stat-card {
    background: var(--chiptune-card-bg);
    border: 1px solid var(--chiptune-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.chiptune-theme-february .stat-card .stat-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.chiptune-theme-february .stat-card .stat-value {
    font-size: 1.5rem;
    color: var(--chiptune-primary);
    display: block;
}

.chiptune-theme-february .stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--chiptune-text-secondary);
}

/* Scrollbar styling */
.chiptune-theme-february ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.chiptune-theme-february ::-webkit-scrollbar-track {
    background: var(--chiptune-bg);
}

.chiptune-theme-february ::-webkit-scrollbar-thumb {
    background: var(--chiptune-primary);
    border-radius: 4px;
}

.chiptune-theme-february ::-webkit-scrollbar-thumb:hover {
    background: var(--chiptune-primary-hover);
}

/* Selection color */
.chiptune-theme-february ::selection {
    background: var(--chiptune-primary);
    color: white;
}

/* =============================================================================
   MOBILE RESPONSIVE
   ============================================================================= */

@media (max-width: 1024px) {
    .player-badge {
        bottom: 110px;
        font-size: 0.55rem;
        padding: 0.6rem 1rem;
    }

    .combo-counter {
        font-size: 0.5rem;
        padding: 6px 10px;
    }

    .combo-counter .combo-value {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .player-badge {
        bottom: 110px;
        font-size: 0.5rem;
        padding: 0.5rem 0.85rem;
    }

    .combo-counter {
        right: 10px;
        top: 80px;
    }
}

@media (max-width: 480px) {
    .player-badge {
        bottom: 100px;
        left: 1.5rem;
        font-size: 0.45rem;
        padding: 0.4rem 0.7rem;
    }
}

/* =============================================================================
   FLOATING HEARTS (CSS animated, in addition to canvas particles)
   ============================================================================= */

.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.float-heart {
    position: absolute;
    bottom: -30px;
    animation: floatUp 12s linear infinite;
}

.float-heart.pixel-heart {
    width: 24px;
    height: 21px;
    background:
        linear-gradient(90deg, transparent 0 4px, var(--pixel-color, #ff6b9d) 4px 8px, transparent 8px 16px, var(--pixel-color, #ff6b9d) 16px 20px, transparent 20px),
        linear-gradient(90deg, var(--pixel-color, #ff6b9d) 0 24px);
    background-size: 24px 3px, 24px 3px;
    background-position: 0 0, 0 3px;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120vh) rotate(15deg);
        opacity: 0;
    }
}

/* Flash effect for easter egg interactions */
@keyframes flashFade {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
    }
}
