* {
    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;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-bottom: 25px;
}

.display-section {
    text-align: center;
    margin-bottom: 25px;
}

.word-display {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    min-height: 60px;
    padding: 20px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.word-display.correct {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

.word-display.incorrect {
    background: linear-gradient(145deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
}

.hint-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 10px;
}

.input-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.input-section input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

.input-section input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-section input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.stat-unit {
    font-size: 0.8rem;
    color: #6c757d;
}

.progress-section {
    margin-bottom: 10px;
}

.progress-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.history-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 25px;
}

.history-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.history-item {
    background: linear-gradient(145deg, #fff3cd, #ffeeba);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.history-label {
    font-size: 0.85rem;
    color: #856404;
    margin-bottom: 5px;
}

.history-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #856404;
}

.instructions-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    margin-bottom: 25px;
}

.instructions-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.instructions-section ul {
    list-style: none;
}

.instructions-section li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
    border-bottom: 1px solid #eee;
}

.instructions-section li:last-child {
    border-bottom: none;
}

.instructions-section li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 30px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.final-stat {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 15px;
}

.final-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.final-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.final-value.score {
    font-size: 2rem;
    color: #667eea;
}

.new-record {
    background: linear-gradient(145deg, #fff3cd, #ffeeba);
    color: #856404;
    padding: 10px 20px;
    border-radius: 25px;
    margin-bottom: 25px;
    font-weight: 600;
    animation: pulse 1s infinite;
}

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

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    padding: 20px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .word-display {
        font-size: 1.4rem;
    }
}