/* /domains/gromadan.com/public_html/css/feed/test_card.css
   Картка тесту в стрічці. Кольори — зі змінних теми (рожева/синя). */

.tc-card { padding-bottom: 16px; }

.tc-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 4px 0 12px;
}

/* Умова: матриця 3x3 */
.tc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 340px;
    margin: 0 auto 16px;
}

.tc-cell {
    aspect-ratio: 1 / 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.tc-cell svg { width: 78%; height: 78%; display: block; }

.tc-cell-q {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 800;
}

/* Умова: числовий ряд */
.tc-series {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 16px;
}
.tc-ser {
    aspect-ratio: auto;
    min-width: 54px;
    padding: 14px 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Умова: твоя картинка */
.tc-qimg { text-align: center; margin: 0 auto 16px; }
.tc-qimg img { max-width: 100%; max-height: 340px; border-radius: var(--radius-sm); }
.tc-prompt { text-align: center; font-weight: 600; font-size: 0.95rem; color: var(--text-secondary); margin: 0 0 12px; }

/* Варіанти 3 x 2 */
.tc-opts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tc-opt {
    position: relative;
    aspect-ratio: 10 / 7;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    transition: var(--transition);
}
.tc-opt:hover { border-color: var(--primary); }
.tc-opt:active { transform: scale(0.98); }

.tc-num {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-fig { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.tc-fig svg { width: 62%; height: 62%; display: block; }
.tc-fig img { max-width: 80%; max-height: 80%; display: block; }
.tc-num-val { font-size: 1.5rem; font-weight: 700; }

.tc-pct {
    position: absolute;
    right: 8px;
    bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Після відповіді */
.tc-opt.is-correct { border-color: #2ea44f; background: rgba(46, 164, 79, 0.12); }
.tc-opt.is-wrong   { border-color: #e5484d; background: rgba(229, 72, 77, 0.12); }
.tc-opt.is-dim     { opacity: 0.55; }
.tc-card[data-done="1"] .tc-opt { cursor: default; }
.tc-card[data-done="1"] .tc-opt:hover { border-color: var(--border); }
.tc-card[data-done="1"] .tc-opt.is-correct:hover { border-color: #2ea44f; }
.tc-card[data-done="1"] .tc-opt.is-wrong:hover { border-color: #e5484d; }

.tc-result {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    padding: 2px 4px 0;
}
.tc-result.is-empty { display: none; }

@media (max-width: 900px) {
    .tc-box { padding: 10px; }
    .tc-opts { gap: 8px; }
    .tc-num { width: 20px; height: 20px; top: 6px; left: 6px; }
}
/* Ответ принят: выбранный вариант без оценки, зелёная надпись, схлопывание карточки */
.tc-card[data-done="1"] .tc-opt { pointer-events: none; }
.tc-opt.is-picked { outline: 2px solid #16A34A; outline-offset: -2px; }
.tc-result.is-ok { color: #16A34A; font-weight: 600; animation: tcFadeIn .3s ease; }
@keyframes tcFadeIn { from { opacity: 0; } to { opacity: 1; } }
.tc-card.is-leaving {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    overflow: hidden;
    transition: max-height .45s ease, opacity .3s ease, margin .45s ease, padding .45s ease;
}