/* ── Pages personnages ───────────────────────────────────────────────────── */

.sts-back-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.sts-back-link:hover { color: var(--teal); }

.sts-section-title {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem;
}

.sts-char-header {
    margin-bottom: 0.5rem;
}

.sts-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.sts-spinner-lg {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: sts-spin 0.7s linear infinite;
}

.sts-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    font-size: 14px;
}

/* Carte personnage cliquable */
.sts-character-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sts-character-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
    color: inherit;
    text-decoration: none;
}

/* Boutons rang */
.sts-rank-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sts-rank-btn {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.sts-rank-btn:hover:not(:disabled) {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.sts-rank-btn.active {
    background: var(--teal-dim);
    border-color: var(--border-strong);
    color: var(--teal);
}

.sts-rank-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card body padding */
.sts-card-body {
    padding: 0.25rem 0;
}

/* ── Actions mobile ──────────────────────────────────────────────────── */
.sts-actions-desktop {
    display: flex;
    gap: 0.5rem;
}

.sts-actions-mobile {
    display: none;
}

@media (max-width: 600px) {
    .sts-actions-desktop {
        display: none;
    }

    .sts-actions-mobile {
        display: block;
    }

    /* Portrait au-dessus sur mobile */
    .sts-char-header {
        flex-direction: column !important;
        align-items: center !important;
    }

        .sts-char-header img {
            width: 96px !important;
            height: 96px !important;
        }
}

/* ── Fiche détail — layout 2 colonnes ───────────────────────────────────── */

.sts-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

@media (max-width: 700px) {
    .sts-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Histoire avec fondu ─────────────────────────────────────────────────── */

.sts-histoire {
    background: var(--bg-card);
    border-left: 2px solid var(--teal-dim);
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    max-height: 80px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent);
    mask-image: linear-gradient(to bottom, #000 50%, transparent);
    transition: max-height 0.3s ease, -webkit-mask-image 0.3s, mask-image 0.3s;
    cursor: pointer;
}

    .sts-histoire.expanded {
        max-height: 600px;
        -webkit-mask-image: none;
        mask-image: none;
    }

/* ── Certifications compactes ────────────────────────────────────────────── */

.sts-cert-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sts-cert-item {
    background: var(--bg-card);
    border: 0.5px solid rgba(var(--amber-rgb, 200, 150, 50), 0.2);
    border-radius: 6px;
    padding: 7px 10px;
}

.sts-cert-name {
    font-size: 12px;
    color: var(--amber);
    font-weight: 500;
    margin-bottom: 2px;
}

.sts-cert-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Traits compacts ─────────────────────────────────────────────────────── */

.sts-trait-item {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 5px;
}

.sts-trait-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    margin-top: 5px;
    flex-shrink: 0;
}

.sts-trait-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sts-trait-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Compétences avec accent ─────────────────────────────────────────────── */

.sts-rang-label {
    font-size: 10px;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 10px 0 5px;
}

.sts-ability-card {
    background: var(--bg-card);
    border: 0.5px solid var(--border);
    border-left: 2px solid var(--teal);
    border-radius: 0 6px 6px 0;
    padding: 9px 12px;
    margin-bottom: 5px;
}

.sts-ability-card-r2 {
    border-left-color: var(--purple, #a78bfa);
}

.sts-ability-card-r3 {
    border-left-color: var(--amber);
}

/* ── Mobile — modale actions ─────────────────────────────────────────────── */

.sts-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sts-mobile-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border: none;
}

.sts-mobile-btn-primary {
    background: var(--teal);
    color: var(--bg-deep);
}

.sts-mobile-btn-ghost {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    border: 0.5px solid var(--border);
}

.sts-mobile-btn-danger {
    background: rgba(220, 50, 50, 0.1);
    color: #e07070;
    border: 0.5px solid rgba(220, 50, 50, 0.2);
}

/* ── Mobile — header centré ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .sts-char-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
    }

    .sts-char-meta-center {
        justify-content: center;
    }

    .sts-stats-row {
        justify-content: center;
    }
}


/* ── Ajouts à characters.css ─────────────────────────────────────────────── */
/* À ajouter à la suite du fichier characters.css existant                   */

/* ── Bouton danger ───────────────────────────────────────────────────────── */

.sts-btn-danger {
    color: #e07070 !important;
    border-color: rgba(220, 50, 50, 0.25) !important;
}

    .sts-btn-danger:hover {
        background: rgba(220, 50, 50, 0.08);
    }

/* ── Stat box cliquable (lien inventaire) ────────────────────────────────── */

.sts-stat-box-link {
    cursor: pointer;
    transition: border-color 0.15s;
}

    .sts-stat-box-link:hover {
        border-color: var(--border-strong);
    }

/* ── Onglets Fiche / Inventaire ──────────────────────────────────────────── */

.sts-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin: 1rem 0 0.75rem;
    gap: 0;
}

.sts-tab {
    font-size: 13px;
    padding: 7px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .sts-tab:hover {
        color: var(--text-secondary);
    }

    .sts-tab.active {
        color: var(--teal);
        border-bottom-color: var(--teal);
        font-weight: 500;
    }

.sts-tab-count {
    font-size: 10px;
    color: var(--text-muted);
}

/* ── Collapse headers ────────────────────────────────────────────────────── */

.sts-collapse-hdr {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
    margin: 1.25rem 0 0.4rem;
}

    .sts-collapse-hdr:first-child {
        margin-top: 0;
    }

    .sts-collapse-hdr:hover .sts-section-title {
        color: var(--text-secondary);
    }

.sts-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: auto;
}

    .sts-chevron.collapsed {
        transform: rotate(-90deg);
    }

/* ── Rang headers collapsables ───────────────────────────────────────────── */

.sts-rang-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    margin: 10px 0 4px;
}

    .sts-rang-hdr:hover .sts-rang-label {
        opacity: 0.8;
    }

/* Couleur du chevron selon le rang */
.sts-chevron-rang-1 {
    color: var(--teal);
}

.sts-chevron-rang-2 {
    color: var(--purple);
}

.sts-chevron-rang-3 {
    color: var(--amber);
}

/* Couleur du label selon le rang (surcharge .sts-rang-label existant) */
.sts-rang-label-2 {
    color: var(--purple);
}

.sts-rang-label-3 {
    color: var(--amber);
}

/* ── Inventaire stats ────────────────────────────────────────────────────── */

.sts-inv-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 0.5rem;
}

/* ── Grille inventaire ───────────────────────────────────────────────────── */

.sts-inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 7px;
    margin-top: 0.4rem;
    margin-bottom: 0.5rem;
}

.sts-inv-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .sts-inv-card:hover {
        border-color: var(--border-strong);
        background: var(--bg-card-hover);
    }

.sts-inv-card-equipped {
    border-color: rgba(78, 195, 196, 0.4);
}

.sts-inv-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
    line-height: 1;
}

.sts-inv-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

/* Icône main équipée */
.sts-inv-hand {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.sts-inv-hand-main {
    color: var(--teal);
}

.sts-inv-hand-off {
    color: var(--text-muted);
}

/* Placeholder invisible pour aligner les cartes sans icône de main */
.sts-inv-hand-placeholder {
    display: inline-block;
    width: 13px;
    height: 13px;
}


/* ── Section titles renforcés ────────────────────────────────────────────── */

.sts-collapse-hdr .sts-section-title {
    color: var(--text-secondary);
    letter-spacing: 0.10em;
}

.sts-collapse-hdr:hover .sts-section-title {
    color: var(--teal);
}
