@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Roboto+Mono:wght@400;700&display=swap');

/* ===== Splash screen ===== */
#splash{
    position:fixed;
    inset:0;                    /* top:0; right:0; bottom:0; left:0 */
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--bg-color);
    z-index:3000;               /* above every UI element */
    opacity:0;
    animation:
        splashFadeIn   1.6s   ease-out   0s   forwards,
        splashFadeOut  1.2s   ease-in    2.3s forwards;
}

/* Hide UI elements during splash screen */
.ui-container, #overlay, #scenarioInfoDisplay, #scenarioInfoBox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.0s ease-in, visibility 0s linear 1.0s;
    pointer-events: none;
}

/* Show UI elements after splash */
.ui-container.showUI, #overlay.showUI, #scenarioInfoDisplay.showUI, #scenarioInfoBox.showUI {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.0s ease-in, visibility 0s linear 0s;
    pointer-events: auto;
}

/* Ensure scenario info box is properly styled when shown with showUI class */
#scenarioInfoBox.showUI {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: scenarioInfoSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
#splash h1{
    margin:0;
    font-family:'Poppins',sans-serif;
    font-weight:600;
    font-size: clamp(4rem, 8vw, 8rem);
    letter-spacing:0.12em;
    color:var(--primary-color);
    text-shadow:0 0 25px var(--primary-color);
    opacity: 0;
    animation: logoFadeIn 1.0s ease-out 0.3s forwards;
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.0); }
}

/*  hidden until JS adds .showCanvas  */
#simulationCanvas, #starfieldCanvas {
    opacity:0;              /* fully transparent       */
    visibility:hidden;      /* not rendered at all     */
    transition:opacity 1.2s ease-in;  /* fade-in only */
}

/*  added by JS after splash is gone  */
#simulationCanvas.showCanvas, #starfieldCanvas.showCanvas {
    visibility:visible;     /* render now              */
    opacity:1;              /* and fade up to opaque   */
}


/* --- keyframes --- */
@keyframes splashFadeIn  { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
@keyframes splashFadeOut { 
    from { opacity: 1; } 
    to { opacity: 0; } 
}


:root {
    --bg-color: #0d0d1a;
    --text-color: #e0e0e0;
    --primary-color: #00aaff;
    --secondary-color: #ffaa00;
    --panel-bg: rgba(20, 20, 40, 0.95);
    --button-bg: #333;
    --button-hover-bg: #555;
    --button-apply-bg: #28a745;
    --button-apply-hover-bg: #218838;
    --separator-color: #00aaff80;
}

/* === layered canvases === */
.sim-canvas{
    position:fixed; inset:0;
    width:100%; height:100%;
    display:block;
}
#starfieldCanvas{ z-index:1; }   /* back-most */
#simulationCanvas{ z-index:2; }  /* front */


/* Responsive layout system */
html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure clean splash screen start */
html, body {
    background-color: var(--bg-color);
}

/* Main simulation container */
.simulation-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    opacity: 0;
    animation: fadeInSimulation 1.5s ease-out forwards;
}

@keyframes fadeInSimulation {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#simulationCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#starfieldCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#overlay {
    position: fixed;
    top: 10px;
    left: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #E0E0E0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    pointer-events: none;
    line-height: 1.6;
    z-index: 10;
    max-width: calc(100vw - 20px);
    word-wrap: break-word;
    opacity: 0;
    animation: fadeInOverlay 1.5s ease-out forwards;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Data panel styling improvements */
#overlay .category-label {
    font-weight: 600;
    color: #FFFFFF;
}

#overlay .important-stat {
    font-size: 15px;
    font-weight: 500;
}

#overlay .separator-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 8px 0;
    border-radius: 1px;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#scenarioInfoDisplay {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    padding: 10px 20px;
    background: var(--panel-bg);
    border: 1px solid var(--separator-color);
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.0s ease-in, visibility 0s linear 1.0s;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    animation: fadeInScenarioInfo 1.5s ease-out forwards;
}

@keyframes fadeInScenarioInfo {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 768px) {
    #overlay {
        top: 10px;
        left: 10px;
        font-size: 12px;
        max-width: calc(100vw - 20px);
        padding: 8px;
    }
    
    #overlay .important-stat {
        font-size: 13px;
    }
    
    #overlay .separator-line {
        margin: 6px 0;
    }
    
    #scenarioInfoDisplay {
        top: 10px;
        width: 95%;
        max-width: none;
        padding: 8px 16px;
    }
    
    #scenarioInfoDisplay h4 {
        font-size: 16px;
    }
    
    #scenarioInfoDisplay p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #overlay {
        top: 10px;
        left: 10px;
        font-size: 11px;
        max-width: calc(100vw - 20px);
        padding: 6px;
    }
    
    #overlay .important-stat {
        font-size: 12px;
    }
    
    #overlay .separator-line {
        margin: 4px 0;
    }
    
    #scenarioInfoDisplay {
        top: 5px;
        width: 98%;
        padding: 6px 12px;
    }
    
    #scenarioInfoDisplay h4 {
        font-size: 15px;
    }
    
    #scenarioInfoDisplay p {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    #overlay {
        top: 10px;
        left: 10px;
        font-size: 10px;
        max-width: calc(100vw - 20px);
        padding: 5px;
        line-height: 1.4;
    }
    
    #overlay .important-stat {
        font-size: 11px;
    }
    
    #overlay .separator-line {
        margin: 3px 0;
    }
}
#scenarioInfoDisplay.visible {
    opacity: 1;
}
#scenarioInfoDisplay h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 600;
}
#scenarioInfoDisplay p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
}

/* Object Inspector Modal */
#objectInspector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 0 0 40px rgba(0, 170, 255, 0.3);
    z-index: 2000;
    display: none;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    flex-direction: column;
}

#objectInspector.visible {
    display: flex !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

@keyframes inspectorFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 1px solid var(--separator-color);
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(0, 170, 255, 0.05));
    flex-shrink: 0;
}

.inspector-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.inspector-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inspector-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    transform: scale(1.1);
}

.inspector-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    line-height: 1.5;
}

/* Custom scrollbar for inspector */
.inspector-content::-webkit-scrollbar {
    width: 8px;
}

/* Stat row styles for object inspector */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
    font-size: 14px;
}

.object-description {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 170, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
}

.object-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.inspector-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.inspector-content::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.6);
    border-radius: 4px;
}

.inspector-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 170, 255, 0.8);
}

.inspector-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
}

.inspector-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    opacity: 0.7;
}

.inspector-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    opacity: 1;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.inspector-tab:hover {
    opacity: 1;
    background: rgba(0, 170, 255, 0.1);
}

.inspector-tab-content {
    display: none;
}

.inspector-tab-content.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(0, 170, 255, 0.08);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: rgba(0, 170, 255, 0.12);
    border-color: rgba(0, 170, 255, 0.4);
    transform: translateY(-2px);
}

.stat-card.highlight {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
}

.stat-card.warning {
    background: rgba(255, 69, 0, 0.1);
    border-color: rgba(255, 69, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--text-color);
    font-weight: 600;
}

.stat-large {
    grid-column: 1 / -1;
}

.stat-large .stat-value {
    font-size: 16px;
}

.object-description {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(0, 170, 255, 0.05));
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.object-icon {
    font-size: 28px;
    margin-right: 12px;
}

/* Mobile responsive inspector */
@media (max-width: 768px) {
    #objectInspector {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        top: 5%;
        left: 2.5%;
        transform: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .inspector-header {
        padding: 15px 20px 12px 20px;
    }
    
    .inspector-title {
        font-size: 18px;
    }
    
    .inspector-content {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    #objectInspector {
        width: 98%;
        max-height: 95vh;
        top: 2.5%;
        left: 1%;
        border-radius: 12px;
    }
    
    .inspector-header {
        padding: 12px 16px;
    }
    
    .inspector-title {
        font-size: 16px;
    }
    
    .inspector-content {
        padding: 12px 16px;
    }
    
    .stats-grid {
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
}


/* Responsive UI Container */
.ui-container {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    max-width: calc(100vw - 30px);
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUI 1.5s ease-out forwards;
}

@keyframes fadeInUI {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide mobile instructions by default on desktop */
#mobileInstructions {
    display: none;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .ui-container {
        gap: 8px;
    }
    
    .ui-button {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 36px;
}

    .speed-controls {
        padding: 8px 10px;
    }
    
    .speed-btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
        min-width: 55px;
        min-height: 32px;
    }
}

@media (max-width: 768px) {
    .ui-container {
        top: 10px;
        right: 10px;
        left: 10px;
        gap: 8px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: flex-start;
    }
    
    .ui-button {
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-height: 40px; /* Reduced from 44px for better mobile fit */
        flex: 0 0 auto;
        min-width: 80px;
        border-radius: 8px !important;
    }
    
    .speed-controls {
        padding: 8px 12px;
        order: -1;
        flex: 1 1 auto;
        justify-content: center;
    }
    
    .speed-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
        min-width: 70px;
        min-height: 36px;
    }
    
    #settingsPanel {
        width: 95%;
        max-width: none;
        height: 95vh;
        max-height: none;
        top: 2.5%;
        left: 2.5%;
        transform: none;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px 20px;
    }
    
    .setting-label {
        justify-self: start;
        text-align: left;
    }
    
    #mobileInstructions {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(13, 13, 26, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(0, 170, 255, 0.3);
        border-radius: 15px;
        padding: 20px;
        z-index: 2000;
        max-width: 300px;
        text-align: center;
    }
    
    .mobile-instructions-content h3 {
        margin: 0 0 15px 0;
        color: var(--primary-color);
        font-size: 18px;
    }
    
    .mobile-instructions-content p {
        margin: 8px 0;
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .ui-container {
        top: 5px;
        right: 5px;
        left: 5px;
        gap: 6px;
    }
    
    .ui-button {
        padding: 8px 10px !important;
        font-size: 11px !important;
        min-width: 70px;
        min-height: 36px;
        border-radius: 6px !important;
    }
    
    .speed-controls {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .speed-btn {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-width: 60px;
        min-height: 32px;
    }
    
    .speed-display {
        font-size: 12px;
        min-width: 40px;
    }
    
    #settingsPanel {
        width: 98%;
        height: 98vh;
        top: 1%;
        left: 1%;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .ui-container {
        top: 3px;
        right: 3px;
        left: 3px;
        gap: 4px;
    }
    
    .ui-button {
        padding: 6px 8px !important;
        font-size: 10px !important;
        min-width: 60px;
        min-height: 32px;
        border-radius: 5px !important;
    }
    
    .speed-controls {
        padding: 4px 8px;
        gap: 4px;
    }
    
    .speed-btn {
        padding: 4px 8px !important;
        font-size: 9px !important;
        min-width: 50px;
        min-height: 28px;
    }
    
    .speed-display {
        font-size: 10px;
        min-width: 35px;
    }
    
    .settings-header {
        padding: 20px 25px;
        font-size: 24px;
    }
    
    .settings-content {
        padding: 20px 25px;
    }
}

.ui-button {
    padding: 8px 16px;
    background-color: var(--button-bg);
    color: var(--text-color);
    border: 1px solid #666;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.ui-button:hover {
    background-color: var(--button-hover-bg);
}
.ui-button:active {
    transform: scale(0.98);
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 20, 40, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 170, 255, 0.3);
}

.speed-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 60px;
}

.speed-display {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    min-width: 50px;
    text-align: center;
    font-weight: bold;
}

#settingsPanel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 850px;
    background: rgba(13, 13, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1200px) {
    #settingsPanel {
        width: 92%;
        max-width: 700px;
        height: 88vh;
    }
}

@media (max-width: 768px) {
    #settingsPanel {
        width: 95%;
        max-width: none;
        height: 95vh;
        max-height: none;
        top: 2.5%;
        left: 2.5%;
        transform: none;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    #settingsPanel {
        width: 98%;
        height: 98vh;
        top: 1%;
        left: 1%;
        border-radius: 12px;
    }
}

#settingsPanel.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    pointer-events: none;
    filter: blur(10px);
}

.settings-header {
    padding: 25px 30px;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(0, 170, 255, 0.05));
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 20px 20px 0 0;
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.settings-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px 35px;
    background: rgba(0, 0, 0, 0.1);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px 35px;
    align-items: center;
}

@media (max-width: 1200px) {
    .settings-grid {
        gap: 20px 25px;
    }
}

@media (max-width: 768px) {
    .settings-grid {
        gap: 15px 20px;
    }
    
    .setting-label {
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .settings-grid {
        gap: 12px 15px;
    }
}

.setting-item, .setting-special-button {
    display: contents;
}

.setting-label {
    justify-self: end;
    text-align: right;
    font-size: 15px;
    color: rgba(224, 224, 224, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-control input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(90deg, rgba(0, 170, 255, 0.3), rgba(0, 170, 255, 0.1));
    border-radius: 10px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.setting-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), #0088cc);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 2px 8px rgba(0, 170, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}
.setting-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 
        0 4px 12px rgba(0, 170, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.setting-control .value-display {
    min-width: 60px;
    text-align: left;
    font-family: 'Roboto Mono', monospace;
    color: rgba(224, 224, 224, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.setting-control select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(34, 34, 34, 0.92);
    border: 1.5px solid rgba(0, 170, 255, 0.25);
    color: var(--text-color);
    border-radius: 10px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.setting-control select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.18);
    background: rgba(44, 44, 64, 0.98);
}

.setting-control select:hover {
    background: rgba(44, 44, 64, 0.98);
    border-color: rgba(0, 170, 255, 0.45);
}

/* Custom arrow for select (optional, for modern look) */
.setting-control select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2300aaff" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

/* Style dropdown options (limited support, but improves look on some browsers) */
.setting-control select option {
    border-radius: 8px;
    padding: 8px 14px;
    background: #23233a;
    color: #fff;
    font-size: 15px;
    transition: background 0.18s;
}

.setting-control select option:checked,
.setting-control select option:focus,
.setting-control select option:active {
    background: #00aaff;
    color: #fff;
}

/* For browsers that support option:hover */
.setting-control select option:hover {
    background: #2e2e4d;
    color: #fff;
}

.setting-control input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 50px;
    height: 30px;
    background-color: transparent;
    border: 2px solid rgba(0, 170, 255, 0.3);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.setting-control input[type="color"]:hover {
    border-color: rgba(0, 170, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.setting-control input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: none;
}

.setting-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}
.setting-separator h3 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 18px;
    white-space: nowrap;
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.5);
}
.setting-separator .line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--separator-color), transparent);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.settings-footer {
    padding: 25px 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.05), rgba(0, 170, 255, 0.1));
    border-top: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 0 0 20px 20px;
}

.footer-button {
    padding: 12px 28px;
    font-size: 16px;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.footer-button:hover {
    background: rgba(50, 50, 50, 0.9);
    border-color: rgba(0, 170, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
#settingsApply { 
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.8), rgba(40, 167, 69, 0.6));
    border-color: rgba(40, 167, 69, 0.4);
}
#settingsApply:hover { 
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(40, 167, 69, 0.7));
    border-color: rgba(40, 167, 69, 0.6);
}

#bhMassesModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    background-color: var(--panel-bg);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

#bhMassesModal.hidden { display: none; }
.bh-masses-header { text-align: center; padding: 15px; font-size: 20px; color: var(--primary-color); }
.bh-masses-content { 
    padding: 20px 30px; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    max-height: 50vh; 
    overflow-y: auto; 
}
.bh-mass-item { 
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 15px;
}
.bh-mass-item label {
    justify-self: end;
    text-align: right;
}
.bh-mass-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bh-mass-control input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: #444;
    border-radius: 5px;
    outline: none;
}
.bh-mass-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}
.bh-mass-control .value-display {
    min-width: 60px;
    text-align: left;
    font-family: 'Roboto Mono', monospace;
}
.bh-masses-footer { padding: 15px; text-align: center; }

/* --- Preset title / summary box --- */
.preset-info{
    margin:18px 0 10px;
    padding:12px 16px;
    background:rgba(0,0,0,.25);
    border:1px solid var(--separator-color);
    border-radius:6px;
    font-size:14px;
    line-height:1.4;
}
.preset-info h4{
    margin:0 0 4px;
    font-size:17px;
    color:var(--primary-color);
}

/* --- Preset Scenario Dropdown Custom Styles --- */
#settingsGrid select,
.settings-grid select,
.setting-control select {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1.5px solid rgba(0,170,255,0.25);
  background: rgba(34, 34, 44, 0.95);
  color: #e0e0e0;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

#settingsGrid select:focus,
.settings-grid select:focus,
.setting-control select:focus {
  border-color: #00aaff;
  box-shadow: 0 0 0 2px rgba(0,170,255,0.18);
  background: rgba(34, 34, 64, 1);
}

#settingsGrid select:hover,
.settings-grid select:hover,
.setting-control select:hover {
  background: rgba(44, 44, 64, 1);
  border-color: #00aaff;
}

/* Option hover/focus workaround for modern browsers */
#settingsGrid select option:checked,
.settings-grid select option:checked,
.setting-control select option:checked {
  background: #1e293b;
  color: #fff;
}

/* For browsers that support it, highlight hovered option */
#settingsGrid select option:hover,
.settings-grid select option:hover,
.setting-control select option:hover {
  background: #2563eb !important;
  color: #fff !important;
}

/* Add a dropdown arrow (optional, for style) */
#settingsGrid select,
.settings-grid select,
.setting-control select {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23e0e0e0" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 38px;
}

/* Scenario List Modal Styles */
#scenarioListModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(13,13,26,0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-out, visibility 0s linear 0.5s;
}
#scenarioListModal:not(.hidden) {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease-out, visibility 0s linear 0s;
  animation: scenarioMenuFadeIn 0.5s ease-out;
}
#scenarioListContent {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 8px 32px rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.2);
  padding: 40px 32px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  color: #fff;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
#scenarioListContent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.05) 0%, rgba(0, 242, 254, 0.05) 100%);
  border-radius: 20px;
  pointer-events: none;
}
.scenario-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(79, 172, 254, 0.3);
  position: relative;
}

.scenario-list-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 1px;
}

.scenario-list-header h3 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  text-shadow: 0 0 30px rgba(79, 172, 254, 0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: calc(100% - 60px);
  line-height: 1.3;
}

#closeScenarioList {
  font-size: 1.4em;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: fixed;
  top: 40px;
  right: calc(50% - 45vw + 32px);
  flex-shrink: 0;
  z-index: 1002;
}

#closeScenarioList:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
#scenarioListItems {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

/* Custom scrollbar styling for WebKit browsers */
#scenarioListItems::-webkit-scrollbar {
  width: 6px;
}

#scenarioListItems::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

#scenarioListItems::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
  transition: background 0.2s ease;
}

#scenarioListItems::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* Custom scrollbar styling for main scenario list content */
#scenarioListContent::-webkit-scrollbar {
  width: 6px;
}

#scenarioListContent::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

#scenarioListContent::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
  transition: background 0.2s ease;
}

#scenarioListContent::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.scenario-list-item {
  cursor: pointer;
  padding: 16px;
  background: linear-gradient(135deg, #1e1e3f 0%, #3a3a5c 100%);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.3s ease-in-out;
  position: relative;
  border: 1px solid rgba(79, 172, 254, 0.1);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(10px);
  animation: scenarioCardFadeIn 0.6s ease-out forwards;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.scenario-list-item:last-child {
  margin-bottom: 0;
}

.scenario-list-item:hover, .scenario-list-item:focus {
  transform: scale(1.02);
  background: linear-gradient(135deg, #2a2a4f 0%, #4a4a6c 100%);
  box-shadow: 
    0 8px 25px rgba(0,0,0,0.3),
    0 4px 12px rgba(79, 172, 254, 0.2),
    0 0 20px rgba(79, 172, 254, 0.1);
  border-color: rgba(79, 172, 254, 0.3);
  outline: none;
}

.scenario-list-item:active {
  transform: scale(1.01);
  background: linear-gradient(135deg, #252545 0%, #424262 100%);
  box-shadow: 
    0 4px 15px rgba(0,0,0,0.3),
    0 2px 8px rgba(79, 172, 254, 0.15);
}

/* Scenario card containers */
.scenario-title {
  margin-bottom: 0.75rem;
}

.scenario-title strong {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  overflow: hidden;
}

.scenario-title span {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #888888;
  line-height: 1.4;
  display: block;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scenario-separator {
  margin: 8px 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(79, 172, 254, 0.3) 20%, rgba(79, 172, 254, 0.5) 50%, rgba(79, 172, 254, 0.3) 80%, transparent 100%);
  opacity: 0.7;
  width: 100%;
}

.scenario-description {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.scenario-description span {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #cccccc;
  line-height: 1.5;
  display: block;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Responsive typography */
@media (max-width: 768px) {
  .scenario-list-item {
    padding: 16px;
    margin-bottom: 8px;
  }
  
  .scenario-title strong {
    font-size: 18px;
    margin-bottom: 0.4rem;
    line-height: 1.5;
  }

  .scenario-title span {
    font-size: 12px;
    line-height: 1.4;
  }

  .scenario-separator {
    margin: 6px 0;
    opacity: 0.6;
  }

  .scenario-description span {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  .scenario-list-item {
    padding: 16px;
    margin-bottom: 8px;
  }
  
  .scenario-title strong {
    font-size: 18px;
    margin-bottom: 0.35rem;
    line-height: 1.5;
  }
  
  .scenario-title span {
    font-size: 12px;
    line-height: 1.4;
  }

  .scenario-separator {
    margin: 5px 0;
    opacity: 0.5;
  }

  .scenario-description span {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .scenario-list-item {
    padding: 14px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .scenario-title strong {
    font-size: 18px;
    margin-bottom: 0.3rem;
    line-height: 1.5;
  }

  .scenario-title span {
    font-size: 12px;
    line-height: 1.4;
  }

  .scenario-separator {
    margin: 4px 0;
    opacity: 0.4;
  }

  .scenario-description span {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .scenario-list-item {
    padding: 12px;
    margin-bottom: 4px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .scenario-title strong {
    font-size: 18px;
    margin-bottom: 0.25rem;
    line-height: 1.5;
  }

  .scenario-title span {
    font-size: 12px;
    line-height: 1.4;
  }

  .scenario-separator {
    margin: 3px 0;
    opacity: 0.3;
  }

  .scenario-description span {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow: hidden;
  }
}
#closeScenarioList {
  background: #23233a;
  color: #fff;
  border: none;
    border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, transform 0.18s;
}
#closeScenarioList:hover {
  background: #2e2e4d;
  transform: scale(1.08);
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes scenarioMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scenarioCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  #scenarioListContent {
    min-width: 0;
    width: 95vw;
    padding: 1.5rem 1.25rem;
    max-height: 90vh;
    border-radius: 16px;
}

  #closeScenarioList {
    top: 24px;
    right: calc(50% - 47.5vw + 20px);
  }

  .scenario-list-header h3 {
    font-size: 1.3rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: calc(100% - 60px);
    line-height: 1.3;
  }

  .scenario-list-item {
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
  }

  #scenarioListItems {
    gap: 8px;
  }
}

@media (max-width: 600px) {
  #scenarioListContent {
    width: 100vw;
    padding: 1rem 0.75rem;
    border-radius: 12px;
    max-height: 95vh;
    margin: 0;
  }

  #closeScenarioList {
    top: 16px;
    right: 12px;
  }

  .scenario-list-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
    
  .scenario-list-header h3 {
    font-size: 1.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: calc(100% - 60px);
    line-height: 1.3;
  }
    
  .scenario-list-item {
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
  }
    
  #scenarioListItems {
    gap: 8px;
    width: 100%;
  }
}

@media (max-width: 480px) {
  #scenarioListContent {
    width: 100vw;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    max-height: 98vh;
    margin: 0;
  }

  #closeScenarioList {
    top: 12px;
    right: 8px;
  }
  
  .scenario-list-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .scenario-list-header h3 {
    font-size: 1.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: calc(100% - 60px);
    line-height: 1.3;
  }

  .scenario-list-item {
    padding: 14px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
  }
  
  #scenarioListItems {
    gap: 6px;
    width: 100%;
  }
}

@media (max-width: 360px) {
  #scenarioListContent {
    width: 100vw;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    max-height: 100vh;
    margin: 0;
  }

  #closeScenarioList {
    top: 8px;
    right: 4px;
  }
  
  .scenario-list-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
  }

  .scenario-list-header h3 {
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: calc(100% - 60px);
    line-height: 1.3;
  }

  .scenario-list-item {
    padding: 12px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
  }
  
  #scenarioListItems {
    gap: 4px;
    width: 100%;
  }
}

/* Enhanced Scenario Info Box Styles */
.scenario-info-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
        opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
    }

/* Ensure close button is always clickable when parent is visible */
.scenario-info-box.show .scenario-info-close {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.scenario-info-box.show {
        opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: scenarioInfoSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario-info-box.show .scenario-info-close {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.scenario-info-content {
  background: var(--panel-bg);
  border: 1px solid var(--separator-color);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  width: 95%;
  max-width: 900px;
  position: relative;
  text-align: left;
}



.scenario-info-header {
    display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  position: relative;
}

.scenario-info-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: calc(100% - 50px);
  line-height: 1.3;
}

.scenario-info-close {
  background: none !important;
  border: none !important;
  color: var(--text-color) !important;
  font-size: 18px !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  transform: none !important;
  text-shadow: none !important;
  font-weight: normal !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  display: inline-block !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 1001 !important;
  pointer-events: auto !important;
  flex-shrink: 0 !important;
}

.scenario-info-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: var(--primary-color) !important;
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.3) !important;
  transform: scale(1.1) !important;
  text-shadow: none !important;
}

.scenario-info-close:active {
  background: rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important;
  transform: none !important;
  text-shadow: none !important;
}

.scenario-info-close:focus {
  outline: 2px solid var(--primary-color) !important;
  outline-offset: 2px !important;
}

.scenario-info-body {
    color: var(--text-color);
  line-height: 1.4;
  text-align: left;
}

.scenario-info-body p {
  margin: 0 0 8px 0;
    font-size: 14px;
  color: var(--text-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  line-height: 1.5;
  overflow: hidden;
  text-align: left;
}

.scenario-info-details {
  margin-top: 8px;
}

.scenario-info-key {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
    font-size: 14px;
}

.scenario-info-details ul {
    margin: 0;
  padding-left: 16px;
  list-style: none;
}

.scenario-info-details li {
  margin: 2px 0;
  padding-left: 12px;
  position: relative;
    color: var(--text-color);
    font-size: 13px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  line-height: 1.4;
  overflow: hidden;
}

.scenario-info-details li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

@keyframes scenarioInfoSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 768px) {
  .scenario-info-box {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    }
    
  .scenario-info-content {
    width: 95%;
    max-width: none;
    padding: 8px 16px;
    }
    
  .scenario-info-header h3 {
    font-size: 16px;
    }
    
  .scenario-info-body p {
        font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    line-height: 1.5;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .scenario-info-box {
    top: 5px;
    left: 5px;
    right: 5px;
    }
    
  .scenario-info-content {
    width: 98%;
    padding: 6px 12px;
  }
  
  .scenario-info-header h3 {
    font-size: 15px;
  }
  
  .scenario-info-body p {
        font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    line-height: 1.5;
    overflow: hidden;
  }
  
  .scenario-info-details li {
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    line-height: 1.4;
    overflow: hidden;
    }
} 

/* ===== Settings Info Icons ===== */
.setting-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
}

.setting-info-icon:hover {
  background: linear-gradient(135deg, #3a8be8 0%, #00d0e0 100%);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 255, 255, 0.3);
}

.setting-info-icon:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.setting-info-icon:focus {
  outline: 2px solid #00aaff;
  outline-offset: 2px;
}

.setting-label-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-label {
  flex: 1;
}

/* Responsive adjustments for info icons */
@media (max-width: 768px) {
  .setting-info-icon {
    width: 16px;
    height: 16px;
    font-size: 11px;
    margin-left: 6px;
  }
}

@media (max-width: 480px) {
  .setting-info-icon {
    width: 15px;
    height: 15px;
    font-size: 10px;
    margin-left: 4px;
  }
}