html {
    font-size: clamp(10.2px, 0.765vw, 13.6px);
}






body {
            margin: 0;
            overflow: hidden;
            font-family: 'Segoe UI', 'Arial', sans-serif;
            color: white;
        }

        /* Fondo con estrellas animadas (CSS) */
        #stars-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -2;
            background: radial-gradient(ellipse at center, #0a0a2a 0%, #000000 100%);
        }
        .star {
            position: absolute;
            background-color: white;
            border-radius: 50%;
            opacity: 0.8;
            animation: twinkle 3s infinite alternate;
        }
        @keyframes twinkle {
            0% { opacity: 0.2; transform: scale(1);}
            100% { opacity: 1; transform: scale(1.2);}
        }

        /* UI principal */
        #ui-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none; /* Para permitir clics en el canvas 3D */
        }
        .panel {
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(12px);
            border-radius: 20px;
            border: 1px solid rgba(255,255,255,0.2);
            padding: clamp(10px, 1vw, 20px);
            margin: clamp(5px, 1vw, 20px);
            pointer-events: auto;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            touch-action: none;
        }
        .panel:hover {
            background: rgba(0, 0, 0, 0.9);
            border-color: rgba(255,215,0,0.4);
        }

        /* Header con título y botón volver */
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }
        h1 {
            margin: 0;
            font-size: clamp(1.1rem, 2vw, 2rem);
            text-shadow: 0 0 10px rgba(0,255,255,0.5);
            letter-spacing: 1px;
        }
        .back-btn {
            background: rgba(255,255,255,0.15);
            border: none;
            color: white;
            padding: 8px 20px;
            border-radius: 40px;
            cursor: pointer;
            font-weight: bold;
            transition: 0.2s;
            font-size: 1rem;
        }
        .back-btn:hover {
            background: rgba(255,215,0,0.8);
            color: black;
            transform: scale(1.02);
        }

        /* Layout de dos columnas */
        .star-info {
            position: absolute;
            top: 100px;
            left: 20px;
            width: clamp(204px, 18.7vw, 272px);
            max-width: calc(100% - 40px);
            max-height: 70vh;
            overflow-y: auto;
            font-size: 0.9rem;
        }
        .star-info h2 {
            margin-top: 0;
            border-bottom: 1px solid gold;
            display: inline-block;
        }
        .info-grid {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 8px;
            margin: 10px 0;
        }
        .info-label {
            font-weight: bold;
            color: #ffd966;
        }
        .special-badge, .fact-item {
            background: rgba(100,100,200,0.3);
            border-radius: 12px;
            padding: 4px 10px;
            display: inline-block;
            margin: 4px 4px 0 0;
            font-size: 0.8rem;
        }

        /* Lista de planetas (abajo) */
        .planets-list {
            position: absolute;
            bottom: 20px;
            left: 400px; ;
            right: 20px;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(12px);
            border-radius: 20px;
            padding: 15px;
            pointer-events: auto;
            overflow-x: auto;
            white-space: nowrap;
            scrollbar-width: thin;
        }
        .planets-list h3 {
            margin: 0 0 10px 0;
            display: inline-block;
        }
        .planets-scroll {
            display: flex;
            gap: 15px;
            overflow-x: auto;
            padding-bottom: 10px;
        }
        .planet-card {
            background: rgba(20,20,40,0.9);
            border-radius: 16px;
            padding: 12px;
            min-width: 153px;
            width: 153px;
            display: inline-block;
            cursor: pointer;
            transition: transform 0.2s, border 0.2s;
            border: 1px solid rgba(255,255,255,0.2);
            text-align: center;
        }
        .planet-card:hover {
            transform: translateY(-5px);
            border-color: #ffaa44;
            background: rgba(30,30,60,0.95);
        }
        .habit-bar {
            background: #333;
            border-radius: 10px;
            height: 8px;
            width: 100%;
            margin: 8px 0;
            overflow: hidden;
        }
        .habit-fill {
            background: linear-gradient(90deg, #2ecc71, #f1c40f);
            height: 100%;
            border-radius: 10px;
            width: 0%;
        }
        .planet-name {
            font-weight: bold;
            font-size: 1.1rem;
        }
        .planet-type {
            font-size: 0.7rem;
            opacity: 0.8;
        }

        /* Modal flotante al hacer clic en planeta */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            pointer-events: auto;
            backdrop-filter: blur(5px);
        }
        .modal-content {
            background: #0a0a1f;
            border-radius: 28px;
            padding: 24px;
            max-width: 450px;
            width: 90%;
            max-height: 80%;
            overflow-y: auto;
            border: 1px solid gold;
            box-shadow: 0 0 30px rgba(0,0,0,0.8);
        }
        .modal-content h3 {
            margin-top: 0;
            color: #ffaa66;
        }
        .close-modal {
            float: right;
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            color: white;
        }
        .modal-info-grid {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 8px;
            margin: 15px 0;
        }

        /* Responsive */
        @media (max-width: 900px) {

    .panel {
        margin: 8px;
        border-radius: 12px;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .star-info {
        position: relative;
        width: auto;
        left: auto;
        top: auto;
        max-height: none;
    }

    .planets-list {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 10px;
    }

    .planet-card {
        min-width: 140px;
        width: 140px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

}
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: #111;
        }
        ::-webkit-scrollbar-thumb {
            background: #ffaa44;
            border-radius: 5px;
        }
        
        .art-switch{
    position:relative;
    display:inline-block;
    width:119px;
    height:51px;
    cursor:pointer;
}

.art-switch input{
    opacity:0;
    width:0;
    height:0;
}

.art-switch .slider{

    position:absolute;
    inset:0;

    background:linear-gradient(145deg,#1d1d24,#121218);

    border-radius:50px;

    box-shadow:
        inset 5px 5px 10px #0a0a0d,
        inset -5px -5px 10px #22222b,
        0 0 0 2px #333344;

    transition:.5s;

}

.art-switch .slider::before{

    content:"";

    position:absolute;

    width:40.8px;
    height:40.8px;

    left:5.1px;
    bottom:5.1px;

    border-radius:50px;

    background:
        linear-gradient(
            135deg,
            #ff416c,
            #ff4b2b
        );

    transition:.5s;

}

.art-switch .slider::after{

    content:"ART";

    position:absolute;

    right:15.3px;

    top:50%;

    transform:translateY(-50%);

    color:#777;

    font-weight:bold;

}

.art-switch input:checked + .slider::before{

    transform:translateX(68px);

    background:

        linear-gradient(

            135deg,

            #00b4db,

            #0083b0

        );

}

.art-switch input:checked + .slider::after{

    content:"REAL";

    left:15.3px;

    right:auto;

    color:#00b4db;

}
/* ===================================
   CABECERA DE PANELES
   =================================== */

.panel-header{

    display:flex;
    align-items:center;
    gap:10px;

    cursor:move;

    user-select:none;

    margin-bottom:10px;
    touch-action: none;
}

.panel-toggle{

    background:none;
    border:none;

    color:white;

    font-size:1.2rem;

    cursor:pointer;

}

/* ===================================
   PANEL COLAPSADO
   =================================== */

.panel.collapsed{

    width:auto !important;
    min-width:auto !important;

    padding:8px 12px;

}

.panel.collapsed .panel-content{

    display:none;

}

.panel.collapsed .panel-header{

    margin-bottom:0;

}
.panel-header {
    user-select: none;
    touch-action: none;
}

.panel {
    will-change: transform;
}
.panel.collapsed {

    width: fit-content !important;

    min-width: 0 !important;

}

.panel.collapsed.planets-list {

    right: auto !important;

}
/* Ajuste de posición inicial para móviles */
@media (max-width: 900px) {
    #star-info-panel {
        top:105px !important;
        bottom: 0px !important; /* Ajusta este valor para subirlos/bajarlos */
        left: 20px !important;
        right: 10px !important;
    }
    
    #planets-list-container {
        top: 100px !important;
        bottom: auto !important; 
        left: 20px !important;
        right: 10px !important;
    }
}
/* Asegura que el contenedor de la UI esté por encima del canvas */
#ui-container {
    z-index: 10;
}

/* Opcional: evita que el navegador interfiera con el arrastre en móvil */
.panel-header {
    touch-action: none;
}

/* ===================================
   MINI SWITCH (zonas)
   =================================== */
.mini-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    cursor: pointer;
}

.mini-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mini-slider {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #1d1d24, #121218);
    border-radius: 50px;
    box-shadow:
        inset 2px 2px 4px #0a0a0d,
        inset -2px -2px 4px #22222b,
        0 0 0 1px #333344;
    transition: .4s;
}

.mini-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: #555;
    transition: .4s;
}

.mini-switch input:checked + .mini-slider.tidal::before {
    transform: translateX(20px);
    background: linear-gradient(135deg, #4488ff, #2266cc);
    box-shadow: 0 0 6px rgba(68, 136, 255, 0.6);
}

.mini-switch input:checked + .mini-slider.goldilocks::before {
    transform: translateX(20px);
    background: linear-gradient(135deg, #44dd66, #22aa44);
    box-shadow: 0 0 6px rgba(68, 221, 102, 0.6);
}

.mini-switch input:checked + .mini-slider.tidal {
    box-shadow:
        inset 2px 2px 4px #0a0a0d,
        inset -2px -2px 4px #22222b,
        0 0 0 1px #4488ff;
}

.mini-switch input:checked + .mini-slider.goldilocks {
    box-shadow:
        inset 2px 2px 4px #0a0a0d,
        inset -2px -2px 4px #22222b,
        0 0 0 1px #44dd66;
}

.mini-switch input:checked + .mini-slider.neutral::before {
    transform: translateX(20px);
    background: linear-gradient(135deg, #aaaaaa, #888888);
    box-shadow: 0 0 6px rgba(170, 170, 170, 0.6);
}

.mini-switch input:checked + .mini-slider.neutral {
    box-shadow:
        inset 2px 2px 4px #0a0a0d,
        inset -2px -2px 4px #22222b,
        0 0 0 1px #aaaaaa;
}