@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: #000000;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    margin: 0;
    padding: 0;
}

/* Container styles */
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* System prompt container - perfectly centered */
.system-prompt {
    border: 2px solid #00ffff;
    padding: 3rem;
    background: rgba(0, 255, 255, 0.05);
    position: relative;
    text-align: center;
    min-width: 600px;
    max-width: 80vw;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 50 !important;
}

.system-prompt::before {
    content: "SYSTEM ACCESS TERMINAL";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #000000;
    padding: 0 10px;
    font-size: 0.8rem;
    color: #00ffff;
    letter-spacing: 1px;
}

.main-question {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #00ffff;
    /* Removed all glow effects */
}

/* CRT scanlines effect */
.system-prompt::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    pointer-events: none;
}

.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.glitch-text::before {
    content: attr(data-text);
    animation: glitch-1 0.5s infinite;
    color: #ff0040;
    z-index: -1;
}

.glitch-text::after {
    content: attr(data-text);
    animation: glitch-2 0.5s infinite;
    color: #00ff40;
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, 1px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, -1px);
    }
}

/* Subtle flicker without glow */
@keyframes subtle-flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

.button-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.cosmic-button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1.3rem;
    padding: 0.9rem 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cosmic-button:hover {
    background: #00ffff;
    color: #000000;
    box-shadow: 0 0 20px #00ffff;
    transform: scale(1.05);
}

.cosmic-button:active {
    transform: scale(0.95);
}

/* Grid layout for corner buttons */
.corner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20rem;
    width: 80vw;
    height: 60vh;
    margin: 0 auto;
}

.corner-button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1.2rem;
    padding: 0.9rem 1.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
}

.corner-button:hover {
    background: #00ffff;
    color: #000000;
    box-shadow: 0 0 15px #00ffff;
}

/* Vertical button layout */
.vertical-buttons {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

/* Random positioned buttons */
.random-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 50 !important;
}

.random-button {
    position: absolute;
    background: transparent !important;
    border: 2px solid #00ffff !important;
    color: #00ffff !important;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100 !important;
}

.random-button:hover {
    background: #00ffff;
    color: #000000;
    border-color: #00ffff;
    box-shadow: 0 0 15px #00ffff;
}

.moving-button {
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Exit page styles */
.exit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.exit-text {
    font-size: 3rem;
    animation: fade-out 3s ease-in-out;
}

@keyframes fade-out {
    0% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Cosmology document styles */
.document-container {
    max-width: 90%;
    margin: 2rem auto;
    padding: 2rem;
    line-height: 1.6;
    overflow-y: auto;
    height: 90vh;
}

.document-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    text-decoration: underline;
    color: #00ffff;
}

.section-title {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #00ffff;
    text-decoration: underline;
}

.document-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    text-indent: 1rem;
}

.separator {
    text-align: center;
    margin: 2rem 0;
    font-size: 1.2rem;
    color: #00ffff;
}

/* Persistent navigation button */
.nav-button {
    position: fixed !important;
    bottom: 2rem !important;
    left: 2rem !important;
    background: transparent !important;
    border: 2px solid #00ffff !important;
    color: #00ffff !important;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    transition: all 0.1s ease;
    z-index: 1000 !important;
}

.nav-button:hover {
    background: #00ffff;
    color: #000000;
}

.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #00ffff;
    color: #000000;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }
    
    .main-question {
        font-size: 1.8rem;
    }
    
    .system-prompt {
        min-width: 90vw;
        padding: 2rem;
        margin: 1rem;
    }
    
    .corner-grid {
        gap: 3rem;
        width: 90vw;
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        padding: 2rem 0;
    }
    
    .corner-button {
        font-size: 1rem;
        padding: 1rem 1.5rem;
        width: 80%;
        margin: 0 auto;
    }
    
    .cosmic-button {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }
    
    /* Random buttons mobile layout */
    .random-container {
        height: auto;
        min-height: 100vh;
        padding: 4rem 1rem 1rem 1rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-content: start;
    }
    
    .random-button {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100%;
        margin: 0.5rem 0;
        font-size: 0.9rem;
        padding: 1rem;
        text-align: center;
    }
    
    /* File container mobile */
    .file-container {
        padding: 1rem;
        margin: 4rem 0.5rem 1rem 0.5rem;
        max-width: 95vw;
    }
    
    .file-content {
        padding: 1rem;
    }
    
    .file-text {
        font-size: 0.8rem;
        line-height: 1.4;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* Navigation button mobile */
    .nav-button {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1000;
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
    
    /* Info grid mobile */
    .info-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
        padding: 1rem !important;
    }
    
    .info-button {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
}
/* Device selection styles */
.device-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

.device-button {
    background: transparent !important;
    border: 2px solid #00ffff !important;
    color: #00ffff !important;
    font-family: 'Courier Prime', monospace;
    padding: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
}

.device-button:hover {
    background: #00ffff;
    color: #000000;
    transform: scale(1.05);
}

.device-icon {
    font-size: 3rem;
    filter: grayscale(1) brightness(0) invert(1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.device-button:hover .device-icon {
    filter: none;
}

.device-label {
    font-size: 1.2rem;
    font-weight: bold;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile mode adaptations */
body.mobile-mode {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh !important;
}

body.mobile-mode .random-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    padding: 4rem 1rem 1rem 1rem !important;
    height: auto !important;
    min-height: calc(100vh - 5rem) !important;
    position: relative !important;
    width: 100% !important;
    overflow: visible !important;
}

body.mobile-mode .random-button {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    margin: 0.5rem 0 !important;
    font-size: 0.8rem !important;
    padding: 0.8rem 0.5rem !important;
    text-align: center !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.mobile-mode .corner-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    width: 90% !important;
    height: auto !important;
    padding: 2rem 0 !important;
}

body.mobile-mode .corner-button {
    width: 100% !important;
    margin: 0.5rem 0 !important;
    font-size: 1rem !important;
    padding: 1.2rem !important;
    position: relative !important;
}

body.mobile-mode .system-prompt {
    min-width: 90vw !important;
    max-width: 95vw !important;
    padding: 2rem !important;
    margin: 1rem !important;
}

body.mobile-mode .main-question {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

body.mobile-mode .file-container {
    padding: 1rem !important;
    margin: 4rem 0.5rem 1rem 0.5rem !important;
    max-width: 95vw !important;
}

body.mobile-mode .file-text {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

body.mobile-mode .nav-button {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 1000 !important;
    font-size: 0.9rem !important;
    padding: 0.8rem 1rem !important;
}

/* Desktop mode optimizations */
body.desktop-mode .random-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: block;
}

body.desktop-mode .random-button {
    position: absolute;
}

body.desktop-mode .corner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15rem;
    width: 60vw;
    height: 40vh;
}

body.desktop-mode .system-prompt {
    min-width: 600px;
    max-width: 80vw;
}

/* Device selection responsive */
@media (max-width: 768px) {
    .device-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .device-button {
        padding: 1.5rem !important;
    }
    
    .device-icon {
        font-size: 2rem !important;
    }
    
    .device-label {
        font-size: 1rem !important;
    }
}

/* Audio indicator styles */
.audio-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 0.5rem 1rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 10000;
    border-radius: 3px;
    transition: all 0.3s ease;
    animation: audioPulse 2s ease-in-out infinite;
}

.audio-indicator:hover {
    background: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
}

@keyframes audioPulse {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.3); 
    }
    50% { 
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.6); 
    }
}

/* Audio visualization (optional) */
.audio-visualizer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 20px;
    display: flex;
    align-items: end;
    gap: 2px;
    opacity: 0.3;
    z-index: 1000;
}

.audio-bar {
    width: 3px;
    background: #00ffff;
    border-radius: 1px;
    animation: audioVisualize 1s ease-in-out infinite;
}

.audio-bar:nth-child(1) { animation-delay: 0s; height: 5px; }
.audio-bar:nth-child(2) { animation-delay: 0.1s; height: 8px; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; height: 12px; }
.audio-bar:nth-child(4) { animation-delay: 0.3s; height: 7px; }
.audio-bar:nth-child(5) { animation-delay: 0.4s; height: 15px; }
.audio-bar:nth-child(6) { animation-delay: 0.5s; height: 10px; }
.audio-bar:nth-child(7) { animation-delay: 0.6s; height: 6px; }
.audio-bar:nth-child(8) { animation-delay: 0.7s; height: 13px; }

@keyframes audioVisualize {
    0%, 100% { 
        transform: scaleY(0.3); 
        opacity: 0.3; 
    }
    50% { 
        transform: scaleY(1); 
        opacity: 0.8; 
    }
}

/* ===== ADVANCED VISUAL EFFECTS ===== */

/* 4. System Boot Sequence */
.boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
}

.boot-text {
    font-size: 1rem;
    margin: 0.5rem 0;
    opacity: 0;
    animation: bootTextAppear 0.5s ease-out forwards;
}

@keyframes bootTextAppear {
    to { opacity: 1; }
}

/* 5. Circuit Board Pattern */
.circuit-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    opacity: 0.03;
    background-image: 
        linear-gradient(90deg, #00ffff 1px, transparent 1px),
        linear-gradient(180deg, #00ffff 1px, transparent 1px);
    background-size: 50px 50px;
    animation: circuitMove 20s linear infinite;
}

@keyframes circuitMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.circuit-line {
    position: absolute;
    background: #00ffff;
    opacity: 0;
    animation: circuitPulse 3s ease-in-out infinite;
}

@keyframes circuitPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.1; }
}

/* 6. Mouse Trail Particles */
.mouse-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: #00ffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    0% { 
        opacity: 0.8; 
        transform: scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: scale(0.2); 
    }
}

/* 8. Click Ripple Effect Enhanced */
.click-ripple {
    position: fixed;
    border: 2px solid #00ffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: clickRippleExpand 0.8s ease-out forwards;
}

@keyframes clickRippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

/* 11. Digital Noise */
.digital-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.02;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="1" result="noise"/><feColorMatrix in="noise" type="saturate" values="0"/><feComponentTransfer><feFuncA type="discrete" tableValues="0 0.1 0 0.2 0"/></feComponentTransfer></filter></defs><rect width="100%" height="100%" filter="url(%23noise)" fill="%2300ffff"/></svg>');
    animation: noiseShift 0.1s linear infinite;
}

@keyframes noiseShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-2px, -2px); }
}

/* 12. Floating Code Fragments */
.code-fragment {
    position: fixed;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    animation: codeFloat 15s linear infinite;
}

@keyframes codeFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* 17. Data Corruption Waves */
.corruption-wave {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 255, 0.1) 50%, 
        transparent 100%);
    pointer-events: none;
    z-index: 9997;
    animation: corruptionSweep 3s ease-in-out;
}

@keyframes corruptionSweep {
    0% { left: -100%; }
    50% { left: 0%; }
    100% { left: 100%; }
}

.text-corrupt {
    animation: textCorrupt 0.3s ease-out;
}

@keyframes textCorrupt {
    0%, 100% { 
        filter: none; 
        transform: translateX(0); 
    }
    25% { 
        filter: hue-rotate(180deg) contrast(2); 
        transform: translateX(-2px); 
    }
    75% { 
        filter: invert(1); 
        transform: translateX(2px); 
    }
}

/* Enhanced button effects for UI sounds */
.sound-button {
    position: relative;
    overflow: hidden;
}

.sound-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.sound-button:hover::after {
    width: 100%;
    height: 100%;
}

/* System overload effect */
.system-overload {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.1);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    animation: systemOverload 2s ease-out;
}

@keyframes systemOverload {
    0% { opacity: 0; }
    10% { opacity: 1; filter: invert(1); }
    20% { opacity: 0; filter: none; }
    30% { opacity: 1; filter: hue-rotate(180deg); }
    40% { opacity: 0; filter: none; }
    50% { opacity: 1; filter: contrast(3); }
    60% { opacity: 0; filter: none; }
    100% { opacity: 0; filter: none; }
}

.overload-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-family: 'Courier Prime', monospace;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px #ff0000;
    z-index: 10000;
    opacity: 0;
    animation: overloadTextFlash 2s ease-out;
}

@keyframes overloadTextFlash {
    0%, 100% { opacity: 0; }
    20%, 40%, 60% { opacity: 1; }
    30%, 50% { opacity: 0; }
}

/* Updated button styles - no glow, sharp edges */
.cosmic-button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1.3rem;
    padding: 0.9rem 1.8rem;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 10;
}

.cosmic-button:hover {
    background: #00ffff;
    color: #000000;
    transform: scale(1.02);
}

/* Remove old cursor trail styles */

/* Grid layout for INFO section - clean alignment */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 80%;
    margin: 0 auto;
}

.info-button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
}

.info-button:hover {
    background: #00ffff;
    color: #000000;
}

/* Random buttons - consistent motion logic */
.random-button {
    position: absolute;
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* System rearrangement - sudden repositioning */
@keyframes sudden-reposition {
    0% { transform: translate(0, 0); }
    100% { transform: translate(var(--new-x), var(--new-y)); }
}

.repositioning {
    animation: sudden-reposition 0.1s ease-out forwards;
}
/* File container styles */
.file-container {
    max-width: 90%;
    margin: 2rem auto;
    padding: 2rem;
    overflow-y: auto;
    overflow-x: hidden;
    height: 90vh;
    position: relative;
}

/* Image placeholder */
.image-placeholder {
    border: 2px solid #00ffff;
    width: 300px;
    height: 200px;
    margin: 0 auto 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 255, 255, 0.05);
    font-family: 'Courier Prime', monospace;
    color: #00ffff;
    font-size: 1rem;
    text-align: center;
}

.image-note {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.7rem;
    color: #000000 !important;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

/* File content styles */
.file-content {
    text-align: left;
}

.file-text {
    font-family: 'Courier Prime', monospace;
    color: #00ffff;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    margin: 0;
    padding: 1rem;
    border: 1px solid #00ffff;
    background: rgba(0, 255, 255, 0.02);
    overflow-x: hidden;
}

/* Responsive adjustments for file display */
@media (max-width: 768px) {
    .image-placeholder {
        width: 250px;
        height: 150px;
    }
    
    .file-text {
        font-size: 0.8rem;
    }
}
/* Credits text styling */
.credits-text {
    font-size: 1.5rem;
    color: #00ffff;
    text-align: center;
    font-family: 'Courier Prime', monospace;
    line-height: 1.6;
}
/* Loading screen styles */
.loading-text {
    font-size: 2rem;
    color: #00ffff;
    text-align: center;
    font-family: 'Courier Prime', monospace;
    margin-bottom: 2rem;
}

.loading-bar-container {
    width: 100%;
    height: 20px;
    border: 2px solid #00ffff;
    background: transparent;
    position: relative;
}

.loading-bar {
    height: 100%;
    background: #00ffff;
    width: 0%;
    transition: width 0.2s ease;
}

/* Error screen styles */
.error-grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 1rem;
    width: 100vw;
    height: 100vh;
    padding: 2rem;
    box-sizing: border-box;
}

.error-box {
    border: 2px solid #00ffff;
    background: rgba(0, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier Prime', monospace;
    color: #00ffff;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Final access screen - black for now */
.final-access-container {
    width: 100vw;
    height: 100vh;
    background: #000000;
}
/* Error message styling */
.error-message {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier Prime', monospace;
    color: #00ffff;
    font-size: 1.5rem;
    text-align: center;
    z-index: 1000;
}
/* Access granted message */
.access-granted-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Courier Prime', monospace;
    color: #00ffff;
    font-size: 2rem;
    text-align: center;
}
/* ===== ADVANCED GLITCH & ANIMATION SYSTEM ===== */

/* Animated background grid */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-shift 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes grid-shift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Scanlines effect */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.02) 2px,
        rgba(0, 255, 255, 0.02) 4px
    );
    animation: scanlines 0.1s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Enhanced glitch text effects */
.glitch-text {
    position: relative;
    animation: text-flicker 3s infinite linear;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
}

.glitch-text::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0040;
    z-index: -1;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text::after {
    animation: glitch-2 0.5s infinite;
    color: #00ff40;
    z-index: -2;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    15%, 49% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    21%, 62% {
        transform: translate(2px, -1px);
        filter: hue-rotate(270deg);
    }
}

@keyframes text-flicker {
    0%, 94%, 96%, 100% { opacity: 1; }
    95% { opacity: 0.5; }
}

/* System prompt enhanced animations */
.system-prompt {
    animation: prompt-pulse 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.system-prompt::before {
    animation: label-glitch 2s infinite;
}

@keyframes prompt-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
        border-color: #00ffff;
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
        border-color: #00cccc;
    }
}

@keyframes label-glitch {
    0%, 90%, 100% { transform: translate(0); }
    91%, 92% { transform: translate(-1px, 0); }
    93%, 94% { transform: translate(1px, 0); }
}

/* Button enhanced animations */
.cosmic-button, .corner-button, .info-button {
    position: relative;
    overflow: hidden;
    animation: button-idle 3s ease-in-out infinite;
}

.cosmic-button::before, .corner-button::before, .info-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    animation: button-scan 3s linear infinite;
}

@keyframes button-idle {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(0.5px, 0); }
    75% { transform: translate(-0.5px, 0); }
}

@keyframes button-scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.cosmic-button:hover, .corner-button:hover, .info-button:hover {
    animation: button-hover-glitch 0.3s ease-out;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

@keyframes button-hover-glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, 2px); }
    80% { transform: translate(1px, -2px); }
}

/* Loading bar enhanced */
.loading-bar {
    position: relative;
    overflow: hidden;
}

.loading-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: loading-shine 1s linear infinite;
}

@keyframes loading-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Corner grid enhanced */
.corner-grid {
    animation: grid-breathe 6s ease-in-out infinite;
}

@keyframes grid-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* File container matrix effect */
.file-container {
    position: relative;
}

.file-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
    animation: matrix-shift 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes matrix-shift {
    0%, 100% { opacity: 0.3; transform: rotate(0deg); }
    50% { opacity: 0.6; transform: rotate(1deg); }
}

/* Image placeholder enhanced */
.image-placeholder {
    position: relative;
    animation: placeholder-static 0.5s infinite;
}

@keyframes placeholder-static {
    0%, 90%, 100% { 
        background: rgba(0, 255, 255, 0.05);
        border-color: #00ffff;
    }
    95% { 
        background: rgba(0, 255, 255, 0.1);
        border-color: #00cccc;
    }
}

/* Navigation button pulse */
.nav-button, .back-button {
    animation: nav-pulse 2s ease-in-out infinite;
}

@keyframes nav-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Error boxes chaos */
.error-box {
    animation: error-chaos 3s infinite;
}

.error-box:nth-child(2n) {
    animation-delay: -0.5s;
}

.error-box:nth-child(3n) {
    animation-delay: -1s;
}

.error-box:nth-child(5n) {
    animation-delay: -1.5s;
}

@keyframes error-chaos {
    0%, 96%, 100% { 
        transform: translate(0);
        background: rgba(0, 255, 255, 0.05);
    }
    97% { 
        transform: translate(1px, -1px);
        background: rgba(255, 0, 64, 0.1);
    }
    98% { 
        transform: translate(-1px, 1px);
        background: rgba(0, 255, 64, 0.1);
    }
    99% { 
        transform: translate(1px, 1px);
        background: rgba(0, 255, 255, 0.1);
    }
}

/* Credits text typewriter effect */
.credits-text {
    overflow: hidden;
    border-right: 2px solid #00ffff;
    animation: typewriter 3s steps(40) 1s both, cursor-blink 1s infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes cursor-blink {
    0%, 50% { border-color: #00ffff; }
    51%, 100% { border-color: transparent; }
}

/* Vertical buttons stagger */
.vertical-buttons .cosmic-button {
    animation: stagger-in 0.6s ease-out both;
}

.vertical-buttons .cosmic-button:nth-child(1) { animation-delay: 0.1s; }
.vertical-buttons .cosmic-button:nth-child(2) { animation-delay: 0.2s; }
.vertical-buttons .cosmic-button:nth-child(3) { animation-delay: 0.3s; }

@keyframes stagger-in {
    0% { 
        opacity: 0; 
        transform: translateX(-50px) rotateY(90deg);
    }
    100% { 
        opacity: 1; 
        transform: translateX(0) rotateY(0deg);
    }
}

/* Final access dramatic effect */
.access-granted-message {
    animation: access-granted 2s ease-out both;
}

@keyframes access-granted {
    0% { 
        opacity: 0; 
        transform: scale(0.5) rotateX(90deg);
        filter: blur(10px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotateX(45deg);
        filter: blur(2px);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}
/* Custom scrollbar for file containers */
.file-container::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.file-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.file-container::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 4px;
    border: 1px solid #000000;
}

.file-container::-webkit-scrollbar-thumb:hover {
    background: #00cccc;
}

/* Firefox scrollbar */
.file-container {
    scrollbar-width: thin;
    scrollbar-color: #00ffff rgba(0, 0, 0, 0.3);
}