* {
    box-sizing: border-box;
}

body {
    background: #080911;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    margin: 0;
    padding: 20px 15px;
    min-height: 100vh;
    overflow-x: hidden;
    perspective: 1000px;
}

/* Fondo resplandeciente */
.glow-volcanico {
    position: fixed;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.25) 0%, rgba(230, 126, 34, 0.08) 50%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Partículas flotantes */
.contenedor-cenizas-3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.brasa {
    position: absolute;
    bottom: -10px;
    background: radial-gradient(circle, #ff9f43, #ff5252);
    border-radius: 50%;
    box-shadow: 0 0 10px #ff5252;
    animation: flotar 6s infinite linear;
    opacity: 0.8;
}

@keyframes flotar {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-105vh) rotate(360deg); opacity: 0; }
}

/* Tarjeta Principal en 3D */
.contenedor-principal-3d {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 10px auto;
    padding: 25px;
    background: rgba(18, 22, 36, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 2px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 87, 34, 0.25);
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

/* Titular Neón 3D */
.titulo-portada-3d {
    font-family: 'Righteous', cursive;
    font-size: 42px;
    margin: 0;
    background: linear-gradient(180deg, #ffffff 0%, #ff7f50 40%, #ff3838 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px rgba(255, 87, 34, 0.8));
    letter-spacing: 2px;
}

.subtitulo-portada-3d {
    font-family: 'Righteous', cursive;
    font-size: 20px;
    color: #feca57;
    text-shadow: 0 0 12px rgba(254, 202, 87, 0.6);
    margin-top: 6px;
    letter-spacing: 1.5px;
}

/* Ficha Académica estilo Cristal 3D */
.tarjeta-creditos-3d {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1.5px solid rgba(0, 210, 211, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(0, 210, 211, 0.15);
    border-radius: 18px;
    padding: 18px 22px;
    margin: 20px auto 10px;
    transform: translateZ(30px);
}

.institucion-badge-3d {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, #00d2d3, #48dbfb);
    color: #03131a;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 12px;
    box-shadow: 0 5px 15px rgba(0, 210, 211, 0.4);
}

.detalles-creditos {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-credito {
    font-size: 16px;
}

.etiqueta { color: #c8d6e5; font-weight: 600; }
.valor { font-weight: 800; }
.highlight-estudiante { color: #ff9f43; text-shadow: 0 0 10px rgba(255, 159, 67, 0.5); }
.highlight-docente { color: #54a0ff; }

.seccion-personalizar h3, .seccion-dificultad h2 {
    font-family: 'Righteous', cursive;
    color: #48dbfb;
    font-size: 20px;
}

/* Botones de Colores en 3D */
.paleta-colores-3d {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 18px 0;
}

.btn-color-3d {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--c);
    border: 3px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.5), 0 0 12px var(--c);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-color-3d:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.5), 0 0 20px var(--c);
}

.btn-color-3d.activo {
    transform: translateY(3px) scale(1.1);
    border: 4px solid #ffffff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 25px var(--c);
}

.divisor-brillante {
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff6b6b, #48dbfb, transparent);
    margin: 24px 0;
}

/* Botones de Dificultad / Modo de Juego */
.grupo-botones-3d {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-dificultad-3d {
    font-family: 'Righteous', cursive;
    font-size: 16px;
    color: #ffffff;
    padding: 14px 22px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-facil {
    background: linear-gradient(180deg, #1dd1a1, #10ac84);
    box-shadow: 0 6px 0 #0e8364, 0 8px 15px rgba(29, 209, 161, 0.4);
}

.btn-medio {
    background: linear-gradient(180deg, #feca57, #ff9f43);
    color: #111;
    box-shadow: 0 6px 0 #c87f33, 0 8px 15px rgba(254, 202, 87, 0.4);
}

.btn-dificil {
    background: linear-gradient(180deg, #ff6b6b, #ee5253);
    box-shadow: 0 6px 0 #b83b3c, 0 8px 15px rgba(255, 107, 107, 0.4);
}

.btn-trivia {
    background: linear-gradient(180deg, #54a0ff, #2e86de);
    box-shadow: 0 6px 0 #1b4f9c, 0 8px 15px rgba(84, 160, 255, 0.4);
}

.btn-dificultad-3d:hover {
    transform: translateY(-3px);
}

.btn-dificultad-3d:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* Estilos de la Trivia */
.header-trivia {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #48dbfb;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.header-trivia h2 {
    font-family: 'Righteous', cursive;
    color: #ff9f43;
    margin: 0;
}

#marcadorTrivia {
    font-size: 18px;
    font-weight: 800;
    color: #1dd1a1;
}

.caja-pregunta-3d h3 {
    font-size: 19px;
    color: #ffffff;
    margin-bottom: 20px;
}

.opciones-trivia {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-opcion-trivia {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(72, 219, 251, 0.4);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.btn-opcion-trivia:hover {
    background: rgba(72, 219, 251, 0.25);
    border-color: #48dbfb;
    transform: translateX(5px);
}

.retro-trivia {
    margin-top: 15px;
    font-size: 16px;
    font-weight: 700;
    min-height: 24px;
}

.btn-salir-trivia {
    margin-top: 25px;
    background: linear-gradient(180deg, #8395a7, #576574);
    box-shadow: 0 4px 0 #222f3e;
}

/* Escena 3D del juego */
#contenedorJuego {
    position: relative;
    width: 800px;
    height: 450px;
    margin: 20px auto;
    border: 3px solid #ff5722;
    border-radius: 16px;
    box-shadow: 0 0 35px rgba(255, 87, 34, 0.5);
    overflow: hidden;
}

#canvas3d { width: 100%; height: 100%; }

#hud {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(8, 9, 17, 0.88);
    backdrop-filter: blur(8px);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid #ff5722;
    font-size: 15px;
    font-weight: 800;
    z-index: 10;
    text-align: left;
}

#indicadorColor { font-size: 12px; color: #48dbfb; margin-top: 4px; }

/* Panel Informativo */
.panel-informacion-3d {
    position: relative;
    z-index: 1;
    max-width: 750px;
    margin: 25px auto;
    background: rgba(18, 22, 36, 0.8);
    border-left: 6px solid #48dbfb;
    padding: 18px 24px;
    border-radius: 12px;
    text-align: left;
}

.panel-informacion-3d h3 {
    font-family: 'Righteous', cursive;
    color: #48dbfb;
    margin-top: 0;
}