* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.container {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
}

h1 {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 40px;
}

.letter-selection {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.letter-btn {
    width: 70px;
    height: 70px;
    font-size: 2em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.letter-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.letter-btn:active {
    transform: translateY(-2px) scale(1.05);
}

/* Volba obtížnosti */
.difficulty-selection {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    padding: 25px 40px;
    border: none;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid #667eea;
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.difficulty-btn:hover .diff-title,
.difficulty-btn:hover .diff-desc {
    color: white;
}

.diff-title {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.diff-desc {
    font-size: 1.1em;
    color: #666;
}

.back-btn {
    margin-top: 30px;
    padding: 12px 30px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #667eea;
    color: white;
}

/* Herní obrazovka */
#gameScreen {
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.score-container {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.score-label {
    margin-right: 10px;
}

#score {
    font-size: 1.3em;
    color: #764ba2;
}

.timer-container {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.timer-label {
    margin-right: 10px;
}

#timer {
    font-size: 1.3em;
    color: #764ba2;
    font-family: 'Courier New', monospace;
}

.target-word-container {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    background: #fff;
    padding: 10px 30px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 3px solid #667eea;
}

.target-label {
    color: #999;
    font-size: 0.6em;
    margin-right: 10px;
}

#targetWord {
    color: #764ba2;
}

.lives-container {
    display: flex;
    gap: 8px;
    font-size: 2em;
}

.heart {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.heart.lost {
    opacity: 0.2;
    filter: grayscale(100%);
}

/* Animace bliknutí a zmizení srdíčka */
.heart.losing {
    animation: heartBlinkOut 0.7s forwards;
}

@keyframes heartBlinkOut {
    0% { opacity: 1; filter: none; transform: scale(1); }
    30% { opacity: 1; filter: brightness(2) drop-shadow(0 0 10px #ff1744); transform: scale(1.2); }
    60% { opacity: 1; filter: brightness(2) drop-shadow(0 0 10px #ff1744); transform: scale(1.2); }
    100% { opacity: 0; filter: grayscale(100%); transform: scale(0.5); }
}
}

#gameArea {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1300px;
    height: calc(100vh - 120px);
    margin: 0 auto;
}

/* Červený countdown */
.countdown-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 500;
    pointer-events: none;
}

.countdown-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 23, 68, 0.2);
    border: 6px solid #ff1744;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 40px rgba(255, 23, 68, 0.6);
    animation: pulse 1s ease-in-out infinite;
}

#countdown {
    font-size: 3.5em;
    font-weight: bold;
    color: #ff1744;
    text-shadow: 0 0 20px rgba(255, 23, 68, 0.8);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(255, 23, 68, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(255, 23, 68, 0.9);
    }
}

.falling-word {
    position: absolute;
    font-size: 1.5em;
    font-weight: bold;
    padding: 15px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
    border: 2px solid #667eea;
    color: #333;
}

.falling-word:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.falling-word.correct {
    animation: correctClick 0.5s ease-out forwards;
}

.falling-word.wrong {
    animation: wrongClick 0.5s ease-out forwards;
}

@keyframes correctClick {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes wrongClick {
    0% {
        transform: translateX(0);
        background: white;
    }
    25% {
        transform: translateX(-10px);
        background: #ff6b6b;
    }
    50% {
        transform: translateX(10px);
        background: #ff6b6b;
    }
    75% {
        transform: translateX(-10px);
        background: #ff6b6b;
    }
    100% {
        transform: translateX(0);
        background: white;
    }
}

.pause-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 100;
}

.pause-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Konečná obrazovka */
.game-over-title {
    font-size: 4em;
    color: #ff1744;
    margin-bottom: 20px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    letter-spacing: 0.1em;
}

.final-score {
    font-size: 1.8em;
    color: #333;
    margin: 20px 0;
}

#finalScore {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.3em;
}

.end-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.play-again-btn,
.main-menu-btn {
    padding: 15px 40px;
    font-size: 1.3em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-again-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.main-menu-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.play-again-btn:hover,
.main-menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Responzivita */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        margin: 20px;
        max-width: 90%;
    }

    h1 {
        font-size: 2em;
    }
    
    .game-over-title {
        font-size: 3em;
        margin-bottom: 20px;
    }
    
    .final-score {
        font-size: 1.5em;
        margin: 20px 0;
    }
    
    .end-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .play-again-btn,
    .main-menu-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1.2em;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .target-word-container {
        font-size: 1.4em;
    }

    .falling-word {
        font-size: 1.2em;
        padding: 10px 20px;
    }

    .letter-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
}

/* Animace pro notifikace */
@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Animace pro červený flash */
@keyframes flashRed {
    0% {
        opacity: 1;
        border-width: 10px;
    }
    50% {
        opacity: 1;
        border-width: 20px;
    }
    100% {
        opacity: 0;
        border-width: 10px;
    }
}

/* Animace pro zelený flash */
@keyframes flashGreen {
    0% {
        opacity: 1;
        border-width: 10px;
    }
    50% {
        opacity: 0.8;
        border-width: 15px;
    }
    100% {
        opacity: 0;
        border-width: 10px;
    }
}
