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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #111827;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #F9FAFB;
    overflow-x: hidden;
    position: relative;
}

.game-container {
    width: 100%;
    max-width: 900px;
    padding: 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Start Screen Styles */
.start-screen {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    max-height: 100vh;
}

.logo-section {
    margin-bottom: 2rem;
    position: relative;
}

.game-title {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(45deg, #F59E0B, #EF4444, #F59E0B);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: titleGradient 3s ease-in-out infinite, titleFloat 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.subtitle {
    font-size: 1.1rem;
    color: #F9FAFB;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
    animation: subtitlePulse 2s ease-in-out infinite;
}

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

@keyframes titleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

.stats-section {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.high-score-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(37, 99, 235, 0.1));
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    border: 2px solid rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    animation: cardFloat 3s ease-in-out infinite;
}

.high-score-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(245, 158, 11, 0.1), transparent);
    animation: cardShine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-5px) scale(1.02); }
}

@keyframes cardShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
}

.high-score-label {
    font-size: 1rem;
    color: rgba(249, 250, 251, 0.8);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.high-score-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: #F59E0B;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
    animation: scoreGlow 2s ease-in-out infinite alternate;
}

@keyframes scoreGlow {
    from { text-shadow: 0 0 30px rgba(245, 158, 11, 0.6); }
    to { text-shadow: 0 0 40px rgba(245, 158, 11, 0.9); }
}

.instructions {
    margin-bottom: 2rem;
    position: relative;
    height: 60px;
    overflow: hidden;
    background: rgba(249, 250, 251, 0.05);
    backdrop-filter: blur(5px);
}

.scrolling-text {
    position: absolute;
    white-space: nowrap;
    animation: scroll 15s linear infinite;
    font-size: 1.1rem;
    color: rgba(249, 250, 251, 0.8);
    font-weight: 500;
    line-height: 60px;
    padding: 0 2rem;
}

@keyframes scroll {
    0% { transform: translateX(90%); }
    100% { transform: translateX(-90%); }
}


.start-btn {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 900;
    color: #F9FAFB;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    animation: buttonPulse 3s ease-in-out infinite;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-btn:hover {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6);
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6); }
}

.btn-icon {
    font-size: 1.4rem;
    animation: iconSpin 4s linear infinite;
}

@keyframes iconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Game Area Styles */
#gameArea {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    max-height: 100vh;
    padding: 1rem 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: #1F2937;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(249, 250, 251, 0.1);
}

.score-section {
    text-align: left;
}

.score-label {
    font-size: 0.9rem;
    color: rgba(249, 250, 251, 0.6);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: #F59E0B;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.hearts {
    font-size: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.heart {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
    position: relative;
    display: inline-block;
}

.heart.lost {
    opacity: 0;
    transform: scale(0.3);
    filter: grayscale(100%) blur(2px);
}

.heart.losing {
    animation: heartLoss 1.5s ease-out forwards;
}

.heart-text {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    color: #EF4444;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    z-index: 10;
}

.heart.losing .heart-text {
    animation: heartTextFloat 1.5s ease-out forwards;
}

@keyframes heartLoss {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
    }
    25% {
        transform: scale(1.3) rotate(-10deg);
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8));
    }
    50% {
        transform: scale(0.8) rotate(5deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.3);
        opacity: 0;
        filter: grayscale(100%) blur(2px);
    }
}

@keyframes heartTextFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0px) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-10px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-25px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px) scale(0.8);
    }
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.mute-btn {
    background: rgba(249, 250, 251, 0.1);
    border: none;
    color: #F9FAFB;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(249, 250, 251, 0.2);
}

.mute-btn:hover {
    background: rgba(249, 250, 251, 0.2);
    transform: scale(1.05);
}

.command-section {
    margin-bottom: 1.5rem;
}

.command-word {
    font-size: 3.5rem;
    font-weight: 900;
    color: #F59E0B;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    margin-bottom: 0.5rem;
    animation: commandPulse 2s ease-in-out infinite;
}

.difficulty-indicator {
    font-size: 1rem;
    color: rgba(249, 250, 251, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes commandPulse {
    0%, 100% { 
        text-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 40px rgba(245, 158, 11, 0.8);
        transform: scale(1.02);
    }
}

.timer-container {
    margin-bottom: 1.5rem;
}

.timer-bar {
    width: 100%;
    height: 12px;
    background: rgba(249, 250, 251, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(249, 250, 251, 0.3);
}

.timer-fill {
    height: 100%;
    background: #F43F5E;
    border-radius: 6px;
    transition: width 0.1s linear;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.5);
}

.timer-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #F9FAFB;
}

.buttons-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.game-button {
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #2563EB;
    color: #F9FAFB;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(249, 250, 251, 0.1);
}

.game-button:hover {
    background: #3B82F6;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.4);
}

.game-button:active {
    transform: translateY(-1px);
}

.game-button.correct {
    animation: correctFlash 0.6s ease;
}

.game-button.wrong {
    animation: wrongFlash 0.6s ease;
}

@keyframes correctFlash {
    0%, 100% { 
        background: #2563EB;
        box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
    }
    50% { 
        background: #10B981;
        box-shadow: 0 15px 40px rgba(16, 185, 129, 0.6);
        transform: scale(1.05);
    }
}

@keyframes wrongFlash {
    0%, 100% { 
        background: #2563EB;
        transform: translateX(0);
    }
    25% { 
        background: #EF4444;
        transform: translateX(-10px);
    }
    75% { 
        background: #EF4444;
        transform: translateX(10px);
    }
}

.feedback {
    font-size: 1.3rem;
    font-weight: bold;
    min-height: 1.5rem;
    transition: all 0.3s ease;
}

.feedback.correct {
    color: #10B981;
    animation: feedbackBounce 0.5s ease;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.feedback.wrong {
    color: #EF4444;
    animation: feedbackBounce 0.5s ease;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

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

/* Game Over Styles */
.game-over {
    display: none;
    background: rgba(0, 0, 0, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.game-over-content {
    background: linear-gradient(135deg, #1F2937, #111827);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(245, 158, 11, 0.3);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
    animation: gameOverFloat 3s ease-in-out infinite;
}

.game-over-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(245, 158, 11, 0.1), transparent);
    animation: gameOverShine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gameOverFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-5px) scale(1.01); }
}

@keyframes gameOverShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
}

.game-over-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, #EF4444, #F59E0B, #EF4444);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gameOverTitleGradient 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

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

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

.final-score {
    font-size: 1.8rem;
    color: #F59E0B;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    position: relative;
    z-index: 2;
}

.high-score-result {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    margin: 0 auto;
    max-width: 300px;
    position: relative;
    z-index: 2;
}

.high-score-result.new-record {
    background: #10B981;
    color: #F9FAFB;
    animation: newRecordGlow 1s ease-in-out infinite alternate;
}

.high-score-result.no-record {
    background: rgba(249, 250, 251, 0.1);
    color: rgba(249, 250, 251, 0.7);
}

@keyframes newRecordGlow {
    from { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
    to { box-shadow: 0 0 30px rgba(16, 185, 129, 0.8); }
}

.restart-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #F9FAFB;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.restart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.restart-btn:hover {
    background: linear-gradient(135deg, #3B82F6, #60A5FA);
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6);
}

.restart-btn:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        min-height: 100vh;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .high-score-card {
        padding: 1rem 1.5rem;
    }
    
    .high-score-value {
        font-size: 2rem;
    }
    
    .scrolling-text {
        font-size: 0.9rem;
    }
    
    .start-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .command-word {
        font-size: 2rem;
    }
    
    .header {
        padding: 0.8rem 1rem;
        margin-bottom: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .score-section, .hearts, .controls {
        text-align: center;
    }
    
    .buttons-container {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .game-button {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .game-over-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .game-over-content h2 {
        font-size: 2rem;
    }
    
    .final-score {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .command-word {
        font-size: 1.8rem;
    }
    
    .header {
        padding: 0.6rem 0.8rem;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .hearts {
        font-size: 1.2rem;
    }
}