/* ============================================================
   Genshin – Characters Page
   Only page‑unique styles. All shared styles come from base.css.
   ============================================================ */

/* ---- Mobile games toggle (kept from original) ---- */
.mobile-games-toggle {
    display: none; /* hidden on desktop, shown on mobile via media query */
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: bold;
    padding: 10px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

.mobile-games-toggle .mobile-games-arrow {
    float: right;
    transition: transform 0.3s;
}

.mobile-games-toggle.active .mobile-games-arrow {
    transform: rotate(180deg);
}

/* ---- Section headers ---- */
.section-header {
    font-size: 32px;
    color: var(--text-heading);
    text-align: center;
    margin: 50px 0 20px 0;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 12px;
    transition: color 0.3s ease, border-color 0.3s ease;
}
.section-header:first-of-type {
    margin-top: 0;
}

/* ---- Character grid ---- */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
}

/* ---- Character card ---- */
.char-card {
    background: var(--bg-card);
    backdrop-filter: blur(6px);
    border-radius: 18px;
    padding: 22px 18px 20px 18px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.4s;
    display: flex;
    flex-direction: column;
}
.char-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color);
    box-shadow: 0 12px 40px var(--shadow-color);
}

.char-card .image-wrapper {
    width: 100%;
    height: 200px;
    background: var(--bg-secondary);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    transition: border-color 0.3s ease, background 0.3s ease;
}
.char-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}
.char-card .image-wrapper img:hover {
    transform: scale(1.06);
}
.char-card .image-wrapper .no-image {
    font-size: 56px;
    color: var(--text-muted);
    opacity: 0.6;
}

.char-card .rarity {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}
.rarity-5 {
    color: #ffd700;
}
.rarity-4 {
    color: #b0c4de;
}

.char-card h4 {
    color: var(--text-heading);
    font-size: 20px;
    margin: 6px 0 2px 0;
    transition: color 0.3s ease;
}
.char-card .char-details {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
    transition: color 0.3s ease;
}
.char-card .char-details span {
    display: inline-block;
    margin: 0 4px;
}
.char-card .faction-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 14px;
    border-radius: 20px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.char-card .btn-char {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 28px;
    background: var(--btn-primary-bg);
    color: white;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
    border: 1px solid var(--badge-border);
    cursor: pointer;
    text-decoration: none;
}
.char-card .btn-char:hover {
    background: var(--btn-primary-hover);
    transform: scale(1.04);
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* ---- Loading spinner ---- */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 18px;
}
.loading-spinner::after {
    content: ' ⏳';
    animation: dots 1.5s steps(4) infinite;
}
@keyframes dots {
    0% { content: ' ⏳'; }
    25% { content: ' ⏳.'; }
    50% { content: ' ⏳..'; }
    75% { content: ' ⏳...'; }
}

/* ---- Footer sub text ---- */
.footer-sub {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   RESPONSIVE TWEAKS (page‑specific only)
   ============================================================ */
@media (max-width: 768px) {
    .char-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 18px;
    }
    .char-card .image-wrapper {
        height: 160px;
    }
    .char-card .btn-char {
        padding: 6px 20px;
        font-size: 12px;
    }
    /* Show the mobile games toggle on small screens */
    .mobile-games-toggle {
        display: block;
    }
}

@media (max-width: 480px) {
    .char-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
    .char-card .image-wrapper {
        height: 200px;
    }
}