/* =====================================================================
   Ship Panel
   Same position/size as Realm and Character panels; toggled by Ship btn.
   ===================================================================== */
#ship-panel.ship-panel--open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
    z-index: 1502;
}

/* Ship panel inner layout reuses .cp-* primitives where possible */
.sp-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 38px 44px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hero banner - same structure as pp-hero */
.sp-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    align-items: stretch;
    gap: 0;
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.9),
        0px 0 12px rgba(0, 0, 0, 0.6),
        -3px 0 12px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid #1e2330;
    border-radius: 3px;
    padding: 0;
    position: relative;
    overflow: hidden;
}
/* Loadout row spans both portrait + info columns */
.sp-hero > .sp-cannon-section {
    grid-column: 1 / -1;
}
.sp-hero-portrait {
    width: 300px;
    height: 250px;
    margin-top: -60px;
    margin-bottom: 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-self: stretch;
    position: relative;
    overflow: hidden;
    padding: 14px 16px;
}
.sp-hero-portrait-img {
    position: absolute;
    inset: 0;
    width: 80%;
    left: 10%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: rotate(180deg) scale(1.3);
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.8));
    pointer-events: none;
}
.sp-location-badge {
    background: rgba(5, 7, 10, 0.82);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: 3px;
    padding: 3px 8px;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    letter-spacing: 0.1em;
    color: rgba(197, 160, 89, 0.7);
    white-space: nowrap;
    pointer-events: none;
}
.sp-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    padding: 20px 24px 20px 20px;
    position: relative;
    gap: 4px;
    margin-top: -70px;
}
.sp-hero-class {
    font-family: var(--font-body);
    font-size: var(--font-size-lg);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4a5568;
}
.sp-hero-class span {
    color: var(--gold);
}
.sp-hero-name {
    font-family: var(--font-body);
    font-size: var(--font-size-3xl);
    font-weight: bold;
    color: var(--gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    margin: 2px 0 8px;
}
.sp-hero-faction {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sp-faction-badge {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4a5568;
    background: var(--surface-raised);
    border: 1px solid #1e2330;
    padding: 3px 8px;
    border-radius: 2px;
}

/* ── Ship portrait level badge ───────────────────────────────────── */
.sp-portrait-level-badge {
    display: none;
    background: rgba(197, 160, 89, 0.95);
    color: #05070a;
    font-family: var(--font-body);
    font-size: var(--font-size-lg);
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(197, 160, 89, 0.5);
    line-height: 1;
}

/* ── Portrait health bars (overlaid below ring) ─────────────────── */
.sp-portrait-bars {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 80%;
    margin-left: 10%;
    margin-bottom: 0;
}
.sp-hero-stat-strip {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80%;
    margin-left: 10%;
    margin-bottom: 3px;
}
.sp-hero-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: rgba(197, 160, 89, 0.65);
}
.sp-hero-stat-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.7;
}
.sp-hero-stat-sep {
    color: rgba(197, 160, 89, 0.3);
    font-size: var(--font-size-sm);
}
.sp-portrait-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sp-portrait-bar-label {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    letter-spacing: 0.1em;
    color: rgba(197, 160, 89, 0.45);
    width: 30px;
    flex-shrink: 0;
}
.sp-portrait-bar-track {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    overflow: hidden;
}
.sp-portrait-bar-num {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: rgba(197, 160, 89, 0.45);
    width: 38px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}
.sp-health-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
}
.sp-health-fill--crew {
    background: #edc56e66;
}
.sp-health-fill--hull {
    background: #edc56e66;
}
.sp-health-fill--crew.sp-health--warn {
    background: linear-gradient(90deg, #b87020, #df9030);
}
.sp-health-fill--hull.sp-health--warn {
    background: linear-gradient(90deg, #4a4c70, #6a6e90);
}
.sp-health-fill--crew.sp-health--crit {
    background: linear-gradient(90deg, #aa2020, #cc3030);
    animation: sp-pulse 1.2s ease-in-out infinite;
}
.sp-health-fill--hull.sp-health--crit {
    background: linear-gradient(90deg, #2a2040, #3e3060);
    animation: sp-pulse 1.2s ease-in-out infinite;
}
@keyframes sp-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

/* Status stat strip - reuses .cp-stat-strip */
/* Already defined via .rp-stat-* - ship panel uses .rp-stat-* directly */

/* ── Ship inventory header (title + capacity on same row) ───── */
.sp-inv-title-col {
    width: 100%;
}
.sp-armaments-section {
    margin-bottom: 12px;
}

/* ── Cannon Equipment Slots ─────────────────────────────────── */
.sp-cannon-section {
    margin-bottom: 16px;
    padding: 14px 16px;
    margin-left: 4%;
}
.sp-section-subtitle {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
    font-style: italic;
}
.sp-munition-header {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 14px 0 6px;
}
.sp-munition-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sp-munition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}
.sp-munition-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.sp-munition-icon .item-icon__img {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
}
.sp-munition-name {
    flex: 1;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
}
.sp-munition-qty {
    font-size: var(--font-size-sm);
    color: rgba(197, 160, 89, 0.8);
    font-variant-numeric: tabular-nums;
}
