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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

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

#gameSubtitle {
    text-align: center;
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.language-selector, .challenge-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.github-star-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.github-star-btn:hover {
    background: #1b1f23;
}

.btn-icon {
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-icon:hover {
    background: #5a67d8;
}

label {
    font-weight: 600;
    color: #4a5568;
}

select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:hover, select:focus {
    border-color: #667eea;
    outline: none;
}

main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
    color: #4a5568;
}

.instructions {
    background: #e6fffa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #234e52;
    border-left: 4px solid #38b2ac;
}

.sentence-container {
    background: #f7fafc;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sentence {
    font-size: 1.3em;
    line-height: 1.8;
    text-align: center;
    max-width: 100%;
}

.word {
    display: inline-block;
    padding: 5px 8px;
    margin: 3px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    border: 2px solid transparent;
}

.word:hover {
    background: #e6fffa;
    transform: translateY(-2px);
}

.word.selected {
    background: #4299e1;
    color: white;
    border-color: #2b6cb0;
}

.word.correct {
    background: #48bb78;
    color: white;
    border-color: #2f855a;
}

.word.incorrect {
    background: #f56565;
    color: white;
    border-color: #c53030;
}

.word.missed {
    background: #ed8936;
    color: white;
    border-color: #c05621;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

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

.feedback {
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: 500;
}

.feedback.success {
    background: #f0fff4;
    color: #2f855a;
    border: 2px solid #9ae6b4;
}

.feedback.error {
    background: #fed7d7;
    color: #c53030;
    border: 2px solid #feb2b2;
}

.feedback.partial {
    background: #fefcbf;
    color: #c05621;
    border: 2px solid #f6e05e;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none !important;
    visibility: hidden !important;
}

.hidden {
    display: none !important;
}

footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    text-align: center;
    color: #4a5568;
}

.footer-content p {
    margin: 5px 0;
}

.footer-content a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 600;
}

.footer-content a:hover {
    text-decoration: underline;
}

.version-info {
    font-size: 0.9em;
    color: #718096;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header, main, footer {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .controls {
        gap: 15px;
    }
    
    .sentence {
        font-size: 1.1em;
    }
    
    .word {
        padding: 4px 6px;
        margin: 2px;
    }
    
    .game-controls {
        gap: 10px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9em;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .progress-info {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin: 0;
    color: #4a5568;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
}

.modal-body {
    padding: 25px;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.setting-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.checkbox-label:hover {
    background-color: #f7fafc;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: normal;
    color: #4a5568;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 100px;
}