* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

body {
    background: #ffffff;
    color: #451a03;
    display: flex;
    flex-direction: column;
    height: 100dvh; /* Usa la altura dinámica real del viewport móvil */
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

/* Degradado superior sutil y progresivo para cualquier fondo */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px; /* Un poco más alto para que la transición sea más larga y suave */
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: 5;
}

#site-logo-container {
    position: absolute;
    top: 5px;
    left: 15px;
    z-index: 50;
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#site-icons-right {
    position: absolute;
    top: 5px;
    right: 10px;
    z-index: 50;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column; /* Coloca los iconos uno debajo de otro */
    align-items: center;
    gap: 8px; /* Espacio vertical entre cada icono */
}

#site-icons-right a {
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, color 0.2s ease;
}

#site-icons-right a:hover {
    transform: scale(1.15);
    color: #e0f2fe;
}

.sidebar {
    position: fixed;
    top: 0;
    background: rgba(2, 132, 199, 0);
    color: #ffffff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
    padding: 40px 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    visibility: hidden;
    pointer-events: none;
    height: 100vh;
    width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-left {
    left: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.25);
    transform: translateX(-100%);
}

.sidebar-right {
    right: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    transform: translateX(100%);
}

.sidebar-full {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    transform: translateY(-100%);
	background: rgba(2, 132, 199, 0.2);
}

.sidebar-full-down {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    transform: translateY(100%);
    background: rgba(2, 132, 199, 0.2);
}

.sidebar.from-left {
    left: 0;
    right: auto;
    border-right: 2px solid rgba(255, 255, 255, 0.25);
    border-left: none;
    transform: translateX(-100%);
}

.sidebar.from-right {
    right: 0;
    left: auto;
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    border-right: none;
    transform: translateX(100%);
}

.sidebar.open {
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate(0, 0) !important;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px; /* <--- AQUÍ DEBE IR A LA DERECHA DEL PANEL */
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding-bottom: 2px;
    transition: all 0.2s ease;
}

.close-btn:hover { 
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sidebar.open .close-btn {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-content {
    margin-top: 25px;
    height: calc(100% - 50px);
    overflow-y: auto;
}

/* HEADER */
.zen-header {
    padding-top: 20px;
    padding-bottom: 5px;
    text-align: center;
}

.zen-header h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #0284c7;
    text-transform: uppercase;
}

/* BOTONES SUPERIORES */
.top-bar-controls {
    position: absolute;
    top: 20px;
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 50;
}

.panel-trigger {
    background: #ffffff;
    border: 3px solid #7dd3fc;
    color: #0284c7;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.panel-trigger:hover {
    background: #f0f9ff;
    transform: scale(1.05);
}

/* CONTENEDOR CENTRAL DEL JUEGO */

#game-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 62vh; /* <--- Reducido para dejar espacio en celulares */
    max-height: 550px; /* <--- Reducido un poco para evitar desbordes */
    background-color: #ffffff;
    border: 6px solid #e0f2fe;
    border-radius: 0px;
    overflow: hidden;
    z-index: 10;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0px;
	touch-action: none;
}

/* NAVEGACIÓN DE NIVELES (DENTRO DEL CONTENEDOR) */
#level-nav-container {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 85px;
    z-index: 10;
}

#level-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-nav-level {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: bold;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.btn-nav-level:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* PUNTOS (DENTRO DEL CONTENEDOR) */
#score-container {
    position: absolute;
    top: 55px;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* CONTROLES INFERIORES (DENTRO DEL CONTENEDOR) */
#controls {
    position: absolute;
    bottom: 12px; /* <--- Un poco más cerca del borde inferior para ganar espacio */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* <--- Reducido ligeramente el espacio entre botones para que entren en pantallas angostas */
    padding: 0 10px;
    z-index: 10;
}

/* BOTÓN SOPLAR - Estilo sólido, elegante y llamativo con tono celeste/azul */

#btn-soplador {
    background: #0284c7;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 14px 24px; /* <--- Padding horizontal ligeramente ajustado */
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#btn-soplador:hover {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

#btn-soplador:active { 
    transform: scale(0.95); 
}

/* ESTILO SÓLIDO Y ELEGANTE PARA PUBLICIDAD Y DONAR (A juego con el menú) */

#btn-publicidad,
#btn-donar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #ffffff;
    color: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.9);
    width: 105px; /* <--- Ancho fijo idéntico para ambos */
    height: 42px; /* <--- Alto fijo idéntico para ambos */
    padding: 0 8px; /* <--- Padding interno uniforme */
    font-size: 0.65rem; /* <--- Tamaño de texto equilibrado */
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 16px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    white-space: nowrap; /* Evita que el texto se baje de línea de forma desigual */
}

#btn-publicidad:hover,
#btn-donar:hover {
    background: #f8fafc;
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.heart-icon { 
    color: #e11d48; 
    font-size: 0.9rem; 
}

/* FOOTER */
.zen-footer {
    padding: 15px;
    text-align: center;
    font-size: 0.7rem;
    color: #78350f;
}

.footer-nav a { color: #0284c7; text-decoration: none; margin: 0 4px; font-weight: 700; }

#site-lang-right {
position: absolute;
bottom: 20px;
right: 15px;
z-index: 50;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}

#site-lang-right a {
color: #ffffff;
text-decoration: none;
font-size: 0.9rem;
font-weight: 700;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-juego-lateral {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 2.2rem;
    font-weight: 800;
    width: 50px;
    height: 90px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* --- Ajustes milimétricos de centrado --- */
    line-height: 1;
    padding-bottom: 4px; /* Compensa el peso visual hacia abajo de los símbolos */
    /* -------------------------------------- */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.btn-juego-lateral:hover {
    background: rgba(2, 132, 199, 0.2);
    border-color: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.3);
}

.btn-juego-lateral:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-juego-prev {
    left: 20px;
}

.btn-juego-next {
    right: 20px;
}

@media screen and (max-width: 768px) {
    #site-logo-container .logo-text {
        /* display: none !important; */
    }
	#btn-soplador {
        display: none !important;
    }
}

@media screen and (max-height: 750px) { /* Sube un poco el rango para asegurar que te abarque */
	#site-logo-container .logo-text {
        font-size: 1rem !important; /* Bájale a 0.9rem o lo que necesites para que se vea bien */
    }
    #game-container {
        height: 50vh;
        max-height: 380px; /* Redúcelo un poco más para forzar que quepa */
    }
    #controls {
        bottom: 4px;
        gap: 4px;
    }
    #btn-publicidad,
    #btn-donar {
        width: 90px;  /* <--- Ancho fijo idéntico también en celulares */
        height: 36px; /* <--- Alto fijo idéntico también en celulares */
        padding: 0 4px;
        font-size: 0.55rem;
    }
	#btn-soplador {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}