/* css/credits.css — Моите кредити (issue #135 Фаза 5).
   Page-scoped — зарежда се само от credits.html (като tp-generator.css).
   Само дизайн токени от base.css. */

/* ============ Balance hero ============ */
.cr-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
}
.cr-balance__main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.cr-balance__label {
    width: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}
.cr-balance__value {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}
.cr-balance__unit {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}
.cr-balance__actions { flex-shrink: 0; }

/* ============ Прайс справка ============ */
.cr-prices {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cr-prices li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.cr-prices li:last-child { border-bottom: 0; }
.cr-prices li span { color: var(--text-secondary); }
.cr-prices li strong { color: var(--text); white-space: nowrap; }
.cr-prices__note {
    margin: 0.8rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ============ История ============ */
.cr-history__wrap { overflow-x: auto; }
.cr-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.cr-history th,
.cr-history td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.cr-history th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cr-history td { color: var(--text-secondary); }
.cr-history .cr-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cr-history .cr-pos { color: var(--success); font-weight: 700; }
.cr-history .cr-neg { color: var(--danger); font-weight: 700; }
.cr-history__empty {
    color: var(--text-muted);
    padding: 1rem 0;
}

/* ============ Gate ============ */
.cr-gate { text-align: center; padding: 2.5rem 1.5rem; }
.cr-gate p { color: var(--text-secondary); max-width: 46rem; margin: 0.6rem auto; }
.cr-gate .account-btn { margin-top: 1rem; }

/* ============ Докупуване на кредити (Фаза B) ============ */
.cr-topup__lead {
    color: var(--text-secondary);
    margin: 0 0 1rem;
}
.cr-packs {
    display: grid;
    grid-template-columns: minmax(0, 360px);
    justify-content: center;
    gap: 1rem;
}
.cr-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.4rem 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 12px);
    background: var(--surface-alt);
    text-align: center;
}
.cr-pack--featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.cr-pack__badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.cr-pack__credits {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.cr-pack__price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}
.cr-pack__price small {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}
.cr-pack__btn { margin-top: 0.4rem; width: 100%; }

/* ============ Mobile ============ */
@media (max-width: 640px) {
    .cr-balance { justify-content: center; text-align: center; }
    .cr-balance__actions { width: 100%; }
    .cr-balance__actions .account-btn { width: 100%; }
    .cr-history th:first-child,
    .cr-history td:first-child { white-space: nowrap; }
    .cr-packs { grid-template-columns: 1fr; }
}
