/* Reset y variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --physics-color: #4facfe;
    --games-color: #43e97b;
    --text-light: #ffffff;
    --text-dark: #2d3748;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Layout principal */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Patrón de fondo sutil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='20' cy='20' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Contenedor principal optimizado para viewport */
.main-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem 1rem 1rem;
    position: relative;
    z-index: 1;
}

/* Sección del logo */
.logo-section {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.logo-img {
    width: 560px;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Sección de descripción */
.description-section {
    text-align: center;
    margin-bottom: 2rem;
    max-width: 600px;
}

.description-text {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
}

/* Navegación principal */
.navigation-section {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px;
    width: 100%;
}

/* Botones de navegación */
.nav-btn {
    display: flex;
    align-items: center;
    padding: 1.2rem 1.8rem;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 300px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.games-btn {
    background: linear-gradient(135deg, rgba(255, 45, 85, 0.9), rgba(255, 100, 150, 0.9));
    color: var(--text-light);
}

.clouds-btn {
    background: linear-gradient(135deg, rgba(3, 81, 150, 0.977), rgba(0, 242, 254, 0.9));
    color: var(--text-light);
}

.physics-btn {
    background: linear-gradient(135deg, rgba(9, 204, 15, 0.9), rgba(129, 199, 132, 0.9));
    color: var(--text-light);
}

.nav-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

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

/* Contenido de botones */
.btn-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo en los botones */
.btn-logo {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.nav-btn:hover .btn-logo {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.btn-content {
    flex: 1;
}

.btn-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: inherit;
}

.btn-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    color: inherit;
    font-weight: 400;
}

/* Footer compacto */
.footer-section {
    text-align: center;
    flex-shrink: 0;
}

.footer-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
}

.footer-text strong {
    color: var(--text-light);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 1.5rem 0.8rem 0.8rem;
    }
    
    .logo-img {
        width: 480px;
        max-height: 300px;
    }
    
    .description-text {
        font-size: 1rem;
    }
    
    .navigation-section {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        min-width: 280px;
        padding: 1rem 1.5rem;
    }
    
    .btn-icon {
        font-size: 2rem;
        margin-right: 0.8rem;
    }
    
    .btn-logo {
        width: 2rem;
        height: 2rem;
    }
    
    .btn-title {
        font-size: 1.1rem;
    }
    
    .btn-desc {
        font-size: 0.85rem;
    }
    
    .footer-badges {
        gap: 0.8rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 1rem 0.5rem 0.5rem;
        height: 100vh;
        overflow-y: auto;
    }
    
    .logo-img {
        width: 400px;
        max-height: 240px;
    }
    
    .description-section {
        margin-bottom: 1.5rem;
    }
    
    .description-text {
        font-size: 0.9rem;
    }
    
    .nav-btn {
        min-width: 260px;
        padding: 0.9rem 1.2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .btn-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
        font-size: 1.8rem;
    }
    
    .btn-logo {
        width: 1.8rem;
        height: 1.8rem;
    }
    
    .btn-title {
        font-size: 1rem;
    }
    
    .btn-desc {
        font-size: 0.8rem;
    }
    
    .footer-badges {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Optimización para pantallas muy pequeñas */
@media (max-height: 600px) {
    .main-container {
        justify-content: flex-start;
        padding-top: 0.5rem;
        overflow-y: auto;
    }
    
    .logo-section {
        margin-bottom: 0.3rem;
    }
    
    .logo-img {
        width: 360px;
        max-height: 200px;
    }
    
    .description-section {
        margin-bottom: 1rem;
    }
    
    .navigation-section {
        margin-bottom: 1rem;
        gap: 0.8rem;
    }
    
    .nav-btn {
        padding: 0.8rem 1rem;
        min-width: 240px;
    }
}

/* Animaciones de entrada */
.logo-section {
    animation: fadeInDown 0.8s ease-out;
}

.description-section {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.nav-btn:nth-child(1) {
    animation: slideInLeft 0.8s ease-out 0.4s both;
}

.nav-btn:nth-child(2) {
    animation: slideInRight 0.8s ease-out 0.6s both;
}

.nav-btn:nth-child(3) {
    animation: slideInLeft 0.8s ease-out 0.8s both;
}

.footer-section {
    animation: fadeInUp 0.8s ease-out 1.0s both;
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Estados de focus para accesibilidad */
.nav-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* Botón como nav-btn (para el botón de física) */
button.nav-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

/* Modal de advertencia */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: white;
    animation: slideInScale 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='20' cy='20' r='1'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-body {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.modal-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.device-recommendation {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.device-recommendation h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.device-recommendation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.device-recommendation li {
    padding: 0.3rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, #43e97b, #38d9a9);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 233, 123, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Animaciones del modal */
@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive para el modal */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-icon {
        font-size: 2.5rem;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        min-width: auto;
    }
}

/* Efecto de ripple al hacer clic */
.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}