/* ═══════════════════════════════════════════════
   CHARACTER SHEET MODAL
   Follows VISUALS_GUIDE: dark post-apocalyptic, 
   chamfered corners, glassmorphism, condensed font
   ═══════════════════════════════════════════════ */

.game-modal-container.character-sheet-modal {
    display: flex;
    flex-direction: column;
    width: 95vw;
    max-width: 1400px;
    height: 90%;
    max-height: 90%;
    overflow: hidden;
}

.character-sheet-modal .game-modal-content {
    padding: 0;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ─── Loading ─── */
.cs-loading {
    text-align: center;
    padding: 3rem;
    color: #a0a0a0;
    font-size: 1.1rem;
}

/* ─── Header Vitals ─── */
.cs-header-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.cs-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
}

.cs-vitals.cs-header-vitals {
    display: flex;
    flex: 1;
    gap: 1rem;
    min-width: 300px;
}

.cs-vital-bar {
    flex: 1;
    min-width: 80px;
}

/* ─── Tabs ─── */
.cs-tabs {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: var(--game-bg-panel);
    border-bottom: 1px solid var(--game-border-color);
}

.cs-tab {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: #a0aec0;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    clip-path: var(--game-clip-path);
    text-align: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.cs-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.cs-tab.active {
    background: #3182ce;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-color: transparent;
}

.cs-tab-badge {
    position: absolute;
    top: 4px;
    right: 10px;
    background: #c0392b;
    color: white;
    font-size: 0.65rem;
    padding: 1px 5px;
    clip-path: var(--game-clip-path-sm);
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

/* ─── Tab Content ─── */
.cs-tab-content {
    padding: 1rem;
}

/* ─── Sections ─── */
.cs-stats-tab {
    display: flex;
    gap: 2rem;
}

.cs-stats-base-col {
    flex: 0 0 35%;
}

.cs-stats-derived-col {
    flex: 1;
}

.cs-section {
    margin-bottom: 1.25rem;
}

.cs-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a8a9a;
    margin: 0 0 0.6rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Base Stats Grid ─── */
.cs-unspent-badge {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(241, 196, 15, 0.05));
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: #f1c40f;
    padding: 0.35rem 0.75rem;
    clip-path: var(--game-clip-path);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    text-align: center;
}

.cs-base-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cs-stat-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(30, 35, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    clip-path: var(--game-clip-path);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

.cs-stat-row:hover {
    background: rgba(40, 45, 55, 0.8);
    transform: translateY(-1px);
}

.cs-stat-icon {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.cs-stat-name {
    min-width: 80px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #c0c0d0;
    text-transform: capitalize;
}

.cs-stat-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-stat-bar {
    flex: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    clip-path: var(--game-clip-path);
    overflow: hidden;
    position: relative;
}

.cs-stat-bar-fill {
    height: 100%;
    clip-path: var(--game-clip-path);
    transition: width 0.3s ease;
}

.cs-stat-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    min-width: 3.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cs-plus-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(241, 196, 15, 0.5);
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    font-size: 1.1rem;
    font-weight: 700;
    clip-path: var(--game-clip-path);
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-plus-btn:hover {
    background: rgba(241, 196, 15, 0.25);
    border-color: #f1c40f;
}

/* ─── Derived Stats Grid ─── */
.cs-derived-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cs-derived-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: rgba(20, 25, 35, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.03);
    clip-path: var(--game-clip-path);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.15s ease;
}

.cs-derived-row:hover {
    background: rgba(35, 40, 50, 0.6);
}

.cs-derived-icon {
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
}

.cs-derived-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: #a0aec0;
}

.cs-derived-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

/* ─── Skills Tab ─── */
.cs-skills-tab {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.cs-skill-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
}

.cs-skill-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cs-skill-card {
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    clip-path: var(--game-clip-path);
    transition: all 0.15s;
}

.cs-skill-card.locked {
    opacity: 0.5;
}

.cs-skill-card.unlocked {
    border-color: rgba(46, 204, 113, 0.2);
    background: rgba(46, 204, 113, 0.03);
}

.cs-skill-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cs-skill-icon {
    font-size: 1.1rem;
}

.cs-skill-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d0d0e0;
}

.cs-skill-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    clip-path: var(--game-clip-path-sm);
}

.cs-skill-badge.unlocked {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.cs-skill-badge.locked {
    color: #8a8a9a;
}

.cs-skill-desc {
    font-size: 0.72rem;
    color: #8a8a9a;
    margin: 0.2rem 0;
    line-height: 1.35;
}

.cs-skill-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.cs-skill-tag {
    font-size: 0.65rem;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.06);
    color: #a0a0b0;
    clip-path: var(--game-clip-path-sm);
}

.cs-skill-tag.req {
    color: #e07a5f;
}

/* ─── Perks Tab ─── */
.cs-perks-tab {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cs-perk-points {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(241, 196, 15, 0.05);
    border: 1px solid rgba(241, 196, 15, 0.15);
    clip-path: var(--game-clip-path);
}

.cs-perk-points-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #c0c0d0;
}

.cs-perk-points-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f1c40f;
}

.cs-perk-points-hint {
    font-size: 0.7rem;
    color: #8a8a9a;
}

.cs-perk-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.cs-perk-card {
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    clip-path: var(--game-clip-path);
    transition: all 0.15s;
}

.cs-perk-card.owned {
    border-color: rgba(46, 204, 113, 0.25);
    background: rgba(46, 204, 113, 0.04);
}

.cs-perk-card.locked {
    opacity: 0.5;
}

.cs-perk-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-perk-icon {
    font-size: 1.2rem;
}

.cs-perk-title-block {
    flex: 1;
}

.cs-perk-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #d0d0e0;
    display: block;
}

.cs-perk-desc {
    font-size: 0.7rem;
    color: #8a8a9a;
    margin: 0.1rem 0 0 0;
    line-height: 1.3;
}

.cs-perk-status {
    font-size: 0.7rem;
    padding: 2px 8px;
    clip-path: var(--game-clip-path-sm);
    white-space: nowrap;
}

.cs-perk-status.owned {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    font-weight: 600;
}

.cs-perk-status.locked {
    color: #8a8a9a;
}

.cs-perk-reqs {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.cs-perk-req {
    font-size: 0.65rem;
    padding: 1px 5px;
    clip-path: var(--game-clip-path-sm);
    text-transform: capitalize;
}

.cs-perk-req.met {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.cs-perk-req.unmet {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 900px) {
    .cs-stats-tab {
        flex-direction: column;
    }

    .cs-skills-tab {
        grid-template-columns: 1fr;
    }

    .cs-perk-list {
        grid-template-columns: 1fr 1fr;
    }

    .cs-derived-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .cs-derived-grid {
        grid-template-columns: 1fr;
    }

    .cs-perk-list {
        grid-template-columns: 1fr;
    }

    .cs-vitals {
        flex-direction: column;
        gap: 0.3rem;
    }

    .game-modal-container.character-sheet-modal {
        max-width: 100vw;
        max-height: 90vh;
        height: 90vh;
        margin: 0.5rem;
    }
}