/* ==========================================================
   CONFIGURACIÓN GENERAL Y VARIABLES
   ========================================================== */
   :root {
    --azul-cielo: #0099de;
    --verde-pasto: #8bc53f;
    --amarillo-bus: #ffcc00;
    --rojo-sos: #ff4b2b;
    --fuente-principal: 'Arial Rounded MT Bold', 'Helvetica', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: var(--fuente-principal);
    overflow: hidden;
}

/* MARCO RÍGIDO (900x600) */
#game-container {
    width: 900px;
    height: 600px;
    position: relative;
    overflow: hidden;
    background-color: var(--azul-cielo);
    border: 8px solid #333;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

/* ADAPTABILIDAD POR ESCALA */
@media (max-width: 950px) { #game-container { transform: scale(0.8); } }
@media (max-width: 750px) { #game-container { transform: scale(0.6); } }
@media (max-width: 550px) { #game-container { transform: scale(0.45); } }

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden { display: none !important; }

/* ==========================================================
   SISTEMA MÓVIL (BLOQUEO VERTICAL)
   ========================================================== */
#aviso-orientacion {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--azul-cielo);
    z-index: 9999;
    color: white;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
}

@media (max-width: 900px) and (orientation: portrait) {
    #aviso-orientacion { display: flex; }
}

#aviso-orientacion span {
    font-size: 60px;
    margin-bottom: 20px;
    animation: rotarIcono 2s infinite ease-in-out;
}

@keyframes rotarIcono {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* ==========================================================
   PANTALLA DE INICIO
   ========================================================== */
.capa { position: absolute; }

.capa.pasto {
    bottom: -110px;
    left: 50%;
    transform: translateX(-50%);
    width: 110%;
    height: 350px;
    background-color: var(--verde-pasto);
    border-radius: 50% 50% 0 0;
    z-index: 1;
}

.capa.personajes-portada {
    bottom: 115px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    justify-content: center;
}

#bus-portada {
    width: 320px;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.25));
    animation: vibrarBus 3s ease-in-out infinite;
}

.portada-contenido {
    position: relative;
    z-index: 10;
    margin-top: 40px;
    text-align: center;
    width: 100%;
}

.logo-contenedor { width: 520px; margin: 0 auto 15px auto; }
#titulo-juego { width: 100%; filter: drop-shadow(0 0 25px white); animation: flotar 4s ease-in-out infinite; }

.botones-inicio {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 170px;
}

/* ==========================================================
   INTERFAZ DEL JUEGO (TABLERO Y HUD)
   ========================================================== */
#contenedor-tablero {
    background-color: #f0f0f0;
    z-index: 20;
}

#tablero-canvas {
    width: 900px;
    height: 600px;
    display: block;
}

#consola-mensajes {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%; 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(10px); 
    padding: 12px 20px;
    border-radius: 50px;
    border: 3px solid var(--azul-cielo);
    color: #1a365d;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 45;
}

#interfaz-flotante {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 30;
    pointer-events: none;
}

.hud-superior, .controles-inferiores { pointer-events: auto; }

/* NUEVO ESTILO DEL HUD SUPERIOR */
.hud-superior {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 18px;
    border-radius: 40px;
    border: 3px solid var(--amarillo-bus);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#marcador-stickers, #marcador-kilometros {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    white-space: nowrap;
}

#marcador-kilometros {
    color: var(--azul-cielo);
    border-top: 1px solid #ddd;
    padding-top: 2px;
}

.btn-circular {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--azul-cielo);
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 0 #0077ae;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-circular:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #0077ae;
}

/* BOTÓN DADO */
.btn-dado {
    width: 100px;
    height: 100px;
    font-size: 3.5rem;
    background: white;
    border: 6px solid var(--amarillo-bus);
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 10px 0 #cc9900;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-dado:active { 
    transform: translateY(6px) scale(0.95); 
    box-shadow: 0 4px 0 #cc9900; 
}

/* ==========================================================
   BOTONES GENERALES
   ========================================================== */
.btn-primary {
    background-color: var(--amarillo-bus);
    color: #333;
    border: 3px solid white;
    padding: 12px 35px;
    font-size: 22px;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 0 #cc9900;
}

.btn-secondary {
    background-color: white;
    color: var(--azul-cielo);
    border: none;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 0 #ddd;
}

/* ==========================================================
   MODALES Y RETOS
   ========================================================== */
.modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 100;
    backdrop-filter: blur(8px);
}

.modal-contenido {
    background: white;
    width: 70%;
    max-height: 90%;
    padding: 25px;
    border-radius: 40px;
    border: 8px solid var(--azul-cielo);
    text-align: center;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

#reto-imagen {
    width: auto;
    max-width: 280px;
    max-height: 180px;
    object-fit: contain;
    margin: 10px 0 20px 0;
    border-radius: 15px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1));
}

#reto-titulo {
    font-size: 26px;
    color: var(--azul-cielo);
    margin-bottom: 10px;
    text-transform: uppercase;
}

#reto-descripcion {
    font-size: 18px;
    line-height: 1.4;
    color: #444;
    margin-bottom: 20px;
    max-width: 90%;
}

.opciones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.opciones-grid:has(> :only-child) {
    grid-template-columns: 1fr;
}

.btn-opcion {
    background: #f0f4f8;
    border: 2px solid #d1d9e6;
    padding: 12px 15px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-opcion:hover {
    background: var(--amarillo-bus);
    border-color: #f1c40f;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.3);
}

/* ==========================================================
   EXTRAS Y ANIMACIONES
   ========================================================== */
.copyright {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 12px;
    text-shadow: 1px 1px 3px black;
    z-index: 5;
}

@keyframes vibrarBus {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.02) rotate(1deg); }
}

@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
/* Estilo para el logo en la parte inferior derecha */
.logo-footer-cruz {
    position: absolute;
    right: 20px;
    bottom: 15px;
    height: 55px;
    width: auto;
    object-fit: contain;
    z-index: 20;
    pointer-events: auto;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.3));
}