:root {
    --ink: #0a0e0c;
    --canvas: #fef5e7;
    --panel: #1a1a1a;
    --acid: #00d4d4;
    --orange: #ff678d;
    --yellow: #ffd700;
    --muted: #6b7280;
    --line: #0a0e0c;
    --shadow: rgba(10, 14, 12, .35);
    --neon1: #00ff88;
    --neon2: #ff00ff;
    --neon3: #00d4d4;
}

* { box-sizing: border-box; margin: 0; }

    html, body { min-height: 100%; overflow-x: hidden; }

    body {
        background: linear-gradient(135deg, #fef5e7 0%, #f0e5d8 25%, #fef5e7 50%, #f8f0e3 75%, #fef5e7 100%);
        color: var(--ink);
        font-family: "Futura", "Century Gothic", sans-serif;
        background-attachment: fixed;
        position: relative;
    }
    
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: 
            repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,46,99,.02) 35px, rgba(255,46,99,.02) 70px),
            repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(0,212,212,.02) 35px, rgba(0,212,212,.02) 70px);
        pointer-events: none;
        z-index: 0;
    }

    #gridContainer {
        display: grid;
        gap: 20px;
        min-height: 100vh;
        padding: 28px;
        background: transparent;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-areas: 
            "header header header header header header"
            "item1 item1 item2 item2 item3 item3"
            "item4 item4 item5 item5 item6 item6"
            "item7 item7 item8 item8 item9 item9";
        position: relative;
        z-index: 1;
    }

    #header {
        grid-area: header;
        min-height: 240px;
        padding: 32px 40px 28px;
        border: 4px solid var(--ink);
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
        box-shadow: 
            15px 15px 0 var(--orange),
            -5px -5px 20px rgba(255, 46, 99, 0.3),
            inset 0 0 30px rgba(0, 212, 212, 0.1);
        transform: skewY(-1.5deg) rotate(-0.8deg);
        position: relative;
        overflow: hidden;
    }
    
    #header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 136, 0.08) 50%, transparent 100%);
        pointer-events: none;
    }

    #flexbox-container {
        display: flex;
        align-items: center;
        gap: 20px;
        height: 100%;
        position: relative;
        z-index: 1;
    }

    #siteHeader {
        flex: 1;
        background: linear-gradient(90deg, var(--neon1) 0%, var(--neon3) 50%, var(--neon2) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-family: "Futura", "Century Gothic", sans-serif;
        font-size: clamp(2.5rem, 7vw, 7rem);
        font-weight: 900;
        line-height: .85;
        text-transform: uppercase;
        letter-spacing: -2px;
        text-shadow: none;
        filter: drop-shadow(3px 3px 0 rgba(255, 46, 99, 0.4));
    }

    #customize, #slowDown, #speedUp, #hamburger, #closeMenu { cursor: pointer; }

    .flex-item { transition: transform .2s ease, opacity .2s ease; }
    .flex-item:hover { opacity: .7; transform: translateY(-3px); }

    #customize { width: 48px; height: 48px; filter: drop-shadow(3px 3px 6px rgba(0, 212, 212, 0.5)); }
    #slowDown, #speedUp { width: 48px; height: 48px; padding: 10px; border: 4px solid var(--ink); background: linear-gradient(135deg, var(--acid) 0%, var(--neon1) 100%); box-shadow: 0 0 15px rgba(0, 212, 212, 0.4); }

    #speed {
        min-width: 90px;
        padding: 12px 10px;
        color: var(--ink);
        border: 4px solid var(--ink);
        background: linear-gradient(135deg, var(--yellow) 0%, #ffed4e 100%);
        font-family: "Futura", sans-serif;
        font-size: 1.1rem;
        font-weight: 900;
        text-align: center;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    }

    #gridContainer > div:not(#header) {
        position: relative;
        width: 100%;
        min-height: 280px;
        overflow: hidden;
        padding: 20px;
        border: 4px solid var(--ink);
        background: var(--tile, #252a20);
        text-align: center;
        box-shadow: 12px 12px 0 var(--ink), inset 0 0 20px rgba(0, 0, 0, 0.2);
        transition: all .35s cubic-bezier(0.34, 1.56, 0.64, 1);
        transform: skewY(-2deg) rotate(var(--rotation, 0deg));
    }

    .item1 { --tile: linear-gradient(135deg, #ff6b6b 0%, #ff2e63 100%); --rotation: -1.2deg; }
    .item2 { --tile: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%); --rotation: 0.8deg; }
    .item3 { --tile: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); --rotation: -0.6deg; }
    .item4 { --tile: linear-gradient(135deg, #00ff88 0%, #00d4d4 100%); --rotation: 1deg; }
    .item5 { --tile: linear-gradient(135deg, #00d4d4 0%, #00ffff 100%); --rotation: -0.9deg; }
    .item6 { --tile: linear-gradient(135deg, #6495ed 0%, #87ceeb 100%); --rotation: 0.7deg; }
    .item7 { --tile: linear-gradient(135deg, #9370db 0%, #ba55d3 100%); --rotation: -1.1deg; }
    .item8 { --tile: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%); --rotation: 0.9deg; }
    .item9 { --tile: linear-gradient(135deg, #ff006e 0%, #ff2e63 100%); --rotation: -0.8deg; }

    #gridContainer > div:not(#header):hover { 
        background: var(--tile);
        transform: translate(-8px, -8px) scale(1.02) skewY(-2deg) rotate(var(--rotation)) ;
        box-shadow: 18px 18px 0 var(--ink), 0 0 30px rgba(255, 46, 99, 0.4);
    }

    #gridContainer > div.play::after,
    #gridContainer > div.pause::after {
        position: absolute;
        top: 16px;
        left: 16px;
        z-index: 2;
        padding: 7px 12px;
        border: 3px solid var(--ink);
        color: var(--ink);
        background: var(--canvas);
        font: 900 .8rem "Futura", sans-serif;
        letter-spacing: .12em;
        box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    }

    #gridContainer > div.play::after {
        content: "▶ PLAYING";
        animation: pulse-play .5s ease-in-out infinite;
    }

    #gridContainer > div.pause::after {
        content: "⏸ PAUSED";
    }
    
    @keyframes pulse-play {
        0%, 100% { box-shadow: 4px 4px 0 rgba(0, 255, 136, 0.4); }
        50% { box-shadow: 4px 4px 15px rgba(0, 255, 136, 0.8); }
    }

    .helluvacast {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        filter: saturate(.85) contrast(1.08);
        transition: filter .3s ease, transform .3s ease;
    }

    #gridContainer > div:not(#header):hover .helluvacast { filter: saturate(1.2) contrast(1.1); transform: scale(1.04); }

    .dropdown { display: none; }

    #popupMenu {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        z-index: 2;
        width: min(500px, calc(100vw - 36px));
        max-height: calc(100vh - 36px);
        padding: 30px;
        overflow: auto;
        border: 5px solid var(--ink);
        background: linear-gradient(135deg, var(--canvas) 0%, #f5f0e8 100%);
        color: var(--ink);
        box-shadow: 
            20px 20px 0 var(--orange),
            -8px -8px 0 var(--acid),
            0 25px 60px var(--shadow);
        transform: translate(-50%, -50%) rotate(-0.5deg);
    }

    #closeMenu { width: 24px; height: 24px; margin-bottom: 20px; }
    #popup-flex-container { display: flex; flex-direction: column; gap: 18px; }
    .popup-flex-item { margin: 0; }
    #popup-flex-container h1 { 
        background: linear-gradient(90deg, var(--orange) 0%, var(--acid) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font: 900 2.8rem "Futura", sans-serif; 
        text-transform: uppercase;
        letter-spacing: -1px;
    }
    #popup-flex-container p { margin: 12px 0 6px; font-weight: 700; }
    #yourName, #colorPicker { width: 100%; height: 40px; border: 2px solid var(--canvas); background: #fff; }
    #colorPicker { padding: 3px; }
    button { 
        width: 100%; 
        height: 48px; 
        border: 4px solid var(--ink); 
        background: linear-gradient(135deg, var(--orange) 0%, #ff1493 100%);
        color: white;
        cursor: pointer; 
        font-weight: 900; 
        text-transform: uppercase;
        font-family: "Futura", sans-serif;
        transition: all .3s ease;
        box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
    }
    button:hover { 
        background: linear-gradient(135deg, var(--acid) 0%, var(--neon1) 100%);
        transform: translate(-2px, -2px);
        box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
    }

    .dropdown-content { 
        display: none; 
        position: absolute; 
        z-index: 2; 
        min-width: 200px; 
        border: 4px solid var(--ink); 
        background: linear-gradient(135deg, var(--canvas), #f5f0e8);
        box-shadow: 10px 10px 0 var(--orange), 0 0 20px rgba(255, 46, 99, 0.2);
    }
    .dropdown-content a { 
        display: block; 
        padding: 16px 20px; 
        color: var(--ink); 
        text-decoration: none;
        font-weight: 700;
        transition: all .2s ease;
    }
    .dropdown-content a:hover { 
        background: linear-gradient(90deg, var(--acid), var(--neon1));
        color: var(--ink);
        transform: skewX(-5deg);
    }
    .show { display: block; }

    .blur { filter: blur(10px); }
    .play { animation: signal 1.5s infinite alternate ease-in-out; }
    .pause { animation: paused .35s infinite alternate ease; }
    @keyframes signal { from { box-shadow: 12px 12px 0 var(--ink), inset 0 0 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 255, 136, 0.3); } to { box-shadow: 12px 12px 0 var(--ink), inset 0 0 20px rgba(0, 0, 0, 0.2), 0 0 25px rgba(0, 255, 136, 0.7); } }
    @keyframes paused { from { box-shadow: 12px 12px 0 var(--ink), inset 0 0 20px rgba(0, 0, 0, 0.2); } to { box-shadow: 12px 12px 0 var(--ink), inset 0 0 20px rgba(0, 0, 0, 0.3); } }

    @media (max-width: 780px) {
        #gridContainer { 
            grid-template-columns: repeat(2, minmax(0, 1fr)); 
            grid-template-areas: "header header" "item1 item2" "item3 item4" "item5 item6" "item7 item8" "item9 .";
            gap: 16px;
            padding: 18px;
        }
        #header { 
            min-height: 160px; 
            padding: 22px; 
            box-shadow: 10px 10px 0 var(--ink), -3px -3px 15px rgba(255, 46, 99, 0.2);
        }
        #siteHeader { font-size: clamp(2rem, 8vw, 4.5rem); }
        #customize { display: none; }
        .dropdown { display: block; }
        #hamburger { width: 48px; height: 48px; padding: 10px; border: 4px solid var(--ink); background: linear-gradient(135deg, var(--acid), var(--neon1)); box-shadow: 0 0 12px rgba(0, 212, 212, 0.4); }
        #flexbox-container { display: flex; gap: 12px; }
        .dropdown-content { top: 60px; left: 18px; }
        #gridContainer > div:not(#header) { min-height: 40vh; box-shadow: 9px 9px 0 var(--ink), inset 0 0 15px rgba(0, 0, 0, 0.2); }
    }

    @media (max-width: 520px) {
        #gridContainer { 
            grid-template-columns: minmax(0, 1fr); 
            grid-template-areas: "header" "item1" "item2" "item3" "item4" "item5" "item6" "item7" "item8" "item9";
            gap: 14px;
            padding: 14px;
        }
        #header { 
            min-height: 120px; 
            padding: 16px;
            box-shadow: 8px 8px 0 var(--ink), -2px -2px 10px rgba(255, 46, 99, 0.15);
            transform: skewY(-1.5deg) rotate(-0.5deg);
        }
        #siteHeader { font-size: clamp(1.8rem, 7vw, 3.5rem); }
        #gridContainer > div:not(#header) { min-height: 50vh; box-shadow: 8px 8px 0 var(--ink), inset 0 0 12px rgba(0, 0, 0, 0.15); }
        #popupMenu { 
            padding: 22px;
            box-shadow: 
                15px 15px 0 var(--orange),
                -5px -5px 0 var(--acid),
                0 20px 50px var(--shadow);
        }
    }
