
.characters-hero {
    min-height: 380px;
    background:
        linear-gradient(rgba(10, 15, 30, 0.8), rgba(10, 15, 30, 0.97)),
        url('https://images.unsplash.com/photo-1551269901-5c5e14c25df7?q=80&w=1469&auto=format&fit=crop')
        center/cover no-repeat scroll;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 3px solid var(--accent-gold);
    padding: 3rem 2rem;
    position: relative;
}

.characters-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(251, 191, 36, 0.02) 0px,
        rgba(251, 191, 36, 0.02) 1px,
        transparent 1px,
        transparent 12px
    );
    pointer-events: none;
}

.characters-hero {
    position: relative;
}

.characters-hero-content {
    position: relative;
    z-index: 1;
}

.characters-hero-content h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(251, 191, 36, 0.35);
}

.characters-hero-content p {
    font-size: 1.15rem;
    color: var(--text-muted);
}

/* =============================================
   MAIN CONTAINER
============================================= */
.characters-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

/* =============================================
   SECTION HEADER
    Each section (PCs and NPCs) has a small pill label
   above the title — purple for PCs (players/heroes), gold for NPCs
============================================= */
.characters-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.35rem 1.1rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.pc-label {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.npc-label {
    background: rgba(251, 191, 36, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.character-card {
    background: linear-gradient(160deg, #1e2d45 0%, #0f172a 100%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-top: 3px solid var(--accent-gold);
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: charCardIn 0.5s forwards;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    position: relative;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 280px;
    background: radial-gradient(ellipse at top, rgba(251, 191, 36, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.character-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-gold);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(251, 191, 36, 0.1);
}

@keyframes charCardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.character-portrait {
    height: 280px;
    background-size: cover;
    background-position: center top;
    position: relative;
    z-index: 1;
}

.character-portrait::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, #0f172a);
}


.character-type-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    z-index: 1;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.character-card:hover .character-type-badge {
    background: var(--status-color);
    color: var(--primary-dark);
    border-color: var(--status-color);
}

.badge-pc {
    background: rgba(139, 92, 246, 0.85);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.6);
}

.badge-npc {
    background: rgba(251, 191, 36, 0.85);
    color: var(--primary-dark);
    border: 1px solid rgba(251, 191, 36, 0.6);
}


.character-card-body {
    padding: 1.2rem 1.4rem 1.4rem;
}

.character-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-bottom: 0.3rem;
    line-height: 1.3;
    text-shadow:
        0 0 16px rgba(251, 191, 36, 0.45),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.03em;
    text-align: center;
}


.character-race-class {
    font-size: 0.85rem;
    color: var(--accent-purple);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.character-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    font-style: italic;
}

.character-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}


.character-player {
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.character-view-btn {
    background: transparent;
    border: 1.5px solid var(--accent-purple);
    color: var(--accent-purple);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.character-view-btn:hover {
    background: var(--accent-purple);
    color: white;
}

/* =============================================
   MODAL OVERLAY
============================================= */
.character-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1001;
    overflow-y: auto;
    padding: 2rem 1rem;
}

/* =============================================
   MODAL CONTENT
============================================= */
.character-modal-content {
    background: linear-gradient(160deg, #1e2d45 0%, #111827 100%);
    max-width: 860px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    border: 1px solid rgba(251, 191, 36, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    position: relative;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(251, 191, 36, 0.05);
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Gold/purple gradient top bar */
.character-modal-content::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-purple), var(--accent-gold));
}

.character-modal-body {
    display: grid;
    grid-template-columns: 280px 1fr;
}

/*
  EXPLANATION: Modal portrait is taller than the card portrait
  to give the character image more presence. The gradient at bottom
  and the name overlaid on the image (via absolute positioning)
  creates a cinematic feel — like a character sheet cover.
*/
.modal-portrait-col {
    position: relative;
    min-height: 420px;
    background-size: cover;
    background-position: center top;
}

.modal-portrait-col::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(26, 37, 64, 0.95) 100%
    );
}

.modal-portrait-info {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 1;
}

.modal-portrait-badge {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.6rem;
}

.modal-character-name {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--accent-gold);
    line-height: 1.2;
    margin-bottom: 0.3rem;
    text-shadow:
        0 0 20px rgba(251, 191, 36, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.04em;
}

.modal-race-class {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* =============================================
   MODAL INFO COLUMN
============================================= */
.modal-info-col {
    padding: 2rem;
    overflow-y: auto;
    max-height: 600px;
}

.modal-info-section {
    margin-bottom: 1.8rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.modal-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.modal-info-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-info-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}


.modal-player-box {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.modal-player-box i {
    color: var(--accent-purple);
    font-size: 1.2rem;
}

/* =============================================
   CLOSE BUTTON
============================================= */
.close-character-modal {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--text-light);
    font-size: 1.4rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1100;
    line-height: 1;
}

.close-character-modal:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 768px) {
    .characters-hero-content h1 {
        font-size: 2rem;
    }

    .characters-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.2rem;
    }

    /* Modal collapses to single column on mobile */
    .character-modal {
        padding: 0;
    }

    .character-modal-content {
        border-radius: 0;
        min-height: 100dvh;
    }

    .character-modal-body {
        grid-template-columns: 1fr;
    }

    .modal-portrait-col {
        min-height: 300px;
    }

    .modal-info-col {
        max-height: none;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .characters-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .character-portrait {
        height: 200px;
    }

    .character-name {
        font-size: 1rem;
    }

    .character-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .character-view-btn {
        width: 100%;
        justify-content: center;
    }
}