/* Character Stats Panel */

.char-stats-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csp-panel {
    background: linear-gradient(135deg, #1A1E28 0%, #16213e 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 24px;
    min-width: 420px;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.csp-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}
.csp-close:hover { color: #fff; }

/* Header */
.csp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.csp-avatar {
    font-size: 36px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.csp-info { flex: 1; min-width: 0; }
.csp-name { color: #e0e0e0; font-size: 18px; font-weight: 600; }
.csp-prof { color: rgba(255,255,255,0.5); font-size: 13px; margin-top: 2px; }
.csp-role { color: rgba(255,255,255,0.35); font-size: 11px; }

.csp-level { text-align: right; flex-shrink: 0; }
.csp-lv-num { color: #f1c40f; font-size: 20px; font-weight: bold; }
.csp-exp-bar {
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.csp-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.3s;
}
.csp-exp-text { color: rgba(255,255,255,0.35); font-size: 10px; margin-top: 2px; }

/* Body */
.csp-body {
    display: flex;
    gap: 20px;
}

.csp-section { flex: 1; min-width: 0; }
.csp-section-side { flex: 0 0 140px; }
.csp-section-title {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Stat bars */
.csp-stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.csp-stat-icon { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.csp-stat-name {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    width: 28px;
    flex-shrink: 0;
    font-family: monospace;
}
.csp-stat-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.csp-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.csp-stat-val {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-family: monospace;
}

/* Economy */
.csp-economy {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.csp-econ-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
}
.csp-econ-icon { font-size: 16px; }

/* Affection */
.csp-affection { margin-bottom: 14px; }
.csp-aff-label { color: rgba(255,255,255,0.4); font-size: 11px; margin-bottom: 4px; }
.csp-aff-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.csp-aff-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #e91e63);
    border-radius: 3px;
}
.csp-aff-val { color: rgba(255,255,255,0.35); font-size: 10px; margin-top: 2px; }

/* Traits */
.csp-traits { margin-bottom: 14px; }
.csp-trait-list { display: flex; flex-wrap: wrap; gap: 4px; }
.csp-trait {
    padding: 2px 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
}

/* Bio */
.csp-bio-text {
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 500px) {
    .csp-panel { min-width: 0; width: 95%; padding: 16px; }
    .csp-body { flex-direction: column; }
    .csp-section-side { flex: 1; }
}
