* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

header {
    position: relative;
}

.language-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 8px 15px;
    font-size: 0.9em;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: #e0e0e0;
    border-color: #667eea;
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    width: 120px;
    flex-shrink: 0;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    white-space: nowrap;
}

.stat-value {
    color: #333;
    font-size: 1.8em;
    font-weight: bold;
}

.question-container {
    margin-bottom: 30px;
    overflow-x: auto;
}

.question {
    font-size: 3em;
    color: #333;
    font-weight: bold;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-align: center;
}

.question span {
    display: inline-block;
    min-width: 60px;
}

.answer-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    transition: all 0.3s;
    border-radius: 10px;
    padding: 10px;
}

.answer-section.correct {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
}

.answer-section.incorrect {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
}

.virtual-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.keyboard-row {
    display: contents;
}

.key-btn {
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
    background: white;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background: #e0e0e0;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.key-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.key-btn-clear {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
    font-size: 1.5em;
    font-weight: bold;
}

.key-btn-clear:hover {
    background: #ee5a5a;
    border-color: #ee5a5a;
}

.key-btn-check {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
    font-size: 1.5em;
    font-weight: bold;
}

.key-btn-check:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    border-color: #218838;
}

#answer-input {
    width: 100px;
    padding: 10px 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.3s;
    cursor: default;
}

#answer-input:focus {
    outline: none;
    border-color: #667eea;
}

#answer-input[readonly] {
    cursor: default;
    background-color: #fff;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .language-switcher {
        position: static;
        justify-content: center;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    .question {
        font-size: 2em;
        padding: 20px;
    }

    .virtual-keyboard {
        gap: 8px;
        padding: 10px;
    }

    .key-btn {
        padding: 15px;
        font-size: 1.3em;
        min-height: 50px;
    }

    .key-btn-clear {
        font-size: 1.3em;
    }

    .key-btn-check {
        font-size: 1.3em;
    }

    .answer-section {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item {
        width: 100%;
    }

    #answer-input {
        width: 100px;
    }
}
