* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

  @font-face {
    font-family: 'Roboto'; /* Give it a unique name to test */
    src: url('../fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900; /* Required for Variable Fonts to work across weights */
    font-style: normal;
  }

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a3a3a 0%, #2d5a5a 50%, #3d6b6b 100%);            
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
}

/* Language-based background gradients */
body.en {
    background: linear-gradient(135deg, #2d4a4a 0%, #3d6a6a 50%, #4d7a7a 100%);
}        

/* Floating particles background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(168, 212, 196, 0.2);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 22s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 16s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 19s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 21s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 17s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 23s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 20s; }

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(-80vh) scale(1);
    }
    100% {
        transform: translateY(-100vh) scale(0);
        opacity: 0;
    }
}

/* Main container */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: 70px; /* Space for ad bar */
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
    overflow-y: auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header section */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.help-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.help-btn svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.8);
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #5a9a8a 0%, #3d6b6b 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 10px 30px rgba(90, 154, 138, 0.3);
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo svg {
    width: 50px;
    height: 50px;
    fill: white;
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Language toggle */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0 30px;
    animation: fadeIn 1s ease-out 0.3s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.toggle-switch {
    display: none;
}

.toggle-label {
    position: relative;
    width: 56px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-label:hover {
    background: rgba(255, 255, 255, 0.25);
}

.toggle-ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #7ac4a8 0%, #5a9a8a 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch:checked + .toggle-label .toggle-ball {
    transform: translateX(26px);
}

.lang-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    transition: color 0.3s ease;
}

.lang-label.active {
    color: white;
}

/* Category buttons grid */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 360px;
}

.btn {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 28px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--btn-color-1) 0%, var(--btn-color-2) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 24px;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: transparent;
}

.btn:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-icon {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    line-height: 1;
}

.btn-text {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    text-align: center;
}

//* Button colors - nature-inspired palette */
.btn-intro { --btn-color-1: #7ac4a8; --btn-color-2: #5a9a8a; }
.btn-conexion { --btn-color-1: #8fbcaa; --btn-color-2: #6a9a88; }
.btn-deep { --btn-color-1: #5a9a8a; --btn-color-2: #3d7a6a; }
.btn-express { --btn-color-1: #9acaba; --btn-color-2: #7ab4a4; }

/* Animations for buttons */
.btn:nth-child(1) { animation: slideIn 0.6s ease-out 0.1s both; }
.btn:nth-child(2) { animation: slideIn 0.6s ease-out 0.2s both; }
.btn:nth-child(3) { animation: slideIn 0.6s ease-out 0.3s both; }
.btn:nth-child(4) { animation: slideIn 0.6s ease-out 0.4s both; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1a3a3a 0%, #2d5050 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 32px 28px;
    width: calc(100% - 40px);
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.modal-content p {
    color: white;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

.modal-content a {
    color: #7ac4a8;
    text-decoration: none;
    font-weight: 600;
}

.modal-content a:hover {
    text-decoration: underline;
}

/* How to play modal */
.modal-content-how {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1a3a3a 0%, #2d5050 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 32px 28px;
    width: calc(100% - 40px);
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-content-how p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.7;
    margin-top: 10px;
    white-space: pre-line;
}

/* Footer */
footer {
    position: absolute; /* To let adsense work */
    bottom: 75px; /* Above ad bar */
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px;
    z-index: 1;
}

footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.3s ease;
}

footer p:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Apply transparent background with white text for btn-yesno class */
/* Contenedor para alinear y separar */
.button-container {
    display: flex;
    justify-content: center;
    gap: 20px; /* Esto crea un espacio real de 20 píxeles entre los botones */
    margin-top: 15px;
}

.btn-yes {
    background-color: #ffffff; /* Botón sólido para la acción principal */
    color: #000;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    margin-right: 50px;
}

.btn-no {
    background-color: transparent; /* Botón transparente para evitar errores */
    color: #ffffff;
    padding: 10px 20px;
    border: 1px solid #ffffff; /* Solo el borde */
    border-radius: 5px;
}

/* Optionally, style for button focus (when selected) */
.btn-yesno:focus {
    outline: none;              /* Remove default focus outline */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);  /* Add a subtle white glow around button */
}

/* Style for buttons that are disabled (optional) */
.btn-yesno:disabled {
    opacity: 0.5;                 /* Make disabled buttons appear faded */
    cursor: not-allowed;          /* Change cursor to indicate button is disabled */
}



/* Responsive adjustments */
@media (max-width: 380px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .buttons-grid {
        gap: 12px;
    }
    
    .btn {
        padding: 22px 12px;
    }
    
    .btn-icon {
        font-size: 1.6rem;
    }
    
    .btn-text {
        font-size: 0.85rem;
    }
}

@media (max-height: 650px) {
    .header {
        margin-bottom: 15px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .toggle-container {
        margin: 15px 0 20px;
    }
    
    .btn {
        padding: 20px 12px;
    }
}

/* For very tall screens, center better */
@media (min-height: 800px) {
    .container {
        justify-content: center;
    }
}