/* Локальные стили для тренажера Матрицы Равена */
:root {
    --card-bg: rgba(255, 255, 255, 0.5);
    --border-color: rgba(0, 0, 0, 0.1);
    --matrix-border: #333;
    --matrix-bg: #fff;
    --shape-fill: #333;
    --shape-stroke: #333;
}

[data-theme="dark"] {
    --card-bg: rgba(20, 20, 25, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --matrix-border: #888;
    --matrix-bg: #1e1e24;
    --shape-fill: #e0e0e0;
    --shape-stroke: #e0e0e0;
}

.instruction {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--text-color);
    text-align: center;
}

/* UI Elements */
.settings-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.setting-group { margin-bottom: 20px; }
.setting-group:last-child { margin-bottom: 0; }
.setting-title { font-weight: 600; margin-bottom: 10px; color: var(--text-color); }

.custom-select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    outline: none;
    cursor: pointer;
}
[data-theme="dark"] .custom-select { background: rgba(30, 30, 35, 0.8); color: #fff; }

/* Structural styles */
.app-container {
    width: 95%;
    max-width: 1000px;
    min-height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 30px;
    margin: 40px auto;
}
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    transition: opacity 0.3s ease;
}
.screen.hidden { display: none !important; opacity: 0; }
.screen.active { display: flex; opacity: 1; }

.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);
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(70, 114, 48, 0.4); }
.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; }

/* Matrix Grid */
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 4px;
    background-color: var(--matrix-border);
    border: 4px solid var(--matrix-border);
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    margin-bottom: 30px;
}

.matrix-cell {
    background-color: var(--matrix-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.matrix-cell svg {
    width: 80%;
    height: 80%;
}

.empty-cell {
    font-size: 4rem;
    color: var(--border-color);
    font-weight: bold;
}

/* Options */
.options-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.option-btn {
    background-color: var(--matrix-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(46, 204, 113, 0.05);
}

.option-btn svg {
    width: 70%;
    height: 70%;
}

/* Feedback states */
.option-btn.correct {
    border-color: #2ECC71 !important;
    background-color: rgba(46, 204, 113, 0.2) !important;
}

.option-btn.wrong {
    border-color: #E74C3C !important;
    background-color: rgba(231, 76, 60, 0.2) !important;
}

.matrix-cell.correct-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(46, 204, 113, 0.2);
    pointer-events: none;
}

/* Stats */
.stats-grid { display: grid; gap: 20px; width: 100%; max-width: 500px; }
.stat-box {
    background: var(--card-bg); padding: 20px; border-radius: 15px;
    border: 1px solid var(--border-color); text-align: center;
    display: flex; flex-direction: column; justify-content: center;
}
.stat-label { font-size: 1rem; color: var(--text-color); margin-bottom: 10px; opacity: 0.9; }
.stat-value { font-size: 2.2rem; font-weight: 800; }

@media (max-width: 500px) {
    .options-container { gap: 8px; }
    .matrix-grid { max-width: 320px; border-width: 2px; gap: 2px; }
    .empty-cell { font-size: 3rem; }
}
