/* «Хаос → порядок» (features/chaos-order.js). Палитра сайта: хаос — красный #FF5F56, порядок — золото. */
.co-section {
    padding: 2.2rem 1.5rem;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    box-sizing: border-box;
}

/* Высоту и размеры плашек (--co-w, --co-h) выставляет JS под ширину и размер шрифта */
.co-stage {
    --co-w: 170px;
    --co-h: 48px;
    position: relative;
    max-width: 760px;
    min-height: 240px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(180deg, #161011 0%, #0F1113 100%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

/* Фон «порядка» проявляется поверх фона «хаоса» */
.co-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #17150D 0%, var(--bg-card) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.co-stage.is-order::before {
    opacity: 1;
}

.co-item {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--co-w);
    min-height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: #1D1315;
    border: 1px dashed rgba(255, 95, 86, 0.45);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    opacity: 0;
    will-change: transform;
    transform: translate(-200px, -200px);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.2s ease;
}

/* Высота уже посчитана JS (--co-h) — у всех плашек одна, как у их физических тел */
.co-stage[style*="--co-h"] .co-item {
    height: var(--co-h);
}

.co-item.is-in {
    opacity: 1;
}

.co-item.is-solved {
    background: #16171A;
    border: 1px solid rgba(226, 180, 42, 0.45);
    color: var(--text-pure);
}

.co-icon {
    flex-shrink: 0;
    font-size: 1.05rem;
}

.co-item:not(.is-solved) .co-icon {
    filter: grayscale(0.4);
}

.co-label {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

/* ✓ дорисовывается, когда плашка стала «решённой» */
.co-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--gold-primary);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: none;
}

.co-check path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.co-item.is-solved .co-check {
    display: block;
}

.co-item.is-solved .co-check path {
    animation: co-draw 0.3s ease-out 0.25s forwards;
}

@keyframes co-draw {
    to { stroke-dashoffset: 0; }
}

.co-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.2rem;
}

.co-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 600px) {
    .co-section { padding: 1.8rem 1rem; }
    .co-item { font-size: 0.74rem; padding: 0.4rem 0.55rem; gap: 0.4rem; }
    .co-icon { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .co-item.is-solved .co-check path { animation: none; stroke-dashoffset: 0; }
    .co-stage::before { transition: none; }
}
