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

body {
    font-family: 'Arial Black', 'Arial Bold', sans-serif;
    background: linear-gradient(135deg, #FF1493 0%, #FFD700 25%, #00CED1 50%, #FF69B4 75%, #7B68EE 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.container {
    width: 90%;
    max-width: 900px;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.title {
    font-size: 5rem;
    color: #FFFF00;
    text-shadow: 
        4px 4px 0 #FF1493,
        8px 8px 0 #00CED1,
        12px 12px 0 #000,
        16px 16px 20px rgba(0,0,0,0.5);
    animation: bounce 2s ease-in-out infinite;
    letter-spacing: 0.2em;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.lang-selector {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.lang-btn {
    font-size: 2rem;
    border: 4px solid #000;
    background: #FFF;
    cursor: pointer;
    padding: 5px 15px;
    transition: transform 0.2s;
    box-shadow: 4px 4px 0 #000;
}

.lang-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
}

.lang-btn.active {
    background: #FFFF00;
    transform: scale(1.1);
}

.game-area {
    background: #FFF;
    border: 8px solid #000;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 
        8px 8px 0 #FF1493,
        16px 16px 0 #00CED1,
        24px 24px 40px rgba(0,0,0,0.5);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.start-screen, .play-screen, .result-screen {
    text-align: center;
    width: 100%;
}

.hidden {
    display: none !important;
}

.subtitle {
    font-size: 2rem;
    color: #FF1493;
    margin-bottom: 2rem;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #FFD700;
}

.start-btn, .restart-btn {
    font-size: 2rem;
    font-weight: bold;
    padding: 1rem 3rem;
    background: #FFFF00;
    border: 6px solid #000;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 6px 6px 0 #FF1493;
    transition: all 0.2s;
    letter-spacing: 0.1em;
}

.start-btn:hover, .restart-btn:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 #FF1493;
}

.start-btn:active, .restart-btn:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 #FF1493;
}

.timer-bar {
    width: 100%;
    height: 30px;
    background: #000;
    border: 4px solid #000;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #00CED1, #7B68EE, #FF1493);
    width: 100%;
    transition: width 0.1s linear;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat {
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    background: #FFD700;
    padding: 10px 20px;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #FF1493;
}

.word-display {
    font-size: 4rem;
    font-weight: bold;
    color: #FF1493;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    text-shadow: 4px 4px 0 #00CED1;
    animation: wordPop 0.3s ease;
}

@keyframes wordPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.input-area {
    width: 100%;
}

.word-input {
    width: 100%;
    font-size: 2rem;
    padding: 1rem;
    border: 6px solid #000;
    background: #FFF;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    outline: none;
    box-shadow: inset 4px 4px 0 rgba(0,0,0,0.1);
}

.word-input:focus {
    background: #FFFF00;
    box-shadow: 
        inset 4px 4px 0 rgba(0,0,0,0.1),
        0 0 20px #FFD700;
}

.result-title {
    font-size: 3rem;
    color: #FF1493;
    margin-bottom: 2rem;
    text-shadow: 4px 4px 0 #00CED1;
}

.final-stats {
    margin-bottom: 2rem;
}

.final-wpm {
    font-size: 6rem;
    font-weight: bold;
    color: #7B68EE;
    text-shadow: 5px 5px 0 #FFD700;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.wpm-label {
    font-size: 1.5rem;
    color: #000;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.final-words {
    font-size: 1.5rem;
    color: #FF1493;
    margin-top: 1rem;
    font-weight: bold;
}

.floating-words {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-word {
    position: absolute;
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: float 15s linear infinite;
    text-transform: uppercase;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .word-display {
        font-size: 2.5rem;
    }
    
    .word-input {
        font-size: 1.5rem;
    }
    
    .game-area {
        padding: 1.5rem;
    }
    
    .final-wpm {
        font-size: 4rem;
    }
}
