* {
    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;
    color: #333;
}

.screen {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 100%;
    text-align: center;
}

/* Start Menu */
.game-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-level {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.btn-level:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.level-number {
    font-size: 2rem;
    font-weight: bold;
}

.level-name {
    font-size: 1rem;
}

/* Instructions */
.instructions-content {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.instructions-content h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.instructions-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.instructions-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

/* Letter Selection */
.selection-info {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 1.1rem;
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.letter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.letter-item:hover {
    background: #f0f0f0;
}

.letter-item input[type="checkbox"] {
    transform: scale(1.2);
}

.hebrew-char {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 20px;
}

.letter-name {
    font-size: 0.9rem;
}

.selection-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.selection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.count-display {
    font-weight: bold;
    color: #667eea;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.progress {
    font-size: 1rem;
    color: #666;
}

.question-area {
    margin-bottom: 2rem;
}

.hebrew-letter {
    font-size: 6rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
    border: 3px solid #667eea;
}

.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.choice-btn {
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.choice-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.choice-btn.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.choice-btn.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Feedback */
.feedback {
    margin-top: 1rem;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
}

.feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.feedback.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.feedback.hidden {
    display: none;
}

.game-buttons {
    display: flex;
    gap: 10px;
}

/* Results Screen */
.results-content {
    margin-bottom: 2rem;
}

.final-score {
    margin-bottom: 1.5rem;
}

.score-label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
}

.score-total {
    font-size: 1.1rem;
    color: #666;
}

.performance {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Copyright */
.copyright {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.about-text {
    text-align: left;
    line-height: 1.6;
}

.about-text p {
    margin-bottom: 1rem;
}

/* Font Selector */
.font-selector {
    margin-bottom: 1.5rem;
    text-align: left;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.font-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.font-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    .game-title {
        font-size: 2.5rem;
    }

    .hebrew-letter {
        font-size: 4rem;
    }

    .choices {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .selection-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}