* {
    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: 900px;
    width: 100%;
}

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

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

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.info-item {
    text-align: center;
}

.label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.time-display {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat {
    font-size: 1.8em;
    font-weight: bold;
    color: #764ba2;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #ffc107 50%, #f44336 100%);
    transition: width 0.1s linear;
}

.progress-bar.active {
    animation: progress 60s linear;
}

@keyframes progress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

.text-display {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 30px;
    font-size: 1.5em;
    line-height: 1.8;
    min-height: 150px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.text-display span {
    position: relative;
}

.text-display span.correct {
    background-color: #c8e6c9;
    color: #2e7d32;
}

.text-display span.wrong {
    background-color: #ffcdd2;
    color: #c62828;
}

.text-display span.current {
    border-bottom: 3px solid #667eea;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        border-bottom-color: #667eea;
    }
    51%, 100% {
        border-bottom-color: transparent;
    }
}

.input-area {
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    resize: none;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s;
}

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

.result-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    z-index: 1000;
    min-width: 400px;
}

.result-display::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.result-display h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.result-stats {
    margin-bottom: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-label {
    font-size: 1.2em;
    color: #666;
}

.result-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.restart-btn:active {
    transform: translateY(0);
}

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

    h1 {
        font-size: 2em;
    }

    .text-display {
        font-size: 1.2em;
        padding: 20px;
    }

    .game-info {
        flex-direction: column;
        gap: 15px;
    }

    .result-display {
        min-width: 90%;
        padding: 30px 20px;
    }
}

