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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.instructions {
    margin-bottom: 30px;
    color: #666;
    font-size: 1.1em;
}

.instructions p {
    margin: 10px 0;
}

.test-area {
    width: 100%;
    height: 300px;
    background-color: #ecf0f1;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 30px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.test-area:hover {
    background-color: #e0e4e5;
}

.test-area.active {
    background-color: #2ecc71;
    cursor: pointer;
}

.test-area.error {
    background-color: #e74c3c;
}

.status-text {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    transition: color 0.2s ease;
}

.test-area.active .status-text,
.test-area.error .status-text {
    color: white;
}

.results {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.result-item {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-width: 150px;
}

.label {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}

#best-time {
    color: #27ae60;
    font-weight: bold;
}

#avg-time {
    color: #3498db;
    font-weight: bold;
}

#test-count {
    color: #e67e22;
    font-weight: bold;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.game-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.game-link a {
    color: #3498db;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.game-link a:hover {
    color: #2980b9;
    text-decoration: underline;
    transform: translateY(-2px);
}

.start-btn {
    background-color: #3498db;
    color: white;
}

.start-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

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

.reset-btn {
    background-color: #95a5a6;
    color: white;
}

.reset-btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

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

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .test-area {
        height: 250px;
    }
    
    .status-text {
        font-size: 1.5em;
    }
    
    .results {
        flex-direction: column;
        align-items: center;
    }
    
    .result-item {
        width: 100%;
        max-width: 300px;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}