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

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

header {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: #bb86fc;
}

header p {
    color: #b0b0b0;
    margin-top: 5px;
}

.home-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    font-size: 1.5rem;
    padding: 5px 10px;
    background: #333;
    border-radius: 8px;
    transition: 0.2s;
}

.home-btn:hover {
    background: #444;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-option {
    cursor: pointer;
    position: relative;
}

.mode-option input {
    display: none;
}

.mode-option span {
    display: block;
    padding: 10px 15px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: #bbb;
}

.mode-option input:checked + span {
    background-color: #bb86fc;
    color: #000;
    font-weight: bold;
    border-color: #bb86fc;
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.4);
}

.card {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

.word-display {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 25px;
    color: #ffffff;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input[type="text"] {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #2c2c2c;
    color: white;
    font-size: 1rem;
    outline: none;
    width: 100%;
}

input[type="text"]:focus {
    border-color: #bb86fc;
}

button {
    padding: 15px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#check-btn {
    background-color: #bb86fc;
    color: #000;
}

#check-btn:hover {
    background-color: #9965f4;
}

#next-btn {
    background-color: #03dac6;
    color: #000;
    width: 100%;
    margin-top: 15px;
}

#next-btn:hover {
    background-color: #018786;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
}

.feedback.correct {
    background-color: #1b5e20;
    color: #a5d6a7;
    border: 1px solid #2e7d32;
}

.feedback.wrong {
    background-color: #b71c1c;
    color: #ffcdd2;
    border: 1px solid #c62828;
}

.hidden {
    display: none;
}

footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: #666;
}

.char-correct {
    color: #2ecc71;
    font-weight: bold;
}

.char-wrong {
    color: #e74c3c;
    text-decoration: underline;
    font-weight: bold;
}

@media (max-width: 400px) {
    .word-display {
        font-size: 1.2rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    background-color: #2c2c2c;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #444;
    font-size: 0.95rem;
    color: #b0b0b0;
}

.stats-bar strong {
    color: #bb86fc;
}

#result-card {
    text-align: center;
    padding: 40px 30px;
}

#result-card h2 {
    color: #bb86fc;
    margin-bottom: 20px;
    font-size: 2rem;
}

.final-score {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    margin: 20px 0;
}

#evaluation-text {
    margin-bottom: 30px;
    font-size: 1.1rem;
    color: #b0b0b0;
}

#restart-btn {
    background-color: #03dac6;
    color: #000;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#restart-btn:hover {
    background-color: #018786;
}

.hidden {
    display: none !important;
}