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

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

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

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 107, 107, 0.6);
    border-radius: 50%;
    pointer-events: none;
}

/* Stages */
.stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s ease;
}

.stage.active {
    opacity: 1;
    visibility: visible;
}

.content {
    text-align: center;
    max-width: 800px;
    padding: 2rem;
}

/* Typography */
.title {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.8)); }
}

.subtitle, .stage-subtitle {
    font-weight: 300;
    color: #a0a0a0;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.stage-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Glass Morphism Elements */
.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.glass-btn.large {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
}

/* Entry Portal */
.password-container {
    margin-top: 3rem;
}

#entry-password {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    width: 300px;
    text-align: center;
    margin-bottom: 1rem;
}

#entry-password::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.hint {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Constellation Canvas */
#constellation-canvas {
    width: 600px;
    height: 400px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 2rem auto;
    cursor: crosshair;
    background: rgba(10, 10, 30, 0.5);
    transition: border-color 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 2rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    width: 0%;
    transition: width 0.5s ease;
}

/* Globe */
#globe-container {
    width: 400px;
    height: 400px;
    margin: 2rem auto;
    position: relative;
}

#globe-canvas {
    width: 100%;
    height: 100%;
}

.coordinate-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: end;
    margin-top: 2rem;
}

.coord-box {
    text-align: left;
}

.coord-box label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.coord-box input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    color: white;
    width: 200px;
}

/* Memory Grid */
#memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    grid-gap: 15px;
    margin: 2rem auto;
    justify-content: center;
}

.memory-card {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.memory-card:hover {
    transform: scale(1.05);
    border-color: rgba(255, 107, 107, 0.5);
}

.memory-card.flipped {
    background: rgba(255, 107, 107, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: #ff6b6b;
}

.memory-card.matched {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    pointer-events: none;
}

/* Key Slots */
.key-slots {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 3rem 0;
}

.key-slot {
    text-align: center;
}

.slot-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.key-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    color: #4ecdc4;
    text-align: center;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Encrypted Message */
.encrypted-text {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* Final Message */
.final-message {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    line-height: 1.8;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    animation: fadeInMessage 2s ease;
    margin-bottom: 3rem;
}

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

/* Heart Animation */
.heart-animation {
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.beating-heart {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* Collected Items */
.collected-keys, .collected-words {
    margin-top: 1rem;
    font-family: monospace;
    color: #4ecdc4;
    font-size: 1.2rem;
    height: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .stage-title {
        font-size: 2rem;
    }
    
    #constellation-canvas {
        width: 100%;
        max-width: 350px;
        height: 350px;
    }
    
    #globe-container {
        width: 300px;
        height: 300px;
    }
    
    #memory-grid {
        grid-template-columns: repeat(3, 100px);
    }
    
    .memory-card {
        width: 100px;
        height: 100px;
    }
    
    .key-slots {
        flex-direction: column;
        gap: 1rem;
    }
    
    .coordinate-display {
        flex-direction: column;
    }
}