:root {
    --error-color: #e53935;
}

.app-container {
    width: 95%;
    max-width: 800px;
    height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 30px;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Экран 1 */
h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.instruction {
    font-size: 1.2rem;
    text-align: center;
    max-width: 500px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.hints {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-bottom: 40px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(70, 114, 48, 0.3);
}

.btn.outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: none;
}

.btn.outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn.small {
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 8px;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Экран 2: Тест */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    position: absolute;
    top: 30px;
    left: 0;
    width: calc(100% - 60px);
    margin: 0 30px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    width: 0%;
    transition: width 0.2s linear;
}

.stimulus-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.stimulus {
    font-size: 80px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.controls-container {
    width: 100%;
    margin-bottom: 20px;
}

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

.color-btn {
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #f0f0f0;
    border: 2px solid #ddd;
    color: #333;
    border-radius: 10px;
    cursor: pointer;
    min-width: 100px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.color-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.color-btn:active {
    transform: scale(0.95);
}

.btn-key {
    font-size: 0.75rem;
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    color: #666;
}

/* Экран 3: Результаты */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
    width: 100%;
    max-width: 600px;
}

.stat-box {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.history-container {
    margin-top: 40px;
    width: 100%;
    max-width: 600px;
}

.history-container h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    overflow: hidden;
}

.history-table th, .history-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.history-table th {
    background: rgba(0,0,0,0.05);
    font-weight: 600;
}

.chart-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.reaction-bars {
    display: flex;
    align-items: flex-end;
    height: 100px;
    gap: 2px;
    background: rgba(255,255,255,0.5);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.05);
}

.bar {
    flex-grow: 1;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.5s ease;
}

.bar.mismatch {
    background: #d99a2b;
}
