* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    padding: 20px;
}

.card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 900px;
    min-width: 320px;
    max-width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.title {
    font-size: 22px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    margin-bottom: 25px;
    color: #555;
}

/* Header with level and lives */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.level-badge {
    font-weight: bold;
    font-size: 14px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border-radius: 20px;
}

.lives {
    font-size: 24px;
    letter-spacing: 4px;
}

.progress-counter {
    font-size: 14px;
    color: #666;
}

.word {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    min-height: 70px;
}

.syllable {
    padding: 14px 20px;
    font-size: 30px;
    border-radius: 12px;
    background: #f2f3f7;
    cursor: pointer;
    user-select: none;
    transition: 0.15s;
    border: 2px solid transparent;
    min-width: 60px;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.syllable:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.correct {
    background: #c8e6c9 !important;
    border-color: #2e7d32 !important;
}

.wrong {
    background: #ffcdd2 !important;
    border-color: #c62828 !important;
}

button {
    padding: 10px 18px;
    margin: 8px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    background: #667eea;
    color: white;
    transition: 0.2s;
}

button:hover {
    background: #5568d3;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.result {
    font-size: 20px;
    min-height: 28px;
    margin: 15px 0;
}

.correct-text {
    color: #2e7d32;
}

.wrong-text {
    color: #c62828;
}

.stats {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

/* Game Screen */
.game-screen {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* Game Over / Level Complete screens */
.screen {
    display: none;
    flex-direction: column;
    text-align: center;
    animation: fadeIn 0.3s;
    min-height: 500px;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.screen-title {
    font-size: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

.screen-title.victory {
    color: #2e7d32;
}

.screen-subtitle {
    font-size: 18px;
    color: #555;
    margin-bottom: 20px;
}

.screen-stats {
    font-size: 18px;
    margin-bottom: 30px;
    color: #333;
    line-height: 1.6;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 320px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal h3 {
    margin-top: 0;
    color: #333;
}

.modal p {
    font-size: 18px;
    color: #555;
    margin: 15px 0;
}

.modal button {
    margin-top: 15px;
}

