#introPantalla {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 50;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

#introPantalla h1 {
    color: #ffffff;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.8);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

#introPantalla p {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.7);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#introPantalla button {
    background-color: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#introPantalla button:hover {
    background-color: #000000;
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: 0;
    object-fit: cover;
}

.video-overlay-content {
    position: relative;
    z-index: 1;
}

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

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate-fade-in-up.delay-500 {
    animation-delay: 0.5s;
}

.animate-fade-in-up.delay-1000 {
    animation-delay: 1s;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logos en landing page */
.logo-oiss-container {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.logo-oiss-main {
    height: 180px;
    width: auto;
    max-width: 700px;
    object-fit: contain;
    filter: brightness(1.2) contrast(1.2);
    drop-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.logo-aecid-container {
    position: absolute;
    bottom: 30px;
    left: 10px;
    z-index: 2;
}

.aecid-support-text {
    position: absolute;
    bottom: 130px;
    left: 50px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Inter', sans-serif;
}

.logo-aecid {
    height: 160px;
    width: auto;
    max-width: 550px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Responsive para logos */
@media (max-width: 768px) {
    .logo-oiss-container {
        top: 12%;
    }
    
    .logo-oiss-main {
        height: 140px;
        max-width: 550px;
    }
    
    .aecid-support-text {
        font-size: 0.9rem;
        bottom: 100px;
        left: 40px;
    }
    
    .logo-aecid {
        height: 120px;
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    .logo-oiss-container {
        top: 10%;
    }
    
    .logo-oiss-main {
        height: 110px;
        max-width: 450px;
    }
    
    .aecid-support-text {
        font-size: 0.8rem;
        bottom: 80px;
        left: 30px;
    }
    
    .logo-aecid {
        height: 100px;
        max-width: 350px;
    }
}

/* Clases utilitarias de Tailwind que necesitamos */
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.bg-black { background-color: #000; }
.text-white { color: #fff; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.z-50 { z-index: 50; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 1rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.mt-8 { margin-top: 2rem; }
.bg-white { background-color: #fff; }
.text-black { color: #000; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.rounded-xl { border-radius: 0.75rem; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }

/* Transiciones de pantalla */
.fade-out {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.6s ease-in;
}

@media (min-width: 768px) {
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}

/* ========================================== */
/* ESTILOS DEL MUNDO 3D */
/* ========================================== */

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
}

#mundo3D {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    opacity: 1;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    max-width: 350px;
    border: 2px solid #667eea;
}

#stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    min-width: 200px;
    border: 2px solid #667eea;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
}

#interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    display: none;
    font-size: 1.1em;
    border: 2px solid #667eea;
    animation: pulse 2s infinite;
}

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

/* Logos en la oficina 3D - sin contenedores */
.office-oiss-img {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    height: 80px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
}

.office-aecid-img {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    height: 140px;
    width: auto;
    max-width: 500px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Botón de salida de la oficina */
.exit-button-container {
    margin-top: 20px;
    text-align: center;
}

.btn-exit-office {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    width: 100%;
}

.btn-exit-office:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
}

/* Instrucciones mejoradas */
.controls-instructions {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease, opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
    opacity: 1;
    max-height: 1000px;
}

.controls-instructions[style*="display: none"] {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
}

.controls-instructions h4 {
    color: #60a5fa;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.controls-instructions p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.controls-instructions .tip {
    margin-top: 10px;
    padding: 8px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    font-size: 0.85rem;
}

/* Responsive para logos de oficina */
@media (max-width: 768px) {
    .office-oiss-img {
        top: 10px;
        right: 10px;
        height: 50px;
        max-width: 200px;
    }
    
    .office-aecid-img {
        top: 10px;
        left: 10px;
        height: 50px;
        max-width: 180px;
        bottom: auto;
    }
    
    .controls-instructions {
        padding: 12px;
    }
    
    .controls-instructions h4 {
        font-size: 0.9rem;
    }
    
    .controls-instructions p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .office-oiss-img {
        top: 8px;
        right: 8px;
        height: 40px;
        max-width: 160px;
    }
    
    .office-aecid-img {
        top: 8px;
        left: 8px;
        height: 40px;
        max-width: 320px;
    }
}

.floating-text {
    position: absolute;
    color: #ff0;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 2s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-100px); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

@media (max-width: 768px) {
    #ui-overlay, #stats-panel {
        max-width: 250px;
        padding: 15px;
        font-size: 0.9em;
    }
    
    #interaction-prompt {
        font-size: 1em;
        padding: 12px 20px;
    }
}

.office-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.office-header h2 {
    margin: 0;
    color: white;
}

.header-buttons {
    display: flex;
    gap: 8px;
}

.btn-toggle-instructions {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.btn-toggle-instructions span {
    display: inline;
}

.btn-toggle-instructions:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a42a0);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.btn-toggle-instructions.active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.btn-toggle-instructions.active:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.6);
}

.btn-music-3d {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.btn-music-3d:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a42a0);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.btn-music-3d.muted {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.btn-music-3d.muted:hover {
    background: linear-gradient(135deg, #c82333, #dc2626);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.6);
}

@media (max-width: 768px) {
    .office-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .btn-music-3d {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}


/* ========================================== */
/* CONTROLES TÁCTILES PARA MÓVILES */
/* ========================================== */

.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
}

.joystick-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    pointer-events: all;
}

.joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    position: relative;
    backdrop-filter: blur(10px);
}

.joystick-stick {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.action-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: all;
}

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 3px solid white;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    user-select: none;
}

.action-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-btn.interact {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.action-btn.dance {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

/* Mostrar controles solo en móviles y tablets */
@media (max-width: 1024px) {
    .mobile-controls {
        display: block;
    }
    
    /* Ocultar todo el panel de UI en móviles */
    #ui-overlay {
        display: none !important;
    }
    
    /* Botón de música flotante en móviles */
    .btn-music-3d {
        position: fixed !important;
        top: 10px !important;
        right: 50% !important;
        transform: translateX(50%) !important;
        z-index: 1050 !important;
        width: 45px !important;
        height: 45px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.2rem !important;
    }
    
    /* Ocultar instrucciones por defecto en móviles */
    .controls-instructions {
        display: none !important;
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 90%;
        z-index: 1100;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .controls-instructions.show {
        display: block !important;
    }
    
    /* Botón para mostrar/ocultar instrucciones en móviles */
    .btn-toggle-instructions {
        position: fixed !important;
        top: 65px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1050 !important;
        width: auto !important;
        height: auto !important;
        border-radius: 20px !important;
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }
    
    .header-buttons {
        position: relative;
    }
    
    /* Botón de salir flotante en móviles */
    .exit-button-container {
        position: fixed !important;
        bottom: 160px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1050 !important;
    }
    
    .btn-exit-office {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        padding: 10px 20px !important;
        border-radius: 25px !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5) !important;
    }
}

@media (max-width: 480px) {
    .joystick-container {
        width: 100px;
        height: 100px;
        bottom: 15px;
        left: 15px;
    }
    
    .joystick-base {
        width: 100px;
        height: 100px;
    }
    
    .joystick-stick {
        width: 40px;
        height: 40px;
    }
    
    .action-buttons {
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 1.3rem;
    }
}
