/* Layout Global del Mapa */
.mapa-container {
    padding: 40px 0;
    background: #0b1120;
    color: #f8fafc;
    min-height: 85vh;
}

.mapa-header {
    text-align: center;
    margin-bottom: 40px;
}

.mapa-header h1 {
    font-size: 2.5rem;
    color: #38bdf8;
    margin-bottom: 10px;
}

/* Barra de Progreso General */
.barra-progreso-global {
    max-width: 500px;
    margin: 20px auto 0;
}

.barra-progreso-global .track {
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 5px;
}

.barra-progreso-global .fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    transition: width 0.5s ease;
}

/* Grilla de Niveles */
.mapa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Cards de Nivel */
.card-nivel {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Estado: Activo (Disponible para jugar) */
.card-nivel.activo {
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.card-nivel.activo:hover {
    transform: translateY(-5px);
}

/* Estado: Completado */
.card-nivel.completado {
    border-color: #10b981;
    background: #0f2922;
}

/* Estado: Bloqueado */
.card-nivel.bloqueado {
    opacity: 0.5;
    filter: grayscale(80%);
}

.badge-fase {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 10px;
}

.nivel-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.nivel-num {
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: bold;
}

.card-nivel h3 {
    font-size: 1.25rem;
    margin: 5px 0 10px;
}

.card-nivel p {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

/* Botones y Badges */
.btn-jugar {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-jugar.primary { background: #0284c7; color: #fff; }
.btn-jugar.primary:hover { background: #0369a1; }

.btn-jugar.secondary { background: #334155; color: #f8fafc; }
.btn-jugar.secondary:hover { background: #475569; }

.btn-jugar.disabled { background: #1e293b; color: #64748b; cursor: not-allowed; }

/* Modal del Juego */
.modal-juego {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: center;
    align-center;
    z-index: 9999;
}

.modal-juego.hidden { display: none; }

.modal-content {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 1rem;
    cursor: pointer;
}