#start-screen {
    position: absolute; /* Cambiado de fixed a absolute */
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: radial-gradient(circle, #222 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Un nivel por encima de los paneles UI */
    transition: opacity 0.6s ease, visibility 0.6s;
    text-align: center;
}

.start-content {
    padding: 20px;
    width: 80%;
    border-radius: 15px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

#start-screen h1 {
    color: var(--accent-glow);
    font-size: clamp(16px, 4vw, 24px); /* Se ajusta al tamaño del contenedor */
    margin-bottom: 5px;
}

.brand {
    font-weight: bold;
    color: #fff;
    font-size: clamp(10px, 3vw, 16px);
    margin: 0;
    opacity: 0.8;
}

.subtitle {
    color: #aaa;
    font-size: clamp(8px, 2.5vw, 12px);
    margin: 15px 0;
}

#start-btn {
    background: var(--accent-glow);
    color: #000;
    padding: 10px 30px;
    font-size: 16px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
    transition: all 0.3s ease;
}

#start-btn:hover {
    transform: scale(1.05);
    background: #fff;
    box-shadow: 0 0 25px var(--accent-glow);
}
    
        :root {
            --bg-color: #0a0a0a;
            --obj-color: #E6E6E6;
            --btn-bg: #E6E6E6;
            --btn-hover: #B3B3B3;
            --btn-text: #000000;
            --text-color: #ffffff;
            --accent-glow: #00f2ff;
        }
        body.inverted {
            --bg-color: #E6E6E6;
            --obj-color: #1C1C1C;
            --btn-bg: #1C1C1C;
            --btn-hover: #666666;
            --btn-text: #ffffff;
            --text-color: #000000;
        }
        #sim-wrapper { width: 100%; max-width: 800px; margin: 0 auto; position: relative; }
        #sim-container {
            width: 100%;
            aspect-ratio: 4 / 3;
            position: relative;
            background-color: var(--bg-color);
            overflow: hidden;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: var(--text-color);
            border: 1px solid rgba(255,255,255,0.1);
            touch-action: none;
        }
        canvas { width: 100%; height: 100%; display: block; }
        
        .ui-panel {
            position: absolute;
            padding: 10px;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(5px);
            border-radius: 15px;
            border: 1px solid rgba(0, 242, 255, 0.2);
            z-index: 100;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: auto;
        }
        .bottom-ui-column { 
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Espacio entre la fila de botones y el slider */
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 15px;
    border: 1px solid rgba(0, 242, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 999;
    min-width: 200px;
    pointer-events: auto;
}
        .bottom-ui { display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    pointer-events: auto;
        }
        .bottom-right-ui { bottom: 15px; right: 15px; flex-direction: column; gap: 5px; z-index:1000;}
        .vertical-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
        .top-left-ui { top: 15px; left: 15px; }
        .top-right-ui { top: 15px; right: 15px; }
        
        button {
            background: var(--btn-bg);
            color: var(--btn-text);
            border: 1px solid transparent;
            padding: 6px 10px;
            cursor: pointer;
            font-size: 9px;
            font-weight: bold;
            transition: all 0.3s ease;
            border-radius: 4px;
            outline: none;
        }
        button:hover { background: var(--btn-hover); }

        .active-btn { 
            box-shadow: 0 0 12px var(--accent-glow); 
            border: 1px solid var(--accent-glow);
            transform: scale(1.05);
        }

        label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }
        .mass-display { font-weight: bold; font-size: 10px; min-width: 85px; text-align: right; margin-right: 5px; }
        .pattern-btn { font-size: 10px; padding: 4px 8px; }
        #show-ui-btn { position: absolute; top: 10px; right: 10px; opacity: 0.5; padding: 5px; font-size: 14px; z-index: 200; }
        .hidden { display: none !important; }
        .footer-text { text-align: center; font-size: 10px; margin-top: 10px; color: #777; }
        hr { border: 0; border-top: 1px solid rgba(255,255,255,0.1); width: 100%; }
        
        #custom-mass, #custom-vy, #custom-vx{
    background: rgba(0, 0, 0, 0.5);
    color: #00f2ff;
    border: 1px solid #00f2ff;
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: 5px;
    outline: none;
}

#apply-custom-mass {
    background: var(--accent-glow);
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

#apply-custom-mass:hover {
    transform: scale(1.1);
    background: #fff;
}

/* Aseguramos que el input no se vea mal */
#custom-mass {
    background: #1a1a1a;
    color: #00f2ff;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 3px;
}

#custom-mass:focus 

#velocity-meter:not(.hidden) {
    display: block !important;
}

#velocity-meter {
    position: absolute; 
    display: none; /* Empezamos con display none */
    color: #00f2ff; 
    pointer-events: none; 
    font-family: 'Courier New', monospace; 
    font-weight: bold; 
    font-size: 14px;
    text-shadow: 2px 2px 4px #000; 
    z-index: 9999999 !important; /* Super por encima de todo */
    background: rgba(0,0,0,0.4);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,242,255,0.3);

}

.hidden {
    display: none !important;
}