/* ============================================
   HUB.CSS - VERSIÓN MEJORADA Y MODERNA
   ============================================ */

/* 1. RESET Y BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 2. TEMAS CON GRADIENTES ANIMADOS */
.tema-nino { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

.tema-nina { 
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffecd2 100%);
    background-size: 400% 400%;
    animation: gradientFlow 15s ease infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 3. PARTÍCULAS DECORATIVAS */
.particulas-fondo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particula {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: floatParticle 20s infinite;
}

.particula:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particula:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.particula:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
    animation-duration: 22s;
}

.particula:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
    animation-duration: 18s;
}

.particula:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
    animation-duration: 24s;
}

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

/* 4. CONTENEDOR PRINCIPAL */
.hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 5. HUD SUPERIOR MEJORADO */
.hud-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.perfil-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.avatar-hud {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

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

.badge-nivel {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 0.4em;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nombre-agente {
    font-size: 1.4em;
    color: #2c3e50;
    margin: 0;
    font-weight: 700;
}

.rango-agente {
    color: #7f8c8d;
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rango-agente::before {
    content: '⭐';
    font-size: 1.2em;
}

.acciones-hud {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-config {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-config:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-salir {
    text-decoration: none;
    background: linear-gradient(135deg, #ff4b2b 0%, #ff416c 100%);
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 25px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-salir:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 65, 108, 0.5);
}

/* 6. MISIÓN DIARIA */
.mision-diaria-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px 30px;
    border-radius: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mision-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mision-icono {
    font-size: 3em;
    animation: rotate 3s ease-in-out infinite;
}

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

.mision-header h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 0;
}

.mision-descripcion {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.95em;
}

.progreso-container {
    margin: 20px 0;
}

.progreso-barra {
    width: 100%;
    height: 35px;
    background: #ecf0f1;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progreso-relleno {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 25px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progreso-brillo {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    to { left: 100%; }
}

.progreso-texto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-weight: 600;
    color: #34495e;
}

.progreso-porcentaje {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.recompensa-preview {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 12px 20px;
    border-radius: 15px;
    text-align: center;
    font-weight: bold;
    color: #d35400;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.4);
}

/* 7. TÍTULO PRINCIPAL */
.titulo-principal {
    text-align: center;
    color: white;
    font-size: 2.8em;
    margin: 40px 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: 800;
}

.titulo-icono {
    font-size: 1.2em;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 8. GRID DE ISLAS MEJORADO */
.islas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.isla-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.isla-card.activa {
    border-color: rgba(102, 126, 234, 0.3);
}

/* Bordes coloreados por módulo */
.isla-card.activa.modulo-multi {
    border-color: rgba(139, 92, 246, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
}
.isla-card.activa.modulo-multi:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.7);
}

.isla-card.activa.modulo-sumas {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}
.isla-card.activa.modulo-sumas:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.7);
}

.isla-card.activa.modulo-restas {
    border-color: rgba(6, 182, 212, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #ecfeff 100%);
}
.isla-card.activa.modulo-restas:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.7);
}

.isla-card.activa:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
}

.isla-card.bloqueada {
    filter: grayscale(0.8);
    opacity: 0.7;
    cursor: not-allowed;
}

.isla-card.bloqueada:hover {
    transform: translateY(-5px);
}

.candado-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
}

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

.isla-icono {
    font-size: 4.5em;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    animation: floatIcon 3s ease-in-out infinite;
}

/* Icono de Multiplicar con fondo púrpura */
.isla-icono.icono-multiplicar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6, #6d28d9);
    border-radius: 50%;
    box-shadow: 
        0 4px 0 #4c1d95,
        0 8px 25px rgba(139, 92, 246, 0.5),
        inset 0 2px 4px rgba(255,255,255,0.3);
    border: 4px solid rgba(255,255,255,0.4);
}

/* Icono de Sumas con fondo verde */
.isla-icono.icono-sumas {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #34d399, #10b981, #059669);
    border-radius: 50%;
    box-shadow: 
        0 4px 0 #064e3b,
        0 8px 25px rgba(16, 185, 129, 0.5),
        inset 0 2px 4px rgba(255,255,255,0.3);
    border: 4px solid rgba(255,255,255,0.4);
}

/* Icono de Restas con fondo cyan */
.isla-icono.icono-restas {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #67e8f9, #22d3ee, #0891b2);
    border-radius: 50%;
    box-shadow: 
        0 4px 0 #155e75,
        0 8px 25px rgba(6, 182, 212, 0.5),
        inset 0 2px 4px rgba(255,255,255,0.3);
    border: 4px solid rgba(255,255,255,0.4);
}

/* Símbolo matemático dentro del icono */
.icono-simbolo {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.isla-icono.opaco {
    opacity: 0.4;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.isla-estado {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.isla-estado.disponible {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4);
}

.isla-card h3 {
    margin: 15px 0 10px 0;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 700;
}

.isla-card p {
    color: #7f8c8d;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.isla-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #34495e;
}

.stat-icono {
    font-size: 1.2em;
}

.requisito-desbloqueo {
    background: #fff3cd;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #856404;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #ffeaa7;
}

.btn-jugar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 6px 0 #5568d3, 0 8px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.btn-jugar-multi {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 6px 0 #5b21b6, 0 8px 20px rgba(139, 92, 246, 0.4);
}
.btn-jugar-multi:hover {
    box-shadow: 0 9px 0 #5b21b6, 0 12px 25px rgba(139, 92, 246, 0.5) !important;
}
.btn-jugar-multi:active {
    box-shadow: 0 3px 0 #5b21b6, 0 4px 10px rgba(139, 92, 246, 0.3) !important;
}

.btn-jugar-sumas {
    background: linear-gradient(135deg, #34d399, #059669);
    box-shadow: 0 6px 0 #064e3b, 0 8px 20px rgba(16, 185, 129, 0.4);
}
.btn-jugar-sumas:hover {
    box-shadow: 0 9px 0 #064e3b, 0 12px 25px rgba(16, 185, 129, 0.5) !important;
}
.btn-jugar-sumas:active {
    box-shadow: 0 3px 0 #064e3b, 0 4px 10px rgba(16, 185, 129, 0.3) !important;
}

.btn-jugar-restas {
    background: linear-gradient(135deg, #22d3ee, #0284c7);
    box-shadow: 0 6px 0 #155e75, 0 8px 20px rgba(6, 182, 212, 0.4);
}
.btn-jugar-restas:hover {
    box-shadow: 0 9px 0 #155e75, 0 12px 25px rgba(6, 182, 212, 0.5) !important;
}
.btn-jugar-restas:active {
    box-shadow: 0 3px 0 #155e75, 0 4px 10px rgba(6, 182, 212, 0.3) !important;
}

/* Divisiones */
.isla-icono.icono-divisiones {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    box-shadow: 0 4px 0 #92400e, 0 8px 25px rgba(245,158,11,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
}
.btn-jugar-divisiones {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 6px 0 #92400e, 0 8px 20px rgba(245, 158, 11, 0.4);
}
.btn-jugar-divisiones:hover {
    box-shadow: 0 9px 0 #92400e, 0 12px 25px rgba(245, 158, 11, 0.5) !important;
}
.btn-jugar-divisiones:active {
    box-shadow: 0 3px 0 #92400e, 0 4px 10px rgba(245, 158, 11, 0.3) !important;
}

.btn-jugar:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 #5568d3, 0 12px 25px rgba(102, 126, 234, 0.5);
}

.btn-jugar:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #5568d3, 0 4px 10px rgba(102, 126, 234, 0.3);
}

.btn-jugar.deshabilitado {
    background: #95a5a6;
    box-shadow: none;
    cursor: not-allowed;
}

/* 9. ZONA DE PADRES */
.zona-padres-container {
    text-align: center;
    margin: 60px 0 30px 0;
}

.btn-padres {
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 35px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-padres:hover {
    background: rgba(52, 73, 94, 0.95);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.icono-padres {
    font-size: 1.3em;
}

.arrow-padres {
    transition: transform 0.3s;
}

.btn-padres:hover .arrow-padres {
    transform: translateX(5px);
}

/* 10. FOOTER */
.footer-hub {
    text-align: center;
    padding: 30px 0;
    color: white;
    font-size: 1.1em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 11. MODALES MEJORADOS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.modal-header {
    margin-bottom: 25px;
}

.modal-icono {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

.modal-icono-grande {
    font-size: 6em;
    margin-bottom: 20px;
}

.modal-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.modal-descripcion {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1.05em;
}

.modal-motivacion {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 15px;
    border-radius: 15px;
    color: #1565c0;
    font-weight: 600;
    margin-top: 15px;
}

.input-container {
    margin: 25px 0;
}

.input-bonito {
    width: 100%;
    padding: 15px 20px;
    border: 3px solid #ecf0f1;
    border-radius: 15px;
    font-size: 1.2em;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    font-weight: 600;
}

.input-bonito:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-hint {
    margin-top: 10px;
    font-size: 0.85em;
    color: #95a5a6;
}

.modal-acciones {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.btn-continuar {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    flex: 1;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-continuar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-cancelar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    flex: 1;
    transition: all 0.3s;
}

.btn-cancelar:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #7f8c8d 0%, #6c7a89 100%);
}

/* Modal de Configuración */
.config-opciones {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.btn-mini {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-mini:hover {
    background: #5568d3;
    transform: scale(1.05);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 12. RESPONSIVE */
@media (max-width: 768px) {
    .hub-container {
        padding: 15px;
    }
    
    .hud-bar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .avatar-hud {
        width: 70px;
        height: 70px;
        font-size: 2.5em;
    }
    
    .nombre-agente {
        font-size: 1.2em;
    }
    
    .titulo-principal {
        font-size: 2em;
        flex-direction: column;
    }
    
    .islas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-card {
        padding: 30px 20px;
    }
    
    .modal-acciones {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .btn-salir span:first-child {
        display: none;
    }
    
    .isla-icono {
        font-size: 3.5em;
    }
}

/* 13. TEMA NIÑA - Corrección de contraste */
.tema-nina .titulo-principal {
    color: #7c2d6e;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

.tema-nina .seccion-titulo {
    color: #7c2d6e;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

.tema-nina .footer-hub {
    color: #9b3a8d;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.5);
}

.tema-nina .ranking-header h3 {
    color: #4a1942;
}

.tema-nina .ranking-nombre {
    color: #4a1942;
}

.tema-nina .ranking-valor {
    color: #b45309;
    text-shadow: none;
}

.tema-nina .ranking-loading,
.tema-nina .ranking-empty {
    color: rgba(124, 45, 110, 0.7);
}

.tema-nina .ranking-header {
    border-bottom-color: rgba(124, 45, 110, 0.2);
}

.tema-nina .progreso-semanal-header h3 {
    color: #7c2d6e;
}

.tema-nina .progreso-semanal-resumen {
    color: #7c2d6e;
    background: rgba(124, 45, 110, 0.15);
}

.tema-nina .progreso-semanal-mensaje {
    color: #7c2d6e;
    background: rgba(124, 45, 110, 0.1);
}

.tema-nina .dia-barra {
    background: rgba(124, 45, 110, 0.25);
}

.tema-nina .dia-barra.parcial {
    background: linear-gradient(180deg, #d946ef, #a21caf);
}

.tema-nina .dia-barra.cumplido {
    background: linear-gradient(180deg, #10b981, #059669);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.tema-nina .dia-barra.futuro {
    background: rgba(124, 45, 110, 0.1);
}

.tema-nina .dia-barra.hoy {
    border-color: #7c2d6e;
    box-shadow: 0 0 10px rgba(124, 45, 110, 0.4);
}

.tema-nina .dia-minutos {
    color: #7c2d6e;
}

.tema-nina .dia-nombre {
    color: #7c2d6e;
}

.tema-nina .dia-nombre.hoy {
    color: #b45309;
}

/* 14. ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* Sección de Rankings */
.rankings-section {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.seccion-titulo {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tarjeta de Ranking */
.ranking-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.ranking-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.3);
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.ranking-emoji {
    font-size: 2.5em;
    animation: float 3s ease-in-out infinite;
}

.ranking-header h3 {
    color: white;
    font-size: 1.3em;
    margin: 0;
}

/* Lista de Rankings */
.ranking-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: grid;
    grid-template-columns: 40px 50px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(5px);
}

.ranking-item.top-1 {
    background: linear-gradient(135deg, rgba(255,215,0,0.3) 0%, rgba(255,215,0,0.1) 100%);
    border: 2px solid rgba(255,215,0,0.5);
}

.ranking-pos {
    font-size: 1.5em;
    text-align: center;
}

.ranking-avatar-emoji {
    font-size: 2em;
    text-align: center;
}

.ranking-nombre {
    color: white;
    font-weight: 600;
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-valor {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ranking-loading {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.6);
    font-style: italic;
}

.ranking-empty {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.7);
    font-size: 1.1em;
}

/* Animación de flotación para emojis */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .rankings-grid {
        grid-template-columns: 1fr;
    }
    
    .seccion-titulo {
        font-size: 2em;
    }
    
    .ranking-header h3 {
        font-size: 1.1em;
    }
    
    .ranking-item {
        grid-template-columns: 35px 40px 1fr auto;
        gap: 8px;
        padding: 10px;
    }
    
    .ranking-avatar {
        width: 35px;
        height: 35px;
    }
}

/* ============================================
   CAMBIAR MI NOMBRE (modal de configuracion)
   ============================================ */
.config-item.config-nombre {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.config-nombre-fila {
    display: flex;
    gap: 8px;
    width: 100%;
}

.config-nombre-fila .input-mini {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    font-size: 0.95rem;
}

.config-msg {
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 18px;
}
.config-msg.ok { color: #16a34a; }
.config-msg.error { color: #dc2626; }

/* Acceso a la Zona de Maestros (solo lo ve el profesor) */
.btn-padres.btn-maestros {
    text-decoration: none;
    margin-left: 12px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.9), rgba(180, 75, 255, 0.9));
    border-color: rgba(255, 255, 255, 0.45);
}
.btn-padres.btn-maestros:hover {
    background: linear-gradient(135deg, rgba(124, 92, 255, 1), rgba(180, 75, 255, 1));
}
@media (max-width: 560px) {
    .btn-padres.btn-maestros { margin-left: 0; margin-top: 12px; }
}

/* ============================================
   ISLA DEL INGLES (quinta isla del hub)
   ============================================ */
.isla-icono.icono-ingles {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9, #2563eb);
    box-shadow: 0 4px 0 #1e40af, 0 8px 25px rgba(14,165,233,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
}
.btn-jugar-ingles {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 6px 0 #1e40af, 0 8px 20px rgba(14, 165, 233, 0.4);
}
.btn-jugar-ingles:hover {
    box-shadow: 0 9px 0 #1e40af, 0 12px 25px rgba(14, 165, 233, 0.5) !important;
}
.btn-jugar-ingles:active {
    box-shadow: 0 3px 0 #1e40af, 0 4px 10px rgba(14, 165, 233, 0.3) !important;
}

/* ============================================
   ISLA DE LA ORTOGRAFIA (sexta isla del hub)
   ============================================ */
.isla-icono.icono-ortografia {
    background: linear-gradient(135deg, #60a5fa, #2563eb, #1e3a8a);
    box-shadow: 0 4px 0 #1e3a8a, 0 8px 25px rgba(37,99,235,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
}
.btn-jugar-ortografia {
    background: linear-gradient(135deg, #60a5fa, #1d4ed8);
    box-shadow: 0 6px 0 #1e3a8a, 0 8px 20px rgba(37, 99, 235, 0.4);
}
.btn-jugar-ortografia:hover {
    box-shadow: 0 9px 0 #1e3a8a, 0 12px 25px rgba(37, 99, 235, 0.5) !important;
}
.btn-jugar-ortografia:active {
    box-shadow: 0 3px 0 #1e3a8a, 0 4px 10px rgba(37, 99, 235, 0.3) !important;
}

/* ============================================
   ISLA DE FRACCIONES (septima isla del hub)
   ============================================ */
.isla-icono.icono-fracciones {
    background: linear-gradient(135deg, #fdba74, #f97316, #c2410c);
    box-shadow: 0 4px 0 #9a3412, 0 8px 25px rgba(249,115,22,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
}
.btn-jugar-fracciones {
    background: linear-gradient(135deg, #fb923c, #c2410c);
    box-shadow: 0 6px 0 #9a3412, 0 8px 20px rgba(249, 115, 22, 0.4);
}
.btn-jugar-fracciones:hover {
    box-shadow: 0 9px 0 #9a3412, 0 12px 25px rgba(249, 115, 22, 0.5) !important;
}
.btn-jugar-fracciones:active {
    box-shadow: 0 3px 0 #9a3412, 0 4px 10px rgba(249, 115, 22, 0.3) !important;
}
