/* Global Rests & Paranoiac Base */
body {
    background-color: #1F1F56;
    /* The Original Deep Blue Void */
    color: #FFFFFF;
    font-family: 'Source Serif 4', 'Palatino Linotype', 'Palatino', serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Fallback background if WebGPU fails */
    background-image: url('../assets/indexbg.png');
    background-repeat: repeat;
}

a {
    color: #ffd700;
    text-decoration: none;
    cursor: crosshair;
}

a:hover {
    color: #ff4500;
    text-decoration: underline wavy;
}

/* WebGPU Background Layer */
#void-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: screen;
    /* Blend with the blue background */
}

/* Layout Containers */
#labyrinth-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    /* Above the canvas */
    background: rgba(31, 31, 86, 0.4);
    /* Slight transparency */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Header & Logo */
header {
    text-align: center;
    margin-bottom: 30px;
}

.header-logo-container {
    margin-bottom: 20px;
}

.main-logo {
    max-width: 80%;
    height: auto;
    border: 5px ridge #ffd700;
}

h1 {
    font-family: 'Special Elite', cursive;
    font-size: 3em;
    text-shadow: 4px 4px 0px #000;
}

/* Marquees */
.propaganda-marquee {
    background: #ff0000;
    color: #ffff00;
    font-family: 'Press Start 2P', cursive;
    padding: 10px;
    border: 3px double #fff;
    margin-bottom: 20px;
}

.bottom-marquee {
    background: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 5px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

/* Navigation */
.chaos-nav ul {
    list-style-type: square;
    text-align: center;
    font-size: 1.2em;
    padding: 0;
}

.chaos-nav li {
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    display: inline-block;
    padding: 5px 15px;
    border: 1px dashed #666;
}

/* Audio Player */
#audio-container {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #000;
    border: 2px solid #0f0;
    padding: 10px;
    z-index: 1000;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    text-align: center;
    max-width: 600px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

#minimize-audio {
    background: #0f0;
    color: #000;
    border: 3px outset #0f0;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 12px;
    line-height: 1;
    box-shadow: 4px 4px 0px #050;
    transition: all 0.1s;
}

#minimize-audio:hover {
    background: #fff;
    border-color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px #aaa;
}

#minimize-audio:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

#audio-container.minimized {
    padding: 5px 10px;
}

#audio-container.minimized #audio-content {
    display: none;
}

#audio-container.minimized .audio-controls-header {
    margin-bottom: 0;
}

.audio-label {
    color: #0f0;
    margin-bottom: 5px;
    animation: blink 2s infinite;
}

/* Collage Grid */
.collage-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.grid-item {
    position: relative;
    border: 3px solid #ffd700;
    background: #000;
    transition: transform 0.2s;
}

.grid-item:hover {
    transform: scale(1.05) rotate(2deg);
    z-index: 10;
}

.grid-item img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wide {
    width: 100%;
    max-width: 600px;
}

/* Animations */
@keyframes wiggle {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(2deg);
    }

    50% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(1deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.wiggle {
    animation: wiggle 2s infinite ease-in-out;
}

@keyframes melt {
    0% {
        filter: blur(0px) contrast(100%);
    }

    50% {
        filter: blur(2px) contrast(150%) hue-rotate(90deg);
    }

    100% {
        filter: blur(0px) contrast(100%);
    }
}

.melt-anim {
    animation: melt 5s infinite alternate;
}

.melt-anim-slow {
    animation: melt 10s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: brightness(100%);
    }

    50% {
        transform: scale(1.02);
        filter: brightness(150%);
    }

    100% {
        transform: scale(1);
        filter: brightness(100%);
    }
}

.pulse-anim {
    animation: pulse 1s infinite;
}

@keyframes glitch {
    0% {
        clip-path: inset(0 0 0 0);
    }

    10% {
        clip-path: inset(20% 0 80% 0);
    }

    20% {
        clip-path: inset(0 0 0 0);
    }

    30% {
        clip-path: inset(80% 0 5% 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

.glitch-anim:hover {
    animation: glitch 0.5s infinite linear;
    filter: invert(1);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Grid Item Layout Specifics (Chaotic positioning ideas) */
.caption {
    background: #000;
    color: #fff;
    text-align: center;
    font-family: 'Rock Salt', cursive;
    padding: 5px;
}

.memory-link {
    display: block;
    border: 5px solid red;
}

.memory-link .caption {
    color: red;
    font-weight: bold;
}

/* Memory Page Styles (Shared) */
.memory-body {
    background: #000;
    overflow: hidden;
}

#memory-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.2);
    font-family: 'Special Elite', monospace;
    font-size: 5em;
    pointer-events: none;
    z-index: 10;
    text-align: center;
    mix-blend-mode: screen;
}

/* 2020s Annoyance: Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 50px;
    /* Above bottom marquee */
    right: 20px;
    width: 300px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff00ff;
    padding: 15px;
    z-index: 9999;
    /* Super annoying z-index */
    font-family: 'Arial', sans-serif;
    /* Boring font on purpose */
    color: #fff;
    box-shadow: 10px 10px 0px #ff00ff;
    animation: float 3s infinite ease-in-out;
}

.cookie-header {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #ff00ff;
}

.cookie-actions button {
    background: #ff00ff;
    color: #000;
    border: none;
    padding: 10px;
    margin-right: 5px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.cookie-actions button:hover {
    background: #fff;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Legacy Directory */
#labyrinth-contents {
    margin: 100px auto;
    max-width: 1200px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px double #0ff;
    padding: 40px;
    box-shadow: 0 0 20px #0ff;
    position: relative;
    z-index: 100;
}

#labyrinth-contents h2 {
    text-align: center;
    color: #ff0;
    font-family: 'Special Elite', cursive;
    margin-bottom: 30px;
    text-shadow: 2px 2px #f0f;
}

.contents-grid-mega {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

.contents-grid-mega .col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
}

.contents-grid-mega a {
    color: #0f0;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Special Elite', 'Courier New', serif;
    transition: all 0.2s;
}

.contents-grid-mega a:hover {
    color: #fff;
    background: #0f0;
    transform: translateX(10px);
}

/* Carl Wilson Zoom Effect */
.carl-feature {
    animation: slowZoom 10s infinite alternate ease-in-out;
    transform-origin: center center;
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    #labyrinth-container {
        padding: 10px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .collage-grid {
        gap: 10px;
    }

    .grid-item {
        width: calc(50% - 10px);
    }

    .grid-item.wide {
        width: 100%;
    }

    #audio-container {
        position: relative;
        top: 0;
        right: 0;
        width: calc(100% - 20px);
        margin: 10px auto;
        max-width: none;
        box-sizing: border-box;
    }

    .contents-grid-mega {
        flex-direction: column;
        padding: 10px;
    }

    .contents-grid-mega .col {
        min-width: 100%;
        align-items: center;
    }

    #labyrinth-contents {
        margin: 50px 10px;
        padding: 20px 10px;
    }

    #cookie-banner {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        box-sizing: border-box;
    }

    iframe {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 480px) {
    .grid-item {
        width: 100%;
    }

    h1 {
        font-size: 1.5em;
    }
}

/* Cylindrical Truth Hot Dog Styles */
.neon-flashing-hotdog {
    max-height: 200px;
    border: 4px solid #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px #f0f, 0 0 30px #0ff;
    animation: neon-flash 0.5s infinite alternate;
    transition: transform 0.3s;
    margin: 20px 0;
}

.neon-flashing-hotdog:hover {
    transform: scale(1.1) rotate(5deg);
    filter: hue-rotate(90deg);
}

@keyframes neon-flash {
    from {
        box-shadow: 0 0 10px #fff, 0 0 20px #f0f, 0 0 30px #0ff;
        filter: brightness(100%);
    }

    to {
        box-shadow: 0 0 20px #fff, 0 0 40px #0ff, 0 0 60px #f0f;
        filter: brightness(150%) contrast(120%);
    }

    /* LYNX TERMINAL SIMULATION */
    #lynx-terminal-mount {
        width: 100%;
        max-width: 900px;
        height: 500px;
        margin: 20px auto;
        background-color: #000;
        border: 10px ridge #888;
        position: relative;
        font-family: 'VT323', monospace;
        font-size: 18px;
        color: #0c0;
        /* Amber: #fc0, Green: #0c0 */
        overflow: hidden;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    }

    .lynx-terminal {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 5px;
        box-sizing: border-box;
    }

    .lynx-screen {
        flex-grow: 1;
        overflow-y: auto;
        white-space: pre-wrap;
        word-break: break-all;
        padding-bottom: 25px;
        /* Space for status bar */
    }

    .lynx-status-bar {
        height: 24px;
        background: #ccc;
        color: #000;
        padding: 2px 5px;
        font-weight: bold;
        flex-shrink: 0;
    }

    .lynx-link {
        color: #0c0;
        font-weight: bold;
        cursor: pointer;
        /* Even though it's keyboard nav, mouse implies clickable */
    }

    .lynx-link.selected {
        background-color: #0c0;
        color: #000;
        text-decoration: none;
    }

    /* Scrollbar hiding for authenticity */
    .lynx-screen::-webkit-scrollbar {
        width: 8px;
        background: #000;
    }

    .lynx-screen::-webkit-scrollbar-thumb {
        background: #0c0;
    }