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

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.instructions {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.game-area {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

.hebrew-translation {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 10px;
    border: 2px solid #ffc107;
}

.label {
    font-weight: bold;
    color: #856404;
    margin-right: 10px;
}

.hebrew-text {
    font-size: 2em;
    font-weight: bold;
    color: #d35400;
    direction: rtl;
}

.puzzle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    min-height: 80px;
    direction: ltr;
    unicode-bidi: embed;
}

.letter-box {
    width: 50px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    font-family: 'Arial', 'Helvetica', 'Roboto', 'Segoe UI', sans-serif !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    direction: ltr !important;
    unicode-bidi: isolate;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.letter-shown {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.letter-blank {
    background: #fff;
    border: 2px dashed #6c757d;
    color: transparent;
}

.input-area {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#answerInput {
    flex: 1;
    padding: 15px;
    font-size: 1.2em;
    font-family: 'Arial', 'Helvetica', 'Roboto', 'Segoe UI', sans-serif !important;
    border: 2px solid #667eea;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    direction: ltr !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#answerInput:focus {
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-check {
    background: #28a745;
    color: white;
}

.btn-check:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-new {
    width: 100%;
    background: #667eea;
    color: white;
}

.btn-new:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
    animation: celebrate 0.5s ease;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.stats {
    display: flex;
    justify-content: space-around;
    background: #e9ecef;
    border-radius: 10px;
    padding: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .letter-box {
        width: 40px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .hebrew-text {
        font-size: 1.5em;
    }
}
