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

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    overflow-x: hidden;
    min-height: 100vh;
}

.light-leak-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 105, 180, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.2) 0%, transparent 50%),
        linear-gradient(45deg, rgba(255, 0, 150, 0.1) 0%, transparent 70%),
        linear-gradient(-45deg, rgba(0, 255, 255, 0.1) 0%, transparent 70%);
    animation: lightLeak 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes lightLeak {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.8;
    }
    25% { 
        transform: scale(1.1) rotate(5deg); 
        opacity: 0.6;
    }
    50% { 
        transform: scale(0.9) rotate(-3deg); 
        opacity: 1;
    }
    75% { 
        transform: scale(1.05) rotate(2deg); 
        opacity: 0.7;
    }
}

#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
}

.logo-container {
    position: relative;
    display: flex;
    gap: 20px;
    align-items: center;
}

.logo-shard {
    position: relative;
    transform: scale(0) rotate(360deg);
    opacity: 0;
    filter: 
        drop-shadow(0 0 20px rgba(255, 255, 255, 0.5))
        drop-shadow(0 0 40px rgba(0, 255, 255, 0.3))
        drop-shadow(0 0 60px rgba(255, 105, 180, 0.2));
    animation: shardAssemble 2s ease-out forwards;
}

.logo-shard:nth-child(1) { animation-delay: 0.2s; }
.logo-shard:nth-child(2) { animation-delay: 0.4s; }
.logo-shard:nth-child(3) { animation-delay: 0.6s; }
.logo-shard:nth-child(4) { animation-delay: 0.8s; }

.logo-shard img {
    width: 80px;
    height: 80px;
    filter: brightness(1.2) contrast(1.1);
}

@keyframes shardAssemble {
    0% {
        transform: scale(0) rotate(360deg) translateX(var(--scatter-x, 100px)) translateY(var(--scatter-y, 100px));
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg) translateX(0) translateY(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg) translateX(0) translateY(0);
        opacity: 1;
    }
}

.logo-shard[data-letter="8"] { --scatter-x: -150px; --scatter-y: -100px; }
.logo-shard[data-letter="1"] { --scatter-x: 150px; --scatter-y: -100px; }
.logo-shard[data-letter="r"] { --scatter-x: -150px; --scatter-y: 100px; }
.logo-shard[data-letter="t"] { --scatter-x: 150px; --scatter-y: 100px; }

#main-container, #error-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 20px;
    max-width: 800px;
    padding: 40px;
}

.letter-button {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    animation: fadeInLetter 0.6s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.letter-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.letter-button:hover::before {
    transform: rotate(45deg) translateX(100%);
}

.letter-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.letter-button.clicked {
    animation: zoomTransition 0.8s ease-in-out forwards;
}

@keyframes fadeInLetter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes zoomTransition {
    0% {
        transform: scale(1);
        border-radius: 15px;
    }
    100% {
        transform: scale(20);
        border-radius: 0;
        opacity: 0;
    }
}

.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.transition-overlay.active {
    opacity: 1;
}

/* 404 Specific Styles */
.error-content {
    text-align: center;
    color: #fff;
    z-index: 10;
}

.error-code {
    font-size: 8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff69b4, #00ffff, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

.error-message {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 3s forwards;
}

.error-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0;
    color: rgba(255, 255, 255, 0.7);
    animation: fadeInUp 1s ease-out 3.5s forwards;
}

.back-home {
    padding: 15px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 1s ease-out 4s forwards;
}

.back-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-shard img {
        width: 60px;
        height: 60px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 15px;
        padding: 20px;
    }
    
    .letter-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .error-code {
        font-size: 5rem;
    }
    
    .error-message {
        font-size: 1.5rem;
    }
}

