/* Generals management page */
.generals-page {
    max-width: 1200px;
}

.generals-title {
    font-weight: 700;
    color: #fff;
}

.generals-card,
.generals-detail-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========== General Profile Card (reference design) ========== */
.general-profile-card {
    background: var(--cg-surface-bg);
    border: 1px solid var(--cg-surface-border);
    border-radius: var(--cg-surface-radius);
    overflow: hidden;
    box-shadow: var(--cg-surface-shadow);
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}

.general-profile-card:hover {
    transform: translateY(-2px);
    border-color: var(--cg-surface-border-hover);
    box-shadow: var(--cg-surface-shadow-hover);
}

.general-profile-card-selected {
    border-color: var(--cg-surface-border-selected);
    box-shadow: var(--cg-surface-shadow-hover);
}

/* Locked general card - disabled appearance */
.general-profile-card-locked {
    opacity: 0.85;
    background: color-mix(in srgb, var(--bg-surface-1) 70%, transparent);
}

.general-profile-card-locked:hover {
    transform: none;
    border-color: var(--cg-surface-border);
    box-shadow: var(--cg-surface-shadow);
}

.general-profile-level-badge-locked {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    font-size: 1rem;
}

.general-profile-status-locked {
    background: rgba(100, 116, 139, 0.35);
    color: #94a3b8;
}

.general-profile-status-locked i {
    font-size: 8px;
    margin-right: 4px;
}

/* Locked card: requirements block */
.general-profile-locked {
    padding: 8px 0;
}

.general-profile-locked-req {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.general-profile-locked-desc {
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 8px;
    line-height: 1.4;
}

.general-profile-locked-progress {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}

.general-profile-manage-btn-secondary {
    display: block;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #94a3b8;
}

.general-profile-manage-btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.6);
}

.general-profile-card-inner {
    display: flex;
    flex-direction: row;
    min-height: 200px;
}

/* Portrait (left) */
.general-profile-portrait-wrap {
    position: relative;
    flex-shrink: 0;
    width: 170px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.general-profile-portrait-frame {
    width: 100%;
    max-width: 150px;
    height: auto;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.general-profile-portrait {
    width: 100%;
    max-width: 150px;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    object-position: center;
}

.general-profile-portrait-fallback {
    font-size: 3rem;
}

.general-profile-level-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Info (right) */
.general-profile-info {
    flex: 1;
    padding: 16px 20px 16px 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.general-profile-header {
    margin-bottom: 12px;
}

.general-profile-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.general-profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}

.general-profile-rank {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.general-profile-status {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.general-profile-status-deployed {
    background: rgba(234, 179, 8, 0.3);
    color: #fbbf24;
}

.general-profile-status-deployed i {
    font-size: 8px;
    margin-right: 4px;
    color: #ef4444;
}

.general-profile-status-available {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.general-profile-status-available i {
    font-size: 8px;
    margin-right: 4px;
}

/* Stats grid */
.general-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.general-profile-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.general-profile-stat-icon {
    font-size: 1rem;
    color: #d4af37;
}

.general-profile-stat-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Force Bootstrap Icons font - may be overridden by other styles */
.general-profile-stat-icon .bi,
.general-profile-stat-icon i {
    font-family: "bootstrap-icons" !important;
    font-style: normal;
    font-weight: normal;
}

.general-profile-stat-label {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
}

.general-profile-stamina-label-main {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.general-profile-stat-value {
    font-size: 11px;
    font-weight: 600;
    color: #e2e8f0;
    margin-left: auto;
}

/* XP bar */
.general-profile-xp {
    margin-bottom: 12px;
}

.general-profile-xp-label {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.general-profile-xp-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
}

.general-profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Manage button */
.general-profile-manage-btn {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.general-profile-manage-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}

.general-profile-manage-btn:active {
    transform: scale(0.98);
}

@media (max-width: 576px) {
    .general-profile-card-inner {
        flex-direction: column;
        align-items: center;
    }
    .general-profile-portrait-wrap {
        width: 100%;
        padding: 16px 16px 8px;
    }
    .general-profile-portrait-frame {
        max-width: 120px;
    }
    .general-profile-portrait {
        max-width: 120px;
        max-height: 110px;
    }
    .general-profile-info {
        padding: 12px 16px 16px;
    }
}

/* Legacy: keep general-icon-sm for other pages */
.general-card .card-header img,
.generals-detail-card img.general-icon-sm {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* General icons - small, fixed size (override any img max-width:100% etc.) */
img.general-icon-sm,
.general-icon-sm {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.cursor-pointer {
    cursor: pointer;
}

/* Skill rows */
.generals-skills .skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.generals-skills .skill-row:last-child {
    border-bottom: none;
}

.generals-skills .skill-row label {
    margin: 0;
    font-size: 0.9rem;
}

.skill-value {
    min-width: 2rem;
    text-align: center;
    font-weight: 600;
}

/* Equipment slots */
.equipment-slots {
    display: grid;
    gap: 0.75rem;
}

.equipment-slot {
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
}

.equipment-slot .slot-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.slot-item {
    font-size: 0.85rem;
}

/* Equip modal */
.generals-equip-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1050;
    background: var(--bs-body-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
}

.generals-equip-modal .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.generals-equip-modal .modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.generals-equip-modal .list-group-item {
    font-size: 0.9rem;
}

/* ========== General Management Modal - 2-column layout ========== */
.general-mgmt-overlay {
    z-index: 1050;
}

.general-mgmt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1060;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.general-mgmt-body.general-mgmt-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.general-mgmt-left {
    display: flex;
    flex-direction: column;
}

.general-mgmt-right {
    display: flex;
    flex-direction: column;
}

/* Aggregated equipped stats (preview only — management on /equipment) */
.generals-equipped-stats {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.generals-equipped-stats-head {
    margin-bottom: 12px;
}

.generals-equipped-stats-title {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.04em;
}

.generals-equipped-stats-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.generals-equipped-stats-empty {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 16px 0;
}

.generals-equipped-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.8rem;
}

.generals-equipped-stat-k {
    color: #cbd5e1;
}

.generals-equipped-stat-v {
    color: #4ade80;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.generals-equipped-cta {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.generals-equipped-cta-btn {
    background: linear-gradient(180deg, #d4af37 0%, #a67c00 100%);
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: #1a1a1a;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

.generals-equipped-cta-btn:hover {
    filter: brightness(1.08);
    color: #0f0f0f;
}

.generals-equipped-cta-note {
    font-size: 0.72rem;
    color: #64748b;
    max-width: 280px;
    line-height: 1.4;
}

.general-mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    flex-shrink: 0;
}

.general-mgmt-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    margin: 0;
}

.general-mgmt-close-btn {
    background: rgba(71, 85, 105, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.general-mgmt-close-btn:hover {
    background: rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.5);
    color: #fff;
}

/* Tabs — visible only on mobile */
.general-mgmt-tabs {
    display: none;
}

.general-mgmt-footer {
    display: none;
}

.general-mgmt-body {
    min-height: 300px;
}

.general-mgmt-col {
    background: #2d3748;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.general-mgmt-col-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

/* Skills column */
.general-mgmt-available {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.general-mgmt-alloc-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}

.general-mgmt-alloc-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #b8860b 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Stamina bar - karta generała */
.general-profile-stamina {
    margin: 10px 0 12px;
}

.general-profile-stamina-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
}

.general-profile-stamina-next {
    font-size: 0.65rem;
    color: #fbbf24;
}

.general-profile-stamina-full {
    font-size: 0.65rem;
    color: #22c55e;
}

.general-profile-stamina-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
}

.general-profile-stamina-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.general-profile-stamina-fill.stamina-fresh { background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); }
.general-profile-stamina-fill.stamina-tired { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%); }
.general-profile-stamina-fill.stamina-exhausted { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }
.general-profile-stamina-fill.stamina-depleted { background: #6b7280; }

/* Stamina w modalu zarządzania */
.general-mgmt-stamina {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.general-mgmt-stamina-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.general-mgmt-stamina-status {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.general-mgmt-stamina-status.stamina-fresh { background: rgba(34, 197, 94, 0.3); color: #4ade80; }
.general-mgmt-stamina-status.stamina-tired { background: rgba(251, 191, 36, 0.3); color: #fbbf24; }
.general-mgmt-stamina-status.stamina-exhausted { background: rgba(239, 68, 68, 0.3); color: #f87171; }
.general-mgmt-stamina-status.stamina-depleted { background: rgba(107, 114, 128, 0.3); color: #9ca3af; }

.general-mgmt-stamina-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.general-mgmt-stamina-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.general-mgmt-stamina-fill.stamina-fresh { background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); }
.general-mgmt-stamina-fill.stamina-tired { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%); }
.general-mgmt-stamina-fill.stamina-exhausted { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }
.general-mgmt-stamina-fill.stamina-depleted { background: #6b7280; }

.general-mgmt-stamina-next {
    font-size: 0.7rem;
    color: #fbbf24;
}

.general-mgmt-skill-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.general-mgmt-skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 8px;
}

.general-mgmt-skill-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.general-mgmt-skill-label {
    flex: 1;
    font-size: 11px;
    color: #cbd5e1;
}

.general-mgmt-skill-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.general-mgmt-btn {
    width: 28px;
    height: 28px;
    background: rgba(71, 85, 105, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #d4af37;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.general-mgmt-btn:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.3);
    color: #fff;
}

.general-mgmt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.general-mgmt-skill-val {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    font-size: 12px;
}

.general-mgmt-apply-btn {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.general-mgmt-apply-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e6c235 0%, #d4af37 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.general-mgmt-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Paperdoll - Military RPG (EQ_idea style) */
/* Fixed dimensions so slots overlay body parts (head, chest, hands, thighs, feet) */
.paperdoll-area {
    position: relative;
    width: 420px;
    height: 312px;
    margin: 0 auto 16px;
}

/* Full set bonus - ramka i badge */
.full-set-badge {
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 8px;
    border: 1px solid;
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
}
.full-set-badge.full-set-tier-1 { background: rgba(58,106,58,0.35); border-color: #4a8a4a; color: #7dff7d; }
.full-set-badge.full-set-tier-2 { background: rgba(30,106,30,0.4); border-color: #2a9a2a; color: #8fff8f; }
.full-set-badge.full-set-tier-3 { background: rgba(32,96,192,0.35); border-color: #3a7ad4; color: #8ac8ff; }
.full-set-badge.full-set-tier-4 { background: rgba(124,59,191,0.35); border-color: #9b5de5; color: #c9a0ff; }
.full-set-badge.full-set-tier-5 { background: rgba(200,168,75,0.35); border-color: #d4af37; color: #ffe066; box-shadow: 0 0 16px rgba(200,168,75,0.4); }

.paperdoll-area.paperdoll-full-set {
    padding: 8px;
    border-radius: 12px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 12px;
    padding-right: 12px;
}
.paperdoll-area.paperdoll-full-set-t1 { border: 2px solid #4a8a4a; box-shadow: 0 0 20px rgba(74,138,74,0.35), inset 0 0 30px rgba(74,138,74,0.08); }
.paperdoll-area.paperdoll-full-set-t2 { border: 2px solid #2a9a2a; box-shadow: 0 0 22px rgba(42,154,42,0.4), inset 0 0 30px rgba(42,154,42,0.1); }
.paperdoll-area.paperdoll-full-set-t3 { border: 2px solid #3a7ad4; box-shadow: 0 0 24px rgba(58,122,212,0.45), inset 0 0 30px rgba(58,122,212,0.1); }
.paperdoll-area.paperdoll-full-set-t4 { border: 2px solid #9b5de5; box-shadow: 0 0 26px rgba(155,93,229,0.5), inset 0 0 30px rgba(155,93,229,0.12); }
.paperdoll-area.paperdoll-full-set-t5 { border: 2px solid #d4af37; box-shadow: 0 0 28px rgba(212,175,55,0.55), inset 0 0 35px rgba(212,175,55,0.15); }

.paperdoll-img {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    max-height: 300px;
    top: 6px;
    z-index: 0;
    opacity: 0.9;
    object-fit: contain;
}

.eq-slot {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 1px dashed #c8a84b;
    border-radius: 3px;
    background: rgba(12, 16, 22, 0.82);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.eq-slot:hover {
    border-color: #f0d060;
    box-shadow: 0 0 14px rgba(200,168,75,0.4);
}

.eq-slot.filled { border-style: solid; }
.eq-slot.rarity-1 { border-color: #3a6a3a; }
.eq-slot.rarity-2 { border-color: #1e6a1e; }
.eq-slot.rarity-3 { border-color: #2060c0; }
.eq-slot.rarity-4 { border-color: #7c3bbf; }
.eq-slot.rarity-5 { border-color: #c8a84b; box-shadow: 0 0 12px rgba(200,168,75,0.3); }

.slot-label {
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c8a84b;
    margin-top: 4px;
    line-height: 1.1;
}

.slot-empty-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    opacity: 0.35;
}
.eq-slot .slot-empty-icon { display: block; }

.slot-filled-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4px;
}

/* Paperdoll: equipped slot = icon only (no name / tier text) */
.slot-filled-inner--icon-only {
    padding: 2px;
}
.slot-filled-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

.slot-filled-inner .item-icon { font-size: 24px; line-height: 1; }

.rarity-badge {
    position: absolute;
    top: 2px; right: 4px;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
}
.eq-slot.rarity-3 .rarity-badge { color: #6aadff; }
.eq-slot.rarity-4 .rarity-badge { color: #c06aff; }
.eq-slot.rarity-5 .rarity-badge { color: #ffd966; }

.slot-filled-inner .item-name {
    position: absolute;
    bottom: 2px;
    font-size: 7px;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* slot positions — overlay body parts ON the paperdoll (head, hands, chest, thighs, feet) */
.slot-helmet { top: 12px;  left: 182px; }   /* ON head */
.slot-gloves { top: 168px; left: 108px; }  /* ON left hand (bardziej w lewo) */
.slot-vest   { top: 100px; left: 182px; }  /* ON chest (w linii z helmem i spodniami) */
.slot-pants  { top: 192px; left: 182px; }  /* ON legs (nad butami) */
.slot-boots  { top: 258px; left: 182px; }  /* ON feet (przerwa od pants) */

.eq-slot.drag-over {
    border-color: #f0d060 !important;
    border-style: solid !important;
    box-shadow: 0 0 18px rgba(240,208,96,0.5) !important;
    background: rgba(200,168,75,0.1) !important;
}

/* Inventory divider */
.inv-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.inv-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(200,168,75,0.3), transparent);
}

.inv-title {
    font-size: 10px;
    letter-spacing: 2px;
    color: #c8a84b;
}

.inv-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #c8a84b;
    flex-shrink: 0;
}

/* Inventory grid - 7 columns, scrollable (EQ_idea style) */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.inventory-grid.inventory-below {
    max-height: 180px;
    overflow-y: auto;
}

.inv-item {
    aspect-ratio: 1;
    min-height: 48px;
    padding: 6px;
    background: rgba(10, 14, 18, 0.7);
    border: 1px dashed #2a3a2a;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #94a3b8;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.inv-item.filled {
    cursor: grab;
}

.inv-item.filled:hover {
    border-color: #c8a84b;
    box-shadow: 0 0 10px rgba(200,168,75,0.3);
    transform: scale(1.05);
}

.inv-item:active { cursor: grabbing; }

.inv-item.rarity-1 { border-color: #2a4a2a; border-style: solid; }
.inv-item.rarity-2 { border-color: #1e5a1e; border-style: solid; }
.inv-item.rarity-3 { border-color: #1a3a8a; border-style: solid; }
.inv-item.rarity-4 { border-color: #5a2a9a; border-style: solid; }
.inv-item.rarity-5 { border-color: #8a6a1a; border-style: solid; }

.inv-item.dragging {
    opacity: 0.3 !important;
}

.inv-item.inv-empty {
    opacity: 0.2;
    cursor: default;
}
.inv-item.inv-empty:hover {
    transform: none;
    border-color: #2a3a2a;
    box-shadow: none;
}

.inv-item .item-icon { font-size: 22px; }

.inv-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.generals-stat-flyout-inv {
    z-index: 50;
    min-width: 180px;
}

.inventory-grid-unequip-target {
    box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.45);
    border-radius: 6px;
}

.inv-item-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    pointer-events: none;
    user-select: none;
}

.inv-item .item-name {
    font-size: 7px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.equipped-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 7px;
    color: #4ade80;
    font-weight: 700;
}

.inventory-empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.general-mgmt-abilities {
    font-size: 11px;
    color: #94a3b8;
}

.ability-block {
    padding: 8px 0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.ability-block:last-child {
    border-bottom: none;
}

.badge-ok {
    color: #4ade80;
    font-weight: 600;
}

.badge-lock {
    color: #64748b;
}

/* Modal responsive — tablet */
@media (max-width: 768px) {
    .general-mgmt-modal {
        width: 95%;
        max-width: none;
    }
    .general-mgmt-tabs {
        display: flex;
        gap: 0;
        padding: 0 16px;
        background: rgba(0, 0, 0, 0.2);
        border-bottom: 1px solid rgba(212, 175, 55, 0.3);
        flex-shrink: 0;
    }
    .general-mgmt-tab {
        flex: 1;
        padding: 14px 16px;
        background: transparent;
        border: none;
        color: #94a3b8;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        border-bottom: 3px solid transparent;
        transition: all 0.2s;
    }
    .general-mgmt-tab.active {
        color: #d4af37;
        border-bottom-color: #d4af37;
    }
    .general-mgmt-tab:not(.active):hover {
        color: #e2e8f0;
    }
    .general-mgmt-body.general-mgmt-2col {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .general-mgmt-body.mgmt-tab-0 .general-mgmt-right {
        display: none;
    }
    .general-mgmt-body.mgmt-tab-1 .general-mgmt-left {
        display: none;
    }
    .general-mgmt-col {
        padding: 16px;
    }
    .general-mgmt-header {
        padding: 12px 16px;
    }
    .general-mgmt-title {
        font-size: 1rem;
    }
    .general-mgmt-close-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 16px;
    }
    .general-mgmt-footer {
        display: block;
        padding: 12px 16px;
        border-top: 1px solid rgba(212, 175, 55, 0.3);
        background: rgba(0, 0, 0, 0.2);
        flex-shrink: 0;
    }
    .general-mgmt-close-btn-footer {
        width: 100%;
        padding: 14px 20px;
        background: rgba(212, 175, 55, 0.3);
        border: 1px solid rgba(212, 175, 55, 0.5);
        color: #fff;
        font-size: 16px;
        font-weight: 700;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
    }
    .general-mgmt-close-btn-footer:hover {
        background: rgba(212, 175, 55, 0.5);
    }
    .paperdoll-area {
        max-width: 100%;
    }
}

/* Modal responsive — mobile */
@media (max-width: 576px) {
    .general-mgmt-modal {
        width: 100%;
        max-height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }
    .general-mgmt-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
    }
    .general-mgmt-body.general-mgmt-2col {
        padding: 8px;
    }
    .general-mgmt-col {
        padding: 10px;
    }
    /* Skills tab — compact for mobile */
    .general-mgmt-left .general-mgmt-col-title {
        font-size: 0.7rem;
        margin: 0 0 8px 0;
        padding-bottom: 4px;
    }
    .general-mgmt-left .general-mgmt-available {
        font-size: 11px;
        margin-bottom: 4px;
    }
    .general-mgmt-left .general-mgmt-alloc-bar {
        margin-bottom: 8px;
    }
    .general-mgmt-left .general-mgmt-apply-btn {
        margin-top: 8px;
        padding: 10px;
        font-size: 11px;
    }
    .general-mgmt-left .general-mgmt-skill-list {
        gap: 4px;
    }
    .general-mgmt-left .general-mgmt-skill-item {
        padding: 5px 8px;
        gap: 6px;
    }
    .general-mgmt-left .general-mgmt-skill-icon {
        font-size: 0.95rem;
    }
    .general-mgmt-left .general-mgmt-skill-label {
        font-size: 10px;
    }
    .general-mgmt-left .general-mgmt-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    .general-mgmt-left .general-mgmt-skill-val {
        min-width: 18px;
        font-size: 11px;
    }
    .general-mgmt-left .general-mgmt-abilities {
        font-size: 10px;
    }
    .general-mgmt-left .ability-block {
        padding: 4px 0;
    }
    .general-mgmt-left .general-mgmt-col-title.mt-3 {
        margin-top: 6px !important;
    }
    .general-mgmt-header {
        padding: 10px 12px;
    }
    .general-mgmt-title {
        font-size: 0.85rem;
    }
    .general-mgmt-tabs {
        padding: 0 8px;
    }
    .general-mgmt-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
    .general-mgmt-footer {
        padding: 8px 12px;
    }
    .general-mgmt-close-btn-footer {
        padding: 12px 16px;
        font-size: 14px;
    }
    /* Paperdoll — scale to fit, slot positions in % */
    .paperdoll-area {
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 420 / 312;
        margin: 0 auto 12px;
    }
    .paperdoll-img {
        max-height: none;
    }
    .eq-slot {
        width: 44px;
        min-height: 48px;
        padding: 3px 2px 4px;
        overflow: visible;
    }
    .slot-filled-inner .item-icon { font-size: 18px; }
    .slot-empty-icon { width: 30px; height: 30px; }
    .slot-filled-icon-img { width: 40px; height: 40px; }
    .slot-label { font-size: 7px; margin-top: 2px; }
    .rarity-badge { font-size: 6px; }
    /* Slot positions — ON body parts, percentage-based for scaling */
    .slot-helmet { top: 4%;  left: 50%; transform: translateX(-50%); }
    .slot-gloves { top: 54%; left: 26%; }
    .slot-vest   { top: 32%; left: 50%; transform: translateX(-50%); }
    .slot-pants  { top: 56%; left: 50%; transform: translateX(-50%); }
    .slot-boots  { top: 80%; left: 50%; transform: translateX(-50%); }
    /* Inventory grid — fewer columns on mobile */
    .inventory-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.general-profile-power-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.35rem 0 0.65rem;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: color-mix(in srgb, #f59e0b 12%, transparent);
    border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent);
}

.general-profile-power-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.general-profile-power-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fbbf24;
}

.general-profile-power-value {
    margin-left: auto;
    color: #fde68a;
    font-size: 1rem;
}

.generals-leaderboard-page {
    max-width: 1100px;
}

.generals-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.generals-leaderboard-table th,
.generals-leaderboard-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--cg-surface-border);
    vertical-align: middle;
}

.generals-leaderboard-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cg-text-muted);
}

.generals-leaderboard-row-mine {
    background: color-mix(in srgb, #f59e0b 10%, transparent);
}

.generals-leaderboard-general {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.generals-leaderboard-portrait {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--cg-surface-border);
}

.generals-leaderboard-power {
    font-weight: 700;
    color: #fde68a;
}

.generals-leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* ========== Rankings page ========== */
.rankings-page {
    padding: 0;
    max-width: 1920px;
    margin: 0 auto;
    color: #e8ecf1;
    padding-bottom: 80px;
}

.rankings-page-top {
    padding: 1rem 1.25rem 0.75rem;
}

.rankings-page-header {
    margin-bottom: 0.75rem;
}

.rankings-page .rankings-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0;
}

.rankings-country-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    border: 1px solid rgba(42, 53, 68, 0.85);
    background: rgba(8, 12, 18, 0.55);
    color: #c8d4e0;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    height: 40px;
}

.rankings-country-btn:hover,
.rankings-country-btn.active {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(20, 28, 40, 0.92);
}

.rankings-category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0.25rem;
    border: 1px solid rgba(42, 53, 68, 0.85);
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.55);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.rankings-category-btn:hover {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(20, 28, 40, 0.92);
}

.rankings-category-btn:active {
    transform: scale(0.96);
}

.rankings-category-btn.active {
    border-color: rgba(230, 126, 34, 0.75);
    background: linear-gradient(180deg, rgba(230, 126, 34, 0.18) 0%, rgba(230, 126, 34, 0.06) 100%);
    box-shadow: 0 0 12px rgba(230, 126, 34, 0.25);
}

.rankings-category-btn-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.rankings-table-panel .mu-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.rankings-panel-count {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9aa8b8;
    text-transform: none;
}

.rankings-table-wrap {
    padding: 0 !important;
}

.rankings-table-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.rankings-table {
    width: 100%;
    table-layout: fixed;
}

.rankings-table th,
.rankings-table td {
    vertical-align: middle;
}

.rankings-table-rank-col {
    width: 2.75rem;
}

.rankings-table-value-col {
    width: 5.5rem;
    text-align: right;
    white-space: nowrap;
}

.rankings-rank-num {
    display: inline-block;
    min-width: 1.5rem;
    text-align: center;
    color: #9aa8b8;
    font-weight: 700;
    font-size: 0.82rem;
}

.rankings-row-mine {
    background: rgba(230, 126, 34, 0.1) !important;
}

.rankings-row-mine .rankings-value {
    color: #f5d78e;
}

.rankings-entity-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.rankings-entity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(42, 53, 68, 0.85);
}

.rankings-entity-name {
    font-weight: 600;
    color: #e8ecf1;
}

.rankings-entity-sub {
    font-size: 0.75rem;
    color: #9aa8b8;
    margin-top: 0.1rem;
}

.rankings-value {
    font-weight: 700;
    color: #d4af37;
}

.rankings-empty {
    color: #9aa8b8;
    text-align: center;
    padding: 2rem 1rem !important;
}

.rankings-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0.25rem;
}

.rankings-pagination-info {
    font-size: 0.78rem;
    color: #9aa8b8;
}

.rankings-pagination-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rankings-page-btn {
    min-width: 2.2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(42, 53, 68, 0.85);
    border-radius: 4px;
    background: rgba(8, 12, 18, 0.55);
    color: #c8d4e0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rankings-page-btn:hover:not(:disabled) {
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(20, 28, 40, 0.92);
}

.rankings-page-btn.active {
    border-color: rgba(230, 126, 34, 0.75);
    background: rgba(230, 126, 34, 0.18);
    color: #fff4e6;
}

.rankings-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rankings-battle-row {
    cursor: pointer;
}

.rankings-battle-row:hover {
    background: rgba(245, 158, 11, 0.06);
}

.rankings-battle-matchup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-weight: 600;
}

.rankings-vs {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
    font-weight: 500;
}

.rankings-battle-region {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #9aa8b8;
}

@media (max-width: 767.98px) {
    .layout-pc .main-content-below-bars:has(.rankings-page) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .rankings-page {
        width: 100%;
        max-width: 100%;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .rankings-page-top {
        padding: 0.65rem 0.75rem 0.5rem;
    }

    .rankings-table-panel,
    .rankings-page > .mu-panel {
        width: 100%;
        max-width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .rankings-table {
        font-size: 0.78rem;
        display: table;
        width: 100%;
    }

    .rankings-table thead,
    .rankings-table tbody {
        display: table-row-group;
        width: 100%;
    }

    .rankings-table tr {
        display: table-row;
        width: 100%;
    }

    .rankings-table th,
    .rankings-table td {
        display: table-cell;
        padding: 0.55rem 0.45rem;
    }

    .rankings-table-rank-col {
        width: 2.25rem;
        padding-left: 0.35rem !important;
    }

    .rankings-table-value-col {
        width: 4.75rem;
        padding-right: 0.45rem !important;
    }

    .rankings-entity-cell {
        gap: 0.45rem;
    }

    .rankings-entity-avatar {
        width: 28px;
        height: 28px;
    }

    .mu-member-rank-badge {
        width: 26px;
        height: auto;
    }

    .rankings-pagination {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .rankings-pagination-controls {
        justify-content: center;
    }

    .rankings-category-btn {
        width: 36px;
        height: 36px;
    }

    .rankings-category-btn-icon {
        width: 24px;
        height: 24px;
    }

    .rankings-country-btn {
        height: 36px;
        font-size: 0.72rem;
    }
}
