@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Fredoka+One&display=swap');

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

body {
    font-family: 'Fredoka One', cursive;
    background: linear-gradient(180deg, #4e1a83 0%, #2c0e4f 100%);
    min-height: 100vh;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Header */
header {
    width: 100%;
    text-align: center;
}

h1 {
    font-family: 'Bangers', cursive;
    font-size: 2.5rem;
    color: #ffae00;
    text-shadow: 3px 3px 0px #a04f00;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    body {
        padding: 5px;
    }
    
    .container {
        gap: 15px;
    }
    
    /* Ajustes pantallas medianas */
    .letter-square[data-square-size="xlarge"] {
        width: 48px;
        height: 48px;
        font-size: 2rem;
    }
    
    .letter-square[data-square-size="large"] {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .letter-square[data-square-size="medium"] {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
    
    .letter-square[data-square-size="small"] {
        width: 35px;
        height: 35px;
        font-size: 1.4rem;
    }
    
    .letter-square[data-square-size="tiny"] {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    /* Espacios pantallas medianas */
    .word-space[data-square-size="xlarge"] {
        width: 22px;
    }
    
    .word-space[data-square-size="large"] {
        width: 20px;
    }
    
    .word-space[data-square-size="medium"] {
        width: 18px;
    }
    
    .word-space[data-square-size="small"] {
        width: 16px;
    }
    
    .word-space[data-square-size="tiny"] {
        width: 14px;
    }
    
    .emoji-clues {
        max-width: 170px;
    }
    
    .emoji-clues span {
        font-size: 3.5rem;
        width: 65px;
        height: 65px;
    }
}

/* Main Content */
main {
    width: 100%;
}

.hidden {
    display: none; /* Initially hidden */
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 25px;
    padding: 40px 20px;
}

/* Error & Loading */
.error-message, .loading {
    background: rgba(0,0,0,0.5);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    font-size: 1.5rem;
    color: #ffae00;
}

.error-message {
    color: #ff4747;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Game Container */
.game-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Main Buttons Container */
.main-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Emoji Clues */
.emoji-clues {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    justify-items: center;
    align-items: center;
    max-width: 180px;
    margin: 0 auto 30px auto;
}

.emoji-clues span {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Level Display */
.level-display {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 8px 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.level-label {
    color: #66BB6A;
    margin-right: 5px;
}

.level-value {
    color: #A5D6A7;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Level progression colors */
.level-display.level-medium {
    border-color: #FF9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.level-display.level-medium .level-label {
    color: #FFB74D;
}

.level-display.level-medium .level-value {
    color: #FFCC80;
}

.level-display.level-hard {
    border-color: #F44336;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.level-display.level-hard .level-label {
    color: #EF5350;
}

.level-display.level-hard .level-value {
    color: #FFCDD2;
}

.level-display.level-final {
    border-color: #FFD700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.1));
}

.level-display.level-final .level-label {
    color: #FFD700;
}

.level-display.level-final .level-value {
    color: #FFF8E1;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* Score Display */
.score-display {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #9C27B0;
    border-radius: 10px;
    padding: 8px 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
    transition: all 0.3s ease;
}

.score-label {
    color: #AB47BC;
    margin-right: 5px;
}

.score-value {
    color: #E1BEE7;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Timer Display */
.timer, .timer-display {
    text-align: center;
    font-size: 1.5rem;
    color: #ffae00;
    margin: 0;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid #a04f00;
    transition: all 0.3s ease;
    font-family: 'Fredoka One', cursive;
    font-weight: bold;
}

.timer.timer-warning,
.timer-display.timer-warning {
    color: #ff4444;
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    animation: pulse 1s infinite;
}

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

/* Buttons */
.play-button, .play-again-button {
    background: linear-gradient(135deg, #ff8c00, #ff6b00, #d87500);
    color: white;
    border: none;
    border-bottom: 4px solid #a04f00;
    padding: 18px 45px;
    border-radius: 20px;
    font-size: 1.6rem;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-button::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;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    background: linear-gradient(135deg, #ff9500, #ff7700, #e68000);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.6);
    border-bottom-width: 6px;
}

.play-button:active {
    transform: translateY(1px);
    border-bottom-width: 2px;
}

/* Specific button styles */
#new-game-button {
    background: linear-gradient(135deg, #4CAF50, #45a049, #2e7d32);
    border-bottom-color: #1b5e20;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

#new-game-button::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

#new-game-button:hover {
    background: linear-gradient(135deg, #5cbf60, #4caf50, #388e3c);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6);
}

#continue-game-button {
    background: linear-gradient(135deg, #2196F3, #1976D2, #0d47a1);
    border-bottom-color: #0d47a1;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

#continue-game-button::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

#continue-game-button:hover {
    background: linear-gradient(135deg, #42A5F5, #2196F3, #1565C0);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.6);
}

/* Score Button */
.score-button {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2, #4A148C);
    color: white;
    border: none;
    border-bottom: 3px solid #4A148C;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.score-button:hover {
    background: linear-gradient(135deg, #AB47BC, #9C27B0, #6A1B9A);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(156, 39, 176, 0.4);
}

.score-button:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

/* Leaderboard Button */
.leaderboard-button {
    background: linear-gradient(180deg, #ff8c00, #e67e00);
    color: white;
    border: none;
    border-bottom: 3px solid #cc6600;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.leaderboard-button:hover {
    background: linear-gradient(180deg, #ff9500, #f08000);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.4);
}

.leaderboard-button:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
}

/* Movie Display */
.movie-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.word-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.word-container {
    display: flex;
    gap: 3px;
}

.word-space {
    min-width: 20px;
    flex-shrink: 0;
}

.letter-square {
    background: rgba(0,0,0,0.2);
    border: 2px solid #a04f00;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-transform: uppercase;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Tamaños de cuadrados adaptativos */
.letter-square[data-square-size="xlarge"] {
    width: 55px;
    height: 55px;
    font-size: 2.2rem;
}

.letter-square[data-square-size="large"] {
    width: 50px;
    height: 50px;
    font-size: 2rem;
}

.letter-square[data-square-size="medium"] {
    width: 45px;
    height: 45px;
    font-size: 1.8rem;
}

.letter-square[data-square-size="small"] {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
}

.letter-square[data-square-size="tiny"] {
    width: 35px;
    height: 35px;
    font-size: 1.4rem;
}

/* Espacios entre palabras adaptativos */
.word-space[data-square-size="xlarge"] {
    width: 28px;
}

.word-space[data-square-size="large"] {
    width: 25px;
}

.word-space[data-square-size="medium"] {
    width: 22px;
}

.word-space[data-square-size="small"] {
    width: 20px;
}

.word-space[data-square-size="tiny"] {
    width: 18px;
}

.letter-square.guessed {
    background: #ff8c00;
    border-color: #a04f00;
}

.letter-square.celebration {
    animation: celebrate 1.2s ease-in-out, shimmer 0.8s ease-in-out 0.4s;
    background: linear-gradient(45deg, #ffae00, #ff8c00, #d87500, #FFD700);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 174, 0, 1), 0 0 60px rgba(255, 215, 0, 0.8);
    z-index: 10;
    position: relative;
}

@keyframes celebrate {
    0% { 
        transform: scale(1) rotate(0deg) translateY(0px); 
        filter: brightness(1);
    }
    15% { 
        transform: scale(1.3) rotate(-8deg) translateY(-10px); 
        filter: brightness(1.3);
    }
    30% { 
        transform: scale(1.5) rotate(8deg) translateY(-20px); 
        filter: brightness(1.5);
    }
    45% { 
        transform: scale(1.4) rotate(-5deg) translateY(-15px); 
        filter: brightness(1.4);
    }
    60% { 
        transform: scale(1.6) rotate(5deg) translateY(-25px); 
        filter: brightness(1.6);
    }
    75% { 
        transform: scale(1.3) rotate(-3deg) translateY(-10px); 
        filter: brightness(1.3);
    }
    90% { 
        transform: scale(1.2) rotate(2deg) translateY(-5px); 
        filter: brightness(1.2);
    }
    100% { 
        transform: scale(1.1) rotate(0deg) translateY(0px); 
        filter: brightness(1.1);
    }
}

@keyframes shimmer {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(255, 174, 0, 1), 0 0 60px rgba(255, 215, 0, 0.8);
    }
    50% { 
        box-shadow: 0 0 50px rgba(255, 215, 0, 1), 0 0 100px rgba(255, 174, 0, 1), 0 0 150px rgba(255, 193, 7, 0.6);
    }
}

/* Letter Feedback Animations */
@keyframes correctLetter {
    0% { 
        transform: scale(1); 
        background: rgba(0,0,0,0.2);
        box-shadow: none;
    }
    25% { 
        transform: scale(1.2) rotateY(90deg); 
        background: linear-gradient(45deg, #4CAF50, #45a049);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
    50% { 
        transform: scale(1.3) rotateY(180deg); 
        background: linear-gradient(45deg, #66BB6A, #FFA726);
        box-shadow: 0 0 25px rgba(255, 167, 38, 0.7);
    }
    75% { 
        transform: scale(1.1) rotateY(270deg); 
        background: linear-gradient(45deg, #FF8C00, #d87500);
        box-shadow: 0 0 15px rgba(255, 140, 0, 0.5);
    }
    100% { 
        transform: scale(1) rotateY(360deg); 
        background: #ff8c00;
        box-shadow: 0 0 8px rgba(255, 140, 0, 0.3);
    }
}

@keyframes wrongLetter {
    0% { 
        transform: scale(1) translateX(0); 
        background: rgba(0,0,0,0.2);
    }
    20% { 
        transform: scale(1.1) translateX(-10px); 
        background: #ff4444;
        box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    }
    40% { 
        transform: scale(1.1) translateX(10px); 
        background: #ff6666;
    }
    60% { 
        transform: scale(1.1) translateX(-8px); 
        background: #ff4444;
    }
    80% { 
        transform: scale(1.1) translateX(5px); 
        background: #ff6666;
    }
    100% { 
        transform: scale(1) translateX(0); 
        background: rgba(0,0,0,0.2);
        box-shadow: none;
    }
}

.letter-square.correct-animation {
    animation: correctLetter 0.8s ease-in-out;
}

.letter-square.wrong-animation {
    animation: wrongLetter 0.6s ease-in-out;
}

/* Responsive Design for Mobile */
@media (max-width: 480px) {
    /* Start screen adjustments */
    .start-screen {
        gap: 20px;
        padding: 20px 10px;
    }
    
    .play-button {
        padding: 15px 35px;
        font-size: 1.4rem;
        min-width: 180px;
    }
    
    /* Smaller emoji grid */
    .emoji-clues {
        max-width: 160px;
        gap: 15px;
    }
    
    .emoji-clues span {
        font-size: 3rem;
        width: 60px;
        height: 60px;
    }
    
    /* Ajustes móviles para cuadrados */
    .letter-square[data-square-size="xlarge"] {
        width: 38px;
        height: 38px;
        font-size: 1.7rem;
    }
    
    .letter-square[data-square-size="large"] {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .letter-square[data-square-size="medium"] {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
    
    .letter-square[data-square-size="small"] {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
    
    .letter-square[data-square-size="tiny"] {
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }
    
    /* Espacios móviles entre palabras */
    .word-space[data-square-size="xlarge"] {
        width: 18px;
    }
    
    .word-space[data-square-size="large"] {
        width: 16px;
    }
    
    .word-space[data-square-size="medium"] {
        width: 14px;
    }
    
    .word-space[data-square-size="small"] {
        width: 12px;
    }
    
    .word-space[data-square-size="tiny"] {
        width: 10px;
    }
    
    /* Smaller gaps in word rows */
    .word-row {
        gap: 5px;
    }
    
    .movie-display {
        gap: 8px;
    }
    
    /* Game header adjustments */
    .game-header {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    /* Timer adjustments */
    .timer, .timer-display {
        font-size: 1.2rem;
        padding: 8px 15px;
    }
    
    /* Level display adjustments */
    .level-display {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .level-value {
        font-size: 1.1rem;
    }
    
    /* Score display adjustments */
    .score-display {
        font-size: 1rem;
        padding: 6px 12px;
    }
    
    .score-value {
        font-size: 1.1rem;
    }
    
    /* Word display adjustments for mobile */
    .word-row {
        gap: 3px;
        margin-bottom: 6px;
    }
    
    .word-container {
        gap: 2px;
    }
    
    .movie-display {
        gap: 6px;
    }
    
    /* Points lost notification adjustments for mobile */
    .points-lost-content {
        padding: 15px 25px;
        border-radius: 15px;
    }
    
    .points-lost-icon {
        font-size: 1.5rem;
    }
    
    .points-lost-text {
        font-size: 1.2rem;
    }
    
    /* Points gained notification adjustments for mobile */
    .points-gained-content {
        padding: 12px 20px;
        border-radius: 15px;
    }
    
    .points-gained-icon {
        font-size: 1.3rem;
    }
    
    .points-gained-text {
        font-size: 1.1rem;
    }
    
    /* Streak notifications adjustments for mobile */
    .streak-notification-content {
        padding: 15px 20px;
        gap: 12px;
    }
    
    .streak-notification-icon {
        font-size: 2rem;
    }
    
    .streak-notification-title {
        font-size: 1.2rem;
    }
    
    .streak-notification-points {
        font-size: 1rem;
    }

    /* Keyboard adjustments for mobile */
    .virtual-keyboard {
        max-width: 360px;
        gap: 6px;
        padding: 8px;
    }
    
    .keyboard-row {
        gap: 3px;
    }
    
    .key {
        min-width: 28px;
        max-width: 38px;
        height: 40px;
        font-size: 1rem;
        border-radius: 8px;
    }
}

@media (max-width: 360px) {
    /* Extra small screens */
    h1 {
        font-size: 1.8rem;
    }
    
    .start-screen {
        gap: 15px;
        padding: 15px 8px;
    }
    
    .play-button {
        padding: 12px 25px;
        font-size: 1.2rem;
        min-width: 160px;
    }
    
    /* Ajustes móviles extra pequeños */
    .letter-square[data-square-size="xlarge"] {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
    }
    
    .letter-square[data-square-size="large"] {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .letter-square[data-square-size="medium"] {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
    
    .letter-square[data-square-size="small"] {
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }
    
    .letter-square[data-square-size="tiny"] {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }
    
    /* Espacios extra pequeños entre palabras */
    .word-space[data-square-size="large"] {
        width: 12px;
    }
    
    .word-space[data-square-size="medium"] {
        width: 10px;
    }
    
    .word-space[data-square-size="small"] {
        width: 8px;
    }
    
    .word-space[data-square-size="tiny"] {
        width: 6px;
    }
    
    .emoji-clues span {
        font-size: 2.5rem;
        width: 50px;
        height: 50px;
    }
    
    /* Word display adjustments for extra small screens */
    .word-row {
        gap: 2px;
        margin-bottom: 4px;
    }
    
    .word-container {
        gap: 1px;
    }
    
    .movie-display {
        gap: 4px;
    }
    
    /* Points lost notification adjustments for extra small screens */
    .points-lost-content {
        padding: 12px 20px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .points-lost-icon {
        font-size: 1.3rem;
    }
    
    .points-lost-text {
        font-size: 1.1rem;
        letter-spacing: 0.5px;
    }
    
    /* Points gained notification adjustments for extra small screens */
    .points-gained-content {
        padding: 10px 18px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .points-gained-icon {
        font-size: 1.2rem;
    }
    
    .points-gained-text {
        font-size: 1rem;
    }
    
    /* Streak notifications adjustments for extra small screens */
    .streak-notification-content {
        padding: 12px 18px;
        gap: 10px;
    }
    
    .streak-notification-icon {
        font-size: 1.8rem;
    }
    
    .streak-notification-title {
        font-size: 1.1rem;
    }
    
    .streak-notification-points {
        font-size: 0.95rem;
    }

    /* Keyboard for extra small screens */
    .virtual-keyboard {
        max-width: 280px;
        gap: 4px;
        padding: 6px;
    }
    
    .keyboard-row {
        gap: 2px;
    }
    
    .key {
        min-width: 25px;
        max-width: 32px;
        height: 36px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
}

.completion-message {
    text-align: center;
    color: #ffae00;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #a04f00;
}

.completion-message h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.completion-message p {
    font-size: 1.2rem;
}

.completion-message .key-reminder {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    font-size: 1rem;
    color: #FFD700;
}

.completion-message .key-reminder strong {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: rgba(255, 215, 0, 0.3);
    padding: 3px 8px;
    border-radius: 5px;
}

/* Game Status */
.game-status {
    text-align: center;
    color: #ffae00;
    position: relative;
    z-index: 100;
}

.game-status h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-status p {
    font-size: 1.2rem;
}

/* Victory Screen Effects */
.victory-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, rgba(255, 174, 0, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 50;
    animation: victoryOverlay 2s ease-in-out;
    pointer-events: none;
}

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

/* Screen Shake Animation */
.screen-shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-2px, -1px); }
    20% { transform: translate(2px, 1px); }
    30% { transform: translate(-1px, 2px); }
    40% { transform: translate(1px, -2px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(2px, -1px); }
    70% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 2px); }
    90% { transform: translate(-2px, -1px); }
}

/* Points Lost Notification */
.points-lost-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.points-lost-notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.points-lost-notification.hide {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

.points-lost-content {
    background: linear-gradient(135deg, #ff4444, #cc3333);
    border: 3px solid #ff6666;
    border-radius: 20px;
    padding: 20px 30px;
    box-shadow: 
        0 10px 30px rgba(255, 68, 68, 0.5),
        0 0 20px rgba(255, 68, 68, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: shake-warning 0.6s ease-in-out;
}

.points-lost-icon {
    font-size: 2rem;
    animation: pulse-icon 0.8s ease-in-out infinite;
}

.points-lost-text {
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

@keyframes shake-warning {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

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

/* Points Gained Notification */
.points-gained-notification {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.points-gained-notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.points-gained-notification.hide {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

.points-gained-content {
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    border: 3px solid #66BB6A;
    border-radius: 20px;
    padding: 15px 25px;
    box-shadow: 
        0 8px 25px rgba(76, 175, 80, 0.4),
        0 0 15px rgba(76, 175, 80, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: bounce-success 0.6s ease-in-out;
}

.points-gained-icon {
    font-size: 1.5rem;
    animation: sparkle-icon 1s ease-in-out infinite;
}

.points-gained-text {
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes bounce-success {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

@keyframes sparkle-icon {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
}

/* Streak Notifications */
.streak-positive-notification,
.streak-negative-notification {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.streak-positive-notification.show,
.streak-negative-notification.show {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.streak-positive-notification.hide,
.streak-negative-notification.hide {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
}

.streak-notification-content {
    border-radius: 20px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: streak-bounce 0.8s ease-in-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 3px solid;
}

.streak-positive-notification .streak-notification-content {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    border-color: #FFD23F;
    box-shadow: 
        0 10px 30px rgba(255, 107, 53, 0.5),
        0 0 25px rgba(255, 107, 53, 0.4);
}

.streak-negative-notification .streak-notification-content {
    background: linear-gradient(135deg, #FF4444, #CC3333);
    border-color: #FF6666;
    box-shadow: 
        0 10px 30px rgba(255, 68, 68, 0.5),
        0 0 25px rgba(255, 68, 68, 0.4);
}

.streak-notification-icon {
    font-size: 2.5rem;
    animation: streak-icon-bounce 1s ease-in-out infinite;
}

.streak-notification-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.streak-notification-title {
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.streak-notification-points {
    color: #FFD700;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

@keyframes streak-bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    80% { transform: translateY(-8px); }
}

@keyframes streak-icon-bounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-10deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    75% { transform: scale(1.1) rotate(10deg); }
}

/* Enhanced Victory Message */
.victory-message {
    position: relative;
    z-index: 101;
}

.victory-message h2 {
    animation: victoryTitle 1.5s ease-out;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 174, 0, 0.6);
}

@keyframes victoryTitle {
    0% {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0;
        filter: blur(5px);
    }
    30% {
        transform: scale(1.3) rotate(5deg);
        opacity: 0.8;
        filter: blur(2px);
    }
    60% {
        transform: scale(0.9) rotate(-2deg);
        opacity: 1;
        filter: blur(0px);
    }
    80% {
        transform: scale(1.1) rotate(1deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
}

/* Level Transition Animation */
.level-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 174, 0, 0.9), rgba(255, 140, 0, 0.95));
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: levelTransition 2s ease-in-out;
}

.level-transition-content {
    text-align: center;
    color: white;
    font-family: 'Bangers', cursive;
}

.level-transition-content h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: levelTitle 1s ease-out;
}

.level-transition-content p {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-family: 'Fredoka One', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.level-points {
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    border: 2px solid #66BB6A;
    border-radius: 15px;
    padding: 10px 20px;
    margin: 15px 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse-points 1s ease-in-out;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

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

.level-progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px auto;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 4px;
    animation: progressFill 1.5s ease-out 0.5s forwards;
    transform: translateX(-100%);
}

@keyframes levelTransition {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    20% { 
        opacity: 1;
        transform: scale(1.05);
    }
    80% { 
        opacity: 1;
        transform: scale(1);
    }
    100% { 
        opacity: 0;
        transform: scale(1.1);
    }
}

@keyframes levelTitle {
    0% {
        transform: translateY(-50px) rotateX(90deg);
        opacity: 0;
    }
    50% {
        transform: translateY(0) rotateX(45deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) rotateX(0deg);
        opacity: 1;
    }
}

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

/* Virtual Keyboard - Mobile First Design */
.virtual-keyboard {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.key {
    min-width: 30px;
    max-width: 45px;
    height: 45px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(145deg, #5a7bc8, #4a68b5);
    border-bottom: 3px solid #3a528f;
    color: white;
    font-size: 1.1rem;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex: 1;
    box-sizing: border-box;
}

.key-spacer {
    flex: 0.75;
    min-width: 15px;
}

.key:hover {
    background: linear-gradient(145deg, #6a8bd8, #5a7bc8);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.key:active {
    transform: translateY(1px);
    border-bottom-width: 1px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #4a68b5, #3a528f);
}

.key:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key.correct {
    background: linear-gradient(145deg, #6cb56c, #5cb85c);
    border-bottom-color: #449d44;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

.key.correct:hover {
    background: linear-gradient(145deg, #7cc57c, #6cb56c);
}

.key.absent {
    background: linear-gradient(145deg, #666, #555);
    border-bottom-color: #333;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.key.absent:hover {
    background: linear-gradient(145deg, #777, #666);
}

/* Key Press Feedback Animation */
.key.key-pressed {
    animation: keyPress 0.15s ease-out;
    background: linear-gradient(145deg, #FFD700, #FFA500) !important;
    color: #333 !important;
    transform: translateY(1px) scale(0.95);
}

@keyframes keyPress {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: translateY(1px) scale(0.95);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        background: linear-gradient(145deg, #FFD700, #FFA500);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    }
}

/* Ripple effect for key press */
.key {
    position: relative;
    overflow: hidden;
}

.key::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.key.ripple::before {
    width: 100px;
    height: 100px;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

/* Desktop keyboard improvements */
@media (min-width: 769px) {
    .virtual-keyboard {
        max-width: 600px;
        gap: 12px;
        padding: 20px;
    }
    
    .keyboard-row {
        gap: 8px;
    }
    
    .key {
        min-width: 50px;
        max-width: 60px;
        height: 55px;
        font-size: 1.4rem;
        border-radius: 14px;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .movie-display {
        padding: 15px;
        min-height: 70px;
    }

    .letter-square {
        font-size: 1.5rem;
    }

    .key {
        height: 50px;
        font-size: 1.2rem;
    }

    .keyboard-row {
        gap: 5px;
    }
}

/* =====================================
   LITE MODE - REDUCED ANIMATIONS
   ===================================== */

/* Disable heavy animations and effects in lite mode */
.lite-mode * {
    animation: none !important;
    transition-duration: 0.1s !important;
}

/* Allow only essential transitions */
.lite-mode button,
.lite-mode .letter-square,
.lite-mode .key {
    transition: all 0.1s ease !important;
}

/* Remove complex animations completely */
.lite-mode .floating-particles,
.lite-mode .background-animation,
.lite-mode .confetti-container {
    display: none !important;
}

/* Simplify gradients to solid colors */
.lite-mode .gradient-bg {
    background: #1a1a2e !important;
}

.lite-mode .game-container {
    background: #16213e !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

.lite-mode .level-display,
.lite-mode .score-display,
.lite-mode .streak-display {
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
}

/* Simplify buttons */
.lite-mode button {
    transition: all 0.1s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.lite-mode button:hover {
    transform: translateY(-1px) !important;
}

/* Reduce letter square effects */
.lite-mode .letter-square {
    transition: all 0.1s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.lite-mode .letter-square.revealed {
    animation: none !important;
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
}

.lite-mode .letter-square.hint {
    animation: none !important;
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
}

/* Simplify keyboard */
.lite-mode .key {
    transition: all 0.1s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.lite-mode .key.used {
    animation: none !important;
}

/* Reduce notification effects */
.lite-mode .score-notification,
.lite-mode .points-lost-notification,
.lite-mode .streak-positive-notification,
.lite-mode .streak-negative-notification {
    animation: none !important;
    transition: opacity 0.1s ease !important;
}

.lite-mode .score-notification.show,
.lite-mode .points-lost-notification.show,
.lite-mode .streak-positive-notification.show,
.lite-mode .streak-negative-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Simplify victory effects */
.lite-mode .victory-container {
    animation: none !important;
}

.lite-mode .victory-content {
    animation: none !important;
    transform: scale(1) !important;
}

/* Performance button styling */
.performance-button {
    margin-left: 8px;
}

.performance-button.lite-active {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.5);
}

.performance-button.lite-active:hover {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

/* Disable parallax and heavy background effects */
.lite-mode::before,
.lite-mode::after,
.lite-mode .container::before,
.lite-mode .container::after {
    display: none !important;
}

/* Remove text shadows and glows */
.lite-mode h1,
.lite-mode h2,
.lite-mode .neon-text {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
}

/* Optimize timer display */
.lite-mode .timer {
    animation: none !important;
}

.lite-mode .timer.warning {
    animation: none !important;
    background: #e74c3c !important;
}

.lite-mode .timer.critical {
    animation: none !important;
    background: #c0392b !important;
}

/* Simplify emoji clues */
.lite-mode .emoji-clues {
    text-shadow: none !important;
}

/* Remove complex hover effects */
.lite-mode .control-button:hover,
.lite-mode .performance-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(255, 174, 0, 0.3) !important;
}

/* Media queries for lite mode */
@media (max-width: 768px) {
    .lite-mode .game-container {
        padding: 15px !important;
    }
    
    .lite-mode .letter-square {
        font-size: 1.5rem !important;
    }
    
    .lite-mode button {
        padding: 8px 15px !important;
    }
}

