@font-face {
    font-family: 'houstonville_regular';
    src: url('font/houstonville-webfont.woff2') format('woff2'),
         url('font/houstonville-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body, html {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'EB Garamond', serif;
    color: #fffbe7;
}

#background-glow, #particles-container, #mystic-veil {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    pointer-events: none;
    z-index: 0;
}

#background-glow {
    background: radial-gradient(ellipse at center, rgba(70,130,180,0.1) 0%, rgba(70,130,180,0) 70%);
    animation: pulseGlow 10s infinite alternate;
    z-index: 0;
}
@keyframes pulseGlow {
    from { transform: scale(1); opacity: 0.2; }
    to { transform: scale(1.1); opacity: 0.4; }
}

#mystic-veil {
    background: radial-gradient(ellipse at 60% 40%, rgba(110,226,245,0.13) 0%, rgba(40,60,110,0.22) 60%, rgba(10,10,30,0.55) 100%);
    mix-blend-mode: lighten;
    opacity: 0.85;
    z-index: 1;
}

.scenario-card, .card.scenario-card {
    background: rgba(10, 20, 45, 0.92) !important;
    border: 1.5px solid rgba(127, 216, 255, 0.25);
    border-radius: 15px;
    box-shadow: 0 0 18px #7fd8ff22, 0 0 10px #b2eaff22;
    color: #fffbe7;
    margin-bottom: 24px;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.scenario-card:hover {
    box-shadow: 0 0 32px #7fd8ff44, 0 0 12px #b2eaff33;
    border-color: #7fd8ff;
    background: rgba(30, 60, 110, 0.97) !important;
}

.scenario-card .card-title {
    font-family: 'houstonville_regular', sans-serif; /* Use the custom font */
    color: #b2eaff;
    text-shadow: 0 0 6px #7fd8ff44;
    font-size: 2.2em;
    
}

.scenario-card .card-text {
    color: #e0f7fa;
    font-size: 1em;
    margin-bottom: 10px;
}

.tag-badge {
    display: inline-block;
    background: linear-gradient(90deg, #7fd8ff 0%, #b2eaff 100%);
    color: #23213a;
    font-size: 0.92em;
    font-weight: 600;
    border-radius: 8px;
    padding: 2px 10px;
    margin: 0 4px 4px 0;
    box-shadow: 0 0 8px #7fd8ff22;
}

.add-char-form {
    background: rgba(20, 35, 60, 0.85);
    border: 1px solid #7fd8ff55;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.btn-success, .btn-primary, .btn-info, .btn-secondary {
    font-family: 'EB Garamond', serif;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    box-shadow: 0 0 10px #7fd8ff22;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-success {
    background: linear-gradient(90deg, #7fffd4 0%, #7fd8ff 100%);
    color: #0a223a;
}
.btn-success:hover {
    background: #7fd8ff;
    color: #0a223a;
    box-shadow: 0 0 18px #7fd8ff88;
}
.btn-primary {
    background: linear-gradient(90deg, #7fd8ff 0%, #b2eaff 100%);
    color: #0a223a;
}
.btn-primary:hover {
    background: #b2eaff;
    color: #0a223a;
}
.btn-info {
    background: linear-gradient(90deg, #a084e8 0%, #6ee2f5 100%);
    color: #23213a;
}
.btn-info:hover {
    background: #6ee2f5;
    color: #23213a;
}
.btn-secondary {
    background: linear-gradient(90deg, #ffe082 0%, #ffb300 100%);
    color: #0a223a;
}
.btn-secondary:hover {
    background: #ffe082;
    color: #0a223a;
}

.character-avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #7fd8ff;
    background: #222;
}

.alert-info, .alert-secondary {
    background: rgba(127, 216, 255, 0.18);
    color: #0a223a;
    border: 1px solid #7fd8ff;
    border-radius: 8px;
    text-align: center;
    font-family: 'EB Garamond', serif;
    font-size: 1.1em;
    margin-bottom: 20px;
}

h1, h2 {
    color: #b2eaff;
    text-shadow: 0 0 8px #7fd8ff, 0 0 5px #0a223a;
    text-align: center;
    margin-bottom: 24px;
}

.modal-content {
    background: rgba(10, 20, 45, 0.97);
    color: #fffbe7;
    border-radius: 14px;
    border: 1.5px solid #7fd8ff55;
    box-shadow: 0 0 18px #7fd8ff22, 0 0 10px #b2eaff22;
}
.modal-header, .modal-footer {
    border: none;
    background: transparent;
}
.modal-title {
    color: #b2eaff;
    text-shadow: 0 0 6px #7fd8ff44;
}
.list-group-item {
    background: rgba(20, 35, 60, 0.85);
    color: #fffbe7;
    border: 1px solid #7fd8ff33;
}
.list-group-item .character-avatar {
    margin-right: 10px;
}

/* New styles for positioning title and creator on scenario card image */
.scenario-card-image-wrapper {
    position: relative;
    display: block; /* Ensures it behaves like a block for the image */
}

.scenario-card-image-wrapper .card-title {
    position: absolute;
    bottom: 10px;
    left: 15px;
    right: 15px; /* Allows text to wrap and not overflow into creator space */
    z-index: 1;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 0, 0, 0.5);
    font-size: 2.5em; /* Adjusted from original 1.3em for overlay */
    line-height: 1.3;
    /* This will override the default .scenario-card .card-title styles when title is in wrapper */
}

/* Ensure the confidentiality badge within the moved title is also readable */
.scenario-card-image-wrapper .card-title .confidentiality-badge {
    /* text-shadow: none; /* Or a very subtle one if needed */
    /* Potentially adjust opacity or add a slight border if contrast is an issue */
}

/* General creator avatar for cards */
.creator-avatar-on-card {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #222; /* Fallback background */
    border: 1px solid #7fd8ff; /* Default border */
}

.scenario-card-creator-info-on-image {
    font-family: houstonville_regular, sans-serif; /* Use the custom font */
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.4em; /* Adjusted from original 1.3em for overlay */
    z-index: 1;
    color: #7fd8ff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 0, 0, 0.5);
    display: flex; /* Added for avatar alignment */
    align-items: center; /* Added for avatar alignment */
}

/* Specific style for avatar when on image overlay */
.scenario-card-image-wrapper .scenario-card-creator-info-on-image .creator-avatar-on-card {
    border-color: rgba(255, 255, 255, 0.75); /* Lighter border for dark images */
    margin-right: 6px; /* Space between avatar and text on image */
}

/* End of new styles for positioning title and creator */

/* New Styles for V2 Card */
.scenario-card-v2 {
    background-color: #1a163f; /* Dark blue-purple background from image */
    border: 1px solid #3a307b; /* Subtle border */
    border-radius: 8px;
    margin-bottom: 20px;
    color: #e0e0ff; /* Light text color */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures child elements conform to border-radius */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.scenario-card-v2-header {
    position: relative;
    height: 200px; /* Adjust as needed */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center; /* Vertically center title */
    justify-content: center; /* Horizontally center title */
    text-align: center;
}
.scenario-card-v2-header::before { /* Dark overlay for better text readability on image */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5); /* Darker overlay */
    border-top-left-radius: 8px; /* Match parent if image is direct child */
    border-top-right-radius: 8px;
}
.scenario-card-v2-title {
    position: relative; /* To be above overlay */
    color: #fff;
    font-size: 2.2em; /* Larger title */
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.8);
    padding: 0 15px; /* Padding for title */
    font-family: 'Arial Black', Gadget, sans-serif; /* Bold sans-serif font like image */
}

.scenario-card-v2-content-wrapper {
    display: flex;
    padding: 20px; /* Increased padding */
    flex-grow: 1;
}
.scenario-card-v2-main-content {
    flex: 3; /* Takes more space */
    padding-right: 20px; /* Increased spacing */
}
.scenario-card-v2-side-content {
    flex: 1; /* Takes less space, for characters */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center items like characters */
    padding-left: 15px;
    border-left: 1px solid #3a307b; /* Separator line */
}
.scenario-card-v2-tags .tag-badge { /* Use existing .tag-badge, ensure it fits */
    margin-bottom: 10px; /* Spacing after tags */
    background: #6ee2f5; /* Light blue from image */
    color: #1a163f; /* Dark text on light tags */
    font-weight: bold;
}
.scenario-card-v2-background {
    font-size: 1em; /* Readable size */
    margin-bottom: 20px; /* Spacing */
    line-height: 1.6;
    font-family: 'EB Garamond', serif; /* Serif for description */
    color: #d0d0ff; /* Slightly softer white */
}
.scenario-card-v2-section-title {
    font-size: 1.3em; /* Prominent section titles */
    font-weight: bold;
    color: #fff; /* White, like image */
    margin-top: 20px;
    margin-bottom: 12px;
    border-bottom: 2px solid #6ee2f5; /* Accent border */
    padding-bottom: 8px;
    text-transform: uppercase; /* Uppercase like image */
    font-family: 'Impact', Charcoal, sans-serif; /* Impactful font for section titles */
}
.scenario-card-v2-author-limits,
.scenario-card-v2-trigger-warnings,
.scenario-card-v2-salons {
    margin-bottom: 20px;
}
.scenario-card-v2-author-limits .tag-badge,
.scenario-card-v2-salons .tag-badge {
    background-color: #4a4090; /* Different color for these tags if needed */
    color: #e0e0ff;
}

.scenario-card-v2-trigger-warnings .text-warning {
    font-size: 0.9em;
    color: #ffc107 !important; /* Ensure visibility */
}
.scenario-card-v2-characters .character-avatar {
    width: 70px; /* Larger avatars */
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid #a084e8; /* Accent border for avatars */
    box-shadow: 0 0 10px rgba(160, 132, 232, 0.5); /* Glow effect */
}
 .scenario-card-v2-characters p {
    font-size: 0.9em;
    text-align: center;
    margin-top: -2px;
    margin-bottom: 15px;
    font-weight: 500;
 }

.scenario-card-v2-footer {
    padding: 12px 20px;
    background-color: rgba(0,0,0,0.3); /* Slightly darker footer */
    display: flex;
    justify-content: flex-end; /* Aligns creator info to the right */
    align-items: center;
    border-top: 1px solid #3a307b;
}
.scenario-card-v2-creator-info {
    display: flex;
    align-items: center;
}
.scenario-card-v2-creator-info span {
    margin-right: 10px;
    font-size: 0.95em;
    font-weight: 500;
}
.scenario-card-v2-creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #a084e8; /* Consistent avatar border */
}
.scenario-actions { /* Container for buttons etc. */
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #3a307b;
}
.scenario-card-v2 .list-group-item {
    background-color: rgba(35, 33, 58, 0.7); /* Darker list items */
    border-color: #3a307b;
    color: #e0e0ff;
    font-size: 0.9em;
    padding: 8px 12px;
}
.scenario-card-v2 .list-group-item a {
    color: #7fd8ff; /* Link color */
    font-weight: bold;
}
.scenario-card-v2 .alert-info { /* For "Vous êtes le propriétaire" */
    background-color: rgba(44, 40, 100, 0.8);
    border-color: #4a4090;
    color: #b2eaff;
    font-size: 0.95em;
    padding: 8px;
}
.scenario-card-v2 .form-control, .scenario-card-v2 .btn {
    border-radius: 4px; /* Consistent border radius */
}
.scenario-card-v2 textarea.form-control {
    background-color: rgba(20, 20, 40, 0.8);
    color: #e0e0ff;
    border: 1px solid #4a4090;
}
.scenario-card-v2 textarea.form-control::placeholder {
    color: #8a8aae;
}


@media (max-width: 768px) {
    .scenario-card, .card.scenario-card {
        margin-bottom: 16px;
        border-radius: 10px;
        padding: 0;
    }
    .character-avatar {
        width: 36px;
        height: 36px;
    }
    h1, h2 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .scenario-card, .card.scenario-card {
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 0;
    }
    .character-avatar {
        width: 28px;
        height: 28px;
    }
    h1, h2 {
        font-size: 1.1em;
    }
}
 .character-list-modal .character-avatar {
      width: 48px;
      height: 48px;
      object-fit: cover;
      border-radius: 50%;
      margin-right: 10px;
      border: 2px solid #a084e8;
      background: #222;
    }
    .tag-badge {
      display: inline-block;
      background: #6ee2f5;
      color: #23213a;
      font-size: 0.92em;
      font-weight: 600;
      border-radius: 8px;
      padding: 2px 10px;
      margin: 0 4px 4px 0;
    }
    .add-char-form {
      margin-top: 10px;
      background: #29255a;
      padding: 10px;
      border-radius: 10px;
    }
    #sidebar-requests {
        position: fixed;
        top: 80px;
        left: 0;
        width: 320px;
        max-width: 90vw;
        background: rgba(10, 20, 45, 0.98); /* déjà sombre, mais on va renforcer */
        border-right: 2px solid #7fd8ff55;
        box-shadow: 2px 0 16px #7fd8ff22;
        z-index: 1000;
        padding: 18px 12px 12px 12px;
        min-height: 300px;
        max-height: 80vh;
        overflow-y: auto;
        display: block; /* Toujours visible */
        /* Ajout d'un effet de fond plus marqué */
        background-image: linear-gradient(135deg, rgba(20,35,60,0.98) 0%, rgba(10,20,45,0.98) 100%);
        /* Optionnel : un léger contour lumineux pour rappeler les autres volets */
        box-shadow: 0 0 24px #7fd8ff33, 2px 0 16px #7fd8ff22;
        /* Optionnel : un léger flou pour l'effet "verre dépoli" */
        backdrop-filter: blur(2px);
    }
    #sidebar-requests h4 { color: #b2eaff; margin-bottom: 12px; }
    .notif-badge {
        display: inline-block;
        min-width: 22px;
        padding: 2px 7px;
        background: #ff5370;
        color: #fff;
        border-radius: 12px;
        font-size: 0.95em;
        font-weight: bold;
        margin-left: 6px;
        vertical-align: middle;
        box-shadow: 0 0 8px #ff537088;
    }
    #sidebar-toggle-btn {
        position: fixed;
        top: 90px;
        left: 0;
        z-index: 1100;
        background: #7fd8ff;
        color: #23213a;
        border: none;
        border-radius: 0 8px 8px 0;
        padding: 8px 16px;
        font-size: 1.1em;
        font-weight: bold;
        box-shadow: 2px 2px 10px #7fd8ff44;
        cursor: pointer;
    }
    @media (max-width: 600px) {
        #sidebar-requests { width: 98vw; left: 0; top: 60px; }
        #sidebar-toggle-btn { top: 70px; }
    }

    /* Indicateur de connexion WebSocket */
    #ws-status {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2000;
        font-size: 1em;
        color: #fff;
        background: #ff5370;
        padding: 6px 16px;
        border-radius: 8px;
        display: none;
    }

    .scenario-card.requested-anim {
        animation: pulse-request 1.2s 2;
        box-shadow: 0 0 24px #ffe082, 0 0 8px #ff5370;
        border-color: #ffe082;
        position: relative;
    }
    @keyframes pulse-request {
        0% { box-shadow: 0 0 0 #ffe082; border-color: #ffe082; }
        50% { box-shadow: 0 0 24px #ffe082, 0 0 8px #ff5370; border-color: #ff5370; }
        100% { box-shadow: 0 0 0 #ffe082; border-color: #ffe082; }
    }
    .requested-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #ffe082;
        color: #23213a;
        font-weight: bold;
        font-size: 0.95em;
        border-radius: 8px;
        padding: 2px 10px;
        z-index: 10;
        box-shadow: 0 0 8px #ffe08288;
        pointer-events: none;
    }
    .confidentiality-badge {
      font-size: 0.4em;
      padding: 2px 6px;
      border-radius: 4px;
      margin-left: 5px;
    }
    .confidentiality-public { background-color: #28a745; color: white; }
    .confidentiality-private { background-color: #dc3545; color: white; }
    .confidentiality-unlisted { background-color: #6c757d; color: white; }

    .invitation-section {
        background: #2c2864;
        padding: 15px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    .invitation-section h4 { color: #e0e0ff; }
    .scenario-card-image {
        width: 100%;
        height: 180px; /* Adjust as needed */
        object-fit: cover;
        border-top-left-radius: calc(.25rem - 1px); /* Match Bootstrap card radius */
        border-top-right-radius: calc(.25rem - 1px);
    }

    /* Styles for "Read More" functionality - Card Expansion */
    .scenario-description-wrapper {
        position: relative; 
        /* min-height: 50px; /* Removed, let content dictate height */
    }
    .scenario-background-truncated {
        max-height: 100px; /* Initial max height: approx 4-5 lines */
        overflow: hidden;
        transition: max-height 0.5s ease-in-out; /* Smooth transition for expansion */
    }
    .scenario-background-truncated.is-expanded {
        max-height: 1000px; /* Large enough for most content, adjust if necessary or use 'none' if JS handles it well with transition */
                            /* Using a large value helps with CSS transitions if 'none' is problematic */
    }
    /* .scenario-background-truncated.is-hidden { /* No longer hiding, just changing max-height */
    /*    display: none; */
    /* } */

    /* .full-description-overlay { /* Removed as we are expanding the card itself */
    /*    display: none; ... */
    /* } */

    .read-more-toggle {
        display: block;
        margin-top: 8px;
        cursor: pointer;
        color: #7fd8ff;
        font-weight: bold;
        text-align: right;
        font-size: 0.9em;
    }

    /* Styles for "Mes Univers" in sidebar */
    .sidebar-adventure-item {
        background-color: rgba(20, 35, 60, 0.75) !important; /* Ensure override if needed */
        border: 1px solid #7fd8ff33 !important;
        color: #e0e0ff !important;
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        border-radius: 6px !important;
        transition: background-color 0.2s, border-color 0.2s;
    }
    .sidebar-adventure-item:last-child {
        margin-bottom: 0 !important;
    }
    .sidebar-adventure-item a {
        color: #b2eaff;
        font-weight: 500;
        text-decoration: none;
        display: flex;
        align-items: center;
    }
    .sidebar-adventure-item a:hover {
        color: #ffffff;
        /* background-color: rgba(30, 50, 80, 0.85); Optional hover for item */
    }
    .sidebar-adventure-item:hover { /* Hover effect on the li element */
        background-color: rgba(30, 60, 110, 0.9) !important;
        border-color: #7fd8ff55 !important;
    }
    .sidebar-adventure-image {
        width: 32px; 
        height: 32px;
        object-fit: cover;
        border-radius: 4px; 
        border: 1px solid #7fd8ff44;
        background-color: #101425; /* Fallback bg for images */
    }
    #sidebar-requests .alert-secondary { /* Style for "aucun univers" message */
        background-color: rgba(30, 40, 70, 0.5);
        border-color: #7fd8ff33;
        color: #a0b8d0;
    }

    /* New Styles for Sidebar "Mes Univers" based on image */
    .sidebar-main-title {
        font-family: 'houstonville_regular', sans-serif;
        color: #7fd8ff; /* Light blue from image */
        text-shadow: 0 0 8px rgba(127, 216, 255, 0.7), 1px 1px 3px rgba(0,0,0,0.5);
        font-size: 2.2em; /* Adjusted from 2.5em for panel context */
        text-align: center;
        margin-bottom: 20px;
    }

    .sidebar-univers-list {
        padding-left: 0;
        list-style: none;
    }
    /* Use .card for Bootstrap compatibility if needed, or stick to custom */
    .sidebar-scenario-card.card { /* Targeting Bootstrap .card structure */
        background-color: #0a1e3c; 
        border-radius: 12px;
        margin-bottom: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 15px rgba(127, 216, 255, 0.1) inset;
        overflow: visible; /* Allow box shadow to be fully visible, Bootstrap .card might clip */
        border: 1px solid rgba(127, 216, 255, 0.2);
    }
    .sidebar-scenario-card .card-header { /* Styling for the clickable header */
        padding: 0; /* Remove default card-header padding */
        background-color: transparent;
        border-bottom: none; /* Remove Bootstrap's default border */
        cursor: pointer;
    }
    .sidebar-scenario-card .card-header.not-expandable {
        cursor: default;
    }

    .sidebar-scenario-card .card-header:hover .sidebar-scenario-image-header::after {
        opacity: 0.5; /* Slightly darker overlay on hover for visual feedback */
    }
     .sidebar-scenario-card .card-header.not-expandable:hover .sidebar-scenario-image-header::after {
        opacity: 0.3; /* Default opacity if not expandable */
    }

    .sidebar-scenario-image-header { /* Added specific styles for the image container */
        height: 120px; /* Define a fixed height for the image area */
        background-size: contain; /* Ensures the entire image is visible */
        background-repeat: no-repeat; /* Prevents tiling if image is smaller than container */
        background-position: center center; /* Centers the image */
        position: relative; /* For positioning child elements like the title */
        display: flex; /* To help center the title overlay */
        align-items: center;
        justify-content: center;
        border-radius: 6px 6px 0 0; /* Optional: round top corners if header is distinct */
        /* background-color: #051021; */ /* Optional: a slightly different bg for letterbox area */
    }
    .sidebar-scenario-image-header::before { /* Optional: subtle overlay if needed for title contrast with 'contain' */
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-color: rgba(0,0,0,0.2); /* Very subtle dark overlay */
        border-radius: inherit; /* Match parent's border radius */
    }


    .sidebar-scenario-clickable-header { /* Wrapper for image header to make it clickable */
        /* Styles for the clickable area if different from .sidebar-scenario-image-header */
        /* This is now the .card-header */
    }
    
    .sidebar-scenario-link { /* This was for the whole card link, now header is the link/trigger */
        display: block;
        text-decoration: none;
    }

    .sidebar-scenario-management {
        padding: 10px 12px;
        background-color: rgba(10, 30, 60, 0.9); /* Slightly different from card bg for separation */
        border-top: 1px solid rgba(127, 216, 255, 0.15); /* Separator line */
        /* Styles for the content when expanded */
    }
    .sidebar-scenario-management.collapse { /* Bootstrap class for collapsible content */
        transition: height 0.35s ease;
    }
    .sidebar-scenario-management .form-control-sm {
        font-size: 0.85rem;
        background-color: rgba(0,0,0,0.3);
        border-color: #7fd8ff55;
        color: #fffbe7;
    }
    .sidebar-scenario-management .form-control-sm::placeholder {
        color: #a0b8d0;
    }
     .sidebar-scenario-management select.form-control-sm option {
        background-color: #0a1e3c;
        color: #fffbe7;
    }
    .sidebar-scenario-management .btn-sm {
        font-size: 0.8rem;
        padding: .2rem .4rem;
    }
    .sidebar-scenario-management .btn-xs { /* For accept/refuse buttons */
        font-size: 0.75rem;
        padding: .15rem .35rem;
        line-height: 1.2;
    }
     .sidebar-scenario-management .btn-outline-danger.btn-xs {
        color: #ff7b7b;
        border-color: #ff7b7b;
    }
    .sidebar-scenario-management .btn-outline-danger.btn-xs:hover {
        color: #fff;
        background-color: #dc3545;
        border-color: #dc3545;
    }

    .sidebar-scenario-management .management-sub-list {
        font-size: 0.85em;
        max-height: 80px; /* Limit height for scroll */
        overflow-y: auto;
        background-color: rgba(0,0,0,0.2);
        border-radius: 4px;
        padding: 5px;
    }
    .sidebar-scenario-management .management-sub-list .list-group-item {
        background-color: transparent;
        border: none;
        padding: 3px 5px;
        color: #c0dfff;
    }
    .sidebar-scenario-management .management-sub-list .list-group-item small.text-muted {
        color: #8ab4f8 !important; /* Lighter muted text for dark bg */
    }

    .sidebar-scenario-access-link { /* For non-owned scenarios in the panel */
        padding: 10px;
        background-color: rgba(10, 30, 60, 0.3);
    }
    .sidebar-scenario-access-link .btn-outline-primary {
        border-color: #7fd8ff;
        color: #7fd8ff;
    }
    .sidebar-scenario-access-link .btn-outline-primary:hover {
        background-color: #7fd8ff;
        color: #0a1e3c;
    }

    .sidebar-scenario-title {
        font-family: 'houstonville_regular', sans-serif; /* Existing font, good base */
        color: #ffffff;
        font-size: 1.8em; /* Slightly increased for prominence like image */
        text-shadow: 1px 1px 0px rgba(0,0,0,0.6), 
                     -1px -1px 0px rgba(0,0,0,0.6), 
                     1px -1px 0px rgba(0,0,0,0.6), 
                     -1px 1px 0px rgba(0,0,0,0.6),
                     0px 0px 8px rgba(0,0,0,0.7); /* Sharper, more defined shadow */
        position: relative; 
        z-index: 1;
        line-height: 1.2;
        display: flex; /* To align title and badge */
        align-items: center; /* Vertical alignment */
        width: 100%; /* Ensure it takes full width to center content if needed */
        justify-content: center; /* Center title and badge if header is flex */
        flex-wrap: wrap; /* Allow badge to wrap if title is too long */
    }
    .sidebar-scenario-title .badge.confidentiality-badge {
        font-family: 'EB Garamond', serif; /* Standard font for badge text */
        font-size: 0.45em; /* Relative to title's 1.8em, adjust for visual match */
        padding: 3px 7px;
        border-radius: 5px;
        margin-left: 8px; /* Space between title and badge */
        vertical-align: middle; /* Align badge with text */
        font-weight: bold;
        text-shadow: none; /* Badges usually don't have text shadow */
        line-height: 1; /* Ensure badge text is compact */
        /* Specific colors already defined by .confidentiality-public etc. */
    }
    /* Ensure the general confidentiality badge styles don't conflict too much, or override here */
    .sidebar-scenario-title .confidentiality-public { background-color: #28a745; color: white; }
    .sidebar-scenario-title .confidentiality-private { background-color: #dc3545; color: white; }
    .sidebar-scenario-title .confidentiality-unlisted { background-color: #6c757d; color: white; }


    #mes-univers-panel {
        background: linear-gradient(135deg, rgba(20,35,60,0.98) 0%, rgba(10,20,45,0.98) 100%);
        box-shadow: 0 0 24px #7fd8ff33, 2px 0 16px #7fd8ff22;
        border-radius: 16px;
        padding: 18px 12px 12px 12px;
        /* Optionnel : effet verre dépoli */
        backdrop-filter: blur(2px);
        /* Pour éviter que le fond ne déborde sur mobile */
        overflow: hidden;
    }

    #mes-univers-panel .card-header {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    transition: background 0.2s;
}
#mes-univers-panel .card-header:hover,
#mes-univers-panel .card-header:focus {
    background: rgba(127,216,255,0.08);
}
#mes-univers-panel .collapse:not(.show) {
    display: none;
}
#mes-univers-panel .collapse.show {
    display: block;
}
#mes-univers-panel .card-body {
    border-top: 1px solid #7fd8ff22;
    border-radius: 0 0 12px 12px;
    background: none;
    padding-top: 1.2rem;
}
#mes-univers-panel .scenario-card {
    margin-bottom: 18px;
    border-radius: 12px;
    overflow: hidden;
}
#mes-univers-panel .scenario-card-image-wrapper {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}
#mes-univers-panel .card-title {
    font-size: 1.3em;
    margin-bottom: 0;
}
#mes-univers-panel .scenario-card-creator-info-on-image {
    font-size: 1em;
}
#mes-univers-panel .card-body {
    padding: 1.2rem 1rem 1rem 1rem;
}
#mes-aventures-panel {
    background: linear-gradient(135deg, rgba(20,35,60,0.98) 0%, rgba(10,20,45,0.98) 100%);
    box-shadow: 0 0 24px #7fd8ff33, -2px 0 16px #7fd8ff22;
    border-radius: 16px;
    padding: 18px 12px 12px 12px;
    backdrop-filter: blur(2px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    max-height: 80vh;
}
#mes-aventures-panel-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
#mes-aventures-panel-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
#mes-aventures-panel .card {
    margin-bottom: 18px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(10, 20, 45, 0.92) !important;
    border: 1.5px solid rgba(127, 216, 255, 0.25);
    box-shadow: 0 0 18px #7fd8ff22, 0 0 10px #b2eaff22;
    color: #fffbe7;
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    cursor: pointer; /* Indique que la carte est cliquable */
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s, max-height 0.4s;
    overflow: hidden;
    max-height: 500px; /* Valeur par défaut, ajustée dynamiquement */
}
#mes-aventures-panel .card.collapsed {
    max-height: 160px; /* Hauteur pour ne montrer que l'image + titre */
    overflow: hidden;
}
#mes-aventures-panel .card-header {
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    border-radius: 12px 12px 0 0;
    transition: background 0.2s;
    display: flex;
    align-items: flex-end;
    position: relative;
}
#mes-aventures-panel .card-header:hover,
#mes-aventures-panel .card-header:focus {
    background: rgba(127,216,255,0.08);
}
#mes-aventures-panel .card.collapsed .card-body {
    display: none;
}
#mes-aventures-panel .card.collapsed .scenario-card-creator-info-on-image {
    margin-bottom: 10px;
}
#mes-aventures-panel .card-header .collapse-arrow {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 1.3em;
    color: #b2eaff;
    opacity: 0.8;
    transition: transform 0.3s;
    pointer-events: none;
}
#mes-aventures-panel .card.collapsed .card-header .collapse-arrow {
    transform: rotate(-90deg);
}
#mes-aventures-panel .card .card-header .collapse-arrow {
    transform: rotate(0deg);
}

/* Permettre le scroll indépendant de la colonne centrale "Toutes les aventures" sans scrollbars visibles */
@media (min-width: 992px) {
  .container-fluid > .row > .col-lg-6,
  .container-fluid > .row > .col-md-8 {
    height: 80vh;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
  }
  .container-fluid > .row > .col-lg-6::-webkit-scrollbar,
  .container-fluid > .row > .col-md-8::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
}

/* Pour éviter que le body/page entière ne scrolle, si besoin : */
html, body {
  height: 100%;
  overflow: hidden;
}

#mes-univers-panel,
#mes-aventures-panel {
    overflow: hidden;
    position: relative;
}

#mes-univers-panel > div,
#mes-aventures-panel > div,
#mes-univers-panel #accordionMesUnivers,
#mes-aventures-panel .card-list,
#mes-aventures-panel .card, /* fallback for direct children */
#mes-univers-panel .card-list,
#mes-univers-panel .card { /* fallback for direct children */
    /* Make the inner content scrollable if it overflows */
    overflow-y: auto;
    max-height: 75vh;
    /* Hide scrollbars for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
#mes-univers-panel > div::-webkit-scrollbar,
#mes-aventures-panel > div::-webkit-scrollbar,
#mes-univers-panel #accordionMesUnivers::-webkit-scrollbar,
#mes-aventures-panel .card-list::-webkit-scrollbar,
#mes-aventures-panel .card::-webkit-scrollbar,
#mes-univers-panel .card-list::-webkit-scrollbar,
#mes-univers-panel .card::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

#mes-aventures-panel .scenario-background {
    color: #e0f7fa;
    font-size: 1em;
    margin-bottom: 10px;
}
#mes-aventures-panel .btn-primary {
    background: linear-gradient(90deg, #7fd8ff 0%, #b2eaff 100%);
    color: #0a223a;
    border-radius: 8px;
    border: none;
    box-shadow: 0 0 10px #7fd8ff22;
    font-weight: bold;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
#mes-aventures-panel .btn-primary:hover {
    background: #b2eaff;
    color: #0a223a;
    box-shadow: 0 0 18px #7fd8ff88;
}
#mes-aventures-panel .confidentiality-badge {
    font-size: 0.4em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}
#mes-aventures-panel .confidentiality-public { background-color: #28a745; color: white; }
#mes-aventures-panel .confidentiality-private { background-color: #dc3545; color: white; }
#mes-aventures-panel .confidentiality-unlisted { background-color: #6c757d; color: white; }
#mes-aventures-panel .card-text.text-warning {
    color: #ffc107 !important;
}
#mes-aventures-panel .alert-secondary {
    background: rgba(127, 216, 255, 0.18);
    color: #0a223a;
    border: 1px solid #7fd8ff;
    border-radius: 8px;
    text-align: center;
    font-family: 'EB Garamond', serif;
    font-size: 1.1em;
    margin-bottom: 20px;
}
