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

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

/* Cosmic Background */
.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
    z-index: -2;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    from { transform: translateY(0px); }
    to { transform: translateY(-100px); }
}

/* Game Container */
.game-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    z-index: 1;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-item .label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.score-item span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Game Modes */
.game-modes {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border: 2px solid transparent;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: rgba(0, 255, 255, 0.3);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Game Area */
.game-area {
    position: relative;
    height: 400px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    margin-bottom: 20px;
}

.falling-words-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Falling Words */
.falling-word {
    position: absolute;
    padding: 8px 15px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fall linear;
    cursor: default;
    user-select: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.falling-word.easy-mode {
    background: linear-gradient(45deg, #00b894, #00cec9);
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.6);
}

.falling-word.medium-mode {
    background: linear-gradient(45deg, #fdcb6e, #e17055);
    box-shadow: 0 0 20px rgba(253, 203, 110, 0.6);
}

.falling-word.hard-mode {
    background: linear-gradient(45deg, #e84393, #fd79a8);
    box-shadow: 0 0 20px rgba(232, 67, 147, 0.6);
    animation: fall linear, hardGlow 0.3s ease-in-out infinite alternate;
}

.falling-word.paused {
    animation-play-state: paused;
}

@keyframes fall {
    from {
        transform: translateY(-50px);
    }
    to {
        transform: translateY(450px);
    }
}

@keyframes hardGlow {
    from { box-shadow: 0 0 20px rgba(232, 67, 147, 0.6); }
    to { box-shadow: 0 0 30px rgba(232, 67, 147, 1); }
}

/* Input Section */
.input-section {
    text-align: center;
    margin-bottom: 20px;
}

#word-input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#word-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#word-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Game Status */
.game-status {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* Game Over Modal */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .score-board {
        gap: 15px;
    }
    
    .game-area {
        height: 300px;
    }
    
    .falling-word {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    #word-input {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 20px;
        padding: 30px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-modes {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-area {
        height: 250px;
    }
}

/* Special Effects */
.word-matched {
    animation: wordMatched 0.5s ease-out;
}

@keyframes wordMatched {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.streak-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    animation: streakPop 1s ease-out;
    pointer-events: none;
    z-index: 100;
}

@keyframes streakPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Developer Credit Footer */
.developer-credit {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.developer-credit p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.developer-credit strong {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}