/**
 * Schattenwelt – Charakterdatenbank (Redesign, dunkles Gold-Theme).
 * Nur auf /chardb geladen. Farb-Tokens/.btn-gilded kommen aus layout.css.
 * .mobile-dropdown/.desktop-stats-Sichtbarkeits-Umschaltung (900px-Breakpoint) kommt aus
 * style.css und bleibt unveraendert - hier nur der Inhalt gestylt.
 */

.chardb-page,
.chardb-page *,
.chardb-page *::before,
.chardb-page *::after {
    box-sizing: border-box;
}

.chardb-page__title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    color: var(--sw-gold-bright);
    text-align: center;
    margin: 0 0 1.5rem;
}

/* ── Suche ── */
.chardb-search {
    display: flex;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto 1.25rem;
}

.chardb-search input[type="text"] {
    flex: 1;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius-sm);
    color: var(--sw-gold-bright);
    font-size: 0.95rem;
}

.chardb-search input[type="text"]:focus {
    outline: none;
    border-color: var(--sw-gold);
    box-shadow: 0 0 0 3px rgba(201, 166, 92, 0.15);
}

/* ── Aktive Filter ── */
.chardb-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 720px;
    margin: 0 auto 1.5rem;
}

.chardb-badge {
    padding: 0.3rem 0.7rem;
    background: rgba(201, 166, 92, 0.12);
    border: 1px solid var(--sw-border-gold);
    border-radius: 999px;
    color: var(--sw-gold-bright);
    font-size: 0.8rem;
}

.chardb-reset {
    margin-left: auto;
    color: var(--sw-text-muted);
    font-size: 0.8rem;
    text-decoration: none;
}

.chardb-reset:hover {
    color: var(--sw-gold-bright);
}

/* ── Mobile Filter ── */
.chardb-mobile-filters {
    max-width: 480px;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chardb-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chardb-field label {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sw-text-muted);
}

.chardb-field select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius-sm);
    color: var(--sw-gold-bright);
    font-size: 0.9rem;
}

.chardb-field select option {
    background: #14120e;
    color: var(--sw-gold-bright);
}

/* ── Statistik ── */
.chardb-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.chardb-stats__col {
    background: var(--sw-panel-dark);
    border: 1px solid var(--sw-border-gold);
    border-radius: var(--sw-radius);
    padding: 1.5rem;
}

.chardb-stats__title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    margin: 0 0 1rem;
}

.chardb-stats__title a {
    color: var(--sw-gold-bright);
    text-decoration: none;
}

.chardb-stats__title a:hover {
    text-decoration: underline;
}

.chardb-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chardb-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--sw-border-gold);
    border-radius: 999px;
    color: var(--sw-text);
    font-size: 0.82rem;
    text-decoration: none;
}

.chardb-tag:hover {
    background: rgba(201, 166, 92, 0.12);
    color: var(--sw-gold-bright);
}

.chardb-tag span {
    color: var(--sw-gold);
    font-weight: 600;
}

/* ── Charakterliste ── */
.chardb-list-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15rem;
    color: var(--sw-gold-bright);
    text-align: center;
    margin: 0 0 1.5rem;
}

.chardb-az-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 1.5rem;
    position: sticky;
    top: 0.5rem;
    z-index: 5;
}

.chardb-az-nav a,
.chardb-az-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: var(--sw-radius-sm);
    font-size: 0.85rem;
}

.chardb-az-nav a {
    background: var(--sw-panel-dark);
    border: 1px solid var(--sw-border-gold);
    color: var(--sw-gold-bright);
    text-decoration: none;
}

.chardb-az-nav a:hover {
    background: rgba(201, 166, 92, 0.18);
}

.chardb-az-nav span {
    color: var(--sw-text-muted);
    opacity: 0.4;
}

.chardb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.chardb-list__group {
    scroll-margin-top: 3rem;
}

.chardb-list__group h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    color: var(--sw-gold);
    margin: 0 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--sw-border-gold);
}

.chardb-list__group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chardb-list__group li {
    margin-bottom: 0.3rem;
}

.chardb-list__group a {
    color: var(--sw-text);
    text-decoration: none;
    font-size: 0.88rem;
}

.chardb-list__group a:hover {
    color: var(--sw-gold-bright);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .chardb-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .chardb-search {
        flex-direction: column;
    }

    .chardb-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
