#crashSiteSection {
    background: none;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

/* Phone-landscape: navigation moves to the left icon rail popover, so hide in-section tabs
   and tighten padding to maximize usable area. */
@media (max-width: 600px),
       (max-width: 900px) and (max-height: 450px),
       (hover: none) and (pointer: coarse) and (max-width: 900px) and (max-height: 600px) {
    #crashSiteSection {
        padding: 1px;
    }

    #crashSiteSection .crashsite-tabs {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #crashSiteSection > .content-panel.crashsite-panel {
        padding: 1px;
        border-top-width: 1px !important;
        border-top-style: solid !important;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
    }
}

html.is-compact #crashSiteSection {
    padding: 1px;
}

html.is-compact #crashSiteSection .crashsite-tabs {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.is-compact #crashSiteSection > .content-panel.crashsite-panel {
    padding: 1px;
    border-top-width: 1px !important;
    border-top-style: solid !important;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

/* Cross-fade backgrounds between Crash Site and Campsite */
#crashSiteSection::before,
#crashSiteSection::after {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: opacity 240ms ease;
    z-index: 0;
}

/* Default (Local map): crash background visible */
#crashSiteSection::before {
    background-image: url('../../assets/images/crashbackground.png');
    opacity: 1;
}

/* Campsite background layer */
#crashSiteSection::after {
    background-image: url('../../assets/images/crewbackground.png');
    opacity: 0;
}

/* When Campsite tab is active: fade to crew background */
#crashSiteSection.is-campsite::before { opacity: 0; }
#crashSiteSection.is-campsite::after { opacity: 1; }

/* Ensure section content stays above the background layers */
#crashSiteSection > * {
    position: relative;
    z-index: 2;
}

/* --- Crash Site Tabs (mirrors Journal styling) --- */
.crashsite-tabs {
    position: relative;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    align-self: stretch;
    /* Visually attach tabs to the panel border below */
    margin-bottom: -1px;
    z-index: 4;
}

.crashsite-tab {
    flex: 1 1 0;
    text-align: center;
    background: linear-gradient(180deg, rgba(8,8,8,0.96), rgba(4,4,4,0.92));
    border: 1px solid rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.38);
    border-bottom: 1px solid rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.58);
    color: #cfd8cf;
    padding: 12px 28px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    letter-spacing: 0.6px;
    position: relative;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.crashsite-tab:hover {
    color: #fff;
    border-color: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.35);
}

.crashsite-tab.active {
    background: rgba(6, 6, 6, 0.89);
    color: #ffffff;
    border-color: rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.60);
    border-bottom: none;
    box-shadow: none;
    z-index: 2;
}

.crashsite-tab:not(.active) {
    box-shadow:
        0 0 0 1px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.14) inset,
        0 2px 8px rgba(var(--glow-r), var(--glow-g), var(--glow-b), 0.10);
}

.crashsite-tab:disabled {
    cursor: not-allowed;
    opacity: 0.35;
    filter: grayscale(0.35);
}

/* Tab-level NEW badge */
.crashsite-tab .action-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border-radius: 999px;
    background: rgba(255, 213, 74, 0.92);
    color: rgba(0,0,0,0.92);
    font-weight: 900;
    font-size: 12px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
}

#crashSiteSection > .content-panel.crashsite-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    /* Override shared .content-panel height:100% so it behaves well inside padded sections
       (prevents bottom edge from being clipped by the section's padding + overflow). */
    height: auto;
    /* Tighter inset so Local Map fills more of the panel */
    padding: 12px;
    /* The shared .content-panel uses scrollbar-gutter: stable, which can make the
       right side look wider even when there's no scrollbar. Disable that here so
       map/card spacing is symmetric. */
    scrollbar-gutter: auto;
    box-shadow: none !important;
    margin-top: 0;
    position: relative;
    z-index: 3;
}

.crashsite-tabpanes {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.crashsite-pane {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
}

.crashsite-pane.active {
    display: flex;
    flex-direction: column;
}

/* Category headers: match the green header accent used in Character/Journal (e.g., "Equipment") */
#crashSiteSection .category-heading {
    margin: 18px 0 10px 0;
    font-size: 14px;
    color: #90EE90;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* .content-panel and shared UI styles have been moved to styles/base/game-area.css */

/* FINAL OVERRIDES (must be last): phone-landscape spacing */
@media (max-width: 600px),
       (max-width: 900px) and (max-height: 450px),
       (hover: none) and (pointer: coarse) and (max-width: 900px) and (max-height: 600px) {
    /* Ensure compact padding wins over later base rules in this file */
    #crashSiteSection {
        padding: 1px !important;
    }

    #crashSiteSection > .content-panel.crashsite-panel {
        padding: 1px !important;
    }
}