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

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

/* Starfield background */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0033 0%, #000000 100%);
    z-index: 0;
}

/* 3D Vortex Effect */
#vortex {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 500px;
    z-index: 1;
    pointer-events: none;
}

#vortex::before,
#vortex::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 50%;
    animation: vortex-spin 4s linear infinite;
}

#vortex::before {
    width: 80vmin;
    height: 80vmin;
}

#vortex::after {
    width: 60vmin;
    height: 60vmin;
    animation-duration: 3s;
    animation-direction: reverse;
    border-color: rgba(75, 0, 130, 0.3);
}

@keyframes vortex-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
        opacity: 0.5;
    }
}

/* Game Container */
#game-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Title */
#title {
    text-align: center;
    color: white;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.8),
                 0 0 40px rgba(138, 43, 226, 0.6);
    animation: title-glow 2s ease-in-out infinite;
    margin-bottom: 2rem;
}

#title h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
}

#title.hidden {
    display: none;
}

.instructions {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: #ffeb3b;
}

.hint {
    font-size: 1rem;
    color: #64ffda;
    margin-top: 0.5rem;
}

@keyframes title-glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(138, 43, 226, 0.8),
                     0 0 40px rgba(138, 43, 226, 0.6);
    }
    50% {
        text-shadow: 0 0 30px rgba(138, 43, 226, 1),
                     0 0 60px rgba(138, 43, 226, 0.8),
                     0 0 80px rgba(138, 43, 226, 0.6);
    }
}

/* Character Container */
#character-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual Characters */
.character {
    position: absolute;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px currentColor,
                 0 0 40px currentColor;
    animation: character-enter 1.2s ease-out forwards;
    pointer-events: none;
    transform-origin: center;
}

/* Mouse trail sparkles */
.sparkle {
    position: absolute;
    pointer-events: none;
    font-size: 4rem;
    animation: sparkle-float 1.5s ease-out forwards;
    z-index: 3;
}

@keyframes sparkle-float {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(360deg) translateY(-100px);
        opacity: 0;
    }
}

/* Mouse trail line */
.trail {
    position: absolute;
    pointer-events: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: trail-fade 1.2s ease-out forwards;
    z-index: 3;
}

@keyframes trail-fade {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.character.emoji {
    font-size: 4rem;
    animation: emoji-enter 3s ease-out forwards;
}

@keyframes character-enter {
    0% {
        transform: translate(-50%, -50%) scale(6) translateZ(-1000px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3) translateZ(0px) rotate(90deg);
        opacity: 0;
    }
}

@keyframes emoji-enter {
    0% {
        transform: translate(-50%, -50%) scale(0.1) translateZ(-1000px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(2) translateZ(0px) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) translateZ(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Score Display */
#score-display {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
    color: white;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.5s;
}

#score-display.visible {
    opacity: 1;
}

.stat {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.stat span {
    color: #00ffff;
    font-weight: bold;
}

/* Clear Button */
#clear-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    padding: 12px 24px;
    font-size: 1rem;
    background: rgba(138, 43, 226, 0.8);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
    pointer-events: none;
}

#clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

#clear-btn:hover {
    background: rgba(138, 43, 226, 1);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

/* Animated stars */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: star-move linear infinite;
    box-shadow: 0 0 4px white;
}

@keyframes star-move {
    0% {
        transform: translateZ(-1000px) translateY(-50vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateZ(500px) translateY(100vh);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #title h1 {
        font-size: 2.5rem;
        letter-spacing: 0.3rem;
    }
    
    .instructions {
        font-size: 1rem;
    }
    
    .hint {
        font-size: 0.8rem;
    }
    
    .character {
        font-size: 2rem;
    }
    
    .character.emoji {
        font-size: 3rem;
    }
    
    #score-display {
        font-size: 0.9rem;
        gap: 10px;
        top: 10px;
        left: 10px;
    }
    
    .stat {
        padding: 8px 12px;
    }
}

